code: def test_stats_bijection(self):
      step_stats_dtypes = [
          {"a": float, "b": int},
          {"a": float, "c": Warning},
      ]
      bij = StatsBijection(step_stats_dtypes)
      assert bij.object_stats == {"sampler_1__c": (1, "c")}
      assert bij.n_samplers == 2
      w = Warning("hmm")
      stats_l = [
          dict(a=1.5, b=3),
          dict(a=2.5, c=w),
      ]
      stats_d = bij.map(stats_l)
      assert isinstance(stats_d, dict)
      assert stats_d["sampler_0__a"] == 1.5
      assert stats_d["sampler_0__b"] == 3
      assert stats_d["sampler_1__a"] == 2.5
      assert stats_d["sampler_1__c"] == w
      rev = bij.rmap(stats_d)
      assert isinstance(rev, list)
      assert len(rev) == len(stats_l)
      assert rev == stats_l
      # Also rmap incomplete dicts
      rev2 = bij.rmap({"sampler_1__a": 0})
      assert len(rev2) == 2
      assert len(rev2[0]) == 0
      assert len(rev2[1]) == 1
  
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 TestStatsBijection obj's underlying member method code with example usage: obj.test_stats_bijection() without return types