def exec_test(caller_globals, caller_locals, s):
 global_namespace = dict(caller_globals, **caller_locals)
 local_namespace = {}
 exec textwrap.dedent(s) in global_namespace, local_namespace
 return local_namespace

def exec_test ( caller_globals , caller_locals , s ) : global_namespace = dict ( caller_globals , ** caller_locals ) local_namespace = { } exec textwrap . dedent ( s ) in global_namespace , local_namespace return local_namespace
execute s in a given context and return the result namespace .