MCPcopy Create free account
hub / github.com/ActiveState/code / block

Function block

recipes/Python/577920_Blocks_for_python/recipe-577920.py:6–11  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

4
5
6def block(code):
7 code = 'def anon(*args, **kw):\n'+'\n'.join(
8 "\t\t%s" % line for line in code.split('\n') if line.strip())
9 env = {}
10 exec code in env
11 return env['anon'] #@UndefinedVariable suppressed
12
13
14if __name__ == '__main__':

Callers 1

recipe-577920.pyFile · 0.85

Calls 3

joinMethod · 0.45
splitMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected