

def setUp(self):
    test_self = self

    def get_role(self):
        return UserRole(domain=test_self.domain, permissions=test_self.permissions)
    patches = [mock.patch.object(DomainMembership, 'role', property(get_role)), mock.patch.object(Memoized, '__call__', (lambda self, *args, **kwargs: self.func(*args, **test_self)))]
    for patch in patches:
        patch.start()
        self.addCleanup(patch.stop)

dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/users/tests/permissions.py ExportPermissionsTest.setUp/VarMisuse@87/106 `kwargs`->`test_self`