code: def k_means(
      X,
      n_clusters,
      init="k-means||",
      precompute_distances="auto",
      n_init="auto",
      max_iter=300,
      verbose=False,
      tol=1e-4,
      random_state=None,
      copy_x=True,
      n_jobs=-1,
      algorithm="full",
      return_n_iter=False,
      oversampling_factor=2,
      init_max_iter=None,
  ):
      """K-means algorithm for clustering
  
      Differences from scikit-learn:
  
      * init='k-means||'
      * oversampling_factor keyword
      * n_jobs=-1
      """
      labels, inertia, centers, n_iter = _kmeans_single_lloyd(
          X,
          n_clusters,
          max_iter=max_iter,
          init=init,
          verbose=verbose,
          tol=tol,
          random_state=random_state,
          oversampling_factor=oversampling_factor,
          init_max_iter=init_max_iter,
          n_init=n_init,
      )
      if return_n_iter:
          return labels, centers, inertia, n_iter
      else:
          return labels, centers, inertia
  
imports: import logging
  from multiprocessing import cpu_count
  from numbers import Integral
  import dask.array
  import dask.dataframe
  import numpy
  import pandas
  import sklearn.cluster
  from dask import compute
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.utils.extmath import squared_norm
  from sklearn.utils.validation import check_is_fitted
  from .._compat import blockwise
  from .._utils import draw_seed
  from ..metrics import euclidean_distances, pairwise_distances, pairwise_distances_argmin_min
  from ..utils import _timed, _timer, check_array, row_norms
  from ._compat import _kmeans_plusplus
  import numba
label_desc: Use image node_id 1 for calling a global function with example usage: k_means(X, n_clusters, init, precompute_distances, n_init, max_iter, verbose, tol, random_state, copy_x, n_jobs, algorithm, return_n_iter, oversampling_factor, init_max_iter) and returns: labels,  centers,  inertia,  n_iter, labels,  centers,  inertia