code: def check_number_of_labels(n_labels, n_samples):
      if not 1 < n_labels < n_samples:
          raise ValueError(
              "Number of labels is %d. Valid values are 2 "
              "to n_samples - 1 (inclusive)" % n_labels
          )
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/metrics/cluster/unsupervised.py
imports: import numpy
  from ...utils import check_random_state
  from ...utils import check_X_y
  from ...utils.fixes import bincount
  from ..pairwise import pairwise_distances
  from ...preprocessing import LabelEncoder
label_desc: Use image node_id 1 for calling a global function with example usage: check_number_of_labels(n_labels, n_samples) without return types