code: def test_model_with_subsample(subsample_size):
      size = 10
  
      def model():
          with pyro.plate("J", size, subsample_size=subsample_size):
              pyro.sample("x", dist.Normal(0, 1))
  
      kernel = NUTS(model)
      mcmc = MCMC(kernel, 10)
      if subsample_size < size:
          with pytest.raises(RuntimeError, match="subsample"):
              mcmc.run()
      else:
          mcmc.run()
  
file_path: pyro/tests/infer/mcmc/test_mcmc_util.py
imports: from functools import partial
  import pytest
  import torch
  import pyro
  import pyro.distributions
  from pyro.infer import Predictive
  from pyro.infer.autoguide import init_to_feasible, init_to_generated, init_to_mean, init_to_median, init_to_sample, init_to_uniform, init_to_value
  from pyro.infer.mcmc import NUTS
  from pyro.infer.mcmc.api import MCMC
  from pyro.infer.mcmc.util import initialize_model
  from pyro.util import optional
  from tests.common import assert_close, str_erase_pointers
label_desc: Use image node_id 5 for calling a global function with example usage: test_model_with_subsample(subsample_size) without return types