#NEWLINE# def filter_frames( self , frames ) : #NEWLINE# #INDENT# '\n        Removes any frames that should be hidden, according to the\n        values of traceback_hide, self.show_hidden_frames, and the\n        hidden status of the final frame.\n        ' #NEWLINE# if self . show_hidden_frames : #NEWLINE# #INDENT# return frames #NEWLINE# #UNINDENT# new_frames = [ ] #NEWLINE# hidden = False #NEWLINE# for frame in frames : #NEWLINE# #INDENT# hide = frame . traceback_hide #NEWLINE# if ( hide == 'before' ) : #NEWLINE# #INDENT# new_frames = [ ] #NEWLINE# hidden = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( hide == 'before_and_this' ) : #NEWLINE# #INDENT# new_frames = [ ] #NEWLINE# hidden = False #NEWLINE# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( hide == 'reset' ) : #NEWLINE# #INDENT# hidden = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( hide == 'reset_and_this' ) : #NEWLINE# #INDENT# hidden = False #NEWLINE# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( hide == 'after' ) : #NEWLINE# #INDENT# hidden = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( hide == 'after_and_this' ) : #NEWLINE# #INDENT# hidden = True #NEWLINE# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hide : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hidden : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# new_frames . append ( frame ) #NEWLINE# #UNINDENT# if ( frames [ ( - 1 ) ] not in new_frames ) : #NEWLINE# #INDENT# return frames #NEWLINE# #UNINDENT# return new_frames