code: def check_random_state(seed):
      """Turn seed into a np.random.RandomState instance.
  
      This function will check to see whether the input seed is a valid seed
      for generating random numbers. This is a slightly modified version of
      the code from sklearn.utils.validation.
  
      Parameters
      ----------
      seed : None | int | instance of RandomState
          If seed is None, return the RandomState singleton used by np.random.
          If seed is an int, return a new RandomState instance seeded with seed.
          If seed is already a RandomState instance, return it.
          Otherwise raise ValueError.
      """
  
      if seed is None or seed is numpy.random:
          return numpy.random.mtrand._rand
      if isinstance(seed, (numbers.Integral, numpy.integer)):
          return numpy.random.RandomState(seed)
      if isinstance(seed, numpy.random.RandomState):
          return seed
      raise ValueError(
          "%r cannot be used to seed a numpy.random.RandomState"
          " instance" % seed
      )
  
file_path: apricot/apricot/utils.py
imports: import numbers
  import numpy
  import itertools
  from heapq import heappush
  from heapq import heappop
  from heapq import heapify
  from heapq import heapreplace
  from scipy.sparse import csr_matrix
  from sklearn.metrics import pairwise_distances
  from sklearn.neighbors import KNeighborsTransformer
label_desc: Use image node_id 1 for calling a global function with example usage: check_random_state(seed) and returns: numpy, numpy, seed