original_docstring: Turn seed into a np.random.RandomState instance
      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.
      
docstring: Turn seed into a np.random.RandomState instance
  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.
docstring_tokens: Turn seed into a np . random . RandomState instance 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 .
code: def check_random_state(seed):
      """Turn seed into a np.random.RandomState instance
      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 np.random:
          return np.random.mtrand._rand
      if isinstance(seed, numbers.Integral):
          return np.random.RandomState(seed)
      if isinstance(seed, np.random.RandomState):
          return seed
      raise ValueError('%r cannot be used to seed a numpy.random.RandomState'
                       ' instance' % seed)
code_tokens: def check_random_state ( seed ) : 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 ) : return seed raise ValueError ( '%r cannot be used to seed a numpy.random.RandomState' ' instance' % seed )
short_docstring: Turn seed into a np.random.RandomState instance
  Parameters
short_docstring_tokens: Turn seed into a np . random . RandomState instance Parameters
comment: """Turn seed into a np.random.RandomState instance
      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.
      """