--- /dev/null
+import sys\r
+from typing import Any, AnyStr, Dict, IO, Iterable, List, Mapping, Optional, Tuple, TypeVar, Union\r
+\r
+_T = TypeVar('_T', bound=FieldStorage)\r
+\r
+def parse(fp: IO[Any] = ..., environ: Mapping[str, str] = ...,\r
+ keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...\r
+def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...\r
+def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...\r
+def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes]) -> Dict[str, List[bytes]]: ...\r
+def parse_header(s: str) -> Tuple[str, Dict[str, str]]: ...\r
+def test(environ: Mapping[str, str] = ...) -> None: ...\r
+def print_environ(environ: Mapping[str, str] = ...) -> None: ...\r
+def print_form(form: Dict[str, Any]) -> None: ...\r
+def print_directory() -> None: ...\r
+def print_environ_usage() -> None: ...\r
+if sys.version_info >= (3, 0):\r
+ def escape(s: str, quote: bool = ...) -> str: ...\r
+else:\r
+ def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ...\r
+\r
+\r
+class MiniFieldStorage:\r
+ # The first five "Any" attributes here are always None, but mypy doesn't support that\r
+ filename = ... # type: Any\r
+ list = ... # type: Any\r
+ type = ... # type: Any\r
+ file = ... # type: Optional[IO[bytes]] # Always None\r
+ type_options = ... # type: Dict[Any, Any]\r
+ disposition = ... # type: Any\r
+ disposition_options = ... # type: Dict[Any, Any]\r
+ headers = ... # type: Dict[Any, Any]\r
+ name = ... # type: Any\r
+ value = ... # type: Any\r
+\r
+ def __init__(self, name: Any, value: Any) -> None: ...\r
+ def __repr__(self) -> str: ...\r
+\r
+\r
+class FieldStorage(object):\r
+ FieldStorageClass = ... # type: Optional[type]\r
+ keep_blank_values = ... # type: int\r
+ strict_parsing = ... # type: int\r
+ qs_on_post = ... # type: Optional[str]\r
+ headers = ... # type: Mapping[str, str]\r
+ fp = ... # type: IO[bytes]\r
+ encoding = ... # type: str\r
+ errors = ... # type: str\r
+ outerboundary = ... # type: bytes\r
+ bytes_read = ... # type: int\r
+ limit = ... # type: Optional[int]\r
+ disposition = ... # type: str\r
+ disposition_options = ... # type: Dict[str, str]\r
+ filename = ... # type: Optional[str]\r
+ file = ... # type: Optional[IO[bytes]]\r
+ type = ... # type: str\r
+ type_options = ... # type: Dict[str, str]\r
+ innerboundary = ... # type: bytes\r
+ length = ... # type: int\r
+ done = ... # type: int\r
+ list = ... # type: Optional[List[Any]]\r
+ value = ... # type: Union[None, bytes, List[Any]]\r
+\r
+ if sys.version_info >= (3, 0):\r
+ def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ...,\r
+ environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...,\r
+ limit: int = ..., encoding: str = ..., errors: str = ...) -> None: ...\r
+ else:\r
+ def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ...,\r
+ environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ...\r
+\r
+ if sys.version_info >= (3, 0):\r
+ def __enter__(self: _T) -> _T: ...\r
+ def __exit__(self, *args: Any) -> None: ...\r
+ def __repr__(self) -> str: ...\r
+ def __iter__(self) -> Iterable[str]: ...\r
+ def __getitem__(self, key: str) -> Any: ...\r
+ def getvalue(self, key: str, default: Any = ...) -> Any: ...\r
+ def getfirst(self, key: str, default: Any = ...) -> Any: ...\r
+ def getlist(self, key: str) -> List[Any]: ...\r
+ def keys(self) -> List[str]: ...\r
+ if sys.version_info < (3, 0):\r
+ def has_key(self, key: str) -> bool: ...\r
+ def __contains__(self, key: str) -> bool: ...\r
+ def __len__(self) -> int: ...\r
+ if sys.version_info >= (3, 0):\r
+ def __bool__(self) -> bool: ...\r
+ else:\r
+ def __nonzero__(self) -> bool: ...\r
+ if sys.version_info >= (3, 0):\r
+ # In Python 3 it returns bytes or str IO depending on an internal flag\r
+ def make_file(self) -> IO[Any]: ...\r
+ else:\r
+ # In Python 2 it always returns bytes and ignores the "binary" flag\r
+ def make_file(self, binary: Any = ...) -> IO[bytes]: ...\r
+\r
+\r
+if sys.version_info < (3, 0):\r
+ from UserDict import UserDict\r
+\r
+ class FormContentDict(UserDict):\r
+ query_string = ... # type: str\r
+ def __init__(self, environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ...\r
+\r
+ class SvFormContentDict(FormContentDict):\r
+ def getlist(self, key: Any) -> Any: ...\r
+\r
+ class InterpFormContentDict(SvFormContentDict): ...\r
+\r
+ class FormContent(FormContentDict):\r
+ # TODO this should have\r
+ # def values(self, key: Any) -> Any: ...\r
+ # but this is incompatible with the supertype, and adding '# type: ignore' triggers\r
+ # a parse error in pytype (https://github.com/google/pytype/issues/53)\r
+ def indexed_value(self, key: Any, location: int) -> Any: ...\r
+ def value(self, key: Any) -> Any: ...\r
+ def length(self, key: Any) -> int: ...\r
+ def stripped(self, key: Any) -> Any: ...\r
+ def pars(self) -> Dict[Any, Any]: ...\r