code: def test_calinski_harabasz_score():
      assert_raises_on_only_one_label(calinski_harabasz_score)
  
      assert_raises_on_all_points_same_cluster(calinski_harabasz_score)
  
      # Assert the value is 1. when all samples are equals
      assert 1.0 == calinski_harabasz_score(
          np.ones((10, 2)), [0] * 5 + [1] * 5
      )
  
      # Assert the value is 0. when all the mean cluster are equal
      assert 0.0 == calinski_harabasz_score(
          [[-1, -1], [1, 1]] * 10, [0] * 10 + [1] * 10
      )
  
      # General case (with non numpy arrays)
      X = (
          [[0, 0], [1, 1]] * 5
          + [[3, 3], [4, 4]] * 5
          + [[0, 4], [1, 3]] * 5
          + [[3, 1], [4, 0]] * 5
      )
      labels = [0] * 10 + [1] * 10 + [2] * 10 + [3] * 10
      pytest.approx(
          calinski_harabasz_score(X, labels),
          45 * (40 - 4) / (5 * (4 - 1)),
      )
  
imports: import warnings
  import numpy
  import pytest
  from numpy.testing import assert_allclose
  from scipy.sparse import issparse
  from sklearn import datasets
  from sklearn.metrics import pairwise_distances
  from sklearn.metrics.cluster import calinski_harabasz_score, davies_bouldin_score, silhouette_samples, silhouette_score
  from sklearn.metrics.cluster._unsupervised import _silhouette_reduce
  from sklearn.utils._testing import assert_array_equal
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS, DOK_CONTAINERS, LIL_CONTAINERS
label_desc: Use image node_id 13 for calling a global function with example usage: test_calinski_harabasz_score() without return types