code: def new(n, prefix=None):
      
  
      if isinstance(n, Leaf):
          return Leaf(n.type, n.value, prefix=n.prefix if prefix is None else prefix)
  
      # this is hacky, we assume complex nodes are just being reused once from the
      # original AST.
      n.parent = None
      if prefix is not None:
          n.prefix = prefix
      return n
docs: lib2to3's AST requires unique objects as children.