code: def test_get_sampler_stats(self):
      # Initialize a very simply toy model
      N = 45
      with pm.Model() as pmodel:
          a = pm.Normal("a")
          b = pm.Uniform("b")
          c = pm.Deterministic("c", a + b)
          ip = pmodel.initial_point()
          shared = pm.make_shared_replacements(ip, [a, b], pmodel)
          run, traces = init_traces(
              backend=mcb.NumPyBackend(),
              chains=1,
              expected_length=N,
              step=ToyStepper([a, b], shared),
              initial_point=pmodel.initial_point(),
              model=pmodel,
          )
      cra = traces[0]
      assert isinstance(run, mcb.backends.numpy.NumPyRun)
      assert isinstance(cra, ChainRecordAdapter)
  
      # Simulate recording of draws and stats
      rng = np.random.RandomState(2023)
      for i in range(N):
          draw = {"a": rng.normal(), "b_interval__": rng.normal()}
          stats = [
              dict(
                  tune=(i <= 5), s1=i, accepted=bool(rng.randint(0, 2))
              )
          ]
          cra.record(draw, stats)
  
      # Check final state of the chain
      assert len(cra) == N
      # Variables b and c were calculated by the point function
      draws_a = cra.get_values("a")
      draws_b = cra.get_values("b")
      draws_c = cra.get_values("c")
      np.testing.assert_array_equal(draws_a + draws_b, draws_c)
      i = np.random.randint(0, N)
      point = cra.point(idx=i)
      assert point["a"] == draws_a[i]
      assert point["b"] == draws_b[i]
      assert point["c"] == draws_c[i]
  
      # Stats come in different shapes depending on the query
      s1 = cra.get_sampler_stats("s1", sampler_idx=None, burn=3, thin=2)
      assert s1.shape == (21,)
      assert s1.dtype == np.dtype("float64")
      np.testing.assert_array_equal(s1, np.arange(N)[3:None:2])
  
imports: import logging
  import arviz
  import numpy
  import pytest
  import pymc
  from pymc.backends import init_traces
  from pymc.step_methods.arraystep import ArrayStepShared
  from pymc.backends.mcbackend import ChainRecordAdapter, find_data, get_variables_and_point_fn, make_runmeta_and_point_fn
label_desc: Use image node_id 1 for calling the TestChainRecordAdapter obj's underlying member method code with example usage: obj.test_get_sampler_stats() without return types