@py3compat.doctest_refactor_print
def extract_vars(*names, **kw):
 depth = kw.get('depth', 0)
 callerNS = sys._getframe((depth + 1)).f_locals
 return dict(((k, callerNS[k]) for k in names))

@ py3compat . doctest_refactor_print def extract_vars ( * names , ** kw ) : depth = kw . get ( 'depth' , 0 ) callerNS = sys . _getframe ( ( depth + 1 ) ) . f_locals return dict ( ( ( k , callerNS [ k ] ) for k in names ) )
extract a set of variables by name from another frame .