code: def test_rng_state(model, backend):
      with pyro_backend(backend), handlers.seed(
          rng_seed=2
      ), xfail_if_not_implemented():
          f = MODELS[model]()
          model, model_args = f["model"], f.get("model_args", ())
          with handlers.seed(rng_seed=0):
              model(*model_args)
              expected = model(*model_args)
          if expected is None:
              pytest.skip()
          with handlers.seed(rng_seed=0):
              model(*model_args)
              with handlers.seed(rng_seed=0):
                  model(*model_args)
              actual = model(*model_args)
          assert ops.allclose(actual, expected)
  
file_path: pyro/tests/test_generic.py
imports: import pytest
  from pyroapi.testing import MODELS
  from pyro.generic import handlers, infer, ops, pyro, pyro_backend
  from tests.common import xfail_if_not_implemented
label_desc: Use image node_id 5 for calling a global function with example usage: test_rng_state(model, backend) without return types