class_docstr: Base class for general-purpose Python code transformation.
  
  This abstract class provides helpful functions, like state tracking within
  the scope of arbitrary node, helpers for processing code blocks, debugging,
  mapping of transformed code to original code, and others.
  
  Scope-local state tracking: to keep state across nodes, at the level of
  (possibly nested) scopes, use enter/exit_local_scope and set/get_local.
  You must call enter/exit_local_scope manually, but the transformer detects
  when they are not properly paired.
  
  The transformer allows keeping state across calls that is local
  to arbitrary nodes and their descendants, using the self.state attribute.
  Multiple independent scopes are allowed and automatically constructed.
  
  For example, to keep track of the `If` node that encloses any `Name` node,
  one can write:
  
  ```
    class FooType(object):
  
      def __init__(self):
        self.foo_property = None
  
    class DummyTransformer(NodeStateTracker, ast.NodeTransformer):
  
      def visit_If(self, node):
        self.state[FooType].enter()
        self.state[FooType].foo_property = node
        node = self.veneric_visit(node)
        self.state[FooType].exit()
        return node
  
      def visit_Name(self, node):
        self.state[FooType].foo_property  # will hold the innermost enclosing if
  ```
  
  Alternatively, the `enter()`/`exit()` calls can be managed by a `with`
  statement:
  
  ```
      def visit_If(self, node):
        with self.state[FooType] as foo:
          foo.foo_property = node
          return self.generic_visit(node)
  ```
class_docstr_tok: ["Base","class","for","general-purpose","Python","code","transformation",".","This","abstract","class","provides","helpful","functions",",","like","state","tracking","within","the","scope","of","arbitrary","node",",","helpers","for","processing","code","blocks",",","debugging",",","mapping","of","transformed","code","to","original","code",",","and","others",".","Scope-local","state","tracking",":","to","keep","state","across","nodes",",","at","the","level","of","(","possibly","nested",")","scopes",",","use","enter\/exit_local_scope","and","set\/get_local",".","You","must","call","enter\/exit_local_scope","manually",",","but","the","transformer","detects","when","they","are","not","properly","paired",".","The","transformer","allows","keeping","state","across","calls","that","is","local","to","arbitrary","nodes","and","their","descendants",",","using","the","self.state","attribute",".","Multiple","independent","scopes","are","allowed","and","automatically","constructed",".","For","example",",","to","keep","track","of","the","`","If","`","node","that","encloses","any","`","Name","`","node",",","one","can","write",":","``","`","class","FooType","(","object",")",":","def","__init__","(","self",")",":","self.foo_property","=","None","class","DummyTransformer","(","NodeStateTracker",",","ast.NodeTransformer",")",":","def","visit_If","(","self",",","node",")",":","self.state","[","FooType","]",".enter","(",")","self.state","[","FooType","]",".foo_property","=","node","node","=","self.veneric_visit","(","node",")","self.state","[","FooType","]",".exit","(",")","return","node","def","visit_Name","(","self",",","node",")",":","self.state","[","FooType","]",".foo_property","#","will","hold","the","innermost","enclosing","if","``","`","Alternatively",",","the","`","enter","(",")","`","\/","`","exit","(",")","`","calls","can","be","managed","by","a","`","with","`","statement",":","``","`","def","visit_If","(","self",",","node",")",":","with","self.state","[","FooType","]","as","foo",":","foo.foo_property","=","node","return","self.generic_visit","(","node",")","``","`"]
docstr: Helper method useful for debugging. Prints the AST as code.
docstr_tok: ["Helper","method","useful","for","debugging",".","Prints","the","AST","as","code","."]
code: def debug_print_src(self, node):
      """Helper method useful for debugging. Prints the AST as code."""
      if __debug__:
          print(parser.unparse(node))
      return node
  
imports: import collections
  import enum
  import gast
  from nvidia.dali._autograph.pyct import anno
  from nvidia.dali._autograph.pyct import parser
  from nvidia.dali._autograph.pyct import pretty_printer
  from nvidia.dali._autograph.pyct import templates
label_desc: Use image node_id 3 for calling the NodeStateTracker obj's underlying member method code with example usage: obj.debug_print_src(node) and returns: node