code: def test_enum_discrete_plates_dependency_ok(enumerate_, reuse_plate):
      @infer.config_enumerate(default=enumerate_)
      def model():
          x_plate = pyro.plate("x_plate", 10, dim=-1)
          y_plate = pyro.plate("y_plate", 11, dim=-2)
          q = pyro.param("q", torch.tensor([0.5, 0.5]))
          pyro.sample("a", dist.Bernoulli(0.5))
          with x_plate:
              b = pyro.sample("b", dist.Bernoulli(0.5)).long()
          with y_plate:
              # Note that it is difficult to check that c does not depend on b.
              c = pyro.sample("c", dist.Bernoulli(0.5)).long()
          with x_plate, y_plate:
              pyro.sample(
                  "d",
                  dist.Bernoulli(Vindex(q)[b] if reuse_plate else 0.5),
              )
  
          assert c.shape != b.shape or enumerate_ == "sequential"
  
      assert_ok(model, max_plate_nesting=2)
  
file_path: pyro/tests/contrib/funsor/test_valid_models_plate.py
imports: import logging
  import pytest
  import torch
  from pyro.ops.indexing import Vindex
  from tests.common import xfail_param
label_desc: Use image node_id 4 for calling a global function with example usage: test_enum_discrete_plates_dependency_ok(enumerate_, reuse_plate) without return types