code: def index(self, x, x_link=None):
          
          if x is None:  # error
              raise ValueError("provide at least one dataframe")
          elif x_link is not None:  # linking (two arg)
              x = (x, x_link)
          elif isinstance(x, (list, tuple)):  # dedup or linking (single arg)
              x = tuple(x)
          else:  # dedup (single arg)
              x = (x,)
  
          if self.verify_integrity:
  
              for df in x:
                  self._verify_integrety(df)
  
          # linking
          if not self._deduplication(x):
  
              pairs = self._link_index(*x)
              names = self._make_index_names(x[0].index.name, x[1].index.name)
  
          # deduplication
          else:
  
              pairs = self._dedup_index(*x)
              names = self._make_index_names(x[0].index.name, x[0].index.name)
  
          pairs.rename(names, inplace=True)
  
          return pairs
docs: Make an index of record pairs.
  
          Use a custom function to make record pairs of one or two dataframes.
          Each function should return a pandas.MultiIndex with record pairs.
  
          Parameters
          ----------
          x: pandas.DataFrame
              A pandas DataFrame. When `x_link` is None, the algorithm makes
              record pairs within the DataFrame. When `x_link` is not empty,
              the algorithm makes pairs between `x` and `x_link`.
          x_link: pandas.DataFrame, optional
              A second DataFrame to link with the DataFrame x.
  
          Returns
          -------
          pandas.MultiIndex
              A pandas.MultiIndex with record pairs. Each record pair contains
              the index labels of two records.