class_docstr: Magic object referring to the local variables in a function definition.
  
  Obtain with `ProgramBuilder.vars`.  Overrides `setattr` and `getattr` to
  provide a smooth interface to reading and defining variables:
  
  - `ProgramBuilder.var.foo = ProgramBuilder.{call,primop}`
    records an assignment to the auto-batched variable `foo`, possibly
    binding it, and
  
  - `ProgramBuilder.var.foo` reads from the auto-batched variable `foo`
    (if it is bound).
code: def __getattr__(self, name):
      # _MagicVars is meant to be a friend class of ProgramBuilder; is purposely
      # a wrapper around the otherwise-private _locals field.
      # pylint: disable=protected-access
      context = self._context
      if name in context._locals:
          return context._locals[name]
      else:
          # Construct a name for the variable, but do not mark it defined.  If this
          # appears as an input to some reader, the reader will notice the variable
          # is undefined and signal an error.  But, if this appears as an input to
          # multi-value binding (see `_MagicPattern.pattern`), the binding will mark
          # it defined.
          return context.local(name, define=False)
  
imports: import collections
  import contextlib
  import inspect
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 3 for calling the _MagicVars obj's underlying member method code with example usage: obj.__getattr__(name) and returns: context, context