docstr: Checks if all the arguments are valid
docstr_tok: ["Checks","if","all","the","arguments","are","valid"]
code: def _check_arguments(self):
      """Checks if all the arguments are valid"""
  
      if (
          self._is_nonnegative(self.n_clusters, "n_clusters")
          and self._is_nonnegative(self.max_iter, "max_iter")
          and (
              isinstance(
                  self.random_state,
                  (int, np.integer, None, np.random.RandomState),
              )
              or self.random_state is np.random
          )
      ):
          pass
      else:
          raise ValueError("Random state is not valid")
  
      distance_metrics = [
          "euclidean",
          "manhattan",
          "cosine",
          "cityblock",
          "l1",
          "l2",
      ]
      init_methods = ["random", "heuristic"]
  
      if self.metric not in distance_metrics:
          raise ValueError(
              "%s not a supported distance metric" % (self.metric)
          )
  
      if self.init not in init_methods:
          raise ValueError(
              "%s not a supported initialization method" % (self.init)
          )
  
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 4 for calling the KMedoids obj's underlying member method code with example usage: obj._check_arguments() without return types