#NEWLINE# def sameValuesAs( self , other ) : #NEWLINE# #INDENT# def sorter( x , y ) : #NEWLINE# #INDENT# return cmp ( x . pack ( ) , y . pack ( ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# for key in set ( self . iterkeys ( ) ) . union ( set ( other . iterkeys ( ) ) ) : #NEWLINE# #INDENT# if ( ( key == Attribute . CODE . MP_REACH_NLRI ) or ( key == Attribute . CODE . MP_UNREACH_NLRI ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# sval = self [ key ] #NEWLINE# oval = other [ key ] #NEWLINE# if isinstance ( sval , Communities ) : #NEWLINE# #INDENT# if ( not isinstance ( oval , Communities ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# sval = sorted ( sval , sorter ) #NEWLINE# oval = sorted ( oval , sorter ) #NEWLINE# #UNINDENT# if ( cmp ( sval , oval ) != 0 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# return True #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return False