code: def enumerate_site(dist, msg):
      # TODO come up with a better dispatch system for enumeration strategies
      if msg["infer"]["enumerate"] == "flat":
          return _enum_strategy_default(dist, msg)
      elif msg["infer"].get("num_samples", None) is None:
          return _enum_strategy_exact(dist, msg)
      elif msg["infer"]["num_samples"] > 1 and (
          msg["infer"].get("expand", False)
          or msg["infer"].get("tmc") == "full"
      ):
          return _enum_strategy_full(dist, msg)
      elif (
          msg["infer"]["num_samples"] > 1
          and msg["infer"].get("tmc", "diagonal") == "diagonal"
      ):
          return _enum_strategy_diagonal(dist, msg)
      elif (
          msg["infer"]["num_samples"] > 1
          and msg["infer"]["tmc"] == "mixture"
      ):
          return _enum_strategy_mixture(dist, msg)
      raise ValueError("{} not valid enum strategy".format(msg))
  
imports: import functools
  import math
  from collections import OrderedDict
  import funsor
  import torch
  import pyro.poutine.runtime
  import pyro.poutine.util
  from pyro.contrib.funsor.handlers.named_messenger import NamedMessenger
  from pyro.contrib.funsor.handlers.primitives import to_data, to_funsor
  from pyro.contrib.funsor.handlers.replay_messenger import ReplayMessenger
  from pyro.contrib.funsor.handlers.trace_messenger import TraceMessenger
  from pyro.poutine.escape_messenger import EscapeMessenger
  from pyro.poutine.subsample_messenger import _Subsample
label_desc: Use image node_id 11 for calling a global function with example usage: enumerate_site(dist, msg) and returns: _enum_strategy_default, _enum_strategy_exact, _enum_strategy_full, _enum_strategy_diagonal, _enum_strategy_mixture