def assert_attr_equal(attr, left, right, obj='Attributes'):
 left_attr = getattr(left, attr)
 right_attr = getattr(right, attr)
 if (left_attr is right_attr):
  return True
 elif (is_number(left_attr) and np.isnan(left_attr) and is_number(right_attr) and np.isnan(right_attr)):
  return True
 try:
  result = (left_attr == right_attr)
 except TypeError:
  result = False
 if (not isinstance(result, bool)):
  result = result.all()
 if result:
  return True
 else:
  raise_assert_detail(obj, 'Attribute "{0}" are different'.format(attr), left_attr, right_attr)

def assert_attr_equal ( attr , left , right , obj = 'Attributes' ) : left_attr = getattr ( left , attr ) right_attr = getattr ( right , attr ) if ( left_attr is right_attr ) : return True elif ( is_number ( left_attr ) and np . isnan ( left_attr ) and is_number ( right_attr ) and np . isnan ( right_attr ) ) : return True try : result = ( left_attr == right_attr ) except TypeError : result = False if ( not isinstance ( result , bool ) ) : result = result . all ( ) if result : return True else : raise_assert_detail ( obj , 'Attribute "{0}" are different' . format ( attr ) , left_attr , right_attr )
checks attributes are equal .