code: def check_random_state(seed: Optional[RNGSeed]) -> RNG:
      """
      Turn seed into a np.random.RandomState instance
  
      @param seed: 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 np.random:
          return np.random.mtrand._rand
      if isinstance(seed, numbers.Integral):
          return np.random.RandomState(seed)
      if isinstance(seed, (np.random.RandomState, np.random.Generator)):
          return seed
      raise ValueError(
          f"{seed} cannot be used to seed a numpy.random.RandomState instance"
      )
  
file_path: AugLy/augly/audio/utils.py
imports: import numbers
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from augly import utils
  from augly.audio import intensity
  from augly.utils.libsndfile import install_libsndfile
  import librosa
  import soundfile
  import torchaudio
label_desc: Use image node_id 3 for calling a global function with example usage: check_random_state(seed) and returns: np, np, seed