2 # Ron Murawski <ron@horizonchess.com>
\r
3 # Updated by Jukka Lehtosalo
\r
5 # based on https://docs.python.org/2/library/random.html
\r
7 # ----- random classes -----
\r
10 from typing import (
\r
11 Any, TypeVar, Sequence, List, Callable, AbstractSet, Union,
\r
17 class Random(_random.Random):
\r
18 def __init__(self, x: object = ...) -> None: ...
\r
19 def seed(self, x: object = ...) -> None: ...
\r
20 def getstate(self) -> _random._State: ...
\r
21 def setstate(self, state: _random._State) -> None: ...
\r
22 def jumpahead(self, n: int) -> None: ...
\r
23 def getrandbits(self, k: int) -> int: ...
\r
25 def randrange(self, stop: int) -> int: ...
\r
27 def randrange(self, start: int, stop: int, step: int = ...) -> int: ...
\r
28 def randint(self, a: int, b: int) -> int: ...
\r
29 def choice(self, seq: Sequence[_T]) -> _T: ...
\r
30 def shuffle(self, x: List[Any], random: Callable[[], None] = ...) -> None: ...
\r
31 def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ...
\r
32 def random(self) -> float: ...
\r
33 def uniform(self, a: float, b: float) -> float: ...
\r
34 def triangular(self, low: float = ..., high: float = ...,
\r
35 mode: float = ...) -> float: ...
\r
36 def betavariate(self, alpha: float, beta: float) -> float: ...
\r
37 def expovariate(self, lambd: float) -> float: ...
\r
38 def gammavariate(self, alpha: float, beta: float) -> float: ...
\r
39 def gauss(self, mu: float, sigma: float) -> float: ...
\r
40 def lognormvariate(self, mu: float, sigma: float) -> float: ...
\r
41 def normalvariate(self, mu: float, sigma: float) -> float: ...
\r
42 def vonmisesvariate(self, mu: float, kappa: float) -> float: ...
\r
43 def paretovariate(self, alpha: float) -> float: ...
\r
44 def weibullvariate(self, alpha: float, beta: float) -> float: ...
\r
46 # SystemRandom is not implemented for all OS's; good on Windows & Linux
\r
47 class SystemRandom(Random):
\r
50 # ----- random function stubs -----
\r
51 def seed(x: object = ...) -> None: ...
\r
52 def getstate() -> object: ...
\r
53 def setstate(state: object) -> None: ...
\r
54 def jumpahead(n: int) -> None: ...
\r
55 def getrandbits(k: int) -> int: ...
\r
57 def randrange(stop: int) -> int: ...
\r
59 def randrange(start: int, stop: int, step: int = ...) -> int: ...
\r
60 def randint(a: int, b: int) -> int: ...
\r
61 def choice(seq: Sequence[_T]) -> _T: ...
\r
62 def shuffle(x: List[Any], random: Callable[[], float] = ...) -> None: ...
\r
63 def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ...
\r
64 def random() -> float: ...
\r
65 def uniform(a: float, b: float) -> float: ...
\r
66 def triangular(low: float = ..., high: float = ...,
\r
67 mode: float = ...) -> float: ...
\r
68 def betavariate(alpha: float, beta: float) -> float: ...
\r
69 def expovariate(lambd: float) -> float: ...
\r
70 def gammavariate(alpha: float, beta: float) -> float: ...
\r
71 def gauss(mu: float, sigma: float) -> float: ...
\r
72 def lognormvariate(mu: float, sigma: float) -> float: ...
\r
73 def normalvariate(mu: float, sigma: float) -> float: ...
\r
74 def vonmisesvariate(mu: float, kappa: float) -> float: ...
\r
75 def paretovariate(alpha: float) -> float: ...
\r
76 def weibullvariate(alpha: float, beta: float) -> float: ...
\r