class_docstr: This node replaces a function with fused arguments. It deep-copies the
  function for every permutation of fused types, and allocates a new local
  scope for it. It keeps track of the original function in self.node, and
  the entry of the original function in the symbol table is given the
  'fused_cfunction' attribute which points back to us.
  Then when a function lookup occurs (to e.g. call it), the call can be
  dispatched to the right function.
  
  node    FuncDefNode    the original function
  nodes   [FuncDefNode]  list of copies of node with different specific types
  py_func DefNode        the fused python function subscriptable from
                         Python space
  __signatures__         A DictNode mapping signature specialization strings
                         to PyCFunction nodes
  resulting_fused_function  PyCFunction for the fused DefNode that delegates
                            to specializations
  fused_func_assignment   Assignment of the fused function to the function name
  defaults_tuple          TupleNode of defaults (letting PyCFunctionNode build
                          defaults would result in many different tuples)
  specialized_pycfuncs    List of synthesized pycfunction nodes for the
                          specializations
  code_object             CodeObjectNode shared by all specializations and the
                          fused function
  
  fused_compound_types    All fused (compound) types (e.g. floating[:])
class_docstr_tok: ["This","node","replaces","a","function","with","fused","arguments",".","It","deep-copies","the","function","for","every","permutation","of","fused","types",",","and","allocates","a","new","local","scope","for","it",".","It","keeps","track","of","the","original","function","in","self.node",",","and","the","entry","of","the","original","function","in","the","symbol","table","is","given","the","'fused_cfunction","'","attribute","which","points","back","to","us",".","Then","when","a","function","lookup","occurs","(","to","e.g",".","call","it",")",",","the","call","can","be","dispatched","to","the","right","function",".","node","FuncDefNode","the","original","function","nodes","[","FuncDefNode","]","list","of","copies","of","node","with","different","specific","types","py_func","DefNode","the","fused","python","function","subscriptable","from","Python","space","__signatures__","A","DictNode","mapping","signature","specialization","strings","to","PyCFunction","nodes","resulting_fused_function","PyCFunction","for","the","fused","DefNode","that","delegates","to","specializations","fused_func_assignment","Assignment","of","the","fused","function","to","the","function","name","defaults_tuple","TupleNode","of","defaults","(","letting","PyCFunctionNode","build","defaults","would","result","in","many","different","tuples",")","specialized_pycfuncs","List","of","synthesized","pycfunction","nodes","for","the","specializations","code_object","CodeObjectNode","shared","by","all","specializations","and","the","fused","function","fused_compound_types","All","fused","(","compound",")","types","(","e.g",".","floating","[",":","]",")"]
docstr: Create a copy of the original c(p)def function for all specialized
  versions.
docstr_tok: ["Create","a","copy","of","the","original","c","(","p",")","def","function","for","all","specialized","versions","."]
code: def copy_cdef(self, env):
      """
      Create a copy of the original c(p)def function for all specialized
      versions.
      """
      permutations = self.node.type.get_all_specialized_permutations()
      # print 'Node %s has %d specializations:' % (self.node.entry.name,
      #                                            len(permutations))
      # import pprint; pprint.pprint([d for cname, d in permutations])
  
      # Prevent copying of the python function
      self.orig_py_func = orig_py_func = self.node.py_func
      self.node.py_func = None
      if orig_py_func:
          env.pyfunc_entries.remove(orig_py_func.entry)
  
      fused_types = self.node.type.get_fused_types()
      self.fused_compound_types = fused_types
  
      new_cfunc_entries = []
      for cname, fused_to_specific in permutations:
          copied_node = copy.deepcopy(self.node)
  
          # Make the types in our CFuncType specific.
          type = copied_node.type.specialize(fused_to_specific)
          entry = copied_node.entry
          type.specialize_entry(entry, cname)
  
          # Reuse existing Entries (e.g. from .pxd files).
          for i, orig_entry in enumerate(env.cfunc_entries):
              if (
                  entry.cname == orig_entry.cname
                  and type.same_as_resolved_type(orig_entry.type)
              ):
                  copied_node.entry = env.cfunc_entries[i]
                  if not copied_node.entry.func_cname:
                      copied_node.entry.func_cname = entry.func_cname
                  entry = copied_node.entry
                  type = entry.type
                  break
          else:
              new_cfunc_entries.append(entry)
  
          copied_node.type = type
          entry.type, type.entry = type, entry
  
          entry.used = (
              entry.used
              or self.node.entry.defined_in_pxd
              or env.is_c_class_scope
              or entry.is_cmethod
          )
  
          if self.node.cfunc_declarator.optional_arg_count:
              self.node.cfunc_declarator.declare_optional_arg_struct(
                  type, env, fused_cname=cname
              )
  
          copied_node.return_type = type.return_type
          self.create_new_local_scope(
              copied_node, env, fused_to_specific
          )
  
          # Make the argument types in the CFuncDeclarator specific
          self._specialize_function_args(
              copied_node.cfunc_declarator.args, fused_to_specific
          )
  
          # If a cpdef, declare all specialized cpdefs (this
          # also calls analyse_declarations)
          copied_node.declare_cpdef_wrapper(env)
          if copied_node.py_func:
              env.pyfunc_entries.remove(copied_node.py_func.entry)
  
              self.specialize_copied_def(
                  copied_node.py_func,
                  cname,
                  self.node.entry.as_variable,
                  fused_to_specific,
                  fused_types,
              )
  
          if not self.replace_fused_typechecks(copied_node):
              break
  
      # replace old entry with new entries
      if self.node.entry in env.cfunc_entries:
          cindex = env.cfunc_entries.index(self.node.entry)
          env.cfunc_entries[cindex : cindex + 1] = new_cfunc_entries
      else:
          env.cfunc_entries.extend(new_cfunc_entries)
  
      if orig_py_func:
          self.py_func = self.make_fused_cpdef(
              orig_py_func, env, is_def=False
          )
      else:
          self.py_func = orig_py_func
  
imports: from __future__ import absolute_import
  import copy
  from .None import ExprNodes, PyrexTypes, MemoryView, ParseTreeTransforms, StringEncoding, Errors
  from .ExprNodes import CloneNode, ProxyNode, TupleNode
  from .Nodes import FuncDefNode, CFuncDefNode, StatListNode, DefNode
  from ..Utils import OrderedSet
label_desc: Use image node_id 3 for calling the FusedCFuncDefNode obj's underlying member method code with example usage: obj.copy_cdef(env) without return types