class_docstr: Base class for any new effect handlers that use the
  :func:`~pyro.contrib.funsor.to_funsor` and :func:`~pyro.contrib.funsor.to_data` primitives
  to allocate ``DimType.GLOBAL`` or ``DimType.VISIBLE`` dimensions.
  
  Serves as a manual "scope" for dimensions that should not be recycled by :class:`~MarkovMessenger`:
  global dimensions will be considered active until the innermost :class:`~GlobalNamedMessenger`
  under which they were initially allocated exits.
code: def __enter__(self):
      frame = (
          self._saved_frames.pop()
          if self._saved_frames
          else StackFrame(
              name_to_dim=OrderedDict(), dim_to_name=OrderedDict()
          )
      )
      _DIM_STACK.push_global(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 2 for calling the GlobalNamedMessenger obj's underlying member method code with example usage: obj.__enter__() and returns: super