code: def _labels_inertia_precompute_dense(
      X, x_squared_norms, centers, distances
  ):
      """Compute labels and inertia using a full distance matrix.
  
      This will overwrite the 'distances' array in-place.
  
      Parameters
      ----------
      X : numpy array, shape (n_sample, n_features)
          Input data.
  
      x_squared_norms : numpy array, shape (n_samples,)
          Precomputed squared norms of X.
  
      centers : numpy array, shape (n_clusters, n_features)
          Cluster centers which data is assigned to.
  
      distances : numpy array, shape (n_samples,)
          Pre-allocated array in which distances are stored.
  
      Returns
      -------
      labels : numpy array, dtype=np.int, shape (n_samples,)
          Indices of clusters that samples are assigned to.
  
      inertia : float
          Sum of distances of samples to their closest cluster center.
  
      """
      n_samples = X.shape[0]
  
      # Breakup nearest neighbor distance computation into batches to prevent
      # memory blowup in the case of a large number of samples and clusters.
      # TODO: Once PR #7383 is merged use check_inputs=False in metric_kwargs.
      labels, mindist = pairwise_distances_argmin_min(
          X=X,
          Y=centers,
          metric="euclidean",
          metric_kwargs={"squared": True},
      )
      # cython k-means code assumes int32 inputs
      labels = labels.astype(np.int32)
      if n_samples == distances.shape[0]:
          # distances will be changed in-place
          distances[:] = mindist
      inertia = mindist.sum()
      return labels, inertia
  
imports: import warnings
  import numpy
  import scipy.sparse
  from ..base import BaseEstimator, ClusterMixin, TransformerMixin
  from ..metrics.pairwise import euclidean_distances
  from ..metrics.pairwise import pairwise_distances_argmin_min
  from ..utils.extmath import row_norms, squared_norm
  from ..utils.sparsefuncs_fast import assign_rows_csr
  from ..utils.sparsefuncs import mean_variance_axis
  from ..utils.fixes import astype
  from ..utils import check_array
  from ..utils import check_random_state
  from ..utils import as_float_array
  from ..utils import gen_batches
  from ..utils.validation import check_is_fitted
  from ..utils.validation import FLOAT_DTYPES
  from ..utils.random import choice
  from ..externals.joblib import Parallel
  from ..externals.joblib import delayed
  from ..externals.six import string_types
  from .None import _k_means
  from ._k_means_elkan import k_means_elkan
label_desc: Use image node_id 7 for calling a global function with example usage: _labels_inertia_precompute_dense(X, x_squared_norms, centers, distances) and returns: labels,  inertia