class_docstr: Context manager class that modifies behavior
  and adds side effects to stochastic functions
  i.e. callables containing Pyro primitive statements.
  
  This is the base Messenger class.
  It implements the default behavior for all Pyro primitives,
  so that the joint distribution induced by a stochastic function fn
  is identical to the joint distribution induced by ``Messenger()(fn)``.
  
  Class of transformers for messages passed during inference.
  Most inference operations are implemented in subclasses of this.
docstr: :param exc_type: exception type, e.g. ValueError
  :param exc_value: exception instance?
  :param traceback: traceback for exception handling
  :returns: None
  :rtype: None
  
  Removes this messenger from the bottom of the Pyro stack.
  If an exception is raised, removes this messenger and everything below it.
  Always called after every execution of self.fn via self.__call__.
  
  Can be overloaded by derived classes to add any other per-call teardown functionality,
  but the stack must always be popped by the derived class,
  usually by calling super().__exit__(*args).
  
  Derived versions cannot be overridden to take other arguments,
  and must always return None or False.
  
  The arguments are the mandatory arguments used by a with statement.
  Users should never be specifying these.
  They are all None unless the body of the with statement raised an exception.
docstr_tok: [":","param","exc_type",":","exception","type",",","e.g",".","ValueError",":","param","exc_value",":","exception","instance","?",":","param","traceback",":","traceback","for","exception","handling",":","returns",":","None",":","rtype",":","None","Removes","this","messenger","from","the","bottom","of","the","Pyro","stack",".","If","an","exception","is","raised",",","removes","this","messenger","and","everything","below","it",".","Always","called","after","every","execution","of","self.fn","via","self.__call__",".","Can","be","overloaded","by","derived","classes","to","add","any","other","per-call","teardown","functionality",",","but","the","stack","must","always","be","popped","by","the","derived","class",",","usually","by","calling","super","(",")",".__exit__","(","*","args",")",".","Derived","versions","can","not","be","overridden","to","take","other","arguments",",","and","must","always","return","None","or","False",".","The","arguments","are","the","mandatory","arguments","used","by","a","with","statement",".","Users","should","never","be","specifying","these",".","They","are","all","None","unless","the","body","of","the","with","statement","raised","an","exception","."]
code: def __exit__(
      self,
      exc_type: Optional[Type[BaseException]],
      exc_value: Optional[BaseException],
      traceback: Optional[TracebackType],
  ) -> None:
      """
      :param exc_type: exception type, e.g. ValueError
      :param exc_value: exception instance?
      :param traceback: traceback for exception handling
      :returns: None
      :rtype: None
  
      Removes this messenger from the bottom of the Pyro stack.
      If an exception is raised, removes this messenger and everything below it.
      Always called after every execution of self.fn via self.__call__.
  
      Can be overloaded by derived classes to add any other per-call teardown functionality,
      but the stack must always be popped by the derived class,
      usually by calling super().__exit__(*args).
  
      Derived versions cannot be overridden to take other arguments,
      and must always return None or False.
  
      The arguments are the mandatory arguments used by a with statement.
      Users should never be specifying these.
      They are all None unless the body of the with statement raised an exception.
      """
      if (
          exc_type is None
      ):  # callee or enclosed block returned successfully
          # if the callee or enclosed block returned successfully,
          # this poutine should be on the bottom of the stack.
          # If so, remove it from the stack.
          # if not, raise a ValueError because something really weird happened.
          if _PYRO_STACK[-1] == self:
              _PYRO_STACK.pop()
          else:
              # should never get here, but just in case...
              raise ValueError(
                  "This Messenger is not on the bottom of the stack"
              )
      else:  # the wrapped function or block raised an exception
          # poutine exception handling:
          # when the callee or enclosed block raises an exception,
          # find this poutine's position in the stack,
          # then remove it and everything below it in the stack.
          if self in _PYRO_STACK:
              loc = _PYRO_STACK.index(self)
              for i in range(loc, len(_PYRO_STACK)):
                  _PYRO_STACK.pop()
  
imports: from contextlib import contextmanager
  from functools import partial
  from types import TracebackType
  from typing import Any, Callable, Iterator, List, Optional, Type, TypeVar
  from typing_extensions import ParamSpec, Self
  from pyro.poutine.runtime import _PYRO_STACK, Message
label_desc: Use image node_id 3 for calling the Messenger obj's underlying member method code with example usage: obj.__exit__(exc_type, exc_value, traceback) without return types