--- /dev/null
+from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, NamedTuple\r
+from types import TracebackType\r
+import sys\r
+\r
+FIRST_COMPLETED = ... # type: str\r
+FIRST_EXCEPTION = ... # type: str\r
+ALL_COMPLETED = ... # type: str\r
+PENDING = ... # type: Any\r
+RUNNING = ... # type: Any\r
+CANCELLED = ... # type: Any\r
+CANCELLED_AND_NOTIFIED = ... # type: Any\r
+FINISHED = ... # type: Any\r
+LOGGER = ... # type: Any\r
+\r
+class Error(Exception): ...\r
+class CancelledError(Error): ...\r
+class TimeoutError(Error): ...\r
+\r
+_T = TypeVar('_T')\r
+\r
+class Future(Generic[_T]):\r
+ def __init__(self) -> None: ...\r
+ def cancel(self) -> bool: ...\r
+ def cancelled(self) -> bool: ...\r
+ def running(self) -> bool: ...\r
+ def done(self) -> bool: ...\r
+ def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ...\r
+ def result(self, timeout: Optional[float] = ...) -> _T: ...\r
+ def set_running_or_notify_cancel(self) -> bool: ...\r
+ def set_result(self, result: _T) -> None: ...\r
+\r
+ if sys.version_info >= (3,):\r
+ def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ...\r
+ def set_exception(self, exception: Optional[BaseException]) -> None: ...\r
+ else:\r
+ def exception(self, timeout: Optional[float] = ...) -> Any: ...\r
+ def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ...\r
+ def set_exception(self, exception: Any) -> None: ...\r
+ def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ...\r
+\r
+\r
+class Executor:\r
+ def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...\r
+ if sys.version_info >= (3, 5):\r
+ def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ...) -> Iterator[_T]: ...\r
+ else:\r
+ def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ...\r
+ def shutdown(self, wait: bool = ...) -> None: ...\r
+ def __enter__(self: _T) -> _T: ...\r
+ def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool: ...\r
+\r
+def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ...\r
+\r
+def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], Set[Future[_T]]]: ...\r