code: def infer_discrete(model, first_available_dim=None, temperature=1):
      return functools.partial(
          _sample_posterior, model, first_available_dim, temperature
      )
  
file_path: pyro/pyro/contrib/funsor/infer/discrete.py
imports: import functools
  import funsor
  from pyro.contrib.funsor.handlers import enum, replay, trace
  from pyro.contrib.funsor.handlers.enum_messenger import _get_support_value
  from pyro.contrib.funsor.infer.traceenum_elbo import terms_from_trace
  from pyro.poutine import Trace, block
  from pyro.poutine.util import site_is_subsample
label_desc: Use image node_id 2 for calling a global function with example usage: infer_discrete(model, first_available_dim, temperature) and returns: functools