class_docstr: An auto-batching DSL context.
  
  Auto-batching DSL operations are methods on the `ProgramBuilder` object.  It's
  used like this:
  
  ```python
  ab = dsl.ProgramBuilder()
  
  def fib_type(arg_types):
    return arg_types[0]
  
  with ab.function(type_inference=fib_type) as fibonacci:
    n = ab.param('n')
    ab.var.cond = ab.primop(lambda n: n > 1)
    with ab.if_(ab.var.cond):
      ab.var.nm1 = ab.primop(lambda n: n - 1)
      ab.var.fibm1 = ab.call(fibonacci, [ab.var.nm1])
      ab.var.nm2 = ab.primop(lambda n: n - 2)
      ab.var.fibm2 = ab.call(fibonacci, [ab.var.nm2])
      ab.var.ans = ab.primop(lambda fibm1, fibm2: fibm1 + fibm2)
    with ab.else_():
      ab.var.ans = ab.const(1)
    ab.return_(ab.var.ans)
  
  prog = ab.program(main=fibonacci)
  # Now `prog` is a well-formed `instructions.Program`, and the context
  # `ab` is no longer needed.
  ```
  
  Note the sequence of method calls on `ProgramBuilder` corresponds to the
  source code of the `Program` being defined, not its runtime behavior.  This is
  because (a) functions are defined with a context manager (rather than a Python
  function) which executes its body immediately and exactly once; and (b)
  function call instructions (and primitive operations) are just recorded, not
  entered recursively.
docstr: Prepares a multi-value return.
  
  Example:
  ```python
  ab = dsl.ProgramBuilder()
  
  ab((ab.var.two, ab.var.four)).pattern = ab.const((2, 4))
  ```
  
  The protocol is to create a magic pattern object by invoking the
  `ProgramBuilder` as a callable, passing the pattern to bind; then assigning
  the `pattern` attribute of the returned value to the operation whose values
  to accept.
  
  This is like this to work around limitations of embedding a DSL into Python:
  the assignment syntax `=` can be overridden _only_ for fields of objects,
  not for function calls.  It would have been nicer to implement
  `ab.pattern(...) = ...` but that's syntactically invalid Python.  Hence,
  putting the `pattern` token at the end of the phrase rather than the
  beginning.
  
  Args:
    pattern: A pattern of variables (e.g., from `ab.var.name`) to bind.
  
  Returns:
    pat_object: A `_MagicPattern` instance representing the putative binding.
      Invoke the `pattern =` attribute setter on that instance to actually
      bind this pattern as the output of a `primop`, `const`, or `call`.
code: def __call__(self, pattern):
      """Prepares a multi-value return.
  
      Example:
      ```python
      ab = dsl.ProgramBuilder()
  
      ab((ab.var.two, ab.var.four)).pattern = ab.const((2, 4))
      ```
  
      The protocol is to create a magic pattern object by invoking the
      `ProgramBuilder` as a callable, passing the pattern to bind; then assigning
      the `pattern` attribute of the returned value to the operation whose values
      to accept.
  
      This is like this to work around limitations of embedding a DSL into Python:
      the assignment syntax `=` can be overridden _only_ for fields of objects,
      not for function calls.  It would have been nicer to implement
      `ab.pattern(...) = ...` but that's syntactically invalid Python.  Hence,
      putting the `pattern` token at the end of the phrase rather than the
      beginning.
  
      Args:
        pattern: A pattern of variables (e.g., from `ab.var.name`) to bind.
  
      Returns:
        pat_object: A `_MagicPattern` instance representing the putative binding.
          Invoke the `pattern =` attribute setter on that instance to actually
          bind this pattern as the output of a `primop`, `const`, or `call`.
      """
      return _MagicPattern(self, pattern)
  
imports: import collections
  import contextlib
  import inspect
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 7 for calling the ProgramBuilder obj's underlying member method code with example usage: obj.__call__(pattern) and returns: _MagicPattern