#NEWLINE# def reset_refcounts( self , to_counts ) : #NEWLINE# #INDENT# '\n        This method will reset reference counts for aliases so that they match\n        the value passed in :param to_counts:.\n        ' #NEWLINE# for ( alias , cur_refcount ) in self . alias_refcount . copy ( ) . items ( ) : #NEWLINE# #INDENT# unref_amount = ( cur_refcount - to_counts . get ( alias , 0 ) ) #NEWLINE# self . unref_alias ( alias , unref_amount )