code: def test_ConfusionMatrix(
      monkeypatch, confusion_matrix_normalized, expected_fmt
  ):
      state = AnalysisState(
          {
              "model_evaluation": {
                  "problem_type": "binary",
                  "y_true": pd.Series([0, 1, 0, 1]),
                  "y_pred": pd.Series([1, 0, 1, 0]),
                  "importance": pd.DataFrame(
                      {
                          "importance": [0.1, 0.2, 0.3],
                          "stddev": [0.01, 0.02, 0.03],
                          "p_value": [0.1, 0.2, 0.3],
                          "n": [5, 5, 5],
                          "p99_high": [0.02, 0.03, 0.04],
                          "p99_low": [-0.02, -0.03, -0.04],
                      }
                  ),
                  "confusion_matrix_normalized": confusion_matrix_normalized,
                  "confusion_matrix": np.array([[148, 20], [32, 68]]),
              }
          }
      )
  
      call_plt_subplots = MagicMock(return_value=("fig", "ax"))
      call_plt_show = MagicMock()
      call_sns_heatmap = MagicMock()
      call_render_markdown = MagicMock()
      with monkeypatch.context() as m:
          m.setattr(plt, "subplots", call_plt_subplots)
          m.setattr(plt, "show", call_plt_show)
          m.setattr(sns, "heatmap", call_sns_heatmap)
          viz = ConfusionMatrix(
              fig_args=dict(a=1, b=2), headers=True, some_kwarg=123
          )
          viz.render_markdown = call_render_markdown
          viz.render(state)
      call_plt_subplots.assert_called_with(a=1, b=2, figsize=(2, 2))
      call_plt_show.assert_called_with("fig")
      call_sns_heatmap.assert_called_with(
          ANY,
          ax="ax",
          cmap="Blues",
          annot=True,
          linewidths=0.5,
          linecolor="lightgrey",
          fmt=expected_fmt,
          cbar=False,
          some_kwarg=123,
      )
      call_render_markdown.assert_called_with("**Confusion Matrix**")
  
file_path: autogluon/eda/tests/unittests/visualization/test_model.py
imports: from unittest.mock import ANY, MagicMock
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  import seaborn
  from autogluon.eda import AnalysisState
  from autogluon.eda.visualization import ConfusionMatrix, FeatureImportance, ModelLeaderboard, RegressionEvaluation
label_desc: Use image node_id 1 for calling a global function with example usage: test_ConfusionMatrix(monkeypatch, confusion_matrix_normalized, expected_fmt) without return types