human
Solve the following python programming problem given the following code:
@pytest.fixture(params=(True, False))
def limit_loader(request, monkeypatch):
assistant
#Here is the Python code you requested.

    """Patch pkgutil.get_loader to give loader without get_filename or archive.
    This provides for tests where a system has custom loaders, e.g. Google App
    Engine\s HardenedModulesHook, which have neither the `get_filename` method
    nor the `archive` attribute.
    This fixture will run the testcase twice, once with and once without the
    limitation/mock.
    """
    if (not request.param):
        return
    class LimitedLoader(object, ):
        def __init__(self, loader):
            self.loader = loader
        def __getattr__(self, name):
            if (name in ('archive', 'get_filename')):
                msg = ('Mocking    a    loader    which    does    not    have    `%s.`' % name)
                raise AttributeError(msg)
            return getattr(self.loader, name)
    old_get_loader = pkgutil.get_loader
    def get_loader(*args, **kwargs):
        return LimitedLoader(old_get_loader(*args, **kwargs))
    monkeypatch.setattr(pkgutil, 'get_loader', get_loader)