#NEWLINE# def create_summary( self ) : #NEWLINE# #INDENT# 'Return a summary.\n\n        See also the notes on ignore_self in the class as well as the\n        initializer documentation.\n\n        ' #NEWLINE# if ( not self . ignore_self ) : #NEWLINE# #INDENT# res = summary . summarize ( muppy . get_objects ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# all_of_them = [ ] #NEWLINE# ref_counter = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# def store_info( o ) : #NEWLINE# #INDENT# all_of_them . append ( o ) #NEWLINE# if ( id ( o ) in ref_counter ) : #NEWLINE# #INDENT# ref_counter [ id ( o ) ] += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ref_counter [ id ( o ) ] = 1 #NEWLINE# #UNINDENT# #UNINDENT# store_info ( self . summaries ) #NEWLINE# for ( k , v ) in self . summaries . items ( ) : #NEWLINE# #INDENT# store_info ( k ) #NEWLINE# summary . _traverse ( v , ref_counter ) #NEWLINE# #UNINDENT# res = summary . summarize ( muppy . get_objects ( ) ) #NEWLINE# for _id in ref_counter : #NEWLINE# #INDENT# if ( len ( gc . get_referrers ( _id ) ) == 3 ) : #NEWLINE# #INDENT# summary . _subtract ( res , _id ) #NEWLINE# #UNINDENT# #UNINDENT# for o in all_of_them : #NEWLINE# #INDENT# if ( len ( gc . get_referrers ( o ) ) == ( ref_counter [ id ( o ) ] + 2 ) ) : #NEWLINE# #INDENT# summary . _subtract ( res , o ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return res