code: def _init_centroids(
      X, n_clusters, init, random_state, x_squared_norms
  ):
      if random_state is not None:
          random_state = np.random.RandomState(random_state)
      if sklearn.__version__ < "1.3.0":
          return _KMeans(
              n_clusters=n_clusters, init=init
          )._init_centroids(
              X,
              x_squared_norms,
              init,
              random_state,
          )
      else:
          n_samples = X.shape[0]
          return _KMeans(
              n_clusters=n_clusters, init=init
          )._init_centroids(
              X,
              x_squared_norms,
              init,
              random_state,
              sample_weight=np.ones(n_samples) / n_samples,
          )
  
imports: import numpy
  from joblib import Parallel, delayed
  from scipy.stats import norm, chi2
  import sklearn
  from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin, ClusterMixin, clone
  from sklearn.cluster import KMeans
  from .classification import MDM, _check_metric
  from .utils.mean import mean_covariance
  from .utils.geodesic import geodesic
label_desc: Use image node_id 1 for calling a global function with example usage: _init_centroids(X, n_clusters, init, random_state, x_squared_norms) and returns: _KMeans, _KMeans