mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-21 09:08:27 +08:00
add (overwrite with) mypy stubs, if available
This commit is contained in:
38
third_party/3/__init__.pyi
vendored
Normal file
38
third_party/3/__init__.pyi
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# Stubs for requests (based on version 2.6.0, Python 3)
|
||||
|
||||
from typing import Any
|
||||
from . import models
|
||||
from . import api
|
||||
from . import sessions
|
||||
from . import status_codes
|
||||
from . import exceptions
|
||||
import logging
|
||||
|
||||
__title__ = ... # type: Any
|
||||
__build__ = ... # type: Any
|
||||
__license__ = ... # type: Any
|
||||
__copyright__ = ... # type: Any
|
||||
|
||||
Request = models.Request
|
||||
Response = models.Response
|
||||
PreparedRequest = models.PreparedRequest
|
||||
request = api.request
|
||||
get = api.get
|
||||
head = api.head
|
||||
post = api.post
|
||||
patch = api.patch
|
||||
put = api.put
|
||||
delete = api.delete
|
||||
options = api.options
|
||||
session = sessions.session
|
||||
Session = sessions.Session
|
||||
codes = status_codes.codes
|
||||
RequestException = exceptions.RequestException
|
||||
Timeout = exceptions.Timeout
|
||||
URLRequired = exceptions.URLRequired
|
||||
TooManyRedirects = exceptions.TooManyRedirects
|
||||
HTTPError = exceptions.HTTPError
|
||||
ConnectionError = exceptions.ConnectionError
|
||||
|
||||
class NullHandler(logging.Handler):
|
||||
def emit(self, record): ...
|
||||
69
third_party/3/adapters.pyi
vendored
Normal file
69
third_party/3/adapters.pyi
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
# Stubs for requests.adapters (Python 3)
|
||||
|
||||
from typing import Any
|
||||
from . import models
|
||||
from .packages.urllib3 import poolmanager
|
||||
from .packages.urllib3 import response
|
||||
from .packages.urllib3.util import retry
|
||||
from . import compat
|
||||
from . import utils
|
||||
from . import structures
|
||||
from .packages.urllib3 import exceptions as urllib3_exceptions
|
||||
from . import cookies
|
||||
from . import exceptions
|
||||
from . import auth
|
||||
|
||||
Response = models.Response
|
||||
PoolManager = poolmanager.PoolManager
|
||||
proxy_from_url = poolmanager.proxy_from_url
|
||||
HTTPResponse = response.HTTPResponse
|
||||
Retry = retry.Retry
|
||||
DEFAULT_CA_BUNDLE_PATH = utils.DEFAULT_CA_BUNDLE_PATH
|
||||
get_encoding_from_headers = utils.get_encoding_from_headers
|
||||
prepend_scheme_if_needed = utils.prepend_scheme_if_needed
|
||||
get_auth_from_url = utils.get_auth_from_url
|
||||
urldefragauth = utils.urldefragauth
|
||||
CaseInsensitiveDict = structures.CaseInsensitiveDict
|
||||
ConnectTimeoutError = urllib3_exceptions.ConnectTimeoutError
|
||||
MaxRetryError = urllib3_exceptions.MaxRetryError
|
||||
ProtocolError = urllib3_exceptions.ProtocolError
|
||||
ReadTimeoutError = urllib3_exceptions.ReadTimeoutError
|
||||
ResponseError = urllib3_exceptions.ResponseError
|
||||
extract_cookies_to_jar = cookies.extract_cookies_to_jar
|
||||
ConnectionError = exceptions.ConnectionError
|
||||
ConnectTimeout = exceptions.ConnectTimeout
|
||||
ReadTimeout = exceptions.ReadTimeout
|
||||
SSLError = exceptions.SSLError
|
||||
ProxyError = exceptions.ProxyError
|
||||
RetryError = exceptions.RetryError
|
||||
|
||||
DEFAULT_POOLBLOCK = ... # type: Any
|
||||
DEFAULT_POOLSIZE = ... # type: Any
|
||||
DEFAULT_RETRIES = ... # type: Any
|
||||
|
||||
class BaseAdapter:
|
||||
def __init__(self): ...
|
||||
# TODO: "request" parameter not actually supported, added to please mypy.
|
||||
def send(self, request=None): ...
|
||||
def close(self): ...
|
||||
|
||||
class HTTPAdapter(BaseAdapter):
|
||||
__attrs__ = ... # type: Any
|
||||
max_retries = ... # type: Any
|
||||
config = ... # type: Any
|
||||
proxy_manager = ... # type: Any
|
||||
def __init__(self, pool_connections=..., pool_maxsize=..., max_retries=...,
|
||||
pool_block=...): ...
|
||||
poolmanager = ... # type: Any
|
||||
def init_poolmanager(self, connections, maxsize, block=..., **pool_kwargs): ...
|
||||
def proxy_manager_for(self, proxy, **proxy_kwargs): ...
|
||||
def cert_verify(self, conn, url, verify, cert): ...
|
||||
def build_response(self, req, resp): ...
|
||||
def get_connection(self, url, proxies=None): ...
|
||||
def close(self): ...
|
||||
def request_url(self, request, proxies): ...
|
||||
def add_headers(self, request, **kwargs): ...
|
||||
def proxy_headers(self, proxy): ...
|
||||
# TODO: "request" is not actually optional, modified to please mypy.
|
||||
def send(self, request=None, stream=False, timeout=None, verify=True, cert=None,
|
||||
proxies=None): ...
|
||||
14
third_party/3/api.pyi
vendored
Normal file
14
third_party/3/api.pyi
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# Stubs for requests.api (Python 3)
|
||||
|
||||
import typing
|
||||
|
||||
from .models import Response
|
||||
|
||||
def request(method: str, url: str, **kwargs) -> Response: ...
|
||||
def get(url: str, **kwargs) -> Response: ...
|
||||
def options(url: str, **kwargs) -> Response: ...
|
||||
def head(url: str, **kwargs) -> Response: ...
|
||||
def post(url: str, data=None, json=None, **kwargs) -> Response: ...
|
||||
def put(url: str, data=None, **kwargs) -> Response: ...
|
||||
def patch(url: str, data=None, **kwargs) -> Response: ...
|
||||
def delete(url: str, **kwargs) -> Response: ...
|
||||
41
third_party/3/auth.pyi
vendored
Normal file
41
third_party/3/auth.pyi
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# Stubs for requests.auth (Python 3)
|
||||
|
||||
from typing import Any
|
||||
from . import compat
|
||||
from . import cookies
|
||||
from . import utils
|
||||
from . import status_codes
|
||||
|
||||
extract_cookies_to_jar = cookies.extract_cookies_to_jar
|
||||
parse_dict_header = utils.parse_dict_header
|
||||
to_native_string = utils.to_native_string
|
||||
codes = status_codes.codes
|
||||
|
||||
CONTENT_TYPE_FORM_URLENCODED = ... # type: Any
|
||||
CONTENT_TYPE_MULTI_PART = ... # type: Any
|
||||
|
||||
class AuthBase:
|
||||
def __call__(self, r): ...
|
||||
|
||||
class HTTPBasicAuth(AuthBase):
|
||||
username = ... # type: Any
|
||||
password = ... # type: Any
|
||||
def __init__(self, username, password): ...
|
||||
def __call__(self, r): ...
|
||||
|
||||
class HTTPProxyAuth(HTTPBasicAuth):
|
||||
def __call__(self, r): ...
|
||||
|
||||
class HTTPDigestAuth(AuthBase):
|
||||
username = ... # type: Any
|
||||
password = ... # type: Any
|
||||
last_nonce = ... # type: Any
|
||||
nonce_count = ... # type: Any
|
||||
chal = ... # type: Any
|
||||
pos = ... # type: Any
|
||||
num_401_calls = ... # type: Any
|
||||
def __init__(self, username, password): ...
|
||||
def build_digest_header(self, method, url): ...
|
||||
def handle_redirect(self, r, **kwargs): ...
|
||||
def handle_401(self, r, **kwargs): ...
|
||||
def __call__(self, r): ...
|
||||
6
third_party/3/compat.pyi
vendored
Normal file
6
third_party/3/compat.pyi
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# Stubs for requests.compat (Python 3.4)
|
||||
|
||||
from typing import Any
|
||||
import collections
|
||||
|
||||
OrderedDict = collections.OrderedDict
|
||||
65
third_party/3/cookies.pyi
vendored
Normal file
65
third_party/3/cookies.pyi
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
# Stubs for requests.cookies (Python 3)
|
||||
|
||||
from typing import Any, MutableMapping
|
||||
#import cookielib
|
||||
from http import cookiejar as cookielib
|
||||
import collections
|
||||
from . import compat
|
||||
|
||||
#cookielib = compat.cookielib
|
||||
|
||||
class MockRequest:
|
||||
type = ... # type: Any
|
||||
def __init__(self, request): ...
|
||||
def get_type(self): ...
|
||||
def get_host(self): ...
|
||||
def get_origin_req_host(self): ...
|
||||
def get_full_url(self): ...
|
||||
def is_unverifiable(self): ...
|
||||
def has_header(self, name): ...
|
||||
def get_header(self, name, default=None): ...
|
||||
def add_header(self, key, val): ...
|
||||
def add_unredirected_header(self, name, value): ...
|
||||
def get_new_headers(self): ...
|
||||
@property
|
||||
def unverifiable(self): ...
|
||||
@property
|
||||
def origin_req_host(self): ...
|
||||
@property
|
||||
def host(self): ...
|
||||
|
||||
class MockResponse:
|
||||
def __init__(self, headers): ...
|
||||
def info(self): ...
|
||||
def getheaders(self, name): ...
|
||||
|
||||
def extract_cookies_to_jar(jar, request, response): ...
|
||||
def get_cookie_header(jar, request): ...
|
||||
def remove_cookie_by_name(cookiejar, name, domain=None, path=None): ...
|
||||
|
||||
class CookieConflictError(RuntimeError): ...
|
||||
|
||||
class RequestsCookieJar(cookielib.CookieJar, MutableMapping):
|
||||
def get(self, name, default=None, domain=None, path=None): ...
|
||||
def set(self, name, value, **kwargs): ...
|
||||
def iterkeys(self): ...
|
||||
def keys(self): ...
|
||||
def itervalues(self): ...
|
||||
def values(self): ...
|
||||
def iteritems(self): ...
|
||||
def items(self): ...
|
||||
def list_domains(self): ...
|
||||
def list_paths(self): ...
|
||||
def multiple_domains(self): ...
|
||||
def get_dict(self, domain=None, path=None): ...
|
||||
def __getitem__(self, name): ...
|
||||
def __setitem__(self, name, value): ...
|
||||
def __delitem__(self, name): ...
|
||||
def set_cookie(self, cookie, *args, **kwargs): ...
|
||||
def update(self, other): ...
|
||||
def copy(self): ...
|
||||
|
||||
def create_cookie(name, value, **kwargs): ...
|
||||
def morsel_to_cookie(morsel): ...
|
||||
def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True): ...
|
||||
def merge_cookies(cookiejar, cookies): ...
|
||||
26
third_party/3/exceptions.pyi
vendored
Normal file
26
third_party/3/exceptions.pyi
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
# Stubs for requests.exceptions (Python 3)
|
||||
|
||||
from typing import Any
|
||||
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
|
||||
|
||||
class RequestException(IOError):
|
||||
response = ... # type: Any
|
||||
request = ... # type: Any
|
||||
def __init__(self, *args, **kwargs): ...
|
||||
|
||||
class HTTPError(RequestException): ...
|
||||
class ConnectionError(RequestException): ...
|
||||
class ProxyError(ConnectionError): ...
|
||||
class SSLError(ConnectionError): ...
|
||||
class Timeout(RequestException): ...
|
||||
class ConnectTimeout(ConnectionError, Timeout): ...
|
||||
class ReadTimeout(Timeout): ...
|
||||
class URLRequired(RequestException): ...
|
||||
class TooManyRedirects(RequestException): ...
|
||||
class MissingSchema(RequestException, ValueError): ...
|
||||
class InvalidSchema(RequestException, ValueError): ...
|
||||
class InvalidURL(RequestException, ValueError): ...
|
||||
class ChunkedEncodingError(RequestException): ...
|
||||
class ContentDecodingError(RequestException, BaseHTTPError): ...
|
||||
class StreamConsumedError(RequestException, TypeError): ...
|
||||
class RetryError(RequestException): ...
|
||||
8
third_party/3/hooks.pyi
vendored
Normal file
8
third_party/3/hooks.pyi
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Stubs for requests.hooks (Python 3)
|
||||
|
||||
from typing import Any
|
||||
|
||||
HOOKS = ... # type: Any
|
||||
|
||||
def default_hooks(): ...
|
||||
def dispatch_hook(key, hooks, hook_data, **kwargs): ...
|
||||
134
third_party/3/models.pyi
vendored
Normal file
134
third_party/3/models.pyi
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
# Stubs for requests.models (Python 3)
|
||||
|
||||
from typing import Any, List, MutableMapping, Iterator, Dict
|
||||
import datetime
|
||||
|
||||
from . import hooks
|
||||
from . import structures
|
||||
from . import auth
|
||||
from . import cookies
|
||||
from .cookies import RequestsCookieJar
|
||||
from .packages.urllib3 import fields
|
||||
from .packages.urllib3 import filepost
|
||||
from .packages.urllib3 import util
|
||||
from .packages.urllib3 import exceptions as urllib3_exceptions
|
||||
from . import exceptions
|
||||
from . import utils
|
||||
from . import compat
|
||||
from . import status_codes
|
||||
|
||||
default_hooks = hooks.default_hooks
|
||||
CaseInsensitiveDict = structures.CaseInsensitiveDict
|
||||
HTTPBasicAuth = auth.HTTPBasicAuth
|
||||
cookiejar_from_dict = cookies.cookiejar_from_dict
|
||||
get_cookie_header = cookies.get_cookie_header
|
||||
RequestField = fields.RequestField
|
||||
encode_multipart_formdata = filepost.encode_multipart_formdata
|
||||
parse_url = util.parse_url
|
||||
DecodeError = urllib3_exceptions.DecodeError
|
||||
ReadTimeoutError = urllib3_exceptions.ReadTimeoutError
|
||||
ProtocolError = urllib3_exceptions.ProtocolError
|
||||
LocationParseError = urllib3_exceptions.LocationParseError
|
||||
HTTPError = exceptions.HTTPError
|
||||
MissingSchema = exceptions.MissingSchema
|
||||
InvalidURL = exceptions.InvalidURL
|
||||
ChunkedEncodingError = exceptions.ChunkedEncodingError
|
||||
ContentDecodingError = exceptions.ContentDecodingError
|
||||
ConnectionError = exceptions.ConnectionError
|
||||
StreamConsumedError = exceptions.StreamConsumedError
|
||||
guess_filename = utils.guess_filename
|
||||
get_auth_from_url = utils.get_auth_from_url
|
||||
requote_uri = utils.requote_uri
|
||||
stream_decode_response_unicode = utils.stream_decode_response_unicode
|
||||
to_key_val_list = utils.to_key_val_list
|
||||
parse_header_links = utils.parse_header_links
|
||||
iter_slices = utils.iter_slices
|
||||
guess_json_utf = utils.guess_json_utf
|
||||
super_len = utils.super_len
|
||||
to_native_string = utils.to_native_string
|
||||
codes = status_codes.codes
|
||||
|
||||
REDIRECT_STATI = ... # type: Any
|
||||
DEFAULT_REDIRECT_LIMIT = ... # type: Any
|
||||
CONTENT_CHUNK_SIZE = ... # type: Any
|
||||
ITER_CHUNK_SIZE = ... # type: Any
|
||||
json_dumps = ... # type: Any
|
||||
|
||||
class RequestEncodingMixin:
|
||||
@property
|
||||
def path_url(self): ...
|
||||
|
||||
class RequestHooksMixin:
|
||||
def register_hook(self, event, hook): ...
|
||||
def deregister_hook(self, event, hook): ...
|
||||
|
||||
class Request(RequestHooksMixin):
|
||||
hooks = ... # type: Any
|
||||
method = ... # type: Any
|
||||
url = ... # type: Any
|
||||
headers = ... # type: Any
|
||||
files = ... # type: Any
|
||||
data = ... # type: Any
|
||||
json = ... # type: Any
|
||||
params = ... # type: Any
|
||||
auth = ... # type: Any
|
||||
cookies = ... # type: Any
|
||||
def __init__(self, method=None, url=None, headers=None, files=None, data=None, params=None,
|
||||
auth=None, cookies=None, hooks=None, json=None): ...
|
||||
def prepare(self): ...
|
||||
|
||||
class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
|
||||
method = ... # type: Any
|
||||
url = ... # type: Any
|
||||
headers = ... # type: Any
|
||||
body = ... # type: Any
|
||||
hooks = ... # type: Any
|
||||
def __init__(self): ...
|
||||
def prepare(self, method=None, url=None, headers=None, files=None, data=None, params=None,
|
||||
auth=None, cookies=None, hooks=None, json=None): ...
|
||||
def copy(self): ...
|
||||
def prepare_method(self, method): ...
|
||||
def prepare_url(self, url, params): ...
|
||||
def prepare_headers(self, headers): ...
|
||||
def prepare_body(self, data, files, json=None): ...
|
||||
def prepare_content_length(self, body): ...
|
||||
def prepare_auth(self, auth, url=''): ...
|
||||
def prepare_cookies(self, cookies): ...
|
||||
def prepare_hooks(self, hooks): ...
|
||||
|
||||
class Response:
|
||||
__attrs__ = ... # type: Any
|
||||
status_code = ... # type: int
|
||||
headers = ... # type: MutableMapping[str, str]
|
||||
raw = ... # type: Any
|
||||
url = ... # type: str
|
||||
encoding = ... # type: str
|
||||
history = ... # type: List[Response]
|
||||
reason = ... # type: str
|
||||
cookies = ... # type: RequestsCookieJar
|
||||
elapsed = ... # type: datetime.timedelta
|
||||
request = ... # type: PreparedRequest
|
||||
def __init__(self) -> None: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __nonzero__(self) -> bool: ...
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
@property
|
||||
def ok(self) -> bool: ...
|
||||
@property
|
||||
def is_redirect(self) -> bool: ...
|
||||
@property
|
||||
def is_permanent_redirect(self) -> bool: ...
|
||||
@property
|
||||
def apparent_encoding(self) -> str: ...
|
||||
def iter_content(self, chunk_size: int = 1,
|
||||
decode_unicode: bool = False) -> Iterator[Any]: ...
|
||||
def iter_lines(self, chunk_size=..., decode_unicode=None, delimiter=None): ...
|
||||
@property
|
||||
def content(self) -> bytes: ...
|
||||
@property
|
||||
def text(self) -> str: ...
|
||||
def json(self, **kwargs) -> Any: ...
|
||||
@property
|
||||
def links(self) -> Dict[Any, Any]: ...
|
||||
def raise_for_status(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
8
third_party/3/packages/__init__.pyi
vendored
Normal file
8
third_party/3/packages/__init__.pyi
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Stubs for requests.packages (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
class VendorAlias:
|
||||
def __init__(self, package_names): ...
|
||||
def find_module(self, fullname, path=None): ...
|
||||
def load_module(self, name): ...
|
||||
35
third_party/3/packages/urllib3/__init__.pyi
vendored
Normal file
35
third_party/3/packages/urllib3/__init__.pyi
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
# Stubs for requests.packages.urllib3 (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from . import connectionpool
|
||||
from . import filepost
|
||||
from . import poolmanager
|
||||
from . import response
|
||||
from .util import request as _request
|
||||
from .util import url
|
||||
from .util import timeout
|
||||
from .util import retry
|
||||
import logging
|
||||
|
||||
__license__ = ... # type: Any
|
||||
|
||||
HTTPConnectionPool = connectionpool.HTTPConnectionPool
|
||||
HTTPSConnectionPool = connectionpool.HTTPSConnectionPool
|
||||
connection_from_url = connectionpool.connection_from_url
|
||||
encode_multipart_formdata = filepost.encode_multipart_formdata
|
||||
PoolManager = poolmanager.PoolManager
|
||||
ProxyManager = poolmanager.ProxyManager
|
||||
proxy_from_url = poolmanager.proxy_from_url
|
||||
HTTPResponse = response.HTTPResponse
|
||||
make_headers = _request.make_headers
|
||||
get_host = url.get_host
|
||||
Timeout = timeout.Timeout
|
||||
Retry = retry.Retry
|
||||
|
||||
class NullHandler(logging.Handler):
|
||||
def emit(self, record): ...
|
||||
|
||||
def add_stderr_logger(level=...): ...
|
||||
def disable_warnings(category=...): ...
|
||||
51
third_party/3/packages/urllib3/_collections.pyi
vendored
Normal file
51
third_party/3/packages/urllib3/_collections.pyi
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# Stubs for requests.packages.urllib3._collections (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from collections import MutableMapping
|
||||
|
||||
class RLock:
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc_type, exc_value, traceback): ...
|
||||
|
||||
class RecentlyUsedContainer(MutableMapping):
|
||||
ContainerCls = ... # type: Any
|
||||
dispose_func = ... # type: Any
|
||||
lock = ... # type: Any
|
||||
def __init__(self, maxsize=10, dispose_func=None): ...
|
||||
def __getitem__(self, key): ...
|
||||
def __setitem__(self, key, value): ...
|
||||
def __delitem__(self, key): ...
|
||||
def __len__(self): ...
|
||||
def __iter__(self): ...
|
||||
def clear(self): ...
|
||||
def keys(self): ...
|
||||
|
||||
class HTTPHeaderDict(dict):
|
||||
def __init__(self, headers=None, **kwargs): ...
|
||||
def __setitem__(self, key, val): ...
|
||||
def __getitem__(self, key): ...
|
||||
def __delitem__(self, key): ...
|
||||
def __contains__(self, key): ...
|
||||
def __eq__(self, other): ...
|
||||
def __ne__(self, other): ...
|
||||
values = ... # type: Any
|
||||
get = ... # type: Any
|
||||
update = ... # type: Any
|
||||
iterkeys = ... # type: Any
|
||||
itervalues = ... # type: Any
|
||||
def pop(self, key, default=...): ...
|
||||
def discard(self, key): ...
|
||||
def add(self, key, val): ...
|
||||
def extend(*args, **kwargs): ...
|
||||
def getlist(self, key): ...
|
||||
getheaders = ... # type: Any
|
||||
getallmatchingheaders = ... # type: Any
|
||||
iget = ... # type: Any
|
||||
def copy(self): ...
|
||||
def iteritems(self): ...
|
||||
def itermerged(self): ...
|
||||
def items(self): ...
|
||||
@classmethod
|
||||
def from_httplib(cls, message, duplicates=...): ...
|
||||
64
third_party/3/packages/urllib3/connection.pyi
vendored
Normal file
64
third_party/3/packages/urllib3/connection.pyi
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# Stubs for requests.packages.urllib3.connection (Python 3.4)
|
||||
|
||||
from typing import Any
|
||||
from . import packages
|
||||
from http.client import HTTPConnection as _HTTPConnection
|
||||
# from httplib import HTTPConnection as _HTTPConnection # python 2
|
||||
from . import exceptions
|
||||
from .packages import ssl_match_hostname
|
||||
from .util import ssl_
|
||||
from . import util
|
||||
import http.client
|
||||
|
||||
class DummyConnection: ...
|
||||
|
||||
import ssl
|
||||
BaseSSLError = ssl.SSLError
|
||||
ConnectionError = __builtins__.ConnectionError
|
||||
HTTPException = http.client.HTTPException
|
||||
|
||||
ConnectTimeoutError = exceptions.ConnectTimeoutError
|
||||
SystemTimeWarning = exceptions.SystemTimeWarning
|
||||
SecurityWarning = exceptions.SecurityWarning
|
||||
match_hostname = ssl_match_hostname.match_hostname
|
||||
resolve_cert_reqs = ssl_.resolve_cert_reqs
|
||||
resolve_ssl_version = ssl_.resolve_ssl_version
|
||||
ssl_wrap_socket = ssl_.ssl_wrap_socket
|
||||
assert_fingerprint = ssl_.assert_fingerprint
|
||||
connection = util.connection
|
||||
|
||||
port_by_scheme = ... # type: Any
|
||||
RECENT_DATE = ... # type: Any
|
||||
|
||||
class HTTPConnection(_HTTPConnection):
|
||||
default_port = ... # type: Any
|
||||
default_socket_options = ... # type: Any
|
||||
is_verified = ... # type: Any
|
||||
source_address = ... # type: Any
|
||||
socket_options = ... # type: Any
|
||||
def __init__(self, *args, **kw): ...
|
||||
def connect(self): ...
|
||||
|
||||
class HTTPSConnection(HTTPConnection):
|
||||
default_port = ... # type: Any
|
||||
key_file = ... # type: Any
|
||||
cert_file = ... # type: Any
|
||||
def __init__(self, host, port=None, key_file=None, cert_file=None, strict=None, timeout=..., **kw): ...
|
||||
sock = ... # type: Any
|
||||
def connect(self): ...
|
||||
|
||||
class VerifiedHTTPSConnection(HTTPSConnection):
|
||||
cert_reqs = ... # type: Any
|
||||
ca_certs = ... # type: Any
|
||||
ssl_version = ... # type: Any
|
||||
assert_fingerprint = ... # type: Any
|
||||
key_file = ... # type: Any
|
||||
cert_file = ... # type: Any
|
||||
assert_hostname = ... # type: Any
|
||||
def set_cert(self, key_file=None, cert_file=None, cert_reqs=None, ca_certs=None, assert_hostname=None, assert_fingerprint=None): ...
|
||||
sock = ... # type: Any
|
||||
auto_open = ... # type: Any
|
||||
is_verified = ... # type: Any
|
||||
def connect(self): ...
|
||||
|
||||
UnverifiedHTTPSConnection = ... # type: Any
|
||||
87
third_party/3/packages/urllib3/connectionpool.pyi
vendored
Normal file
87
third_party/3/packages/urllib3/connectionpool.pyi
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
# Stubs for requests.packages.urllib3.connectionpool (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from . import exceptions
|
||||
from .packages import ssl_match_hostname
|
||||
from . import packages
|
||||
from . import connection
|
||||
from . import request
|
||||
from . import response
|
||||
from .util import connection as _connection
|
||||
from .util import retry
|
||||
from .util import timeout
|
||||
from .util import url
|
||||
|
||||
ClosedPoolError = exceptions.ClosedPoolError
|
||||
ProtocolError = exceptions.ProtocolError
|
||||
EmptyPoolError = exceptions.EmptyPoolError
|
||||
HostChangedError = exceptions.HostChangedError
|
||||
LocationValueError = exceptions.LocationValueError
|
||||
MaxRetryError = exceptions.MaxRetryError
|
||||
ProxyError = exceptions.ProxyError
|
||||
ReadTimeoutError = exceptions.ReadTimeoutError
|
||||
SSLError = exceptions.SSLError
|
||||
TimeoutError = exceptions.TimeoutError
|
||||
InsecureRequestWarning = exceptions.InsecureRequestWarning
|
||||
CertificateError = ssl_match_hostname.CertificateError
|
||||
port_by_scheme = connection.port_by_scheme
|
||||
DummyConnection = connection.DummyConnection
|
||||
HTTPConnection = connection.HTTPConnection
|
||||
HTTPSConnection = connection.HTTPSConnection
|
||||
VerifiedHTTPSConnection = connection.VerifiedHTTPSConnection
|
||||
HTTPException = connection.HTTPException
|
||||
BaseSSLError = connection.BaseSSLError
|
||||
ConnectionError = connection.ConnectionError
|
||||
RequestMethods = request.RequestMethods
|
||||
HTTPResponse = response.HTTPResponse
|
||||
is_connection_dropped = _connection.is_connection_dropped
|
||||
Retry = retry.Retry
|
||||
Timeout = timeout.Timeout
|
||||
get_host = url.get_host
|
||||
|
||||
xrange = ... # type: Any
|
||||
log = ... # type: Any
|
||||
|
||||
class ConnectionPool:
|
||||
scheme = ... # type: Any
|
||||
QueueCls = ... # type: Any
|
||||
host = ... # type: Any
|
||||
port = ... # type: Any
|
||||
def __init__(self, host, port=None): ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc_type, exc_val, exc_tb): ...
|
||||
def close(self): ...
|
||||
|
||||
class HTTPConnectionPool(ConnectionPool, RequestMethods):
|
||||
scheme = ... # type: Any
|
||||
ConnectionCls = ... # type: Any
|
||||
strict = ... # type: Any
|
||||
timeout = ... # type: Any
|
||||
retries = ... # type: Any
|
||||
pool = ... # type: Any
|
||||
block = ... # type: Any
|
||||
proxy = ... # type: Any
|
||||
proxy_headers = ... # type: Any
|
||||
num_connections = ... # type: Any
|
||||
num_requests = ... # type: Any
|
||||
conn_kw = ... # type: Any
|
||||
def __init__(self, host, port=None, strict=False, timeout=..., maxsize=1, block=False, headers=None, retries=None, _proxy=None, _proxy_headers=None, **conn_kw): ...
|
||||
def close(self): ...
|
||||
def is_same_host(self, url): ...
|
||||
def urlopen(self, method, url, body=None, headers=None, retries=None, redirect=True, assert_same_host=True, timeout=..., pool_timeout=None, release_conn=None, **response_kw): ...
|
||||
|
||||
class HTTPSConnectionPool(HTTPConnectionPool):
|
||||
scheme = ... # type: Any
|
||||
ConnectionCls = ... # type: Any
|
||||
key_file = ... # type: Any
|
||||
cert_file = ... # type: Any
|
||||
cert_reqs = ... # type: Any
|
||||
ca_certs = ... # type: Any
|
||||
ssl_version = ... # type: Any
|
||||
assert_hostname = ... # type: Any
|
||||
assert_fingerprint = ... # type: Any
|
||||
def __init__(self, host, port=None, strict=False, timeout=..., maxsize=1, block=False, headers=None, retries=None, _proxy=None, _proxy_headers=None, key_file=None, cert_file=None, cert_reqs=None, ca_certs=None, ssl_version=None, assert_hostname=None, assert_fingerprint=None, **conn_kw): ...
|
||||
|
||||
def connection_from_url(url, **kw): ...
|
||||
4
third_party/3/packages/urllib3/contrib/__init__.pyi
vendored
Normal file
4
third_party/3/packages/urllib3/contrib/__init__.pyi
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Stubs for requests.packages.urllib3.contrib (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
54
third_party/3/packages/urllib3/exceptions.pyi
vendored
Normal file
54
third_party/3/packages/urllib3/exceptions.pyi
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
# Stubs for requests.packages.urllib3.exceptions (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class HTTPError(Exception): ...
|
||||
class HTTPWarning(Warning): ...
|
||||
|
||||
class PoolError(HTTPError):
|
||||
pool = ... # type: Any
|
||||
def __init__(self, pool, message): ...
|
||||
def __reduce__(self): ...
|
||||
|
||||
class RequestError(PoolError):
|
||||
url = ... # type: Any
|
||||
def __init__(self, pool, url, message): ...
|
||||
def __reduce__(self): ...
|
||||
|
||||
class SSLError(HTTPError): ...
|
||||
class ProxyError(HTTPError): ...
|
||||
class DecodeError(HTTPError): ...
|
||||
class ProtocolError(HTTPError): ...
|
||||
|
||||
ConnectionError = ... # type: Any
|
||||
|
||||
class MaxRetryError(RequestError):
|
||||
reason = ... # type: Any
|
||||
def __init__(self, pool, url, reason=None): ...
|
||||
|
||||
class HostChangedError(RequestError):
|
||||
retries = ... # type: Any
|
||||
def __init__(self, pool, url, retries=3): ...
|
||||
|
||||
class TimeoutStateError(HTTPError): ...
|
||||
class TimeoutError(HTTPError): ...
|
||||
class ReadTimeoutError(TimeoutError, RequestError): ...
|
||||
class ConnectTimeoutError(TimeoutError): ...
|
||||
class EmptyPoolError(PoolError): ...
|
||||
class ClosedPoolError(PoolError): ...
|
||||
class LocationValueError(ValueError, HTTPError): ...
|
||||
|
||||
class LocationParseError(LocationValueError):
|
||||
location = ... # type: Any
|
||||
def __init__(self, location): ...
|
||||
|
||||
class ResponseError(HTTPError):
|
||||
GENERIC_ERROR = ... # type: Any
|
||||
SPECIFIC_ERROR = ... # type: Any
|
||||
|
||||
class SecurityWarning(HTTPWarning): ...
|
||||
class InsecureRequestWarning(SecurityWarning): ...
|
||||
class SystemTimeWarning(SecurityWarning): ...
|
||||
class InsecurePlatformWarning(SecurityWarning): ...
|
||||
16
third_party/3/packages/urllib3/fields.pyi
vendored
Normal file
16
third_party/3/packages/urllib3/fields.pyi
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Stubs for requests.packages.urllib3.fields (Python 3.4)
|
||||
|
||||
from typing import Any
|
||||
from . import packages
|
||||
|
||||
def guess_content_type(filename, default=''): ...
|
||||
def format_header_param(name, value): ...
|
||||
|
||||
class RequestField:
|
||||
data = ... # type: Any
|
||||
headers = ... # type: Any
|
||||
def __init__(self, name, data, filename=None, headers=None): ...
|
||||
@classmethod
|
||||
def from_tuples(cls, fieldname, value): ...
|
||||
def render_headers(self): ...
|
||||
def make_multipart(self, content_disposition=None, content_type=None, content_location=None): ...
|
||||
19
third_party/3/packages/urllib3/filepost.pyi
vendored
Normal file
19
third_party/3/packages/urllib3/filepost.pyi
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Stubs for requests.packages.urllib3.filepost (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from . import packages
|
||||
#from .packages import six
|
||||
from . import fields
|
||||
|
||||
#six = packages.six
|
||||
#b = six.b
|
||||
RequestField = fields.RequestField
|
||||
|
||||
writer = ... # type: Any
|
||||
|
||||
def choose_boundary(): ...
|
||||
def iter_field_objects(fields): ...
|
||||
def iter_fields(fields): ...
|
||||
def encode_multipart_formdata(fields, boundary=None): ...
|
||||
4
third_party/3/packages/urllib3/packages/__init__.pyi
vendored
Normal file
4
third_party/3/packages/urllib3/packages/__init__.pyi
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Stubs for requests.packages.urllib3.packages (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
8
third_party/3/packages/urllib3/packages/ssl_match_hostname/__init__.pyi
vendored
Normal file
8
third_party/3/packages/urllib3/packages/ssl_match_hostname/__init__.pyi
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Stubs for requests.packages.urllib3.packages.ssl_match_hostname (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
import ssl
|
||||
|
||||
CertificateError = ssl.CertificateError
|
||||
match_hostname = ssl.match_hostname
|
||||
7
third_party/3/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi
vendored
Normal file
7
third_party/3/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Stubs for requests.packages.urllib3.packages.ssl_match_hostname._implementation (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
class CertificateError(ValueError): ...
|
||||
|
||||
def match_hostname(cert, hostname): ...
|
||||
31
third_party/3/packages/urllib3/poolmanager.pyi
vendored
Normal file
31
third_party/3/packages/urllib3/poolmanager.pyi
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# Stubs for requests.packages.urllib3.poolmanager (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from .request import RequestMethods
|
||||
|
||||
class PoolManager(RequestMethods):
|
||||
proxy = ... # type: Any
|
||||
connection_pool_kw = ... # type: Any
|
||||
pools = ... # type: Any
|
||||
def __init__(self, num_pools=10, headers=None, **connection_pool_kw): ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc_type, exc_val, exc_tb): ...
|
||||
def clear(self): ...
|
||||
def connection_from_host(self, host, port=None, scheme=''): ...
|
||||
def connection_from_url(self, url): ...
|
||||
# TODO: This was the original signature -- copied another one from base class to fix complaint.
|
||||
# def urlopen(self, method, url, redirect=True, **kw): ...
|
||||
def urlopen(self, method, url, body=None, headers=None, encode_multipart=True, multipart_boundary=None, **kw): ...
|
||||
|
||||
class ProxyManager(PoolManager):
|
||||
proxy = ... # type: Any
|
||||
proxy_headers = ... # type: Any
|
||||
def __init__(self, proxy_url, num_pools=10, headers=None, proxy_headers=None, **connection_pool_kw): ...
|
||||
def connection_from_host(self, host, port=None, scheme=''): ...
|
||||
# TODO: This was the original signature -- copied another one from base class to fix complaint.
|
||||
# def urlopen(self, method, url, redirect=True, **kw): ...
|
||||
def urlopen(self, method, url, body=None, headers=None, encode_multipart=True, multipart_boundary=None, **kw): ...
|
||||
|
||||
def proxy_from_url(url, **kw): ...
|
||||
13
third_party/3/packages/urllib3/request.pyi
vendored
Normal file
13
third_party/3/packages/urllib3/request.pyi
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Stubs for requests.packages.urllib3.request (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class RequestMethods:
|
||||
headers = ... # type: Any
|
||||
def __init__(self, headers=None): ...
|
||||
def urlopen(self, method, url, body=None, headers=None, encode_multipart=True, multipart_boundary=None, **kw): ...
|
||||
def request(self, method, url, fields=None, headers=None, **urlopen_kw): ...
|
||||
def request_encode_url(self, method, url, fields=None, **urlopen_kw): ...
|
||||
def request_encode_body(self, method, url, fields=None, headers=None, encode_multipart=True, multipart_boundary=None, **urlopen_kw): ...
|
||||
60
third_party/3/packages/urllib3/response.pyi
vendored
Normal file
60
third_party/3/packages/urllib3/response.pyi
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
# Stubs for requests.packages.urllib3.response (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
import io
|
||||
from . import _collections
|
||||
from . import exceptions
|
||||
#from .packages import six
|
||||
from . import connection
|
||||
from .util import response
|
||||
|
||||
HTTPHeaderDict = _collections.HTTPHeaderDict
|
||||
ProtocolError = exceptions.ProtocolError
|
||||
DecodeError = exceptions.DecodeError
|
||||
ReadTimeoutError = exceptions.ReadTimeoutError
|
||||
binary_type = bytes # six.binary_type
|
||||
PY3 = True # six.PY3
|
||||
HTTPException = connection.HTTPException
|
||||
BaseSSLError = connection.BaseSSLError
|
||||
is_fp_closed = response.is_fp_closed
|
||||
|
||||
class DeflateDecoder:
|
||||
def __init__(self): ...
|
||||
def __getattr__(self, name): ...
|
||||
def decompress(self, data): ...
|
||||
|
||||
class GzipDecoder:
|
||||
def __init__(self): ...
|
||||
def __getattr__(self, name): ...
|
||||
def decompress(self, data): ...
|
||||
|
||||
class HTTPResponse(io.IOBase):
|
||||
CONTENT_DECODERS = ... # type: Any
|
||||
REDIRECT_STATUSES = ... # type: Any
|
||||
headers = ... # type: Any
|
||||
status = ... # type: Any
|
||||
version = ... # type: Any
|
||||
reason = ... # type: Any
|
||||
strict = ... # type: Any
|
||||
decode_content = ... # type: Any
|
||||
def __init__(self, body='', headers=None, status=0, version=0, reason=None, strict=0, preload_content=True, decode_content=True, original_response=None, pool=None, connection=None): ...
|
||||
def get_redirect_location(self): ...
|
||||
def release_conn(self): ...
|
||||
@property
|
||||
def data(self): ...
|
||||
def tell(self): ...
|
||||
def read(self, amt=None, decode_content=None, cache_content=False): ...
|
||||
def stream(self, amt=..., decode_content=None): ...
|
||||
@classmethod
|
||||
def from_httplib(ResponseCls, r, **response_kw): ...
|
||||
def getheaders(self): ...
|
||||
def getheader(self, name, default=None): ...
|
||||
def close(self): ...
|
||||
@property
|
||||
def closed(self): ...
|
||||
def fileno(self): ...
|
||||
def flush(self): ...
|
||||
def readable(self): ...
|
||||
def readinto(self, b): ...
|
||||
29
third_party/3/packages/urllib3/util/__init__.pyi
vendored
Normal file
29
third_party/3/packages/urllib3/util/__init__.pyi
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# Stubs for requests.packages.urllib3.util (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from . import connection
|
||||
from . import request
|
||||
from . import response
|
||||
from . import ssl_
|
||||
from . import timeout
|
||||
from . import retry
|
||||
from . import url
|
||||
import ssl
|
||||
|
||||
is_connection_dropped = connection.is_connection_dropped
|
||||
make_headers = request.make_headers
|
||||
is_fp_closed = response.is_fp_closed
|
||||
SSLContext = ssl.SSLContext
|
||||
HAS_SNI = ssl_.HAS_SNI
|
||||
assert_fingerprint = ssl_.assert_fingerprint
|
||||
resolve_cert_reqs = ssl_.resolve_cert_reqs
|
||||
resolve_ssl_version = ssl_.resolve_ssl_version
|
||||
ssl_wrap_socket = ssl_.ssl_wrap_socket
|
||||
current_time = timeout.current_time
|
||||
Timeout = timeout.Timeout
|
||||
Retry = retry.Retry
|
||||
get_host = url.get_host
|
||||
parse_url = url.parse_url
|
||||
split_first = url.split_first
|
||||
Url = url.Url
|
||||
11
third_party/3/packages/urllib3/util/connection.pyi
vendored
Normal file
11
third_party/3/packages/urllib3/util/connection.pyi
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Stubs for requests.packages.urllib3.util.connection (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
poll = ... # type: Any
|
||||
select = ... # type: Any
|
||||
|
||||
def is_connection_dropped(conn): ...
|
||||
def create_connection(address, timeout=..., source_address=None, socket_options=None): ...
|
||||
12
third_party/3/packages/urllib3/util/request.pyi
vendored
Normal file
12
third_party/3/packages/urllib3/util/request.pyi
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# Stubs for requests.packages.urllib3.util.request (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
#from ..packages import six
|
||||
|
||||
#b = six.b
|
||||
|
||||
ACCEPT_ENCODING = ... # type: Any
|
||||
|
||||
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None): ...
|
||||
5
third_party/3/packages/urllib3/util/response.pyi
vendored
Normal file
5
third_party/3/packages/urllib3/util/response.pyi
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Stubs for requests.packages.urllib3.util.response (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
def is_fp_closed(obj): ...
|
||||
36
third_party/3/packages/urllib3/util/retry.pyi
vendored
Normal file
36
third_party/3/packages/urllib3/util/retry.pyi
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Stubs for requests.packages.urllib3.util.retry (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from .. import exceptions
|
||||
from .. import packages
|
||||
|
||||
ConnectTimeoutError = exceptions.ConnectTimeoutError
|
||||
MaxRetryError = exceptions.MaxRetryError
|
||||
ProtocolError = exceptions.ProtocolError
|
||||
ReadTimeoutError = exceptions.ReadTimeoutError
|
||||
ResponseError = exceptions.ResponseError
|
||||
|
||||
log = ... # type: Any
|
||||
|
||||
class Retry:
|
||||
DEFAULT_METHOD_WHITELIST = ... # type: Any
|
||||
BACKOFF_MAX = ... # type: Any
|
||||
total = ... # type: Any
|
||||
connect = ... # type: Any
|
||||
read = ... # type: Any
|
||||
redirect = ... # type: Any
|
||||
status_forcelist = ... # type: Any
|
||||
method_whitelist = ... # type: Any
|
||||
backoff_factor = ... # type: Any
|
||||
raise_on_redirect = ... # type: Any
|
||||
def __init__(self, total=10, connect=None, read=None, redirect=None, method_whitelist=..., status_forcelist=None, backoff_factor=0, raise_on_redirect=True, _observed_errors=0): ...
|
||||
def new(self, **kw): ...
|
||||
@classmethod
|
||||
def from_int(cls, retries, redirect=True, default=None): ...
|
||||
def get_backoff_time(self): ...
|
||||
def sleep(self): ...
|
||||
def is_forced_retry(self, method, status_code): ...
|
||||
def is_exhausted(self): ...
|
||||
def increment(self, method=None, url=None, response=None, error=None, _pool=None, _stacktrace=None): ...
|
||||
24
third_party/3/packages/urllib3/util/ssl_.pyi
vendored
Normal file
24
third_party/3/packages/urllib3/util/ssl_.pyi
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Stubs for requests.packages.urllib3.util.ssl_ (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from .. import exceptions
|
||||
import ssl
|
||||
|
||||
SSLError = exceptions.SSLError
|
||||
InsecurePlatformWarning = exceptions.InsecurePlatformWarning
|
||||
SSLContext = ssl.SSLContext
|
||||
|
||||
HAS_SNI = ... # type: Any
|
||||
create_default_context = ... # type: Any
|
||||
OP_NO_SSLv2 = ... # type: Any
|
||||
OP_NO_SSLv3 = ... # type: Any
|
||||
OP_NO_COMPRESSION = ... # type: Any
|
||||
|
||||
def assert_fingerprint(cert, fingerprint): ...
|
||||
def resolve_cert_reqs(candidate): ...
|
||||
def resolve_ssl_version(candidate): ...
|
||||
def create_urllib3_context(ssl_version=None, cert_reqs=..., options=None, ciphers=None): ...
|
||||
def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None, ca_certs=None,
|
||||
server_hostname=None, ssl_version=None, ciphers=None, ssl_context=None): ...
|
||||
24
third_party/3/packages/urllib3/util/timeout.pyi
vendored
Normal file
24
third_party/3/packages/urllib3/util/timeout.pyi
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Stubs for requests.packages.urllib3.util.timeout (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from .. import exceptions
|
||||
|
||||
TimeoutStateError = exceptions.TimeoutStateError
|
||||
|
||||
def current_time(): ...
|
||||
|
||||
class Timeout:
|
||||
DEFAULT_TIMEOUT = ... # type: Any
|
||||
total = ... # type: Any
|
||||
def __init__(self, total=None, connect=..., read=...): ...
|
||||
@classmethod
|
||||
def from_float(cls, timeout): ...
|
||||
def clone(self): ...
|
||||
def start_connect(self): ...
|
||||
def get_connect_duration(self): ...
|
||||
@property
|
||||
def connect_timeout(self): ...
|
||||
@property
|
||||
def read_timeout(self): ...
|
||||
26
third_party/3/packages/urllib3/util/url.pyi
vendored
Normal file
26
third_party/3/packages/urllib3/util/url.pyi
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
# Stubs for requests.packages.urllib3.util.url (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from .. import exceptions
|
||||
|
||||
LocationParseError = exceptions.LocationParseError
|
||||
|
||||
url_attrs = ... # type: Any
|
||||
|
||||
class Url:
|
||||
slots = ... # type: Any
|
||||
def __new__(cls, scheme=None, auth=None, host=None, port=None, path=None, query=None, fragment=None): ...
|
||||
@property
|
||||
def hostname(self): ...
|
||||
@property
|
||||
def request_uri(self): ...
|
||||
@property
|
||||
def netloc(self): ...
|
||||
@property
|
||||
def url(self): ...
|
||||
|
||||
def split_first(s, delims): ...
|
||||
def parse_url(url): ...
|
||||
def get_host(url): ...
|
||||
92
third_party/3/sessions.pyi
vendored
Normal file
92
third_party/3/sessions.pyi
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
# Stubs for requests.sessions (Python 3)
|
||||
|
||||
from typing import Any, Union, MutableMapping
|
||||
from . import auth
|
||||
from . import compat
|
||||
from . import cookies
|
||||
from . import models
|
||||
from .models import Response
|
||||
from . import hooks
|
||||
from . import utils
|
||||
from . import exceptions
|
||||
from .packages.urllib3 import _collections
|
||||
from . import structures
|
||||
from . import adapters
|
||||
from . import status_codes
|
||||
|
||||
OrderedDict = compat.OrderedDict
|
||||
cookiejar_from_dict = cookies.cookiejar_from_dict
|
||||
extract_cookies_to_jar = cookies.extract_cookies_to_jar
|
||||
RequestsCookieJar = cookies.RequestsCookieJar
|
||||
merge_cookies = cookies.merge_cookies
|
||||
Request = models.Request
|
||||
PreparedRequest = models.PreparedRequest
|
||||
DEFAULT_REDIRECT_LIMIT = models.DEFAULT_REDIRECT_LIMIT
|
||||
default_hooks = hooks.default_hooks
|
||||
dispatch_hook = hooks.dispatch_hook
|
||||
to_key_val_list = utils.to_key_val_list
|
||||
default_headers = utils.default_headers
|
||||
to_native_string = utils.to_native_string
|
||||
TooManyRedirects = exceptions.TooManyRedirects
|
||||
InvalidSchema = exceptions.InvalidSchema
|
||||
ChunkedEncodingError = exceptions.ChunkedEncodingError
|
||||
ContentDecodingError = exceptions.ContentDecodingError
|
||||
RecentlyUsedContainer = _collections.RecentlyUsedContainer
|
||||
CaseInsensitiveDict = structures.CaseInsensitiveDict
|
||||
HTTPAdapter = adapters.HTTPAdapter
|
||||
requote_uri = utils.requote_uri
|
||||
get_environ_proxies = utils.get_environ_proxies
|
||||
get_netrc_auth = utils.get_netrc_auth
|
||||
should_bypass_proxies = utils.should_bypass_proxies
|
||||
get_auth_from_url = utils.get_auth_from_url
|
||||
codes = status_codes.codes
|
||||
REDIRECT_STATI = models.REDIRECT_STATI
|
||||
|
||||
REDIRECT_CACHE_SIZE = ... # type: Any
|
||||
|
||||
def merge_setting(request_setting, session_setting, dict_class=...): ...
|
||||
def merge_hooks(request_hooks, session_hooks, dict_class=...): ...
|
||||
|
||||
class SessionRedirectMixin:
|
||||
def resolve_redirects(self, resp, req, stream=False, timeout=None, verify=True, cert=None,
|
||||
proxies=None): ...
|
||||
def rebuild_auth(self, prepared_request, response): ...
|
||||
def rebuild_proxies(self, prepared_request, proxies): ...
|
||||
|
||||
class Session(SessionRedirectMixin):
|
||||
__attrs__ = ... # type: Any
|
||||
headers = ... # type: MutableMapping[str, str]
|
||||
auth = ... # type: Any
|
||||
proxies = ... # type: Any
|
||||
hooks = ... # type: Any
|
||||
params = ... # type: Any
|
||||
stream = ... # type: Any
|
||||
verify = ... # type: Any
|
||||
cert = ... # type: Any
|
||||
max_redirects = ... # type: Any
|
||||
trust_env = ... # type: Any
|
||||
cookies = ... # type: Any
|
||||
adapters = ... # type: Any
|
||||
redirect_cache = ... # type: Any
|
||||
def __init__(self) -> None: ...
|
||||
def __enter__(self) -> 'Session': ...
|
||||
def __exit__(self, *args) -> None: ...
|
||||
def prepare_request(self, request): ...
|
||||
def request(self, method: str, url: Union[str, bytes], params=None, data=None, headers=None,
|
||||
cookies=None, files=None, auth=None, timeout=None, allow_redirects=True,
|
||||
proxies=None, hooks=None, stream=None, verify=None, cert=None,
|
||||
json=None) -> Response: ...
|
||||
def get(self, url: Union[str, bytes], **kwargs) -> Response: ...
|
||||
def options(self, url: Union[str, bytes], **kwargs) -> Response: ...
|
||||
def head(self, url: Union[str, bytes], **kwargs) -> Response: ...
|
||||
def post(self, url: Union[str, bytes], data=None, json=None, **kwargs) -> Response: ...
|
||||
def put(self, url: Union[str, bytes], data=None, **kwargs) -> Response: ...
|
||||
def patch(self, url: Union[str, bytes], data=None, **kwargs) -> Response: ...
|
||||
def delete(self, url: Union[str, bytes], **kwargs) -> Response: ...
|
||||
def send(self, request, **kwargs): ...
|
||||
def merge_environment_settings(self, url, proxies, stream, verify, cert): ...
|
||||
def get_adapter(self, url): ...
|
||||
def close(self) -> None: ...
|
||||
def mount(self, prefix, adapter): ...
|
||||
|
||||
def session() -> Session: ...
|
||||
8
third_party/3/status_codes.pyi
vendored
Normal file
8
third_party/3/status_codes.pyi
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Stubs for requests.status_codes (Python 3)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from .structures import LookupDict
|
||||
|
||||
codes = ... # type: Any
|
||||
21
third_party/3/structures.pyi
vendored
Normal file
21
third_party/3/structures.pyi
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Stubs for requests.structures (Python 3)
|
||||
|
||||
from typing import Any
|
||||
import collections
|
||||
|
||||
class CaseInsensitiveDict(collections.MutableMapping):
|
||||
def __init__(self, data=None, **kwargs): ...
|
||||
def __setitem__(self, key, value): ...
|
||||
def __getitem__(self, key): ...
|
||||
def __delitem__(self, key): ...
|
||||
def __iter__(self): ...
|
||||
def __len__(self): ...
|
||||
def lower_items(self): ...
|
||||
def __eq__(self, other): ...
|
||||
def copy(self): ...
|
||||
|
||||
class LookupDict(dict):
|
||||
name = ... # type: Any
|
||||
def __init__(self, name=None): ...
|
||||
def __getitem__(self, key): ...
|
||||
def get(self, key, default=None): ...
|
||||
52
third_party/3/utils.pyi
vendored
Normal file
52
third_party/3/utils.pyi
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
# Stubs for requests.utils (Python 3)
|
||||
|
||||
from typing import Any
|
||||
from . import compat
|
||||
from . import cookies
|
||||
from . import structures
|
||||
from . import exceptions
|
||||
|
||||
OrderedDict = compat.OrderedDict
|
||||
RequestsCookieJar = cookies.RequestsCookieJar
|
||||
cookiejar_from_dict = cookies.cookiejar_from_dict
|
||||
CaseInsensitiveDict = structures.CaseInsensitiveDict
|
||||
InvalidURL = exceptions.InvalidURL
|
||||
|
||||
NETRC_FILES = ... # type: Any
|
||||
DEFAULT_CA_BUNDLE_PATH = ... # type: Any
|
||||
|
||||
def dict_to_sequence(d): ...
|
||||
def super_len(o): ...
|
||||
def get_netrc_auth(url): ...
|
||||
def guess_filename(obj): ...
|
||||
def from_key_val_list(value): ...
|
||||
def to_key_val_list(value): ...
|
||||
def parse_list_header(value): ...
|
||||
def parse_dict_header(value): ...
|
||||
def unquote_header_value(value, is_filename=False): ...
|
||||
def dict_from_cookiejar(cj): ...
|
||||
def add_dict_to_cookiejar(cj, cookie_dict): ...
|
||||
def get_encodings_from_content(content): ...
|
||||
def get_encoding_from_headers(headers): ...
|
||||
def stream_decode_response_unicode(iterator, r): ...
|
||||
def iter_slices(string, slice_length): ...
|
||||
def get_unicode_from_response(r): ...
|
||||
|
||||
UNRESERVED_SET = ... # type: Any
|
||||
|
||||
def unquote_unreserved(uri): ...
|
||||
def requote_uri(uri): ...
|
||||
def address_in_network(ip, net): ...
|
||||
def dotted_netmask(mask): ...
|
||||
def is_ipv4_address(string_ip): ...
|
||||
def is_valid_cidr(string_network): ...
|
||||
def should_bypass_proxies(url): ...
|
||||
def get_environ_proxies(url): ...
|
||||
def default_user_agent(name=''): ...
|
||||
def default_headers(): ...
|
||||
def parse_header_links(value): ...
|
||||
def guess_json_utf(data): ...
|
||||
def prepend_scheme_if_needed(url, new_scheme): ...
|
||||
def get_auth_from_url(url): ...
|
||||
def to_native_string(string, encoding=''): ...
|
||||
def urldefragauth(url): ...
|
||||
Reference in New Issue
Block a user