code: def _get_rename_function(mapper):
      
      if isinstance(mapper, (abc.Mapping, ABCSeries)):
  
          def f(x):
              if x in mapper:
                  return mapper[x]
              else:
                  return x
      else:
          f = mapper
  
      return f
docs: Returns a function that will map names/labels, dependent if mapper
      is a dict, Series or just a function.