code: def test_stats_from_steps(self):
      with pm.Model():
          s1 = pm.NUTS(pm.Normal("n"))
          s2 = pm.Metropolis(pm.Bernoulli("b", 0.5))
          cs = pm.CompoundStep([s1, s2])
      # Make sure that sampler initialization does not modify the
      # class-level default values of the attributes.
      assert pm.NUTS.stats_dtypes == []
      assert pm.Metropolis.stats_dtypes == []
  
      sds = get_stats_dtypes_shapes_from_steps([s1, s2])
      assert "sampler_0__step_size" in sds
      assert "sampler_1__accepted" in sds
      assert len(cs.stats_dtypes) == 2
      assert cs.stats_dtypes_shapes == sds
  
imports: import pytensor
  import pytest
  import pymc
  from pymc.step_methods import NUTS, CompoundStep, DEMetropolis, HamiltonianMC, Metropolis, Slice
  from pymc.step_methods.compound import BlockedStep, StatsBijection, flatten_steps, get_stats_dtypes_shapes_from_steps, infer_warn_stats_info
  from pymc.testing import fast_unstable_sampling_mode
  from tests.helpers import StepMethodTester
  from tests.models import simple_2model_continuous
label_desc: Use image node_id 2 for calling the TestStatsMetadata obj's underlying member method code with example usage: obj.test_stats_from_steps() without return types