massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 3 / urllib / request.pyi
diff --git a/.config/coc/extensions/coc-python-data/languageServer.0.5.59/Typeshed/stdlib/3/urllib/request.pyi b/.config/coc/extensions/coc-python-data/languageServer.0.5.59/Typeshed/stdlib/3/urllib/request.pyi
new file mode 100644 (file)
index 0000000..8bfff06
--- /dev/null
@@ -0,0 +1,208 @@
+# Stubs for urllib.request (Python 3.4)\r
+\r
+from typing import (\r
+    Any, Callable, ClassVar, Dict, List, IO, Mapping, Optional, Sequence, Tuple,\r
+    TypeVar, Union, overload,\r
+)\r
+from http.client import HTTPResponse, HTTPMessage\r
+from http.cookiejar import CookieJar\r
+from email.message import Message\r
+from urllib.response import addinfourl\r
+import ssl\r
+import sys\r
+import os\r
+\r
+_T = TypeVar('_T')\r
+_UrlopenRet = Union[HTTPResponse, addinfourl]\r
+\r
+\r
+def urlopen(\r
+    url: Union[str, 'Request'], data: Optional[bytes] = ...,\r
+    timeout: float = ..., *, cafile: Optional[str] = ...,\r
+    capath: Optional[str] = ..., cadefault: bool = ...,\r
+    context: Optional[ssl.SSLContext] = ...\r
+) -> _UrlopenRet: ...\r
+def install_opener(opener: OpenerDirector) -> None: ...\r
+def build_opener(\r
+    *handlers: Union[BaseHandler, Callable[[], BaseHandler]]\r
+) -> OpenerDirector: ...\r
+def url2pathname(path: str) -> str: ...\r
+def pathname2url(path: str) -> str: ...\r
+def getproxies() -> Dict[str, str]: ...\r
+def parse_http_list(s: str) -> List[str]: ...\r
+def parse_keqv_list(l: List[str]) -> Dict[str, str]: ...\r
+\r
+class Request:\r
+    @property\r
+    def full_url(self) -> str: ...\r
+    @full_url.setter\r
+    def full_url(self, value: str) -> None: ...\r
+    @full_url.deleter\r
+    def full_url(self) -> None: ...\r
+    type: str\r
+    host: str\r
+    origin_req_host: str\r
+    selector: str\r
+    data: Optional[bytes]\r
+    headers: Dict[str, str]\r
+    unverifiable: bool\r
+    method: Optional[str]\r
+    def __init__(self, url: str, data: Optional[bytes] = ...,\r
+            headers: Dict[str, str] =..., origin_req_host: Optional[str] = ...,\r
+            unverifiable: bool = ..., method: Optional[str] = ...) -> None: ...\r
+    def get_method(self) -> str: ...\r
+    def add_header(self, key: str, val: str) -> None: ...\r
+    def add_unredirected_header(self, key: str, val: str) -> None: ...\r
+    def has_header(self, header_name: str) -> bool: ...\r
+    def remove_header(self, header_name: str) -> None: ...\r
+    def get_full_url(self) -> str: ...\r
+    def set_proxy(self, host: str, type: str) -> None: ...\r
+    @overload\r
+    def get_header(self, header_name: str) -> Optional[str]: ...\r
+    @overload\r
+    def get_header(self, header_name: str, default: _T) -> Union[str, _T]: ...\r
+    def header_items(self) -> List[Tuple[str, str]]: ...\r
+\r
+class OpenerDirector:\r
+    addheaders: List[Tuple[str, str]]\r
+    def add_handler(self, handler: BaseHandler) -> None: ...\r
+    def open(self, url: Union[str, Request], data: Optional[bytes] = ...,\r
+             timeout: float = ...) -> _UrlopenRet: ...\r
+    def error(self, proto: str, *args: Any) -> _UrlopenRet: ...\r
+\r
+\r
+class BaseHandler:\r
+    handler_order: ClassVar[int]\r
+    parent: OpenerDirector\r
+    def add_parent(self, parent: OpenerDirector) -> None: ...\r
+    def close(self) -> None: ...\r
+    def http_error_nnn(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                       hdrs: Mapping[str, str]) -> _UrlopenRet: ...\r
+\r
+class HTTPDefaultErrorHandler(BaseHandler): ...\r
+\r
+class HTTPRedirectHandler(BaseHandler):\r
+    def redirect_request(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                         hdrs: Mapping[str, str],\r
+                         newurl: str) -> Optional[Request]: ...\r
+    def http_error_301(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                       hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...\r
+    def http_error_302(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                       hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...\r
+    def http_error_303(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                       hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...\r
+    def http_error_307(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                       hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...\r
+\r
+class HTTPCookieProcessor(BaseHandler):\r
+    cookiejar: CookieJar\r
+    def __init__(self, cookiejar: Optional[CookieJar] = ...) -> None: ...\r
+\r
+class ProxyHandler(BaseHandler):\r
+    def __init__(self, proxies: Optional[Dict[str, str]] = ...) -> None: ...\r
+    # TODO add a method for every (common) proxy protocol\r
+\r
+class HTTPPasswordMgr:\r
+    def add_password(self, realm: str, uri: Union[str, Sequence[str]],\r
+                     user: str, passwd: str) -> None: ...\r
+    def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ...\r
+\r
+class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr):\r
+    def add_password(self, realm: str, uri: Union[str, Sequence[str]],\r
+                     user: str, passwd: str) -> None: ...\r
+    def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ...\r
+\r
+if sys.version_info >= (3, 5):\r
+    class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm):\r
+        def add_password(self, realm: str, uri: Union[str, Sequence[str]],\r
+                         user: str, passwd: str,\r
+                         is_authenticated: bool = ...) -> None: ...\r
+        def update_authenticated(self, uri: Union[str, Sequence[str]],\r
+                                 is_authenticated: bool = ...) -> None: ...\r
+        def is_authenticated(self, authuri: str) -> bool: ...\r
+\r
+class AbstractBasicAuthHandler:\r
+    def __init__(self,\r
+                 password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ...\r
+    def http_error_auth_reqed(self, authreq: str, host: str, req: Request,\r
+                              headers: Mapping[str, str]) -> None: ...\r
+\r
+class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):\r
+    def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                       hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...\r
+\r
+class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):\r
+    def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                       hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...\r
+\r
+class AbstractDigestAuthHandler:\r
+    def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ...\r
+    def reset_retry_count(self) -> None: ...\r
+    def http_error_auth_reqed(self, auth_header: str, host: str, req: Request,\r
+                              headers: Mapping[str, str]) -> None: ...\r
+    def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[_UrlopenRet]: ...\r
+    def get_cnonce(self, nonce: str) -> str: ...\r
+    def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ...\r
+    def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ...\r
+    def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ...\r
+\r
+class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):\r
+    def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                       hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...\r
+\r
+class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):\r
+    def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int,\r
+                       hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...\r
+\r
+class HTTPHandler(BaseHandler):\r
+    def http_open(self, req: Request) -> _UrlopenRet: ...\r
+\r
+class HTTPSHandler(BaseHandler):\r
+    def __init__(self, debuglevel: int = ...,\r
+                 context: Optional[ssl.SSLContext] = ...,\r
+                 check_hostname: bool = ...) -> None: ...\r
+    def https_open(self, req: Request) -> _UrlopenRet: ...\r
+\r
+class FileHandler(BaseHandler):\r
+    def file_open(self, req: Request) -> _UrlopenRet: ...\r
+\r
+class DataHandler(BaseHandler):\r
+    def data_open(self, req: Request) -> _UrlopenRet: ...\r
+\r
+class FTPHandler(BaseHandler):\r
+    def ftp_open(self, req: Request) -> _UrlopenRet: ...\r
+\r
+class CacheFTPHandler(FTPHandler):\r
+    def setTimeout(self, t: float) -> None: ...\r
+    def setMaxConns(self, m: int) -> None: ...\r
+\r
+class UnknownHandler(BaseHandler):\r
+    def unknown_open(self, req: Request) -> _UrlopenRet: ...\r
+\r
+class HTTPErrorProcessor(BaseHandler):\r
+    def http_response(self) -> _UrlopenRet: ...\r
+    def https_response(self) -> _UrlopenRet: ...\r
+\r
+if sys.version_info >= (3, 6):\r
+    def urlretrieve(url: str, filename: Optional[Union[str, os.PathLike]] = ...,\r
+                    reporthook: Optional[Callable[[int, int, int], None]] = ...,\r
+                    data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ...\r
+else:\r
+    def urlretrieve(url: str, filename: Optional[str] = ...,\r
+                    reporthook: Optional[Callable[[int, int, int], None]] = ...,\r
+                    data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ...\r
+def urlcleanup() -> None: ...\r
+\r
+class URLopener:\r
+    version: ClassVar[str]\r
+    def __init__(self, proxies: Optional[Dict[str, str]] = ...,\r
+                 **x509: str) -> None: ...\r
+    def open(self, fullurl: str, data: Optional[bytes] = ...) -> _UrlopenRet: ...\r
+    def open_unknown(self, fullurl: str,\r
+                     data: Optional[bytes] = ...) -> _UrlopenRet: ...\r
+    def retrieve(self, url: str, filename: Optional[str] = ...,\r
+                 reporthook: Optional[Callable[[int, int, int], None]] = ...,\r
+                 data: Optional[bytes] = ...) -> Tuple[str, Optional[Message]]: ...\r
+\r
+class FancyURLopener(URLopener):\r
+    def prompt_user_passwd(self, host: str, realm: str) -> Tuple[str, str]: ...\r