code: def _sample_dist(fn, *args, **kwargs):
      name = kwargs.pop("name", None)
      name = genname(type(fn).__name__ if name is None else name)
      return pyro.sample(name, fn, *args, **kwargs)
  
imports: from collections import defaultdict
  from collections.abc import Iterable
  from functools import singledispatch
  import pyro
  from pyro.poutine.handlers import _make_handler
  from pyro.poutine.reentrant_messenger import ReentrantMessenger
  from pyro.poutine.runtime import effectful
label_desc: Use image node_id 5 for calling a global function with example usage: _sample_dist(fn) and returns: pyro