code: def test_markov_history(max_plate_nesting, history):
      @infer.config_enumerate
      def model():
          p = pyro.param("p", 0.25 * torch.ones(2, 2))
          q = pyro.param("q", 0.25 * torch.ones(2))
          x_prev = torch.tensor(0)
          x_curr = torch.tensor(0)
          for t in pyro.markov(range(10), history=history):
              probs = p[x_prev, x_curr]
              x_prev, x_curr = (
                  x_curr,
                  pyro.sample(
                      "x_{}".format(t), dist.Bernoulli(probs)
                  ).long(),
              )
              pyro.sample(
                  "y_{}".format(t),
                  dist.Bernoulli(q[x_curr]),
                  obs=torch.tensor(0.0),
              )
  
      assert_ok(model, max_plate_nesting=max_plate_nesting)
  
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 13 for calling a global function with example usage: test_markov_history(max_plate_nesting, history) without return types