class_docstr: Given a stochastic function with param calls and a prior distribution,
  create a stochastic function where all param calls are replaced by sampling from prior.
  Prior should be a callable or a dict of names to callables.
  
  Consider the following Pyro program:
  
      >>> def model(x):
      ...     s = pyro.param("s", torch.tensor(0.5))
      ...     z = pyro.sample("z", dist.Normal(x, s))
      ...     return z ** 2
      >>> lifted_model = pyro.poutine.lift(model, prior={"s": dist.Exponential(0.3)})
  
  ``lift`` makes ``param`` statements behave like ``sample`` statements
  using the distributions in ``prior``.  In this example, site `s` will now behave
  as if it was replaced with ``s = pyro.sample("s", dist.Exponential(0.3))``:
  
      >>> tr = pyro.poutine.trace(lifted_model).get_trace(0.0)
      >>> tr.nodes["s"]["type"] == "sample"
      True
      >>> tr2 = pyro.poutine.trace(lifted_model).get_trace(0.0)
      >>> bool((tr2.nodes["s"]["value"] == tr.nodes["s"]["value"]).all())
      False
  
  :param fn: function whose parameters will be lifted to random values
  :param prior: prior function in the form of a Distribution or a dict of stochastic fns
  :returns: ``fn`` decorated with a :class:`~pyro.poutine.lift_messenger.LiftMessenger`
code: def __exit__(self, *args, **kwargs) -> None:
      self._samples_cache = {}
      if is_validation_enabled() and isinstance(self.prior, dict):
          extra = set(self.prior) - self._param_hits
          if extra:
              warnings.warn(
                  "pyro.module prior did not find params ['{}']. "
                  "Did you instead mean one of ['{}']?".format(
                      "', '".join(extra),
                      "', '".join(self._param_misses),
                  )
              )
      return super().__exit__(*args, **kwargs)
  
file_path: pyro/pyro/poutine/lift_messenger.py
imports: import warnings
  from typing import TYPE_CHECKING, Callable, Dict, Set, Union
  from typing_extensions import Self
  from pyro import params
  from pyro.distributions.distribution import Distribution
  from pyro.poutine.messenger import Messenger
  from pyro.poutine.util import is_validation_enabled
label_desc: Use image node_id 3 for calling the LiftMessenger obj's underlying member method code with example usage: obj.__exit__() and returns: super