code: def _check_seed(seed):
      
      if isinstance(seed, (Number, string_types)):
          try:
              seed = int(seed)
          except ValueError:
              logger.warning("`seed` must be castable to an integer")
              seed = None
          else:
              if seed < 0:
                  logger.warning("`seed` may not be negative")
                  seed = None
              elif seed > MAX_UINT:
                  raise ValueError('`seed` is too large; max is {}'.format(MAX_UINT))
      elif isinstance(seed, np.random.RandomState):
          seed = seed.randint(0, MAX_UINT)
      elif seed is not None:
          logger.warning('`seed` has unexpected type')
          seed = None
  
      if seed is None:
          seed = random.randint(0, MAX_UINT)
  
      return seed
docs: If possible, convert `seed` into a valid form for Stan (an integer
      between 0 and MAX_UINT, inclusive). If not possible, use a random seed
      instead and raise a warning if `seed` was not provided as `None`.