class_docstr: NodeTransformer-like visitor that copies an AST.
class_docstr_tok: ["NodeTransformer-like","visitor","that","copies","an","AST","."]
docstr: Returns a deep copy of node (excluding some fields, see copy_clean).
docstr_tok: ["Returns","a","deep","copy","of","node","(","excluding","some","fields",",","see","copy_clean",")","."]
code: def copy(self, node):
      """Returns a deep copy of node (excluding some fields, see copy_clean)."""
  
      if isinstance(node, list):
          return [self.copy(n) for n in node]
      elif isinstance(node, tuple):
          return tuple(self.copy(n) for n in node)
      elif not isinstance(node, (gast.AST, ast.AST)):
          # Assuming everything that's not an AST, list or tuple is a value type
          # and may simply be assigned.
          return node
  
      assert isinstance(node, (gast.AST, ast.AST))
  
      new_fields = {}
      for f in node._fields:
          if not f.startswith("__") and hasattr(node, f):
              new_fields[f] = self.copy(getattr(node, f))
      new_node = type(node)(**new_fields)
  
      if self.preserve_annos:
          for k in self.preserve_annos:
              anno.copyanno(node, new_node, k)
      return new_node
  
imports: import ast
  import gast
  from tensorflow.python.autograph.pyct import anno
  from tensorflow.python.autograph.pyct import parser
  from tensorflow.python.autograph.pyct import qual_names
label_desc: Use image node_id 2 for calling the CleanCopier obj's underlying member method code with example usage: obj.copy(node) and returns: new_node, unknown, tuple, node