code: def test_from_raw_data(
      y, normalize, target_names, target_names_expected
  ):
      y_true, y_pred = y
      cm = plot.ConfusionMatrix.from_raw_data(
          y_true, y_pred, normalize=normalize, target_names=target_names
      )
  
      denominator = 4 if normalize else 1
      value = 2 / denominator
  
      assert cm._get_data() == {
          "class": "sklearn_evaluation.plot.ConfusionMatrix",
          "cm": [[value, value], [value, value]],
          "normalize": normalize,
          "target_names": target_names_expected,
          "version": __version__,
      }
  
file_path: sklearn-evaluation/tests/test_confusion_matrix.py
imports: import pytest
  import numpy
  from sklearn_evaluation import plot, __version__
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: test_from_raw_data(y, normalize, target_names, target_names_expected) without return types