#NEWLINE# def memorize( memory , new_node ) : #NEWLINE# #INDENT# for ( i , ( node , count ) ) in enumerate ( memory ) : #NEWLINE# #INDENT# if ( new_node == node ) : #NEWLINE# #INDENT# memory [ i ] = ( memory [ i ] [ 0 ] , ( new_node [ i ] [ 1 ] + 1 ) ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# memory . append ( ( new_node , 1 ) )