code: def test_warn_divergences():
      idata = arviz.from_dict(
          sample_stats={
              "diverging": np.array(
                  [[1, 0, 1, 0], [0, 0, 0, 0]]
              ).astype(bool),
          }
      )
      warns = convergence.warn_divergences(idata)
      assert len(warns) == 1
      assert "2 divergences after tuning" in warns[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 1 for calling a global function with example usage: test_warn_divergences() without return types