#NEWLINE# def replace( self , state ) : #NEWLINE# #INDENT# if ( state . key in self . _dict ) : #NEWLINE# #INDENT# existing = existing . _dict [ state . key ] #NEWLINE# if ( existing is not state ) : #NEWLINE# #INDENT# self . _manage_removed_state ( existing ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# self . _dict [ state . key ] = state #NEWLINE# self . _manage_incoming_state ( state )