code: def run_confusion_matrix_check(
      y_pred: np.ndarray,
      y_true: np.ndarray,
      with_display=True,
      normalize_display=True,
  ) -> CheckResult:
      """Calculate confusion matrix based on predictions and true label values."""
      total_classes = sorted(
          [str(x) for x in set(y_pred).union(set(y_true))]
      )
      result = confusion_matrix(y_true, y_pred)
  
      if with_display:
          displays = create_confusion_matrix_figure(
              result, total_classes, normalize_display
          )
      else:
          displays = None
  
      # For accessing the class names from the condition
      result = pd.DataFrame(
          result, index=total_classes, columns=total_classes
      )
  
      return CheckResult(result, display=displays)
  
file_path: deepchecks/deepchecks/utils/abstracts/confusion_matrix_abstract.py
imports: from typing import List
  import numpy
  import pandas
  import plotly.graph_objects
  from sklearn.metrics import confusion_matrix
  from deepchecks import ConditionCategory, ConditionResult
  from deepchecks.core import CheckResult
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.utils.strings import format_number_if_not_nan, format_percent
label_desc: Use image node_id 1 for calling a global function with example usage: run_confusion_matrix_check(y_pred, y_true, with_display, normalize_display) and returns: CheckResult