code: def test_permute_labels(metric_name):
      # All clustering metrics do not change score due to permutations of labels
      # that is when 0 and 1 exchanged.
      y_label = np.array([0, 0, 0, 1, 1, 0, 1])
      y_pred = np.array([1, 0, 1, 0, 1, 1, 0])
      if metric_name in SUPERVISED_METRICS:
          metric = SUPERVISED_METRICS[metric_name]
          score_1 = metric(y_pred, y_label)
          assert_allclose(score_1, metric(1 - y_pred, y_label))
          assert_allclose(score_1, metric(1 - y_pred, 1 - y_label))
          assert_allclose(score_1, metric(y_pred, 1 - y_label))
      else:
          metric = UNSUPERVISED_METRICS[metric_name]
          X = np.random.randint(10, size=(7, 10))
          score_1 = metric(X, y_pred)
          assert_allclose(score_1, metric(X, 1 - y_pred))
  
file_path: scikit-learn/sklearn/metrics/cluster/tests/test_common.py
imports: from functools import partial
  from itertools import chain
  import numpy
  import pytest
  from sklearn.metrics.cluster import adjusted_mutual_info_score, adjusted_rand_score, calinski_harabasz_score, completeness_score, davies_bouldin_score, fowlkes_mallows_score, homogeneity_score, mutual_info_score, normalized_mutual_info_score, rand_score, silhouette_score, v_measure_score
  from sklearn.utils._testing import assert_allclose
label_desc: Use image node_id 5 for calling a global function with example usage: test_permute_labels(metric_name) without return types