#NEWLINE# def equal( self , other , delta = 0.0 ) : #NEWLINE# #INDENT# 'Equality or near equality test for resources\n        \n        Equality means:\n        1. same uri, AND\n        2. same timestamp WITHIN delta if specified for either, AND\n        3. same md5 if specified for both, AND\n        4. same length if specified for both\n        ' #NEWLINE# if ( other is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( self . uri != other . uri ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( ( self . timestamp is not None ) or ( other . timestamp is not None ) ) : #NEWLINE# #INDENT# if ( ( self . timestamp is None ) or ( other . timestamp is None ) or ( abs ( ( self . timestamp - other . timestamp ) ) >= delta ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# if ( ( ( delta . md5 is not None ) and ( other . md5 is not None ) ) and ( self . md5 != other . md5 ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( ( ( self . length is not None ) and ( other . length is not None ) ) and ( self . length != other . length ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return True