code: def block_messengers(
      predicate: Callable[[Messenger], bool]
  ) -> Iterator[List[Messenger]]:
      """
      EXPERIMENTAL Context manager to temporarily remove matching messengers from
      the _PYRO_STACK. Note this does not call the ``.__exit__()`` and
      ``.__enter__()`` methods.
  
      This is useful to selectively block enclosing handlers.
  
      :param callable predicate: A predicate mapping messenger instance to boolean.
          This mutes all messengers ``m`` for which ``bool(predicate(m)) is True``.
      :yields: A list of matched messengers that are blocked.
      """
      blocked = {}
      try:
          for i, messenger in enumerate(_PYRO_STACK):
              if predicate(messenger):
                  blocked[i] = messenger
                  _PYRO_STACK[i] = Messenger()  # trivial messenger
          yield list(blocked.values())
      finally:
          for i, messenger in blocked.items():
              _PYRO_STACK[i] = messenger
  
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 a global function with example usage: block_messengers(predicate) without return types