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 __enter__(self):
      if self.keep and self._saved_frames:
          frame = self._saved_frames.pop()
      else:
          frame = StackFrame(
              name_to_dim=OrderedDict(),
              dim_to_name=OrderedDict(),
              history=self.history,
              keep=self.keep,
          )
  
      _DIM_STACK.push_local(frame)
      return super().__enter__()
  
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 4 for calling the MarkovMessenger obj's underlying member method code with example usage: obj.__enter__() and returns: super