parameters: (self, other, **kwargs)
docstring: Determine if two Index objects contain the same elements.
  
          Returns
          -------
          out: bool
              True if “other” is an Index and it has the same elements
              as calling index; False otherwise.
docstring_summary: Determine if two Index objects contain the same elements.
docstring_tokens: Determine if two Index objects contain the same elements .
function: def equals(self, other, **kwargs):
          """
          Determine if two Index objects contain the same elements.
  
          Returns
          -------
          out: bool
              True if “other” is an Index and it has the same elements
              as calling index; False otherwise.
          """
          if not isinstance(other, BaseIndex):
              return False
  
          check_types = False
  
          self_is_categorical = isinstance(self, CategoricalIndex)
          other_is_categorical = isinstance(other, CategoricalIndex)
          if self_is_categorical and not other_is_categorical:
              other = other.astype(self.dtype)
              check_types = True
          elif other_is_categorical and not self_is_categorical:
              self = self.astype(other.dtype)
              check_types = True
  
          try:
              return super().equals(other, check_types=check_types)
          except TypeError:
              return False
function_tokens: def equals ( self , other , * * kwargs ) : if not isinstance ( other , BaseIndex ) : return False check_types = False self_is_categorical = isinstance ( self , CategoricalIndex ) other_is_categorical = isinstance ( other , CategoricalIndex ) if self_is_categorical and not other_is_categorical : other = other . astype ( self . dtype ) check_types = True elif other_is_categorical and not self_is_categorical : self = self . astype ( other . dtype ) check_types = True try : return super ( ) . equals ( other , check_types = check_types ) except TypeError : return False