--- /dev/null
+import io\r
+import sys\r
+from typing import Any, IO, Mapping, Optional, Sequence, Union\r
+\r
+if sys.version_info >= (3, 6):\r
+ from os import PathLike\r
+ _PathOrFile = Union[str, bytes, IO[Any], PathLike[Any]]\r
+else:\r
+ _PathOrFile = Union[str, bytes, IO[Any]]\r
+\r
+_FilterChain = Sequence[Mapping[str, Any]]\r
+\r
+FORMAT_AUTO: int\r
+FORMAT_XZ: int\r
+FORMAT_ALONE: int\r
+FORMAT_RAW: int\r
+CHECK_NONE: int\r
+CHECK_CRC32: int\r
+CHECK_CRC64: int\r
+CHECK_SHA256: int\r
+CHECK_ID_MAX: int\r
+CHECK_UNKNOWN: int\r
+FILTER_LZMA1: int\r
+FILTER_LZMA2: int\r
+FILTER_DELTA: int\r
+FILTER_X86: int\r
+FILTER_IA64: int\r
+FILTER_ARM: int\r
+FILTER_ARMTHUMB: int\r
+FILTER_SPARC: int\r
+FILTER_POWERPC: int\r
+MF_HC3: int\r
+MF_HC4: int\r
+MF_BT2: int\r
+MF_BT3: int\r
+MF_BT4: int\r
+MODE_FAST: int\r
+MODE_NORMAL: int\r
+PRESET_DEFAULT: int\r
+PRESET_EXTREME: int\r
+\r
+# from _lzma.c\r
+class LZMADecompressor(object):\r
+ def __init__(self, format: Optional[int] = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> None: ...\r
+ def decompress(self, data: bytes, max_length: int = ...) -> bytes: ...\r
+ @property\r
+ def check(self) -> int: ...\r
+ @property\r
+ def eof(self) -> bool: ...\r
+ @property\r
+ def unused_data(self) -> bytes: ...\r
+ if sys.version_info >= (3, 5):\r
+ @property\r
+ def needs_input(self) -> bool: ...\r
+\r
+# from _lzma.c\r
+class LZMACompressor(object):\r
+ def __init__(self,\r
+ format: Optional[int] = ...,\r
+ check: int = ...,\r
+ preset: Optional[int] = ...,\r
+ filters: Optional[_FilterChain] = ...) -> None: ...\r
+ def compress(self, data: bytes) -> bytes: ...\r
+ def flush(self) -> bytes: ...\r
+\r
+\r
+class LZMAError(Exception): ...\r
+\r
+\r
+class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027\r
+ def __init__(self,\r
+ filename: Optional[_PathOrFile] = ...,\r
+ mode: str = ...,\r
+ *,\r
+ format: Optional[int] = ...,\r
+ check: int = ...,\r
+ preset: Optional[int] = ...,\r
+ filters: Optional[_FilterChain] = ...) -> None: ...\r
+ def close(self) -> None: ...\r
+ @property\r
+ def closed(self) -> bool: ...\r
+ def fileno(self) -> int: ...\r
+ def seekable(self) -> bool: ...\r
+ def readable(self) -> bool: ...\r
+ def writable(self) -> bool: ...\r
+ def peek(self, size: int = ...) -> bytes: ...\r
+ def read(self, size: Optional[int] = ...) -> bytes: ...\r
+ def read1(self, size: int = ...) -> bytes: ...\r
+ def readline(self, size: int = ...) -> bytes: ...\r
+ def write(self, data: bytes) -> int: ...\r
+ def seek(self, offset: int, whence: int = ...) -> int: ...\r
+ def tell(self) -> int: ...\r
+\r
+\r
+def open(filename: _PathOrFile,\r
+ mode: str = ...,\r
+ *,\r
+ format: Optional[int] = ...,\r
+ check: int = ...,\r
+ preset: Optional[int] = ...,\r
+ filters: Optional[_FilterChain] = ...,\r
+ encoding: Optional[str] = ...,\r
+ errors: Optional[str] = ...,\r
+ newline: Optional[str] = ...) -> IO[Any]: ...\r
+def compress(data: bytes, format: int = ..., check: int = ..., preset: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ...\r
+def decompress(data: bytes, format: int = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ...\r
+def is_check_supported(check: int) -> bool: ...\r