def extract_vars_above(*names):
 callerNS = sys._getframe(2).f_locals
 return dict(((k, callerNS[k]) for k in names))

def extract_vars_above ( * names ) : callerNS = sys . _getframe ( 2 ) . f_locals return dict ( ( ( k , callerNS [ k ] ) for k in names ) )
extract a set of variables by name from another frame .