code: def seed_random_state(seed):
      
      if (seed is None) or (isinstance(seed, int)):
          return np.random.RandomState(seed)
      elif isinstance(seed, np.random.RandomState):
          return seed
      raise ValueError("%r can not be used to generate numpy.random.RandomState"
                       " instance" % seed)
docs: Turn seed into np.random.RandomState instance