docstr: Until `BlockedStep.stats_dtypes` is removed, the new `stats_dtypes_shapes`
  attributed is inferred from `stats_dtypes`, or vice versa.
docstr_tok: ["Until","`","BlockedStep.stats_dtypes","`","is","removed",",","the","new","`","stats_dtypes_shapes","`","attributed","is","inferred","from","`","stats_dtypes","`",",","or","vice","versa","."]
code: def test_infer_warn_stats_info(self):
      """
      Until `BlockedStep.stats_dtypes` is removed, the new `stats_dtypes_shapes`
      attributed is inferred from `stats_dtypes`, or vice versa.
      """
      # Infer new
      with pytest.warns(DeprecationWarning, match="to specify"):
          old, new = infer_warn_stats_info(
              [{"a": int, "b": object}], {}, "bla"
          )
      assert isinstance(old, list)
      assert len(old) == 1
      assert old[0] == {"a": int, "b": object}
      assert isinstance(new, dict)
      assert new["a"] == (int, None)
      assert new["b"] == (object, None)
  
      # Infer old
      old, new = infer_warn_stats_info(
          [], {"a": (int, []), "b": (float, [2])}, "bla"
      )
      assert isinstance(old, list)
      assert len(old) == 1
      assert old[0] == {"a": int, "b": float}
      assert isinstance(new, dict)
      assert new["a"] == (int, [])
      assert new["b"] == (float, [2])
  
      # Disallow specifying both (single source of truth problem)
      with pytest.raises(TypeError, match="Only one of"):
          infer_warn_stats_info([{"a": float}], {"b": (int, [])}, "bla")
  
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 1 for calling the TestStatsMetadata obj's underlying member method code with example usage: obj.test_infer_warn_stats_info() without return types