#NEWLINE# def log_instance_creation( instance , name = None ) : #NEWLINE# #INDENT# if ( name is None ) : #NEWLINE# #INDENT# name = instance . __class__ . __name__ #NEWLINE# if ( instance not in tracked_classes ) : #NEWLINE# #INDENT# tracked_classes [ name ] = [ ] #NEWLINE# #UNINDENT# tracked_classes [ name ] . append ( weakref . ref ( instance ) )