code: def calinski_harabaz_score(X, labels):
      """Compute the Calinski and Harabaz score.
  
      The score is defined as ratio between the within-cluster dispersion and
      the between-cluster dispersion.
  
      Read more in the :ref:`User Guide <calinski_harabaz_index>`.
  
      Parameters
      ----------
      X : array-like, shape (``n_samples``, ``n_features``)
          List of ``n_features``-dimensional data points. Each row corresponds
          to a single data point.
  
      labels : array-like, shape (``n_samples``,)
          Predicted labels for each sample.
  
      Returns
      -------
      score: float
          The resulting Calinski-Harabaz score.
  
      References
      ----------
      .. [1] `T. Calinski and J. Harabasz, 1974. "A dendrite method for cluster
         analysis". Communications in Statistics
         <http://www.tandfonline.com/doi/abs/10.1080/03610927408827101>`_
      """
      X, labels = check_X_y(X, labels)
      le = LabelEncoder()
      labels = le.fit_transform(labels)
  
      n_samples, _ = X.shape
      n_labels = len(le.classes_)
  
      check_number_of_labels(n_labels, n_samples)
  
      extra_disp, intra_disp = 0.0, 0.0
      mean = np.mean(X, axis=0)
      for k in range(n_labels):
          cluster_k = X[labels == k]
          mean_k = np.mean(cluster_k, axis=0)
          extra_disp += len(cluster_k) * np.sum((mean_k - mean) ** 2)
          intra_disp += np.sum((cluster_k - mean_k) ** 2)
  
      return (
          1.0
          if intra_disp == 0.0
          else extra_disp
          * (n_samples - n_labels)
          / (intra_disp * (n_labels - 1.0))
      )
  
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 4 for calling a global function with example usage: calinski_harabaz_score(X, labels) and returns: unknown