merge 2 and 3 stubs for requests (#1017)

* merge 2 and 3 stubs for requests

* fix version comparison
This commit is contained in:
Jelle Zijlstra
2017-03-18 16:39:40 -07:00
committed by Łukasz Langa
parent f35500caa8
commit 37a854630c
71 changed files with 1 additions and 1127 deletions

View File

@@ -1,39 +0,0 @@
# Stubs for requests (based on version 2.6.0, Python 3)
from typing import Any
from requests import models
from requests import api
from requests import sessions
from requests import status_codes
from requests import exceptions
import logging
__title__ = ... # type: Any
__build__ = ... # type: Any
__license__ = ... # type: Any
__copyright__ = ... # type: Any
__version__ = ... # 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): ...

View File

@@ -1,72 +0,0 @@
# Stubs for requests.adapters (Python 3)
from typing import Any, Container, Union, Tuple
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
PreparedRequest = models.PreparedRequest
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) -> None: ...
def send(self, request: PreparedRequest, stream=False,
timeout: Union[None, float, Tuple[float, float]]=None,
verify=False,
cert: Union[None, Union[str, unicode, bytes], Container[Union[str, unicode]]]=None) -> Response: ...
def close(self) -> None: ...
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=...): ...
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=..., stream=..., timeout=..., verify=..., cert=...,
proxies=...): ...

View File

@@ -1,26 +0,0 @@
# Stubs for requests.api (Python 2)
from typing import Union, Optional, Iterable, Mapping, Tuple
from .models import Response
_ParamsMappingValueType = Union[str, unicode, int, float, Iterable[Union[str, unicode, int, float]]]
def request(method: str, url: str, **kwargs) -> Response: ...
def get(url: Union[str, unicode],
params: Optional[
Union[Mapping[Union[str, unicode, int, float], _ParamsMappingValueType],
Union[str, unicode],
Tuple[Union[str, unicode, int, float], _ParamsMappingValueType],
Mapping[str, _ParamsMappingValueType],
Mapping[unicode, _ParamsMappingValueType],
Mapping[int, _ParamsMappingValueType],
Mapping[float, _ParamsMappingValueType]]] = None,
**kwargs) -> Response: ...
def options(url: Union[str, unicode], **kwargs) -> Response: ...
def head(url: Union[str, unicode], **kwargs) -> Response: ...
def post(url: Union[str, unicode], data=..., json=...,
**kwargs) -> Response: ...
def put(url: Union[str, unicode], data=..., **kwargs) -> Response: ...
def patch(url: Union[str, unicode], data=..., **kwargs) -> Response: ...
def delete(url: Union[str, unicode], **kwargs) -> Response: ...

View File

@@ -1,61 +0,0 @@
# Stubs for requests.cookies (Python 3)
from typing import Any, MutableMapping
import collections
from . import compat
class MockRequest:
type = ... # type: Any
def __init__(self, request) -> None: ...
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=...): ...
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) -> None: ...
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=..., path=...): ...
class CookieConflictError(RuntimeError): ...
class RequestsCookieJar(MutableMapping):
def get(self, name, default=..., domain=..., path=...): ...
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=..., path=...): ...
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=..., overwrite=...): ...
def merge_cookies(cookiejar, cookies): ...

View File

@@ -1,135 +0,0 @@
# 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
from typing import Optional, Union
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
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=..., url=..., headers=..., files=..., data=..., params=...,
auth=..., cookies=..., hooks=..., json=...): ...
def prepare(self): ...
class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
method = ... # type: Optional[Union[str, unicode]]
url = ... # type: Optional[Union[str, unicode]]
headers = ... # type: CaseInsensitiveDict
body = ... # type: Optional[Union[str, unicode]]
hooks = ... # type: Any
def __init__(self) -> None: ...
def prepare(self, method=..., url=..., headers=..., files=..., data=..., params=...,
auth=..., cookies=..., hooks=..., json=...): ...
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=...): ...
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[str]: ...
@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 = ...,
decode_unicode: bool = ...) -> Iterator[Any]: ...
def iter_lines(self, chunk_size=..., decode_unicode=..., delimiter=...): ...
@property
def content(self) -> str: ...
@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: ...

View File

@@ -1,12 +0,0 @@
# Stubs for requests.packages.urllib3 (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
import logging
class NullHandler(logging.Handler):
def emit(self, record): ...
def add_stderr_logger(level=...): ...
def disable_warnings(category=...): ...

View File

@@ -1,51 +0,0 @@
# Stubs for requests.packages.urllib3.connection (Python 3.4)
from typing import Any
from httplib import HTTPException
from . import packages
from . import exceptions
from . import util
class DummyConnection: ...
ConnectTimeoutError = exceptions.ConnectTimeoutError
SystemTimeWarning = exceptions.SystemTimeWarning
SecurityWarning = exceptions.SecurityWarning
port_by_scheme = ... # type: Any
RECENT_DATE = ... # type: Any
class HTTPConnection(object):
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) -> None: ...
def connect(self): ...
class HTTPSConnection(HTTPConnection):
default_port = ... # type: Any
key_file = ... # type: Any
cert_file = ... # type: Any
def __init__(self, host, port=..., key_file=..., cert_file=..., strict=..., timeout=..., **kw) -> None: ...
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=..., cert_file=..., cert_reqs=..., ca_certs=..., assert_hostname=..., assert_fingerprint=...): ...
sock = ... # type: Any
auto_open = ... # type: Any
is_verified = ... # type: Any
def connect(self): ...
UnverifiedHTTPSConnection = ... # type: Any
class ConnectionError(Exception): ...

View File

@@ -1,87 +0,0 @@
# Stubs for requests.packages.urllib3.connectionpool (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
from ssl import SSLError as BaseSSLError
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
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=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., **conn_kw) -> None: ...
def close(self): ...
def is_same_host(self, url): ...
def urlopen(self, method, url, body=..., headers=..., retries=..., redirect=..., assert_same_host=..., timeout=..., pool_timeout=..., release_conn=..., **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=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., key_file=..., cert_file=..., cert_reqs=..., ca_certs=..., ssl_version=..., assert_hostname=..., assert_fingerprint=..., **conn_kw) -> None: ...
def connection_from_url(url, **kw): ...

View File

@@ -1 +0,0 @@
class CertificateError(ValueError): ...

View File

@@ -1,58 +0,0 @@
# Stubs for requests.packages.urllib3.response (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, IO
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 = str # six.binary_type
PY3 = True # six.PY3
is_fp_closed = response.is_fp_closed
class DeflateDecoder:
def __init__(self) -> None: ...
def __getattr__(self, name): ...
def decompress(self, data): ...
class GzipDecoder:
def __init__(self) -> None: ...
def __getattr__(self, name): ...
def decompress(self, data): ...
class HTTPResponse(IO[Any]):
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=..., status=..., version=..., reason=..., strict=..., preload_content=..., decode_content=..., original_response=..., pool=..., connection=...) -> None: ...
def get_redirect_location(self): ...
def release_conn(self): ...
@property
def data(self): ...
def tell(self): ...
def read(self, amt=..., decode_content=..., cache_content=...): ...
def stream(self, amt=..., decode_content=...): ...
@classmethod
def from_httplib(ResponseCls, r, **response_kw): ...
def getheaders(self): ...
def getheader(self, name, default=...): ...
def close(self): ...
@property
def closed(self): ...
def fileno(self): ...
def flush(self): ...
def readable(self): ...
def readinto(self, b): ...

View File

@@ -1,6 +0,0 @@
# 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

View File

@@ -1,106 +0,0 @@
# Stubs for requests.sessions (Python 2.7)
from typing import Any, Union, MutableMapping, Text, Optional, IO, Tuple, Callable
from . import adapters
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
BaseAdapter = adapters.BaseAdapter
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=..., timeout=..., verify=..., cert=...,
proxies=...): ...
def rebuild_auth(self, prepared_request, response): ...
def rebuild_proxies(self, prepared_request, proxies): ...
class Session(SessionRedirectMixin):
__attrs__ = ... # type: Any
headers = ... # type: Optional[MutableMapping[Text, Text]]
auth = ... # type: Union[None, Tuple[Text, Text], Callable[[Request], Request]]
proxies = ... # type: Optional[MutableMapping[Text, Text]]
hooks = ... # type: Optional[MutableMapping[Text, Callable[[Request], Any]]]
params = ... # type: Union[None, bytes, MutableMapping[Text, Text]]
stream = ... # type: bool
verify = ... # type: bool
cert = ... # type: Union[None, Text, Tuple[Text, Text]]
max_redirects = ... # type: int
trust_env = ... # type: bool
cookies = ... # type: Union[None, RequestsCookieJar, MutableMapping[Text, Text]]
adapters = ... # type: MutableMapping
redirect_cache = ... # type: RecentlyUsedContainer
def __init__(self) -> None: ...
def __enter__(self) -> 'Session': ...
def __exit__(self, *args) -> None: ...
def prepare_request(self, request): ...
def request(self, method: str, url: str,
params, # type: Union[None, bytes, MutableMapping[Text, Text]]
data, # type: Union[None, bytes, MutableMapping[Text, Text], IO]
headers, # type: Optional[MutableMapping[Text, Text]]
cookies, # type: Union[None, RequestsCookieJar, MutableMapping[Text, Text]]
files, # type: Optional[MutableMapping[Text, IO]]
auth, # type: Union[None, Tuple[Text, Text], Callable[[Request], Request]]
timeout, # type: Union[None, float, Tuple[float, float]]
allow_redirects, # type: Optional[bool]
proxies, # type: Optional[MutableMapping[Text, Text]]
hooks, # type: Optional[MutableMapping[Text, Callable[[Request], Any]]]
stream, # type: Optional[bool]
verify, # type: Optional[bool]
cert, # type: Union[Text, Tuple[Text, Text], None]
json # type: Optional[MutableMapping]
) -> Response: ...
def get(self, url: str, **kwargs) -> Response: ...
def options(self, url: str, **kwargs) -> Response: ...
def head(self, url: str, **kwargs) -> Response: ...
def post(self, url: str, data=..., json=..., **kwargs) -> Response: ...
def put(self, url: str, data=..., **kwargs) -> Response: ...
def patch(self, url: str, data=..., **kwargs) -> Response: ...
def delete(self, url: str, **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: str, adapter: BaseAdapter) -> None: ...
def session() -> Session: ...

View File

@@ -1,12 +0,0 @@
# Stubs for requests.structures (Python 3)
from typing import Any, Iterator, MutableMapping, Tuple, Union
class CaseInsensitiveDict(MutableMapping[str, Union[str, unicode]]):
def lower_items(self) -> Iterator[Tuple[str, Union[str, unicode]]]: ...
class LookupDict(dict):
name = ... # type: Any
def __init__(self, name=...) -> None: ...
def __getitem__(self, key): ...
def get(self, key, default=...): ...

View File

@@ -9,7 +9,7 @@ from .packages import ssl_match_hostname
from .util import ssl_
from . import util
if sys.version_info <= (3, 0):
if sys.version_info < (3, 0):
from httplib import HTTPConnection as _HTTPConnection
from httplib import HTTPException as HTTPException

View File

@@ -1,41 +0,0 @@
# 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) -> None: ...
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) -> None: ...
def build_digest_header(self, method, url): ...
def handle_redirect(self, r, **kwargs): ...
def handle_401(self, r, **kwargs): ...
def __call__(self, r): ...

View File

@@ -1,6 +0,0 @@
# Stubs for requests.compat (Python 3.4)
from typing import Any
import collections
OrderedDict = collections.OrderedDict

View File

@@ -1,26 +0,0 @@
# 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) -> None: ...
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): ...

View File

@@ -1,8 +0,0 @@
# Stubs for requests.hooks (Python 3)
from typing import Any
HOOKS = ... # type: Any
def default_hooks(): ...
def dispatch_hook(key, hooks, hook_data, **kwargs): ...

View File

@@ -1,8 +0,0 @@
# Stubs for requests.packages (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
class VendorAlias:
def __init__(self, package_names) -> None: ...
def find_module(self, fullname, path=...): ...
def load_module(self, name): ...

View File

@@ -1,51 +0,0 @@
# 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=..., 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=..., **kwargs) -> None: ...
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=...): ...

View File

@@ -1,3 +0,0 @@
# Stubs for requests.packages.urllib3.contrib (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -1,54 +0,0 @@
# 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) -> None: ...
def __reduce__(self): ...
class RequestError(PoolError):
url = ... # type: Any
def __init__(self, pool, url, message) -> None: ...
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=...) -> None: ...
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) -> None: ...
class ResponseError(HTTPError):
GENERIC_ERROR = ... # type: Any
SPECIFIC_ERROR = ... # type: Any
class SecurityWarning(HTTPWarning): ...
class InsecureRequestWarning(SecurityWarning): ...
class SystemTimeWarning(SecurityWarning): ...
class InsecurePlatformWarning(SecurityWarning): ...

View File

@@ -1,16 +0,0 @@
# 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=..., headers=...) -> None: ...
@classmethod
def from_tuples(cls, fieldname, value): ...
def render_headers(self): ...
def make_multipart(self, content_disposition=..., content_type=..., content_location=...): ...

View File

@@ -1,19 +0,0 @@
# 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=...): ...

View File

@@ -1,3 +0,0 @@
# Stubs for requests.packages.urllib3.packages (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

View File

@@ -1,7 +0,0 @@
# 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): ...

View File

@@ -1,31 +0,0 @@
# 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=..., headers=..., **connection_pool_kw) -> None: ...
def __enter__(self): ...
def __exit__(self, exc_type, exc_val, exc_tb): ...
def clear(self): ...
def connection_from_host(self, host, port=..., 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=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ...
class ProxyManager(PoolManager):
proxy = ... # type: Any
proxy_headers = ... # type: Any
def __init__(self, proxy_url, num_pools=..., headers=..., proxy_headers=..., **connection_pool_kw) -> None: ...
def connection_from_host(self, host, port=..., 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=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ...
def proxy_from_url(url, **kw): ...

View File

@@ -1,13 +0,0 @@
# 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=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ...
def request(self, method, url, fields=..., headers=..., **urlopen_kw): ...
def request_encode_url(self, method, url, fields=..., **urlopen_kw): ...
def request_encode_body(self, method, url, fields=..., headers=..., encode_multipart=..., multipart_boundary=..., **urlopen_kw): ...

View File

@@ -1,11 +0,0 @@
# 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=..., socket_options=...): ...

View File

@@ -1,12 +0,0 @@
# 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=..., accept_encoding=..., user_agent=..., basic_auth=..., proxy_basic_auth=..., disable_cache=...): ...

View File

@@ -1,5 +0,0 @@
# 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): ...

View File

@@ -1,36 +0,0 @@
# 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=..., connect=..., read=..., redirect=..., method_whitelist=..., status_forcelist=..., backoff_factor=..., raise_on_redirect=..., _observed_errors=...) -> None: ...
def new(self, **kw): ...
@classmethod
def from_int(cls, retries, redirect=..., default=...): ...
def get_backoff_time(self): ...
def sleep(self): ...
def is_forced_retry(self, method, status_code): ...
def is_exhausted(self): ...
def increment(self, method=..., url=..., response=..., error=..., _pool=..., _stacktrace=...): ...

View File

@@ -1,24 +0,0 @@
# 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=..., connect=..., read=...) -> None: ...
@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): ...

View File

@@ -1,26 +0,0 @@
# 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=..., auth=..., host=..., port=..., path=..., query=..., fragment=...): ...
@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): ...

View File

@@ -1,8 +0,0 @@
# 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

View File

@@ -1,52 +0,0 @@
# 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=...): ...
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): ...