class_docstr: Handler for converting to/from funsors consistent with Pyro's positional batch dimensions.
  
  :param int history: The number of previous contexts visible from the
      current context. Defaults to 1. If zero, this is similar to
      :class:`pyro.plate`.
  :param bool keep: If true, frames are replayable. This is important
      when branching: if ``keep=True``, neighboring branches at the same
      level can depend on each other; if ``keep=False``, neighboring branches
      are independent (conditioned on their shared ancestors).
code: def __exit__(self, *args, **kwargs):
      if self.keep:
          self._saved_frames.append(_DIM_STACK.pop_local())
      else:
          _DIM_STACK.pop_local()
      return super().__exit__(*args, **kwargs)
  
imports: from collections import OrderedDict
  from contextlib import ExitStack
  from pyro.contrib.funsor.handlers.runtime import _DIM_STACK, DimRequest, DimType, StackFrame
  from pyro.poutine.reentrant_messenger import ReentrantMessenger
label_desc: Use image node_id 5 for calling the MarkovMessenger obj's underlying member method code with example usage: obj.__exit__() and returns: super