Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_is_lambda(self):
self.assertTrue(is_lambda(lambda: 0))
self.assertTrue(is_lambda(lambda x, y: x + y))
self.assertFalse(is_lambda(min))
self.assertFalse(is_lambda(flatten_list))
self.assertFalse(is_lambda(self.test_is_lambda))
def check(inp, out):
self.assertEqual(flatten_list(inp), out)
code_info = self._code_infos.get(new_func.__code__)
if code_info:
return new_func
lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int
end_lineno = start_lineno + len(lines)
name = safe_qualname(func)
source_file = inspect.getsourcefile(func)
if source_file.startswith('
code_info = self._code_infos.get(new_func.__code__)
if code_info:
return new_func
lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int
end_lineno = start_lineno + len(lines)
name = safe_qualname(func)
source_file = inspect.getsourcefile(func)
if source_file.startswith('