parameters: (mapper)
return_statement: return f
docstring: Returns a function that will map names/labels, dependent if mapper
      is a dict, Series or just a function.
docstring_summary: Returns a function that will map names/labels, dependent if mapper
      is a dict, Series or just a function.
docstring_tokens: Returns a function that will map names / labels dependent if mapper is a dict Series or just a function .
function: def get_rename_function(mapper):
      """
      Returns a function that will map names/labels, dependent if mapper
      is a dict, Series or just a function.
      """
      if isinstance(mapper, (abc.Mapping, ABCSeries)):
  
          def f(x):
              if x in mapper:
                  return mapper[x]
              else:
                  return x
  
      else:
          f = mapper
  
      return f
function_tokens: 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