code: def equals(self, other):
          
          if self.is_(other):
              return True
  
          if not isinstance(other, Index):
              return False
  
          if is_object_dtype(self) and not is_object_dtype(other):
              # if other is not object, use other's logic for coercion
              return other.equals(self)
  
          try:
              return array_equivalent(com.values_from_object(self),
                                      com.values_from_object(other))
          except Exception:
              return False
docs: Determine if two Index objects contain the same elements.