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

@@ -1,20 +1,17 @@
from typing import (
Any, Callable, Iterable, List, Mapping, Optional, Text, Tuple, Type, Union,
TypeVar,
)
from types import FrameType, TracebackType
import sys
from types import FrameType, TracebackType
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Tuple, Type, TypeVar, Union
# TODO recursive type
_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
_PF = Callable[[FrameType, str, Any], None]
_T = TypeVar('_T')
_T = TypeVar("_T")
__all__: List[str]
def active_count() -> int: ...
if sys.version_info < (3,):
def activeCount() -> int: ...
@@ -41,30 +38,35 @@ if sys.version_info >= (3,):
class ThreadError(Exception): ...
class local(object):
def __getattribute__(self, name: str) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...
def __delattr__(self, name: str) -> None: ...
class Thread:
name: str
ident: Optional[int]
daemon: bool
if sys.version_info >= (3,):
def __init__(self, group: None = ...,
target: Optional[Callable[..., Any]] = ...,
name: Optional[str] = ...,
args: Iterable[Any] = ...,
kwargs: Mapping[str, Any] = ...,
*, daemon: Optional[bool] = ...) -> None: ...
def __init__(
self,
group: None = ...,
target: Optional[Callable[..., Any]] = ...,
name: Optional[str] = ...,
args: Iterable[Any] = ...,
kwargs: Mapping[str, Any] = ...,
*,
daemon: Optional[bool] = ...,
) -> None: ...
else:
def __init__(self, group: None = ...,
target: Optional[Callable[..., Any]] = ...,
name: Optional[Text] = ...,
args: Iterable[Any] = ...,
kwargs: Mapping[Text, Any] = ...) -> None: ...
def __init__(
self,
group: None = ...,
target: Optional[Callable[..., Any]] = ...,
name: Optional[Text] = ...,
args: Iterable[Any] = ...,
kwargs: Mapping[Text, Any] = ...,
) -> None: ...
def start(self) -> None: ...
def run(self) -> None: ...
def join(self, timeout: Optional[float] = ...) -> None: ...
@@ -79,16 +81,14 @@ class Thread:
def isDaemon(self) -> bool: ...
def setDaemon(self, daemonic: bool) -> None: ...
class _DummyThread(Thread): ...
class Lock:
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
@@ -96,29 +96,26 @@ class Lock:
def release(self) -> None: ...
def locked(self) -> bool: ...
class _RLock:
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...
RLock = _RLock
class Condition:
def __init__(self, lock: Union[Lock, _RLock, None] = ...) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
@@ -126,19 +123,17 @@ class Condition:
def release(self) -> None: ...
def wait(self, timeout: Optional[float] = ...) -> bool: ...
if sys.version_info >= (3,):
def wait_for(self, predicate: Callable[[], _T],
timeout: Optional[float] = ...) -> _T: ...
def wait_for(self, predicate: Callable[[], _T], timeout: Optional[float] = ...) -> _T: ...
def notify(self, n: int = ...) -> None: ...
def notify_all(self) -> None: ...
def notifyAll(self) -> None: ...
class Semaphore:
def __init__(self, value: int = ...) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
@@ -150,7 +145,6 @@ class Semaphore:
class BoundedSemaphore(Semaphore): ...
class Event:
def __init__(self) -> None: ...
def is_set(self) -> bool: ...
@@ -162,29 +156,31 @@ class Event:
if sys.version_info >= (3, 8):
from _thread import _ExceptHookArgs as ExceptHookArgs, ExceptHookArgs as _ExceptHookArgs # don't ask
excepthook: Callable[[_ExceptHookArgs], Any]
class Timer(Thread):
if sys.version_info >= (3,):
def __init__(self, interval: float, function: Callable[..., Any],
args: Optional[Iterable[Any]] = ...,
kwargs: Optional[Mapping[str, Any]] = ...) -> None: ...
def __init__(
self,
interval: float,
function: Callable[..., Any],
args: Optional[Iterable[Any]] = ...,
kwargs: Optional[Mapping[str, Any]] = ...,
) -> None: ...
else:
def __init__(self, interval: float, function: Callable[..., Any],
args: Iterable[Any] = ...,
kwargs: Mapping[str, Any] = ...) -> None: ...
def __init__(
self, interval: float, function: Callable[..., Any], args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ...
) -> None: ...
def cancel(self) -> None: ...
if sys.version_info >= (3,):
class Barrier:
parties: int
n_waiting: int
broken: bool
def __init__(self, parties: int, action: Optional[Callable[[], None]] = ...,
timeout: Optional[float] = ...) -> None: ...
def __init__(self, parties: int, action: Optional[Callable[[], None]] = ..., timeout: Optional[float] = ...) -> None: ...
def wait(self, timeout: Optional[float] = ...) -> int: ...
def reset(self) -> None: ...
def abort(self) -> None: ...
class BrokenBarrierError(RuntimeError): ...