code: def test_multilabel_confusion_matrix_errors(setup):
      y_true = mt.array([[1, 0, 1], [0, 1, 0], [1, 1, 0]])
      y_pred = mt.array([[1, 0, 0], [0, 1, 1], [0, 0, 1]])
  
      # Bad sample_weight
      with pytest.raises(
          ValueError, match="inconsistent numbers of samples"
      ):
          multilabel_confusion_matrix(
              y_true, y_pred, sample_weight=[1, 2]
          )
      with pytest.raises(ValueError, match="should be a 1d array"):
          multilabel_confusion_matrix(
              y_true,
              y_pred,
              sample_weight=[[1, 2, 3], [2, 3, 4], [3, 4, 5]],
          )
  
      # Bad labels
      err_msg = r"All labels must be in \[0, n labels\)"
      with pytest.raises(ValueError, match=err_msg):
          multilabel_confusion_matrix(y_true, y_pred, labels=[-1])
      err_msg = r"All labels must be in \[0, n labels\)"
      with pytest.raises(ValueError, match=err_msg):
          multilabel_confusion_matrix(y_true, y_pred, labels=[3])
  
      # Using samplewise outside multilabel
      with pytest.raises(ValueError, match="Samplewise metrics"):
          multilabel_confusion_matrix(
              [0, 1, 2], [1, 2, 0], samplewise=True
          )
  
      # Bad y_type
      err_msg = "multiclass-multioutput is not supported"
      with pytest.raises(ValueError, match=err_msg):
          multilabel_confusion_matrix(
              [[0, 1, 2], [2, 1, 0]], [[1, 2, 0], [1, 0, 2]]
          )
  
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 9 for calling a global function with example usage: test_multilabel_confusion_matrix_errors(setup) without return types