Return the default Random instance.

    Returns:
        Random: A Random instance using the default random number generator.
336796
def random_get_instance() -> tcod.random.Random:
    
    return tcod.random.Random._new_from_cdata(
        ffi.cast("mersenne_data_t*", lib.TCOD_random_get_instance())
    )
1190744
def init_rng(self):
        
        rng = torch.Generator()
        seed = self.seeds[self.epoch]
        logging.info(f'Sampler for epoch {self.epoch} uses seed {seed}')
        rng.manual_seed(seed)
        return rng
178884
def random(self, max_number=None):
        
        min_number = self.obj
        if max_number is None:
            min_number = 0
            max_number = self.obj
        return random.randrange(min_number, max_number)
1365588
def get_random_int(minimum, maximum):
    
    min_int = math.ceil(minimum)
    max_int = math.floor(maximum)

    return random.randint(min_int, max_int - 1)
491023
def generate(self):
        '''
        
        '''
        generated_arr = np.random.uniform(low=self.__low, high=self.__high, size=self.__output_shape)
        if self.noise_sampler is not None:
            self.noise_sampler.output_shape = generated_arr.shape
            generated_arr += self.noise_sampler.generate()
        return generated_arr
170310
def get_random_state(seed):
    
    if seed is None or seed is np.random:
        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(
        '%r cannot be used to seed a np.random.RandomState instance' %
        seed)
1127783
def get_random_value(field):
    
    func = get_factory_func(field)

    if field.default is not None:
        if callable(field.default):
            return field.default()
        return field.default

    if field.choices:
        return random.choice(field.choices)

    return func(field)
787526
function random (seed) {
  /**
   * Creates a subgenerator from the current one
   *
   * @param {string} key Key of the subgenerator
   * @param  {...number} params Parameters affecting the subgenerator's seed
   */

  function subgen (key, ...params) {
    return random(createSeed([...seed, keygen(key), ...params], seed.length))
  }

  /**
   * Retrieves a value from the random generator
   *
   * **Warning:** keys are cached indefinitely, keep them constant
   *
   * @param {string} key Key of the random value
   * @param  {...number} params Parameters affecting the value
   */

  function value (key, ...params) {
    return murmur([...seed, keygen(key), ...params])
  }

  return { seed, subgen, value, util }
}
404256
def default() :
		
		if Shaman._default_instance is not None :
			return Shaman._default_instance

		with open((os.path.dirname(__file__) or '.') + '/data/trained.json') as file :
			tset = json.loads(file.read())

		Shaman._default_instance = Shaman(tset)
		return Shaman._default_instance
878702
def sample(self, rstate=None):
        

        if rstate is None:
            rstate = np.random

        return rstate.rand(self.n)
647245
async def get_random(self) -> Word:
        
        resp = await self._get(random=True)
        return Word(resp['list'][0])
1368254
def level(self) -> str:
        
        levels = self._data['level']
        return self.random.choice(levels)
59745
def find_random(self, **kwargs):
        
        import random
        max = self.count(**kwargs)
        if max:
            num = random.randint(0, max - 1)
            return next(self.find(**kwargs).skip(num))
622864
def random(self, length=None):
        
        if length is None:
            length = self._length

        random_num = int(binascii.b2a_hex(os.urandom(length)), 16)
        return int_to_string(random_num, self._alphabet, padding=length)[:length]
220737
def random(self, n: Optional[int] = None) -> Union[List[float], float]:
        
        return self._generate_randoms(self._request_randoms, max_n=self.config.MAX_NUMBER_OF_FLOATS,
                                      n=n)
2275
def randdict(self):
        
        return {
            self.randstr: self._map_type(int)
            for x in range(self.random.randint(3, 10))}
396021
def randstr(self):
        
        return gen_rand_str(
            2, 10, use=self.random, keyspace=list(self.keyspace))