code: def test_multilabel_sample_weight_invariance(name):
      # multilabel indicator
      random_state = check_random_state(0)
      _, ya = make_multilabel_classification(
          n_features=1,
          n_classes=10,
          random_state=0,
          n_samples=50,
          allow_unlabeled=False,
      )
      _, yb = make_multilabel_classification(
          n_features=1,
          n_classes=10,
          random_state=1,
          n_samples=50,
          allow_unlabeled=False,
      )
      y_true = np.vstack([ya, yb])
      y_pred = np.vstack([ya, ya])
      y_score = random_state.randint(1, 4, size=y_true.shape)
  
      metric = ALL_METRICS[name]
      if name in THRESHOLDED_METRICS:
          check_sample_weight_invariance(name, metric, y_true, y_score)
      else:
          check_sample_weight_invariance(name, metric, y_true, y_pred)
  
imports: from functools import partial
  from inspect import signature
  from itertools import chain, permutations, product
  import numpy
  import pytest
  from sklearn._config import config_context
  from sklearn.datasets import make_multilabel_classification
  from sklearn.metrics import accuracy_score, average_precision_score, balanced_accuracy_score, brier_score_loss, cohen_kappa_score, confusion_matrix, coverage_error, d2_absolute_error_score, d2_pinball_score, d2_tweedie_score, dcg_score, det_curve, explained_variance_score, f1_score, fbeta_score, hamming_loss, hinge_loss, jaccard_score, label_ranking_average_precision_score, label_ranking_loss, log_loss, matthews_corrcoef, max_error, mean_absolute_error, mean_absolute_percentage_error, mean_gamma_deviance, mean_pinball_loss, mean_poisson_deviance, mean_squared_error, mean_tweedie_deviance, median_absolute_error, multilabel_confusion_matrix, ndcg_score, precision_recall_curve, precision_score, r2_score, recall_score, roc_auc_score, roc_curve, top_k_accuracy_score, zero_one_loss
  from sklearn.metrics._base import _average_binary_score
  from sklearn.preprocessing import LabelBinarizer
  from sklearn.utils import shuffle
  from sklearn.utils._array_api import _atol_for_type, yield_namespace_device_dtype_combinations
  from sklearn.utils._testing import _array_api_for_tests, assert_allclose, assert_almost_equal, assert_array_equal, assert_array_less, ignore_warnings
  from sklearn.utils.fixes import COO_CONTAINERS
  from sklearn.utils.multiclass import type_of_target
  from sklearn.utils.validation import _num_samples, check_random_state
label_desc: Use image node_id 36 for calling a global function with example usage: test_multilabel_sample_weight_invariance(name) without return types