code: def test_confusion_matrix():
      true = [0, 1, 1, 2, 2, 2]
      pred = [0, 0, 1, 1, 1, 2]
      cmat = util.confusion_matrix(true, pred)
      assert np.shape(cmat) == (3, 3)
      assert cmat[0][0] == 1
      assert cmat[1][1] == 1
      assert cmat[2][2] == 1
      assert cmat[1][0] == 1
      assert cmat[2][1] == 2
      assert cmat[0][1] == 0
      assert cmat[0][2] == 0
      assert cmat[2][0] == 0
      assert cmat[0][1] == 0
  
imports: from cleanlab.internal import util
  import numpy
  import pytest
  from cleanlab.internal.label_quality_utils import get_normalized_entropy
  from cleanlab.internal.multilabel_utils import int2onehot, onehot2int
  from cleanlab.internal.util import num_unique_classes, format_labels, get_missing_classes
  from cleanlab.internal.validation import assert_valid_class_labels
label_desc: Use image node_id 13 for calling a global function with example usage: test_confusion_matrix() without return types