class_docstr: This handler selectively hides Pyro primitive sites from the outside world.
  Default behavior: block everything.
  
  A site is hidden if at least one of the following holds:
  
      0. ``hide_fn(msg) is True`` or ``(not expose_fn(msg)) is True``
      1. ``msg["name"] in hide``
      2. ``msg["type"] in hide_types``
      3. ``msg["name"] not in expose and msg["type"] not in expose_types``
      4. ``hide``, ``hide_types``, and ``expose_types`` are all ``None``
  
  For example, suppose the stochastic function fn has two sample sites "a" and "b".
  Then any effect outside of ``BlockMessenger(fn, hide=["a"])``
  will not be applied to site "a" and will only see site "b":
  
      >>> def fn():
      ...     a = pyro.sample("a", dist.Normal(0., 1.))
      ...     return pyro.sample("b", dist.Normal(a, 1.))
      >>> fn_inner = pyro.poutine.trace(fn)
      >>> fn_outer = pyro.poutine.trace(pyro.poutine.block(fn_inner, hide=["a"]))
      >>> trace_inner = fn_inner.get_trace()
      >>> trace_outer  = fn_outer.get_trace()
      >>> "a" in trace_inner
      True
      >>> "a" in trace_outer
      False
      >>> "b" in trace_inner
      True
      >>> "b" in trace_outer
      True
  
  :param fn: a stochastic function (callable containing Pyro primitive calls)
  :param hide_fn: function that takes a site and returns True to hide the site
      or False/None to expose it.  If specified, all other parameters are ignored.
      Only specify one of hide_fn or expose_fn, not both.
  :param expose_fn: function that takes a site and returns True to expose the site
      or False/None to hide it.  If specified, all other parameters are ignored.
      Only specify one of hide_fn or expose_fn, not both.
  :param bool hide_all: hide all sites
  :param bool expose_all: expose all sites normally
  :param list hide: list of site names to hide
  :param list expose: list of site names to be exposed while all others hidden
  :param list hide_types: list of site types to be hidden
  :param list expose_types: list of site types to be exposed while all others hidden
  :returns: stochastic function decorated with a :class:`~pyro.poutine.block_messenger.BlockMessenger`
code: def _process_message(self, msg: "Message") -> None:
      msg["stop"] = bool(self.hide_fn(msg))
  
file_path: pyro/pyro/poutine/block_messenger.py
imports: from functools import partial
  from typing import TYPE_CHECKING, Callable, List, Optional
  from pyro.poutine.messenger import Messenger
label_desc: Use image node_id 2 for calling the BlockMessenger obj's underlying member method code with example usage: obj._process_message(msg) without return types