<s> def who_called_me ( show_filename = True , out = None , indent = '<STR_LIT:U+0020>' ) : <EOL> def _wrapper ( fn ) : <EOL> def _inner_wrapper ( * args , ** kwargs ) : <EOL> import sys <EOL> import inspect <EOL> output = out or sys . stdout <EOL> assert hasattr ( output , '<STR_LIT>' ) , '<STR_LIT>' <EOL> index = <NUM_LIT:0> <EOL> stack = inspect . stack ( ) <EOL> stack . reverse ( ) <EOL> stack . pop ( ) <EOL> for record in stack : <EOL> frame = record [ <NUM_LIT:0> ] <EOL> line = frame . f_lineno <EOL> func_name = frame . f_code . co_name <EOL> if show_filename : <EOL> descr = frame . f_code . co_filename <EOL> else : <EOL> descr = frame . f_globals [ "<STR_LIT>" ] <EOL> print >> output , '<STR_LIT>' % ( indent * index , descr , line , func_name ) <EOL> del frame <EOL> index += <NUM_LIT:1> <EOL> del stack <EOL> if hasattr ( output , '<STR_LIT>' ) : <EOL> output . flush ( ) <EOL> return fn ( * args , ** kwargs ) <EOL> return _inner_wrapper <EOL> return _wrapper </s>
