code: def visit_FunctionDef(self, node):
      self.update = True
      if MODULES["functools"] not in self.global_declarations.values():
          import_ = ast.Import(
              [ast.alias("functools", mangle("functools"))]
          )
          self.ctx.module.body.insert(0, import_)
          functools_module = MODULES["functools"]
          self.global_declarations[
              mangle("functools")
          ] = functools_module
  
      self.ctx.module.body.append(node)
  
      former_name = node.name
      seed = 0
      new_name = "pythran_{}{}"
  
      while new_name.format(former_name, seed) in self.identifiers:
          seed += 1
  
      new_name = new_name.format(former_name, seed)
      self.identifiers.add(new_name)
  
      ii = self.gather(ImportedIds, node)
      binded_args = [
          ast.Name(iin, ast.Load(), None, None) for iin in sorted(ii)
      ]
      node.args.args = [
          ast.Name(iin, ast.Param(), None, None) for iin in sorted(ii)
      ] + node.args.args
  
      metadata.add(node, metadata.Local())
  
      class Renamer(ast.NodeTransformer):
          def visit_Call(self, node):
              self.generic_visit(node)
              if (
                  isinstance(node.func, ast.Name)
                  and node.func.id == former_name
              ):
                  node.func.id = new_name
                  node.args = [
                      ast.Name(iin, ast.Load(), None, None)
                      for iin in sorted(ii)
                  ] + node.args
              return node
  
      Renamer().visit(node)
  
      node.name = new_name
      self.global_declarations[node.name] = node
      proxy_call = ast.Name(new_name, ast.Load(), None, None)
  
      new_node = ast.Assign(
          [ast.Name(former_name, ast.Store(), None, None)],
          ast.Call(
              ast.Attribute(
                  ast.Name(mangle("functools"), ast.Load(), None, None),
                  "partial",
                  ast.Load(),
              ),
              [proxy_call] + binded_args,
              [],
          ),
          None,
      )
  
      self.generic_visit(node)
      return new_node
  
file_path: pythran/pythran/transformations/remove_nested_functions.py
imports: from pythran.analyses import GlobalDeclarations, ImportedIds
  from pythran.passmanager import Transformation
  from pythran.tables import MODULES
  from pythran.conversion import mangle
  import pythran.metadata
  import gast
label_desc: Use image node_id 3 for calling the _NestedFunctionRemover obj's underlying member method code with example usage: obj.visit_FunctionDef(node) and returns: new_node, node