code: def test_inference_data_namedtuple(self, data):
      samples = data.obj.get_samples()
      Samples = namedtuple("Samples", samples)
      data_namedtuple = Samples(**samples)
      _old_fn = data.obj.get_samples
      data.obj.get_samples = lambda *args, **kwargs: data_namedtuple
      inference_data = from_numpyro(
          posterior=data.obj,
      )
      assert isinstance(data.obj.get_samples(), Samples)
      data.obj.get_samples = _old_fn
      for key in samples:
          assert key in inference_data.posterior
  
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 5 for calling the TestDataNumPyro obj's underlying member method code with example usage: obj.test_inference_data_namedtuple(data) without return types