code: def test_k_means_convergence(setup):
      for algorithm in ["full", "elkan"]:
          # Check that KMeans stops when convergence is reached when tol=0. (#16075)
          rnd = np.random.RandomState(0)
          X = rnd.normal(size=(5000, 10))
  
          km = KMeans(
              algorithm=algorithm,
              n_clusters=5,
              random_state=0,
              n_init=1,
              tol=0,
              max_iter=300,
              init="k-means++",
          ).fit(X)
  
          assert km.n_iter_ < 300
  
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 4 for calling a global function with example usage: test_k_means_convergence(setup) without return types