code: def _get_random_state(self, seed=None):
      if seed is None or seed is np.random:
          return np.random.mtrand._rand
      elif isinstance(seed, (int, np.integer)):
          return np.random.RandomState(seed)
      elif isinstance(seed, np.random.RandomState):
          return seed
  
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 2 for calling the KMedoids obj's underlying member method code with example usage: obj._get_random_state(seed) and returns: np, np, seed