Lines Matching refs:random

13            pick random element
14 pick random sample
15 pick weighted random sample
16 generate random permutation
39 * The random() method is implemented in C, executes in a single Python step,
83 "random",
111 methods: random(), seed(), getstate(), and setstate().
140 bytes, or bytearray. For version 1 (provided for reproducing random
201 # longer called; we leave it here because it has been here since random was
216 """Control how subclasses generate random integers.
218 The algorithm a subclass can use depends on the random() and/or
220 whether it can generate random integers from arbitrarily large
231 if 'random' in c.__dict__:
236 "Return a random int in the range [0,n). Defined for n > 0."
246 """Return a random int in the range [0,n). Defined for n > 0.
248 The implementation does not use getrandbits, but only random.
251 random = self.random
253 _warn("Underlying random() generator does not supply \n"
256 return _floor(random() * n)
259 r = random()
261 r = random()
271 ## ---- access randomness through the methods: random(),
278 """Generate n random bytes."""
285 """Choose a random item from range(stop) or range(start, stop[, step]).
359 """Return random integer in range [a, b], including both end points.
368 """Choose a random element from a non-empty sequence."""
386 """Chooses k unique random elements from a population sequence.
390 in selection order so that all sub-slices will also be valid random
428 # least entropy from the underlying random number generators.
487 random = self.random
493 return [population[floor(random() * n)] for i in _repeat(None, k)]
514 return [population[bisect(cum_weights, random() * total, 0, hi)]
521 "Get a random number in the range [a, b) or [a, b] depending on rounding."
522 return a + (b - a) * self.random()
533 u = self.random()
551 # A.J. and Monahan, J.F., "Computer generation of random
555 random = self.random
557 u1 = random()
558 u2 = 1.0 - random()
592 random = self.random
596 x2pi = random() * TWOPI
597 g2rad = _sqrt(-2.0 * _log(1.0 - random()))
626 # we use 1-random() instead of random() to preclude the
628 return -_log(1.0 - self.random()) / lambd
636 to a uniform random angle over the range 0 to 2*pi.
646 random = self.random
648 return TWOPI * random()
654 u1 = random()
658 u2 = random()
664 u3 = random()
691 random = self.random
703 u1 = random()
706 u2 = 1.0 - random()
716 return -_log(1.0 - random()) * beta
722 u = random()
729 u1 = random()
768 u = 1.0 - self.random()
779 u = 1.0 - self.random()
788 """Alternate random number generator using sources provided
796 def random(self):
797 """Get the next random number in the range 0.0 <= X < 1.0."""
801 """getrandbits(k) -> x. Generates an int with k random bits."""
809 """Generate n random bytes."""
815 "Stub method. Not used for a system random number generator."
819 "Method should not be called for a system random number generator."
833 random = _inst.random
878 _test_generator(N, random, ())