--- /dev/null
+# Stubs for xmlrpclib (Python 2)\r
+\r
+from typing import Any, AnyStr, Callable, IO, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Type, TypeVar, Union\r
+from types import InstanceType\r
+from datetime import datetime\r
+from time import struct_time\r
+from httplib import HTTPConnection, HTTPResponse, HTTPSConnection\r
+from ssl import SSLContext\r
+from StringIO import StringIO\r
+from gzip import GzipFile\r
+\r
+_Unmarshaller = Any\r
+_timeTuple = Tuple[int, int, int, int, int, int, int, int, int]\r
+# Represents types that can be compared against a DateTime object\r
+_dateTimeComp = Union[AnyStr, DateTime, datetime, _timeTuple]\r
+# A "host description" used by Transport factories\r
+_hostDesc = Union[str, Tuple[str, Mapping[Any, Any]]]\r
+\r
+def escape(s: AnyStr, replace: Callable[[AnyStr, AnyStr, AnyStr], AnyStr] = ...) -> AnyStr: ...\r
+\r
+MAXINT = ... # type: int\r
+MININT = ... # type: int\r
+PARSE_ERROR = ... # type: int\r
+SERVER_ERROR = ... # type: int\r
+APPLICATION_ERROR = ... # type: int\r
+SYSTEM_ERROR = ... # type: int\r
+TRANSPORT_ERROR = ... # type: int\r
+NOT_WELLFORMED_ERROR = ... # type: int\r
+UNSUPPORTED_ENCODING = ... # type: int\r
+INVALID_ENCODING_CHAR = ... # type: int\r
+INVALID_XMLRPC = ... # type: int\r
+METHOD_NOT_FOUND = ... # type: int\r
+INVALID_METHOD_PARAMS = ... # type: int\r
+INTERNAL_ERROR = ... # type: int\r
+\r
+class Error(Exception): ...\r
+\r
+class ProtocolError(Error):\r
+ url = ... # type: str\r
+ errcode = ... # type: int\r
+ errmsg = ... # type: str\r
+ headers = ... # type: Any\r
+ def __init__(self, url: str, errcode: int, errmsg: str, headers: Any) -> None: ...\r
+\r
+class ResponseError(Error): ...\r
+\r
+class Fault(Error):\r
+ faultCode = ... # type: Any\r
+ faultString = ... # type: str\r
+ def __init__(self, faultCode: Any, faultString: str, **extra: Any) -> None: ...\r
+\r
+boolean = ... # type: Type[bool]\r
+Boolean = ... # type: Type[bool]\r
+\r
+class DateTime:\r
+ value = ... # type: str\r
+ def __init__(self, value: Union[str, unicode, datetime, float, int, _timeTuple, struct_time] = ...) -> None: ...\r
+ def make_comparable(self, other: _dateTimeComp) -> Tuple[_dateTimeComp, _dateTimeComp]: ...\r
+ def __lt__(self, other: _dateTimeComp) -> bool: ...\r
+ def __le__(self, other: _dateTimeComp) -> bool: ...\r
+ def __gt__(self, other: _dateTimeComp) -> bool: ...\r
+ def __ge__(self, other: _dateTimeComp) -> bool: ...\r
+ def __eq__(self, other: _dateTimeComp) -> bool: ...\r
+ def __ne__(self, other: _dateTimeComp) -> bool: ...\r
+ def timetuple(self) -> struct_time: ...\r
+ def __cmp__(self, other: _dateTimeComp) -> int: ...\r
+ def decode(self, data: Any) -> None: ...\r
+ def encode(self, out: IO) -> None: ...\r
+\r
+class Binary:\r
+ data = ... # type: str\r
+ def __init__(self, data: Optional[str] = ...) -> None: ...\r
+ def __cmp__(self, other: Any) -> int: ...\r
+ def decode(self, data: str) -> None: ...\r
+ def encode(self, out: IO) -> None: ...\r
+\r
+WRAPPERS = ... # type: tuple\r
+\r
+# Still part of the public API, but see http://bugs.python.org/issue1773632\r
+FastParser = ... # type: None\r
+FastUnmarshaller = ... # type: None\r
+FastMarshaller = ... # type: None\r
+\r
+# xmlrpclib.py will leave ExpatParser undefined if it can't import expat from\r
+# xml.parsers. Because this is Python 2.7, the import will succeed.\r
+class ExpatParser:\r
+ def __init__(self, target: _Unmarshaller) -> None: ...\r
+ def feed(self, data: str): ...\r
+ def close(self): ...\r
+\r
+# TODO: Add xmllib.XMLParser as base class\r
+class SlowParser:\r
+ handle_xml = ... # type: Callable[[str, bool], None]\r
+ unknown_starttag = ... # type: Callable[[str, Any], None]\r
+ handle_data = ... # type: Callable[[str], None]\r
+ handle_cdata = ... # type: Callable[[str], None]\r
+ unknown_endtag = ... # type: Callable[[str, Callable[[Iterable[str], str], str]], None]\r
+ def __init__(self, target: _Unmarshaller) -> None: ...\r
+\r
+class Marshaller:\r
+ memo = ... # type: MutableMapping[int, Any]\r
+ data = ... # type: Optional[str]\r
+ encoding = ... # type: Optional[str]\r
+ allow_none = ... # type: bool\r
+ def __init__(self, encoding: Optional[str] = ..., allow_none: bool = ...) -> None: ...\r
+ dispatch = ... # type: Mapping[type, Callable[[Marshaller, str, Callable[[str], None]], None]]\r
+ def dumps(self, values: Union[Iterable[Union[None, int, bool, long, float, str, unicode, List, Tuple, Mapping, datetime, InstanceType]], Fault]) -> str: ...\r
+ def dump_nil(self, value: None, write: Callable[[str], None]) -> None: ...\r
+ def dump_int(self, value: int, write: Callable[[str], None]) -> None: ...\r
+ def dump_bool(self, value: bool, write: Callable[[str], None]) -> None: ...\r
+ def dump_long(self, value: long, write: Callable[[str], None]) -> None: ...\r
+ def dump_double(self, value: float, write: Callable[[str], None]) -> None: ...\r
+ def dump_string(self, value: str, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ...\r
+ def dump_unicode(self, value: unicode, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ...\r
+ def dump_array(self, value: Union[List, Tuple], write: Callable[[str], None]) -> None: ...\r
+ def dump_struct(self, value: Mapping, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ...\r
+ def dump_datetime(self, value: datetime, write: Callable[[str], None]) -> None: ...\r
+ def dump_instance(self, value: InstanceType, write: Callable[[str], None]) -> None: ...\r
+\r
+class Unmarshaller:\r
+ def append(self, object: Any) -> None: ...\r
+ def __init__(self, use_datetime: bool = ...) -> None: ...\r
+ def close(self) -> tuple: ...\r
+ def getmethodname(self) -> Optional[str]: ...\r
+ def xml(self, encoding: str, standalone: bool) -> None: ...\r
+ def start(self, tag: str, attrs: Any) -> None: ...\r
+ def data(self, text: str) -> None: ...\r
+ def end(self, tag: str, join: Callable[[Iterable[str], str], str] = ...) -> None: ...\r
+ def end_dispatch(self, tag: str, data: str) -> None: ...\r
+ dispatch = ... # type: Mapping[str, Callable[[Unmarshaller, str], None]]\r
+ def end_nil(self, data: str): ...\r
+ def end_boolean(self, data: str) -> None: ...\r
+ def end_int(self, data: str) -> None: ...\r
+ def end_double(self, data: str) -> None: ...\r
+ def end_string(self, data: str) -> None: ...\r
+ def end_array(self, data: str) -> None: ...\r
+ def end_struct(self, data: str) -> None: ...\r
+ def end_base64(self, data: str) -> None: ...\r
+ def end_dateTime(self, data: str) -> None: ...\r
+ def end_value(self, data: str) -> None: ...\r
+ def end_params(self, data: str) -> None: ...\r
+ def end_fault(self, data: str) -> None: ...\r
+ def end_methodName(self, data: str) -> None: ...\r
+\r
+class _MultiCallMethod:\r
+ def __init__(self, call_list: List[Tuple[str, tuple]], name: str) -> None: ...\r
+class MultiCallIterator:\r
+ def __init__(self, results: List) -> None: ...\r
+\r
+class MultiCall:\r
+ def __init__(self, server: ServerProxy) -> None: ...\r
+ def __getattr__(self, name: str) -> _MultiCallMethod: ...\r
+ def __call__(self) -> MultiCallIterator: ...\r
+\r
+def getparser(use_datetime: bool = ...) -> Tuple[Union[ExpatParser, SlowParser], Unmarshaller]: ...\r
+def dumps(params: Union[tuple, Fault], methodname: Optional[str] = ..., methodresponse: Optional[bool] = ..., encoding: Optional[str] = ..., allow_none: bool = ...) -> str: ...\r
+def loads(data: str, use_datetime: bool = ...) -> Tuple[tuple, Optional[str]]: ...\r
+\r
+def gzip_encode(data: str) -> str: ...\r
+def gzip_decode(data: str, max_decode: int = ...) -> str: ...\r
+\r
+class GzipDecodedResponse(GzipFile):\r
+ stringio = ... # type: StringIO\r
+ def __init__(self, response: HTTPResponse) -> None: ...\r
+ def close(self): ...\r
+\r
+class _Method:\r
+ def __init__(self, send: Callable[[str, tuple], Any], name: str) -> None: ...\r
+ def __getattr__(self, name: str) -> _Method: ...\r
+ def __call__(self, *args: Any) -> Any: ...\r
+\r
+class Transport:\r
+ user_agent = ... # type: str\r
+ accept_gzip_encoding = ... # type: bool\r
+ encode_threshold = ... # type: Optional[int]\r
+ def __init__(self, use_datetime: bool = ...) -> None: ...\r
+ def request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> tuple: ...\r
+ verbose = ... # type: bool\r
+ def single_request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> tuple: ...\r
+ def getparser(self) -> Tuple[Union[ExpatParser, SlowParser], Unmarshaller]: ...\r
+ def get_host_info(self, host: _hostDesc) -> Tuple[str, Optional[List[Tuple[str, str]]], Optional[Mapping[Any, Any]]]: ...\r
+ def make_connection(self, host: _hostDesc) -> HTTPConnection: ...\r
+ def close(self) -> None: ...\r
+ def send_request(self, connection: HTTPConnection, handler: str, request_body: str) -> None: ...\r
+ def send_host(self, connection: HTTPConnection, host: str) -> None: ...\r
+ def send_user_agent(self, connection: HTTPConnection) -> None: ...\r
+ def send_content(self, connection: HTTPConnection, request_body: str) -> None: ...\r
+ def parse_response(self, response: HTTPResponse) -> tuple: ...\r
+\r
+class SafeTransport(Transport):\r
+ def __init__(self, use_datetime: bool = ..., context: Optional[SSLContext] = ...) -> None: ...\r
+ def make_connection(self, host: _hostDesc) -> HTTPSConnection: ...\r
+\r
+class ServerProxy:\r
+ def __init__(self, uri: str, transport: Optional[Transport] = ..., encoding: Optional[str] = ..., verbose: bool = ..., allow_none: bool = ..., use_datetime: bool = ..., context: Optional[SSLContext] = ...) -> None: ...\r
+ def __getattr__(self, name: str) -> _Method: ...\r
+ def __call__(self, attr: str) -> Optional[Transport]: ...\r
+\r
+Server = ServerProxy\r