code: def get_rng(seed):
      """Return a RandomState of Numpy.
      If seed is None, use RandomState singleton from numpy.
      If seed is an integer, create a RandomState from that seed.
      If seed is already a RandomState, just return it.
      """
      if seed is None:
          return np.random.mtrand._rand
      if isinstance(seed, (numbers.Integral, np.integer)):
          return np.random.RandomState(seed)
      if isinstance(seed, np.random.RandomState):
          return seed
      raise ValueError(
          "{} can not be used to create a numpy.random.RandomState".format(
              seed
          )
      )
  
file_path: cornac/cornac/utils/common.py
imports: import numbers
  import numpy
  import scipy.sparse
  from .fast_sparse_funcs import inplace_csr_row_normalize_l1, inplace_csr_row_normalize_l2
label_desc: Use image node_id 9 for calling a global function with example usage: get_rng(seed) and returns: np, np, seed