code: def compute_inertia(X, labels, centers):
      reindexed = labels.map_blocks(
          lambda x: centers[x],
          dtype=centers.dtype,
          chunks=X.chunks,
          new_axis=1,
      )
      inertia = (X - reindexed).sum()
      return 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 2 for calling a global function with example usage: compute_inertia(X, labels, centers) and returns: inertia