def _compile_func(body):
 body = u'def {0}():\n    {1}'.format(FUNC_NAME, body.replace('\n', '\n    '))
 code = compile(body, 'inline', 'exec')
 env = {}
 eval(code, env)
 return env[FUNC_NAME]

def _compile_func ( body ) : body = u'def {0}():\n    {1}' . format ( FUNC_NAME , body . replace ( '\n' , '\n    ' ) ) code = compile ( body , 'inline' , 'exec' ) env = { } eval ( code , env ) return env [ FUNC_NAME ]
given python code for a function body .