class_docstr: ``ScopeMessenger`` is the implementation of :func:`pyro.contrib.autoname.scope`
class_docstr_tok: ["``","ScopeMessenger","``","is","the","implementation","of",":","func",":","`","pyro.contrib.autoname.scope","`"]
code: def __call__(self, fn):
      if self.prefix is None:
          self.prefix = fn.__code__.co_name  # fn.__name__
  
      @functools.wraps(fn)
      def _fn(*args, **kwargs):
          with type(self)(prefix=self.prefix, inner=self.inner):
              return fn(*args, **kwargs)
  
      return _fn
  
imports: import functools
  from pyro.poutine.messenger import Messenger
  from pyro.poutine.runtime import effectful
label_desc: Use image node_id 4 for calling the ScopeMessenger obj's underlying member method code with example usage: obj.__call__(fn) and returns: _fn, fn