--- /dev/null
+# Stubs for multiprocessing\r
+\r
+from typing import (\r
+ Any, Callable, ContextManager, Iterable, Mapping, Optional, Dict, List,\r
+ Union, Sequence, Tuple\r
+)\r
+\r
+from logging import Logger\r
+from multiprocessing import connection, pool, synchronize\r
+from multiprocessing.context import (\r
+ BaseContext,\r
+ ProcessError as ProcessError, BufferTooShort as BufferTooShort, TimeoutError as TimeoutError, AuthenticationError as AuthenticationError)\r
+from multiprocessing.managers import SyncManager\r
+from multiprocessing.process import current_process as current_process\r
+from multiprocessing.queues import Queue as Queue, SimpleQueue as SimpleQueue, JoinableQueue as JoinableQueue\r
+import sys\r
+\r
+# N.B. The functions below are generated at runtime by partially applying\r
+# multiprocessing.context.BaseContext's methods, so the two signatures should\r
+# be identical (modulo self).\r
+\r
+# Sychronization primitives\r
+_LockLike = Union[synchronize.Lock, synchronize.RLock]\r
+def Barrier(parties: int,\r
+ action: Optional[Callable] = ...,\r
+ timeout: Optional[float] = ...) -> synchronize.Barrier: ...\r
+def BoundedSemaphore(value: int = ...) -> synchronize.BoundedSemaphore: ...\r
+def Condition(lock: Optional[_LockLike] = ...) -> synchronize.Condition: ...\r
+def Event(lock: Optional[_LockLike] = ...) -> synchronize.Event: ...\r
+def Lock() -> synchronize.Lock: ...\r
+def RLock() -> synchronize.RLock: ...\r
+def Semaphore(value: int = ...) -> synchronize.Semaphore: ...\r
+\r
+def Pipe(duplex: bool = ...) -> Tuple[connection.Connection, connection.Connection]: ...\r
+\r
+def Pool(processes: Optional[int] = ...,\r
+ initializer: Optional[Callable[..., Any]] = ...,\r
+ initargs: Iterable[Any] = ...,\r
+ maxtasksperchild: Optional[int] = ...) -> pool.Pool: ...\r
+\r
+class Process():\r
+ name: str\r
+ daemon: bool\r
+ pid: Optional[int]\r
+ exitcode: Optional[int]\r
+ authkey: bytes\r
+ sentinel: int\r
+ # TODO: set type of group to None\r
+ def __init__(self,\r
+ group: Any = ...,\r
+ target: Optional[Callable] = ...,\r
+ name: Optional[str] = ...,\r
+ args: Iterable[Any] = ...,\r
+ kwargs: Mapping[Any, Any] = ...,\r
+ *,\r
+ daemon: Optional[bool] = ...) -> None: ...\r
+ def start(self) -> None: ...\r
+ def run(self) -> None: ...\r
+ def terminate(self) -> None: ...\r
+ if sys.version_info >= (3, 7):\r
+ def kill(self) -> None: ...\r
+ def close(self) -> None: ...\r
+ def is_alive(self) -> bool: ...\r
+ def join(self, timeout: Optional[float] = ...) -> None: ...\r
+\r
+class Value():\r
+ value: Any = ...\r
+ def __init__(self, typecode_or_type: str, *args: Any, lock: bool = ...) -> None: ...\r
+\r
+# ----- multiprocessing function stubs -----\r
+def active_children() -> List[Process]: ...\r
+def allow_connection_pickling() -> None: ...\r
+def cpu_count() -> int: ...\r
+def freeze_support() -> None: ...\r
+def get_logger() -> Logger: ...\r
+def log_to_stderr(level: Optional[Union[str, int]] = ...) -> Logger: ...\r
+def Manager() -> SyncManager: ...\r
+def set_forkserver_preload(module_names: List[str]) -> None: ...\r
+def set_executable(executable: str) -> None: ...\r
+def get_all_start_methods() -> List[str]: ...\r
+def get_context(method: Optional[str] = ...) -> BaseContext: ...\r
+def get_start_method(allow_none: Optional[bool]) -> Optional[str]: ...\r
+def set_start_method(method: str, force: Optional[bool] = ...) -> None: ...\r