code: def relabel_variables(self, mapping, inplace=True):
          
          if not inplace:
              return self.copy().relabel_variables(mapping, inplace=True)
  
          self.variables.relabel(mapping)
          return self
docs: Relabel the variables of a :class:`SampleSet` according to the specified mapping.
  
          Args:
              mapping (dict):
                  Mapping from current variable labels to new, as a dict. If incomplete mapping is
                  specified, unmapped variables keep their current labels.
  
              inplace (bool, optional, default=True):
                  If True, the current :class:`SampleSet` is updated; otherwise, a new
                  :class:`SampleSet` is returned.
  
          Returns:
              :class:`.SampleSet`: SampleSet with relabeled variables. If `inplace` is True, returns
              itself.
  
          Examples:
              This example creates a relabeled copy of a :class:`SampleSet`.
  
              >>> import dimod
              ...
              >>> sampleset = dimod.ExactSolver().sample_ising({'a': -0.5, 'b': 1.0}, {('a', 'b'): -1})
              >>> new_sampleset = sampleset.relabel_variables({'a': 0, 'b': 1}, inplace=False)
              >>> sampleset.variable_labels    # doctest: +SKIP
              [0, 1]