code: def test_enumeration_in_dag(Eval):
      p = 0.3
  
      @poutine.enum(first_available_dim=-3)
      @config_enumerate
      @poutine.condition(
          data={"b": torch.tensor(0.4), "c": torch.tensor(0.4)}
      )
      def model():
          d = dist.Bernoulli(p)
          context1 = pyro.plate("outer", 3, dim=-1)
          context2 = pyro.plate("inner", 2, dim=-2)
          pyro.sample("w", d)
          pyro.sample("b", dist.Beta(1.1, 1.1))
          with context1:
              pyro.sample("x", d)
          with context2:
              pyro.sample("c", dist.Beta(1.1, 1.1))
              pyro.sample("y", d)
          with context1, context2:
              pyro.sample("z", d)
  
      model_trace = poutine.trace(model).get_trace()
      print_debug_info(model_trace)
      trace_prob_evaluator = Eval(model_trace, True, 2)
      assert_equal(
          trace_prob_evaluator.log_prob(model_trace),
          torch.tensor(0.16196),
      )
  
imports: import io
  import logging
  import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.poutine
  from pyro.infer import config_enumerate
  from pyro.infer.mcmc import HMC, NUTS
  from pyro.infer.mcmc.api import MCMC
  from pyro.infer.mcmc.util import TraceEinsumEvaluator, TraceTreeEvaluator, initialize_model
  from pyro.infer.reparam import LatentStableReparam
  from pyro.poutine.subsample_messenger import _Subsample
  from tests.common import assert_close, assert_equal, xfail_param
label_desc: Use image node_id 9 for calling a global function with example usage: test_enumeration_in_dag(Eval) without return types