massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / random.pyi
1 import _random
2 import sys
3 from collections.abc import Callable, Iterable, MutableSequence, Sequence
4 from fractions import Fraction
5 from typing import Any, NoReturn, Tuple, TypeVar
6
7 _T = TypeVar("_T")
8
9 class Random(_random.Random):
10     def __init__(self, x: Any = ...) -> None: ...
11     def seed(self, a: Any = ..., version: int = ...) -> None: ...
12     def getstate(self) -> Tuple[Any, ...]: ...
13     def setstate(self, state: Tuple[Any, ...]) -> None: ...
14     def getrandbits(self, __k: int) -> int: ...
15     def randrange(self, start: int, stop: int | None = ..., step: int = ...) -> int: ...
16     def randint(self, a: int, b: int) -> int: ...
17     if sys.version_info >= (3, 9):
18         def randbytes(self, n: int) -> bytes: ...
19     def choice(self, seq: Sequence[_T]) -> _T: ...
20     def choices(
21         self,
22         population: Sequence[_T],
23         weights: Sequence[float | Fraction] | None = ...,
24         *,
25         cum_weights: Sequence[float | Fraction] | None = ...,
26         k: int = ...,
27     ) -> list[_T]: ...
28     def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ...
29     if sys.version_info >= (3, 9):
30         def sample(self, population: Sequence[_T] | set[_T], k: int, *, counts: Iterable[_T] | None = ...) -> list[_T]: ...
31     else:
32         def sample(self, population: Sequence[_T] | set[_T], k: int) -> list[_T]: ...
33     def random(self) -> float: ...
34     def uniform(self, a: float, b: float) -> float: ...
35     def triangular(self, low: float = ..., high: float = ..., mode: float | None = ...) -> float: ...
36     def betavariate(self, alpha: float, beta: float) -> float: ...
37     def expovariate(self, lambd: float) -> float: ...
38     def gammavariate(self, alpha: float, beta: float) -> float: ...
39     def gauss(self, mu: float, sigma: float) -> float: ...
40     def lognormvariate(self, mu: float, sigma: float) -> float: ...
41     def normalvariate(self, mu: float, sigma: float) -> float: ...
42     def vonmisesvariate(self, mu: float, kappa: float) -> float: ...
43     def paretovariate(self, alpha: float) -> float: ...
44     def weibullvariate(self, alpha: float, beta: float) -> float: ...
45
46 # SystemRandom is not implemented for all OS's; good on Windows & Linux
47 class SystemRandom(Random):
48     def getstate(self, *args: Any, **kwds: Any) -> NoReturn: ...
49     def setstate(self, *args: Any, **kwds: Any) -> NoReturn: ...
50
51 # ----- random function stubs -----
52 def seed(a: Any = ..., version: int = ...) -> None: ...
53 def getstate() -> object: ...
54 def setstate(state: object) -> None: ...
55 def getrandbits(__k: int) -> int: ...
56 def randrange(start: int, stop: None | int = ..., step: int = ...) -> int: ...
57 def randint(a: int, b: int) -> int: ...
58
59 if sys.version_info >= (3, 9):
60     def randbytes(n: int) -> bytes: ...
61
62 def choice(seq: Sequence[_T]) -> _T: ...
63 def choices(
64     population: Sequence[_T], weights: Sequence[float] | None = ..., *, cum_weights: Sequence[float] | None = ..., k: int = ...
65 ) -> list[_T]: ...
66 def shuffle(x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ...
67
68 if sys.version_info >= (3, 9):
69     def sample(population: Sequence[_T] | set[_T], k: int, *, counts: Iterable[_T] | None = ...) -> list[_T]: ...
70
71 else:
72     def sample(population: Sequence[_T] | set[_T], k: int) -> list[_T]: ...
73
74 def random() -> float: ...
75 def uniform(a: float, b: float) -> float: ...
76 def triangular(low: float = ..., high: float = ..., mode: float | None = ...) -> float: ...
77 def betavariate(alpha: float, beta: float) -> float: ...
78 def expovariate(lambd: float) -> float: ...
79 def gammavariate(alpha: float, beta: float) -> float: ...
80 def gauss(mu: float, sigma: float) -> float: ...
81 def lognormvariate(mu: float, sigma: float) -> float: ...
82 def normalvariate(mu: float, sigma: float) -> float: ...
83 def vonmisesvariate(mu: float, kappa: float) -> float: ...
84 def paretovariate(alpha: float) -> float: ...
85 def weibullvariate(alpha: float, beta: float) -> float: ...