code: def test_multilabel_confusion_matrix_multilabel(setup):
      # Test multilabel confusion matrix - multilabel-indicator case
      from scipy.sparse import csc_matrix, csr_matrix
  
      y_true = np.array([[1, 0, 1], [0, 1, 0], [1, 1, 0]])
      y_pred = np.array([[1, 0, 0], [0, 1, 1], [0, 0, 1]])
      y_true_csr = csr_matrix(y_true)
      y_pred_csr = csr_matrix(y_pred)
      y_true_csc = csc_matrix(y_true)
      y_pred_csc = csc_matrix(y_pred)
  
      y_true_t = mt.tensor(y_true)
      y_pred_t = mt.tensor(y_pred)
  
      # cross test different types
      sample_weight = np.array([2, 1, 3])
      real_cm = [[[1, 0], [1, 1]], [[1, 0], [1, 1]], [[0, 2], [1, 0]]]
      trues = [y_true_t, y_true_csr, y_true_csc]
      preds = [y_pred_t, y_pred_csr, y_pred_csc]
  
      for y_true_tmp in trues:
          for y_pred_tmp in preds:
              cm = multilabel_confusion_matrix(
                  y_true_tmp, y_pred_tmp
              ).fetch()
              assert_array_equal(cm, real_cm)
  
      # test support for samplewise
      cm = multilabel_confusion_matrix(
          y_true_t, y_pred_t, samplewise=True
      ).fetch()
      assert_array_equal(
          cm, [[[1, 0], [1, 1]], [[1, 1], [0, 1]], [[0, 1], [2, 0]]]
      )
  
      # test support for labels
      cm = multilabel_confusion_matrix(
          y_true_t, y_pred_t, labels=[2, 0]
      ).fetch()
      assert_array_equal(cm, [[[0, 2], [1, 0]], [[1, 0], [1, 1]]])
  
      # test support for labels with samplewise
      cm = multilabel_confusion_matrix(
          y_true_t, y_pred_t, labels=[2, 0], samplewise=True
      ).fetch()
      assert_array_equal(
          cm, [[[0, 0], [1, 1]], [[1, 1], [0, 0]], [[0, 1], [1, 0]]]
      )
  
      # test support for sample_weight with sample_wise
      cm = multilabel_confusion_matrix(
          y_true_t,
          y_pred_t,
          sample_weight=sample_weight,
          samplewise=True,
      ).fetch()
      assert_array_equal(
          cm, [[[2, 0], [2, 2]], [[1, 1], [0, 1]], [[0, 3], [6, 0]]]
      )
  
imports: import numpy
  import pytest
  from sklearn import datasets, svm
  from sklearn.exceptions import UndefinedMetricWarning
  from sklearn.metrics import accuracy_score
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_almost_equal, assert_array_equal, assert_array_almost_equal
  from sklearn.utils._mocking import MockDataFrame
  from ....None import execute, fetch
  from ....None import tensor
  from ....lib.sparse import SparseNDArray
  from ..None import accuracy_score, log_loss
  from .._classification import _check_targets, multilabel_confusion_matrix, precision_recall_fscore_support, precision_score, recall_score, f1_score, fbeta_score
label_desc: Use image node_id 8 for calling a global function with example usage: test_multilabel_confusion_matrix_multilabel(setup) without return types