code: def k_init(
      X,
      n_clusters,
      init="k-means||",
      random_state=None,
      max_iter=None,
      oversampling_factor=2,
      n_init="auto",
  ):
      """Choose the initial centers for K-Means.
  
      Parameters
      ----------
      X : da.Array (n_samples, n_features)
      n_clusters : int
          Number of clusters to end up with
      init : {'k-means||', 'k-means++', 'random'} or numpy.ndarray
          Initialization method, or pass a NumPy array to use
      random_state : int, optional
      max_iter : int, optional
          Only used for ``init='k-means||'``.
      oversampling_factor : int, optional
          Only used for ``init='k-means||`''. Controls the additional number of
          candidate centers in each iteration.
      n_init : 'auto' or int, default=10
          Number of times the k-means algorithm will be run with different
          centroid seeds. The final results will be the best output of
          n_init consecutive runs in terms of inertia.
          When `n_init='auto'`, the number of runs will be 10 if using
          `init='random'`, and 1 if using `init='kmeans++'`.
          .. versionadded:: 1.2
             Added 'auto' option for `n_init`.
          .. versionchanged:: 1.4
             Default value for `n_init` will change from 10 to `'auto'` in version 1.4.
  
      Return
      ------
      centers : np.ndarray (n_clusters, n_features)
  
      Notes
      -----
      The default strategy is ``k-means||``, which tends to be slower than
      ``k-means++`` for small (in-memory) datasets, but works better in a
      distributed setting.
  
      .. warning::
  
         Using ``init='k-means++'`` assumes that the entire dataset fits
         in RAM.
      """
      if isinstance(init, np.ndarray):
          K, P = init.shape
  
          if K != n_clusters:
              msg = (
                  "Number of centers in provided 'init' ({}) does "
                  "not match 'n_clusters' ({})"
              )
              raise ValueError(msg.format(K, n_clusters))
  
          if P != X.shape[1]:
              msg = (
                  "Number of features in the provided 'init' ({}) do not "
                  "match the number of features in 'X'"
              )
              raise ValueError(msg.format(P, X.shape[1]))
  
          return init
  
      elif not isinstance(init, str):
          raise TypeError(
              "'init' must be an array or str, got {}".format(
                  type(init)
              )
          )
  
      valid = {"k-means||", "k-means++", "random"}
  
      if isinstance(random_state, Integral) or random_state is None:
          if init == "k-means||":
              random_state = da.random.RandomState(random_state)
          else:
              random_state = np.random.RandomState(random_state)
  
      if init == "k-means||":
          return init_scalable(
              X,
              n_clusters,
              random_state,
              max_iter,
              oversampling_factor,
              n_init,
          )
      elif init == "k-means++":
          return init_pp(X, n_clusters, random_state)
  
      elif init == "random":
          return init_random(X, n_clusters, random_state)
  
      else:
          raise ValueError(
              "'init' must be one of {}, got {}".format(valid, init)
          )
  
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 3 for calling a global function with example usage: k_init(X, n_clusters, init, random_state, max_iter, oversampling_factor, n_init) and returns: init, init_scalable, init_pp, init_random