code: def collapse_conjugate(fn=None):
      r"""
      This replaces a latent-observed pair by collapsing the latent site
      (whose distribution has attribute `collapsible=True`), and replacing the
      observed site (whose distribution has attribute `marginalize_latent=True`)
      with a compound probability distribution that marginalizes out the latent
      site.
      """
      msngr = CollapseConjugateMessenger()
      return msngr(fn) if fn is not None else msngr
  
imports: from collections import defaultdict
  import torch
  import pyro.distributions
  from pyro import poutine
  from pyro.distributions.util import sum_leftmost
  from pyro.poutine.messenger import Messenger
  from pyro.poutine.util import site_is_subsample
label_desc: Use image node_id 6 for calling a global function with example usage: collapse_conjugate(fn) and returns: unknown