parameters: (function, name)
return_statement: return FunctionType(c, function.func_globals, name)
docstring: This function returns a function identical to the given one, but
      with the given name.
docstring_summary: This function returns a function identical to the given one, but
      with the given name.
docstring_tokens: This function returns a function identical to the given one but with the given name .
function: def _renamefunction(function, name):
      """
      This function returns a function identical to the given one, but
      with the given name.
      """
      from types import FunctionType, CodeType
      
      c = function.func_code
      if c.co_name != name:
          # rename the code object.
          c = CodeType(c.co_argcount, c.co_nlocals, c.co_stacksize,
                       c.co_flags, c.co_code, c.co_consts,
                       c.co_names, c.co_varnames, c.co_filename,
                       name, c.co_firstlineno, c.co_lnotab)
      if function.func_defaults != None:
          return FunctionType(c, function.func_globals, name,
                              function.func_defaults)
      return FunctionType(c, function.func_globals, name)
function_tokens: def _renamefunction ( function , name ) : from types import FunctionType , CodeType c = function . func_code if c . co_name != name : # rename the code object. c = CodeType ( c . co_argcount , c . co_nlocals , c . co_stacksize , c . co_flags , c . co_code , c . co_consts , c . co_names , c . co_varnames , c . co_filename , name , c . co_firstlineno , c . co_lnotab ) if function . func_defaults != None : return FunctionType ( c , function . func_globals , name , function . func_defaults ) return FunctionType ( c , function . func_globals , name )