code: def test_get_split_generator_rare_configurations(cv, K):
      all_configurations = np.array(
          list(itertools.product([0, 1], repeat=K))
      )
      given_labels = np.repeat(all_configurations, 2, axis=0)
  
      # Remove one configuration
      given_labels = given_labels[
          ~np.all(given_labels == all_configurations[0], axis=1)
      ]
  
      split_generator = ml_scorer._get_split_generator(given_labels, cv)
      train, test = next(split_generator)
      train_labels, test_labels = (
          given_labels[train],
          given_labels[test],
      )
  
      # Test that the label distribution is relatively equal among the splits.
      _, train_counts = np.unique(
          train_labels, axis=0, return_counts=True
      )
      _, test_counts = np.unique(
          test_labels, axis=0, return_counts=True
      )
      # cv.get_n_splits() is 2, so we expect 1/2 of the labels in each split.
      assert np.all(train_counts == 1)
      assert np.all(test_counts == 1)
      assert (
          len(train_counts)
          == len(test_counts)
          == len(all_configurations) - 1
      )
  
      # Remove one instance from labels
      given_labels = given_labels[1:, :]
  
      split_generator = ml_scorer._get_split_generator(given_labels, cv)
      train, test = next(split_generator)
      train_labels, test_labels = (
          given_labels[train],
          given_labels[test],
      )
  
      # Test that the label distribution is relatively equal among the splits.
      _, train_counts = np.unique(
          train_labels, axis=0, return_counts=True
      )
      _, test_counts = np.unique(
          test_labels, axis=0, return_counts=True
      )
      # cv.get_n_splits() is 2, so we expect 1/2 of the labels in each split,
      # except for the class with one fewer instances.
      assert len(train_counts) != len(test_counts)
  
imports: import itertools
  import typing
  import numpy
  import pytest
  import sklearn
  from hypothesis import given, settings
  from hypothesis import strategies
  from hypothesis.strategies import composite
  from hypothesis.extra.numpy import arrays
  from sklearn.linear_model import LogisticRegression
  from sklearn.multiclass import OneVsRestClassifier
  from cleanlab import multilabel_classification
  from cleanlab.internal import multilabel_scorer
  from cleanlab.internal.multilabel_utils import get_onehot_num_classes, onehot2int, stack_complement
  from cleanlab.multilabel_classification import filter
  from cleanlab.multilabel_classification.dataset import common_multilabel_issues, multilabel_health_summary, overall_multilabel_health_score, rank_classes_by_multilabel_quality
  from cleanlab.multilabel_classification.rank import get_label_quality_scores_per_class
label_desc: Use image node_id 27 for calling a global function with example usage: test_get_split_generator_rare_configurations(cv, K) without return types