code: def rename(self, renaming: Dict[str, str]) -> 'Substitution':
          
          return Substitution((renaming.get(name, name), value) for name, value in self.items())
docs: Return a copy of the substitution with renamed variables.
  
          Example:
  
              Rename the variable *x* to *y*:
  
              >>> subst = Substitution({'x': a})
              >>> subst.rename({'x': 'y'})
              {'y': Symbol('a')}
  
          Args:
              renaming:
                  A dictionary mapping old variable names to new ones.
  
          Returns:
              A copy of the substitution where variable names have been replaced according to the given renaming
              dictionary. Names that are not contained in the dictionary are left unchanged.