code: def test_relocated_clusters(setup, representation, algo):
      # check that empty clusters are relocated as expected
  
      # second center too far from others points will be empty at first iter
      init_centers = np.array([[0.5, 0.5], [3, 3]])
  
      expected_labels = [0, 0, 1, 1]
      expected_inertia = 0.25
      expected_centers = [[0.25, 0], [0.75, 1]]
      expected_n_iter = 3
  
      array_constr = {"dense": np.array, "sparse": sp.csr_matrix}[
          representation
      ]
      X = array_constr([[0, 0], [0.5, 0], [0.5, 1], [1, 1]])
  
      kmeans = KMeans(
          n_clusters=2, n_init=1, init=init_centers, algorithm=algo
      )
      kmeans.fit(X)
  
      np.testing.assert_array_equal(kmeans.labels_, expected_labels)
      np.testing.assert_almost_equal(kmeans.inertia_, expected_inertia)
      np.testing.assert_array_almost_equal(
          kmeans.cluster_centers_, expected_centers
      )
      assert kmeans.n_iter_ == expected_n_iter
  
imports: import sys
  from io import StringIO
  import numpy
  import pytest
  import scipy.sparse
  from ....None import tensor
  from ....core import TileableGraphBuilder, TileableGraph, ChunkGraphBuilder
  from ....config import options
  from ..None import KMeans, k_means
  from .._kmeans import _init_centroids
label_desc: Use image node_id 2 for calling a global function with example usage: test_relocated_clusters(setup, representation, algo) without return types