code: def test_inference_data_constant_data(self):
      import numpyro
      import numpyro.distributions as dist
      from numpyro.infer import MCMC, NUTS
  
      x1 = 10
      x2 = 12
      y1 = np.random.randn(10)
  
      def model_constant_data(x, y1=None):
          _x = numpyro.sample("x", dist.Normal(1, 3))
          numpyro.sample("y1", dist.Normal(x * _x, 1), obs=y1)
  
      nuts_kernel = NUTS(model_constant_data)
      mcmc = MCMC(nuts_kernel, num_samples=10, num_warmup=2)
      mcmc.run(PRNGKey(0), x=x1, y1=y1)
      posterior = mcmc.get_samples()
      posterior_predictive = Predictive(model_constant_data, posterior)(
          PRNGKey(1), x1
      )
      predictions = Predictive(model_constant_data, posterior)(
          PRNGKey(2), x2
      )
      inference_data = from_numpyro(
          mcmc,
          posterior_predictive=posterior_predictive,
          predictions=predictions,
          constant_data={"x1": x1},
          predictions_constant_data={"x2": x2},
      )
      test_dict = {
          "posterior": ["x"],
          "posterior_predictive": ["y1"],
          "sample_stats": ["diverging"],
          "log_likelihood": ["y1"],
          "predictions": ["y1"],
          "observed_data": ["y1"],
          "constant_data": ["x1"],
          "predictions_constant_data": ["x2"],
      }
      fails = check_multiple_attrs(test_dict, inference_data)
      assert not fails
  
file_path: arviz/arviz/tests/external_tests/test_data_numpyro.py
imports: from collections import namedtuple
  import numpy
  import pytest
  from ...data.io_numpyro import from_numpyro
  from ..helpers import chains, check_multiple_attrs, draws, eight_schools_params, importorskip, load_cached_models
label_desc: Use image node_id 10 for calling the TestDataNumPyro obj's underlying member method code with example usage: obj.test_inference_data_constant_data() without return types