code: def test_enum_recycling_nested():
      # (x)
      #   \
      #    y0---(y1)--(y2)
      #    |     |     |
      #   z00   z10   z20
      #    |     |     |
      #   z01   z11  (z21)
      #    |     |     |
      #   z02   z12   z22 <-- what can this depend on?
      #
      # markov dependencies
      # -------------------
      #   x:
      #  y0: x
      # z00: x y0
      # z01: x y0 z00
      # z02: x y0 z01
      #  y1: x y0
      # z10: x y0 y1
      # z11: x y0 y1 z10
      # z12: x y0 y1 z11
      #  y2: x y1
      # z20: x y1 y2
      # z21: x y1 y2 z20
      # z22: x y1 y2 z21
  
      @infer.config_enumerate
      def model():
          p = pyro.param("p", torch.ones(3, 3))
          x = pyro.sample("x", dist.Categorical(p[0]))
          y = x
          for i in pyro.markov(range(10)):
              y = pyro.sample("y_{}".format(i), dist.Categorical(p[y]))
              z = y
              for j in pyro.markov(range(10)):
                  z = pyro.sample(
                      "z_{}_{}".format(i, j), dist.Categorical(p[z])
                  )
  
      assert_ok(model, max_plate_nesting=0)
  
imports: import contextlib
  import logging
  import os
  from collections import defaultdict
  from queue import LifoQueue
  import pytest
  import torch
  from pyro.infer.enum import iter_discrete_escape, iter_discrete_extend
  from pyro.ops.indexing import Vindex
  from pyro.poutine import Trace
  from pyro.poutine.util import prune_subsample_sites
  from pyro.util import check_traceenum_requirements
label_desc: Use image node_id 8 for calling a global function with example usage: test_enum_recycling_nested() without return types