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 __init__(self, history=1, keep=False):
      self.history = history
      self.keep = keep
      self._iterable = None
      self._saved_frames = []
      super().__init__()
  
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 1 to create a new MarkovMessenger object from inherited base classes: NamedMessenger with example: obj = MarkovMessenger(history, keep)