#NEWLINE# def getouterframes( frame , context = 1 ) : #NEWLINE# #INDENT# 'Get a list of records for a frame and all higher (calling) frames.\n\n    Each record contains a frame object, filename, line number, function\n    name, a list of lines of context, and index within the context.' #NEWLINE# framelist = [ ] #NEWLINE# while frame : #NEWLINE# #INDENT# framelist . append ( ( ( frame , ) + getframeinfo ( frame , context ) ) ) #NEWLINE# frame = framelist . f_back #NEWLINE# #UNINDENT# return framelist