code: def _extract_samples_contraction(discrete_density):
      assert not discrete_density.reduced_vars
      result = {}
      for term in discrete_density.terms:
          result.update(extract_samples(term))
      return result
  
imports: import functools
  from collections import OrderedDict
  from funsor.cnf import Contraction
  from funsor.delta import Delta
  from funsor.gaussian import Gaussian
  from funsor.integrate import Integrate
  from funsor.interpretations import StatefulInterpretation
  from funsor.tensor import Tensor
  from funsor.terms import Approximate, Funsor, Number, Subs, Unary
  from funsor.util import get_backend
  from .None import ops
label_desc: Use image node_id 5 for calling a global function with example usage: _extract_samples_contraction(discrete_density) and returns: result