code: def test_log_warning_stats_knows_SamplerWarning(caplog):
      """Checks that SamplerWarning "warning" stats get special treatment."""
      warn = convergence.SamplerWarning(
          convergence.WarningType.BAD_ENERGY,
          "Not that interesting",
          "debug",
      )
      stats = [dict(warning=warn)]
  
      with caplog.at_level(logging.DEBUG, logger="pymc"):
          convergence.log_warning_stats(stats)
  
      assert "Not that interesting" in caplog.records[0].message
  
file_path: pymc/tests/stats/test_convergence.py
imports: import logging
  import arviz
  import numpy
  from pymc.stats import convergence
label_desc: Use image node_id 4 for calling a global function with example usage: test_log_warning_stats_knows_SamplerWarning(caplog) without return types