code: def test_cm_accuracy():
      x = np.asarray([[1, 2], [1, 2]])
      assert cm_accuracy(x) == 0.5
  
imports: from unittest.mock import MagicMock, Mock, patch
  import numpy
  import pytest
  from chitra.visualization.metrics import cm_accuracy, detect_multilabel, plot_confusion_matrix
label_desc: Use image node_id 2 for calling a global function with example usage: test_cm_accuracy() without return types