def assert_class_equal(left, right, exact=True, obj='Input'):
 def repr_class(x):
  if isinstance(x, Index):
   return x
  try:
   return x.__class__.__name__
  except AttributeError:
   return repr(type(x))
 if (exact == 'equiv'):
  if (type(left) != type(right)):
   types = set([type(left).__name__, type(right).__name__])
   if len((types - set(['Int64Index', 'RangeIndex']))):
    msg = '{0} classes are not equivalent'.format(obj)
    raise_assert_detail(obj, msg, repr_class(left), repr_class(right))
 elif exact:
  if (type(left) != type(right)):
   msg = '{0} classes are different'.format(obj)
   raise_assert_detail(obj, msg, repr_class(left), repr_class(right))

def assert_class_equal ( left , right , exact = True , obj = 'Input' ) : def repr_class ( x ) : if isinstance ( x , Index ) : return x try : return x . __class__ . __name__ except AttributeError : return repr ( type ( x ) ) if ( exact == 'equiv' ) : if ( type ( left ) != type ( right ) ) : types = set ( [ type ( left ) . __name__ , type ( right ) . __name__ ] ) if len ( ( types - set ( [ 'Int64Index' , 'RangeIndex' ] ) ) ) : msg = '{0} classes are not equivalent' . format ( obj ) raise_assert_detail ( obj , msg , repr_class ( left ) , repr_class ( right ) ) elif exact : if ( type ( left ) != type ( right ) ) : msg = '{0} classes are different' . format ( obj ) raise_assert_detail ( obj , msg , repr_class ( left ) , repr_class ( right ) )
checks classes are equal .