apply black and isort (#4287)

* apply black and isort

* move some type ignores
This commit is contained in:
Jelle Zijlstra
2020-06-28 13:31:00 -07:00
committed by GitHub
parent fe58699ca5
commit 5d553c9584
800 changed files with 13875 additions and 10332 deletions

View File

@@ -8,9 +8,9 @@
import _random
import sys
from typing import Any, TypeVar, Sequence, Iterable, List, MutableSequence, Callable, AbstractSet, Union, Optional, Tuple
from typing import AbstractSet, Any, Callable, Iterable, List, MutableSequence, Optional, Sequence, Tuple, TypeVar, Union
_T = TypeVar('_T')
_T = TypeVar("_T")
class Random(_random.Random):
def __init__(self, x: Any = ...) -> None: ...
@@ -24,10 +24,19 @@ class Random(_random.Random):
def randbytes(self, n: int) -> bytes: ...
def choice(self, seq: Sequence[_T]) -> _T: ...
if sys.version_info >= (3, 6):
def choices(self, population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ...
def choices(
self,
population: Sequence[_T],
weights: Optional[Sequence[float]] = ...,
*,
cum_weights: Optional[Sequence[float]] = ...,
k: int = ...,
) -> List[_T]: ...
def shuffle(self, x: MutableSequence[Any], random: Union[Callable[[], float], None] = ...) -> None: ...
if sys.version_info >= (3, 9):
def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int, *, counts: Optional[Iterable[_T]] = ...) -> List[_T]: ...
def sample(
self, population: Union[Sequence[_T], AbstractSet[_T]], k: int, *, counts: Optional[Iterable[_T]] = ...
) -> List[_T]: ...
else:
def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ...
def random(self) -> float: ...
@@ -44,8 +53,7 @@ class Random(_random.Random):
def weibullvariate(self, alpha: float, beta: float) -> float: ...
# SystemRandom is not implemented for all OS's; good on Windows & Linux
class SystemRandom(Random):
...
class SystemRandom(Random): ...
# ----- random function stubs -----
def seed(a: Any = ..., version: int = ...) -> None: ...
@@ -54,20 +62,32 @@ def setstate(state: object) -> None: ...
def getrandbits(__k: int) -> int: ...
def randrange(start: int, stop: Union[None, int] = ..., step: int = ...) -> int: ...
def randint(a: int, b: int) -> int: ...
if sys.version_info >= (3, 9):
def randbytes(n: int) -> bytes: ...
def choice(seq: Sequence[_T]) -> _T: ...
if sys.version_info >= (3, 6):
def choices(population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ...
def choices(
population: Sequence[_T],
weights: Optional[Sequence[float]] = ...,
*,
cum_weights: Optional[Sequence[float]] = ...,
k: int = ...,
) -> List[_T]: ...
def shuffle(x: MutableSequence[Any], random: Union[Callable[[], float], None] = ...) -> None: ...
if sys.version_info >= (3, 9):
def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int, *, counts: Optional[Iterable[_T]] = ...) -> List[_T]: ...
else:
def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ...
def random() -> float: ...
def uniform(a: float, b: float) -> float: ...
def triangular(low: float = ..., high: float = ...,
mode: Optional[float] = ...) -> float: ...
def triangular(low: float = ..., high: float = ..., mode: Optional[float] = ...) -> float: ...
def betavariate(alpha: float, beta: float) -> float: ...
def expovariate(lambd: float) -> float: ...
def gammavariate(alpha: float, beta: float) -> float: ...