code: def test_enum_recycling_chain_recur(history):
      @infer.config_enumerate
      def model():
          p = torch.tensor([[0.2, 0.8], [0.1, 0.9]])
  
          x = 0
  
          @pyro.markov(history=history)
          def fn(t, x):
              x = pyro.sample("x_{}".format(t), dist.Categorical(p[x]))
              assert x.dim() <= history + 1
              return x if t >= 100 else fn(t + 1, x)
  
          return fn(0, x)
  
      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 6 for calling a global function with example usage: test_enum_recycling_chain_recur(history) and returns: fn, unknown