docstr: Predict the closest cluster for each sample in X.
  
  Parameters
  ----------
  X : {array-like, sparse matrix}, shape (n_query, n_features),                 or (n_query, n_indexed) if metric == 'precomputed'
      New data to predict.
  
  Returns
  -------
  labels : array, shape = (n_query,)
      Index of the cluster each sample belongs to.
docstr_tok: ["Predict","the","closest","cluster","for","each","sample","in","X.","Parameters","--","--","--","--","--","X",":","{","array-like",",","sparse","matrix","}",",","shape","(","n_query",",","n_features",")",",","or","(","n_query",",","n_indexed",")","if","metric","==","'precomputed'","New","data","to","predict",".","Returns","--","--","--","-","labels",":","array",",","shape","=","(","n_query",",",")","Index","of","the","cluster","each","sample","belongs","to","."]
code: def predict(self, X):
      """Predict the closest cluster for each sample in X.
  
          Parameters
          ----------
          X : {array-like, sparse matrix}, shape (n_query, n_features), \
                  or (n_query, n_indexed) if metric == 'precomputed'
              New data to predict.
  
          Returns
          -------
          labels : array, shape = (n_query,)
              Index of the cluster each sample belongs to.
          """
      check_is_fitted(self, "cluster_centers_")
      # Return data points to clusters based on which cluster assignment
      # yields the smallest distance
      return pairwise_distances_argmin(
          X, Y=self.cluster_centers_, metric=self.metric
      )
  
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 10 for calling the KMedoids obj's underlying member method code with example usage: obj.predict(X) and returns: pairwise_distances_argmin