code: def gen_labels_for_chunks(
      n_chunks, chunk_size, n_classes=10, n_unknown_labels=5
  ):
      """Generates n_chunks*chunk_size labels that split in n_chunks chunks,
      that are homogeneous in the label."""
      assert min(n_chunks, chunk_size) > 0
      classes = shuffle(np.arange(n_classes), random_state=SEED)
      n_per_class = chunk_size * (n_chunks // n_classes)
      n_maj_class = chunk_size * n_chunks - n_per_class * (
          n_classes - 1
      )
  
      first_labels = classes[0] * np.ones(n_maj_class, dtype=int)
      remaining_labels = np.concatenate(
          [k * np.ones(n_per_class, dtype=int) for k in classes[1:]]
      )
      unknown_labels = -1 * np.ones(n_unknown_labels, dtype=int)
  
      labels = np.concatenate(
          [first_labels, remaining_labels, unknown_labels]
      )
      return shuffle(labels, random_state=SEED)
  
file_path: metric-learn/test/test_constraints.py
imports: import pytest
  import numpy
  from sklearn.utils import shuffle
  from metric_learn.constraints import Constraints
  from sklearn.datasets import make_blobs
label_desc: Use image node_id 1 for calling a global function with example usage: gen_labels_for_chunks(n_chunks, chunk_size, n_classes, n_unknown_labels) and returns: shuffle