docstr: Compute inertia of new samples. Inertia is defined as the sum of the
  sample distances to closest cluster centers.
  
  Parameters
  ----------
  distances : {array-like, sparse matrix}, shape=(n_samples, n_clusters)
      Distances to cluster centers.
  
  Returns
  -------
  Sum of sample distances to closest cluster centers.
docstr_tok: ["Compute","inertia","of","new","samples",".","Inertia","is","defined","as","the","sum","of","the","sample","distances","to","closest","cluster","centers",".","Parameters","--","--","--","--","--","distances",":","{","array-like",",","sparse","matrix","}",",","shape=","(","n_samples",",","n_clusters",")","Distances","to","cluster","centers",".","Returns","--","--","--","-","Sum","of","sample","distances","to","closest","cluster","centers","."]
code: def _compute_inertia(self, distances):
      """Compute inertia of new samples. Inertia is defined as the sum of the
      sample distances to closest cluster centers.
  
      Parameters
      ----------
      distances : {array-like, sparse matrix}, shape=(n_samples, n_clusters)
          Distances to cluster centers.
  
      Returns
      -------
      Sum of sample distances to closest cluster centers.
      """
  
      # Define inertia as the sum of the sample-distances
      # to closest cluster centers
      inertia = np.sum(np.min(distances, axis=1))
      return inertia
  
imports: import warnings
  import numpy
  from sklearn.base import BaseEstimator, ClusterMixin
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.metrics.pairwise import pairwise_distances, pairwise_distances_argmin
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 6 for calling the KMedoids obj's underlying member method code with example usage: obj._compute_inertia(distances) and returns: inertia