Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
PK!8'w'w sessions.pynu[""" requests.sessions ~~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os import sys import time from collections import OrderedDict from datetime import timedelta from ._internal_utils import to_native_string from .adapters import HTTPAdapter from .auth import _basic_auth_str from .compat import Mapping, cookielib, urljoin, urlparse from .cookies import ( RequestsCookieJar, cookiejar_from_dict, extract_cookies_to_jar, merge_cookies, ) from .exceptions import ( ChunkedEncodingError, ContentDecodingError, InvalidSchema, TooManyRedirects, ) from .hooks import default_hooks, dispatch_hook # formerly defined here, reexposed here for backward compatibility from .models import ( # noqa: F401 DEFAULT_REDIRECT_LIMIT, REDIRECT_STATI, PreparedRequest, Request, ) from .status_codes import codes from .structures import CaseInsensitiveDict from .utils import ( # noqa: F401 DEFAULT_PORTS, default_headers, get_auth_from_url, get_environ_proxies, get_netrc_auth, requote_uri, resolve_proxies, rewind_body, should_bypass_proxies, to_key_val_list, ) # Preferred clock, based on which one is more accurate on a given system. if sys.platform == "win32": preferred_clock = time.perf_counter else: preferred_clock = time.time def merge_setting(request_setting, session_setting, dict_class=OrderedDict): """Determines appropriate setting for a given request, taking into account the explicit setting on that request, and the setting in the session. If a setting is a dictionary, they will be merged together using `dict_class` """ if session_setting is None: return request_setting if request_setting is None: return session_setting # Bypass if not a dictionary (e.g. verify) if not ( isinstance(session_setting, Mapping) and isinstance(request_setting, Mapping) ): return request_setting merged_setting = dict_class(to_key_val_list(session_setting)) merged_setting.update(to_key_val_list(request_setting)) # Remove keys that are set to None. Extract keys first to avoid altering # the dictionary during iteration. none_keys = [k for (k, v) in merged_setting.items() if v is None] for key in none_keys: del merged_setting[key] return merged_setting def merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict): """Properly merges both requests and session hooks. This is necessary because when request_hooks == {'response': []}, the merge breaks Session hooks entirely. """ if session_hooks is None or session_hooks.get("response") == []: return request_hooks if request_hooks is None or request_hooks.get("response") == []: return session_hooks return merge_setting(request_hooks, session_hooks, dict_class) class SessionRedirectMixin: def get_redirect_target(self, resp): """Receives a Response. Returns a redirect URI or ``None``""" # Due to the nature of how requests processes redirects this method will # be called at least once upon the original response and at least twice # on each subsequent redirect response (if any). # If a custom mixin is used to handle this logic, it may be advantageous # to cache the redirect location onto the response object as a private # attribute. if resp.is_redirect: location = resp.headers["location"] # Currently the underlying http module on py3 decode headers # in latin1, but empirical evidence suggests that latin1 is very # rarely used with non-ASCII characters in HTTP headers. # It is more likely to get UTF8 header rather than latin1. # This causes incorrect handling of UTF8 encoded location headers. # To solve this, we re-encode the location in latin1. location = location.encode("latin1") return to_native_string(location, "utf8") return None def should_strip_auth(self, old_url, new_url): """Decide whether Authorization header should be removed when redirecting""" old_parsed = urlparse(old_url) new_parsed = urlparse(new_url) if old_parsed.hostname != new_parsed.hostname: return True # Special case: allow http -> https redirect when using the standard # ports. This isn't specified by RFC 7235, but is kept to avoid # breaking backwards compatibility with older versions of requests # that allowed any redirects on the same host. if ( old_parsed.scheme == "http" and old_parsed.port in (80, None) and new_parsed.scheme == "https" and new_parsed.port in (443, None) ): return False # Handle default port usage corresponding to scheme. changed_port = old_parsed.port != new_parsed.port changed_scheme = old_parsed.scheme != new_parsed.scheme default_port = (DEFAULT_PORTS.get(old_parsed.scheme, None), None) if ( not changed_scheme and old_parsed.port in default_port and new_parsed.port in default_port ): return False # Standard case: root URI must match return changed_port or changed_scheme def resolve_redirects( self, resp, req, stream=False, timeout=None, verify=True, cert=None, proxies=None, yield_requests=False, **adapter_kwargs, ): """Receives a Response. Returns a generator of Responses or Requests.""" hist = [] # keep track of history url = self.get_redirect_target(resp) previous_fragment = urlparse(req.url).fragment while url: prepared_request = req.copy() # Update history and keep track of redirects. # resp.history must ignore the original request in this loop hist.append(resp) resp.history = hist[1:] try: resp.content # Consume socket so it can be released except (ChunkedEncodingError, ContentDecodingError, RuntimeError): resp.raw.read(decode_content=False) if len(resp.history) >= self.max_redirects: raise TooManyRedirects( f"Exceeded {self.max_redirects} redirects.", response=resp ) # Release the connection back into the pool. resp.close() # Handle redirection without scheme (see: RFC 1808 Section 4) if url.startswith("//"): parsed_rurl = urlparse(resp.url) url = ":".join([to_native_string(parsed_rurl.scheme), url]) # Normalize url case and attach previous fragment if needed (RFC 7231 7.1.2) parsed = urlparse(url) if parsed.fragment == "" and previous_fragment: parsed = parsed._replace(fragment=previous_fragment) elif parsed.fragment: previous_fragment = parsed.fragment url = parsed.geturl() # Facilitate relative 'location' headers, as allowed by RFC 7231. # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource') # Compliant with RFC3986, we percent encode the url. if not parsed.netloc: url = urljoin(resp.url, requote_uri(url)) else: url = requote_uri(url) prepared_request.url = to_native_string(url) self.rebuild_method(prepared_request, resp) # https://github.com/psf/requests/issues/1084 if resp.status_code not in ( codes.temporary_redirect, codes.permanent_redirect, ): # https://github.com/psf/requests/issues/3490 purged_headers = ("Content-Length", "Content-Type", "Transfer-Encoding") for header in purged_headers: prepared_request.headers.pop(header, None) prepared_request.body = None headers = prepared_request.headers headers.pop("Cookie", None) # Extract any cookies sent on the response to the cookiejar # in the new request. Because we've mutated our copied prepared # request, use the old one that we haven't yet touched. extract_cookies_to_jar(prepared_request._cookies, req, resp.raw) merge_cookies(prepared_request._cookies, self.cookies) prepared_request.prepare_cookies(prepared_request._cookies) # Rebuild auth and proxy information. proxies = self.rebuild_proxies(prepared_request, proxies) self.rebuild_auth(prepared_request, resp) # A failed tell() sets `_body_position` to `object()`. This non-None # value ensures `rewindable` will be True, allowing us to raise an # UnrewindableBodyError, instead of hanging the connection. rewindable = prepared_request._body_position is not None and ( "Content-Length" in headers or "Transfer-Encoding" in headers ) # Attempt to rewind consumed file-like object. if rewindable: rewind_body(prepared_request) # Override the original request. req = prepared_request if yield_requests: yield req else: resp = self.send( req, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, allow_redirects=False, **adapter_kwargs, ) extract_cookies_to_jar(self.cookies, prepared_request, resp.raw) # extract redirect url, if any, for the next loop url = self.get_redirect_target(resp) yield resp def rebuild_auth(self, prepared_request, response): """When being redirected we may want to strip authentication from the request to avoid leaking credentials. This method intelligently removes and reapplies authentication where possible to avoid credential loss. """ headers = prepared_request.headers url = prepared_request.url if "Authorization" in headers and self.should_strip_auth( response.request.url, url ): # If we get redirected to a new host, we should strip out any # authentication headers. del headers["Authorization"] # .netrc might have more auth for us on our new host. new_auth = get_netrc_auth(url) if self.trust_env else None if new_auth is not None: prepared_request.prepare_auth(new_auth) def rebuild_proxies(self, prepared_request, proxies): """This method re-evaluates the proxy configuration by considering the environment variables. If we are redirected to a URL covered by NO_PROXY, we strip the proxy configuration. Otherwise, we set missing proxy keys for this URL (in case they were stripped by a previous redirect). This method also replaces the Proxy-Authorization header where necessary. :rtype: dict """ headers = prepared_request.headers scheme = urlparse(prepared_request.url).scheme new_proxies = resolve_proxies(prepared_request, proxies, self.trust_env) if "Proxy-Authorization" in headers: del headers["Proxy-Authorization"] try: username, password = get_auth_from_url(new_proxies[scheme]) except KeyError: username, password = None, None # urllib3 handles proxy authorization for us in the standard adapter. # Avoid appending this to TLS tunneled requests where it may be leaked. if not scheme.startswith("https") and username and password: headers["Proxy-Authorization"] = _basic_auth_str(username, password) return new_proxies def rebuild_method(self, prepared_request, response): """When being redirected we may want to change the method of the request based on certain specs or browser behavior. """ method = prepared_request.method # https://tools.ietf.org/html/rfc7231#section-6.4.4 if response.status_code == codes.see_other and method != "HEAD": method = "GET" # Do what the browsers do, despite standards... # First, turn 302s into GETs. if response.status_code == codes.found and method != "HEAD": method = "GET" # Second, if a POST is responded to with a 301, turn it into a GET. # This bizarre behaviour is explained in Issue 1704. if response.status_code == codes.moved and method == "POST": method = "GET" prepared_request.method = method class Session(SessionRedirectMixin): """A Requests session. Provides cookie persistence, connection-pooling, and configuration. Basic Usage:: >>> import requests >>> s = requests.Session() >>> s.get('https://httpbin.org/get') Or as a context manager:: >>> with requests.Session() as s: ... s.get('https://httpbin.org/get') """ __attrs__ = [ "headers", "cookies", "auth", "proxies", "hooks", "params", "verify", "cert", "adapters", "stream", "trust_env", "max_redirects", ] def __init__(self): #: A case-insensitive dictionary of headers to be sent on each #: :class:`Request ` sent from this #: :class:`Session `. self.headers = default_headers() #: Default Authentication tuple or object to attach to #: :class:`Request `. self.auth = None #: Dictionary mapping protocol or protocol and host to the URL of the proxy #: (e.g. {'http': 'foo.bar:3128', 'http://host.name': 'foo.bar:4012'}) to #: be used on each :class:`Request `. self.proxies = {} #: Event-handling hooks. self.hooks = default_hooks() #: Dictionary of querystring data to attach to each #: :class:`Request `. The dictionary values may be lists for #: representing multivalued query parameters. self.params = {} #: Stream response content default. self.stream = False #: SSL Verification default. #: Defaults to `True`, requiring requests to verify the TLS certificate at the #: remote end. #: If verify is set to `False`, requests will accept any TLS certificate #: presented by the server, and will ignore hostname mismatches and/or #: expired certificates, which will make your application vulnerable to #: man-in-the-middle (MitM) attacks. #: Only set this to `False` for testing. self.verify = True #: SSL client certificate default, if String, path to ssl client #: cert file (.pem). If Tuple, ('cert', 'key') pair. self.cert = None #: Maximum number of redirects allowed. If the request exceeds this #: limit, a :class:`TooManyRedirects` exception is raised. #: This defaults to requests.models.DEFAULT_REDIRECT_LIMIT, which is #: 30. self.max_redirects = DEFAULT_REDIRECT_LIMIT #: Trust environment settings for proxy configuration, default #: authentication and similar. self.trust_env = True #: A CookieJar containing all currently outstanding cookies set on this #: session. By default it is a #: :class:`RequestsCookieJar `, but #: may be any other ``cookielib.CookieJar`` compatible object. self.cookies = cookiejar_from_dict({}) # Default connection adapters. self.adapters = OrderedDict() self.mount("https://", HTTPAdapter()) self.mount("http://", HTTPAdapter()) def __enter__(self): return self def __exit__(self, *args): self.close() def prepare_request(self, request): """Constructs a :class:`PreparedRequest ` for transmission and returns it. The :class:`PreparedRequest` has settings merged from the :class:`Request ` instance and those of the :class:`Session`. :param request: :class:`Request` instance to prepare with this session's settings. :rtype: requests.PreparedRequest """ cookies = request.cookies or {} # Bootstrap CookieJar. if not isinstance(cookies, cookielib.CookieJar): cookies = cookiejar_from_dict(cookies) # Merge with session cookies merged_cookies = merge_cookies( merge_cookies(RequestsCookieJar(), self.cookies), cookies ) # Set environment's basic authentication if not explicitly set. auth = request.auth if self.trust_env and not auth and not self.auth: auth = get_netrc_auth(request.url) p = PreparedRequest() p.prepare( method=request.method.upper(), url=request.url, files=request.files, data=request.data, json=request.json, headers=merge_setting( request.headers, self.headers, dict_class=CaseInsensitiveDict ), params=merge_setting(request.params, self.params), auth=merge_setting(auth, self.auth), cookies=merged_cookies, hooks=merge_hooks(request.hooks, self.hooks), ) return p def request( self, method, url, 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, ): """Constructs a :class:`Request `, prepares it and sends it. Returns :class:`Response ` object. :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'filename': file-like-objects`` for multipart encoding upload. :param auth: (optional) Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How many seconds to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Set to True by default. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol or protocol and hostname to the URL of the proxy. :param hooks: (optional) Dictionary mapping hook name to one event or list of events, event must be callable. :param stream: (optional) whether to immediately download the response content. Defaults to ``False``. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. When set to ``False``, requests will accept any TLS certificate presented by the server, and will ignore hostname mismatches and/or expired certificates, which will make your application vulnerable to man-in-the-middle (MitM) attacks. Setting verify to ``False`` may be useful during local development or testing. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :rtype: requests.Response """ # Create the Request. req = Request( method=method.upper(), url=url, headers=headers, files=files, data=data or {}, json=json, params=params or {}, auth=auth, cookies=cookies, hooks=hooks, ) prep = self.prepare_request(req) proxies = proxies or {} settings = self.merge_environment_settings( prep.url, proxies, stream, verify, cert ) # Send the request. send_kwargs = { "timeout": timeout, "allow_redirects": allow_redirects, } send_kwargs.update(settings) resp = self.send(prep, **send_kwargs) return resp def get(self, url, **kwargs): r"""Sends a GET request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ kwargs.setdefault("allow_redirects", True) return self.request("GET", url, **kwargs) def options(self, url, **kwargs): r"""Sends a OPTIONS request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ kwargs.setdefault("allow_redirects", True) return self.request("OPTIONS", url, **kwargs) def head(self, url, **kwargs): r"""Sends a HEAD request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ kwargs.setdefault("allow_redirects", False) return self.request("HEAD", url, **kwargs) def post(self, url, data=None, json=None, **kwargs): r"""Sends a POST request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ return self.request("POST", url, data=data, json=json, **kwargs) def put(self, url, data=None, **kwargs): r"""Sends a PUT request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ return self.request("PUT", url, data=data, **kwargs) def patch(self, url, data=None, **kwargs): r"""Sends a PATCH request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ return self.request("PATCH", url, data=data, **kwargs) def delete(self, url, **kwargs): r"""Sends a DELETE request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ return self.request("DELETE", url, **kwargs) def send(self, request, **kwargs): """Send a given PreparedRequest. :rtype: requests.Response """ # Set defaults that the hooks can utilize to ensure they always have # the correct parameters to reproduce the previous request. kwargs.setdefault("stream", self.stream) kwargs.setdefault("verify", self.verify) kwargs.setdefault("cert", self.cert) if "proxies" not in kwargs: kwargs["proxies"] = resolve_proxies(request, self.proxies, self.trust_env) # It's possible that users might accidentally send a Request object. # Guard against that specific failure case. if isinstance(request, Request): raise ValueError("You can only send PreparedRequests.") # Set up variables needed for resolve_redirects and dispatching of hooks allow_redirects = kwargs.pop("allow_redirects", True) stream = kwargs.get("stream") hooks = request.hooks # Get the appropriate adapter to use adapter = self.get_adapter(url=request.url) # Start time (approximately) of the request start = preferred_clock() # Send the request r = adapter.send(request, **kwargs) # Total elapsed time of the request (approximately) elapsed = preferred_clock() - start r.elapsed = timedelta(seconds=elapsed) # Response manipulation hooks r = dispatch_hook("response", hooks, r, **kwargs) # Persist cookies if r.history: # If the hooks create history then we want those cookies too for resp in r.history: extract_cookies_to_jar(self.cookies, resp.request, resp.raw) extract_cookies_to_jar(self.cookies, request, r.raw) # Resolve redirects if allowed. if allow_redirects: # Redirect resolving generator. gen = self.resolve_redirects(r, request, **kwargs) history = [resp for resp in gen] else: history = [] # Shuffle things around if there's history. if history: # Insert the first (original) request at the start history.insert(0, r) # Get the last request made r = history.pop() r.history = history # If redirects aren't being followed, store the response on the Request for Response.next(). if not allow_redirects: try: r._next = next( self.resolve_redirects(r, request, yield_requests=True, **kwargs) ) except StopIteration: pass if not stream: r.content return r def merge_environment_settings(self, url, proxies, stream, verify, cert): """ Check the environment and merge it with some settings. :rtype: dict """ # Gather clues from the surrounding environment. if self.trust_env: # Set environment's proxies. no_proxy = proxies.get("no_proxy") if proxies is not None else None env_proxies = get_environ_proxies(url, no_proxy=no_proxy) for k, v in env_proxies.items(): proxies.setdefault(k, v) # Look for requests environment configuration # and be compatible with cURL. if verify is True or verify is None: verify = ( os.environ.get("REQUESTS_CA_BUNDLE") or os.environ.get("CURL_CA_BUNDLE") or verify ) # Merge all the kwargs. proxies = merge_setting(proxies, self.proxies) stream = merge_setting(stream, self.stream) verify = merge_setting(verify, self.verify) cert = merge_setting(cert, self.cert) return {"proxies": proxies, "stream": stream, "verify": verify, "cert": cert} def get_adapter(self, url): """ Returns the appropriate connection adapter for the given URL. :rtype: requests.adapters.BaseAdapter """ for prefix, adapter in self.adapters.items(): if url.lower().startswith(prefix.lower()): return adapter # Nothing matches :-/ raise InvalidSchema(f"No connection adapters were found for {url!r}") def close(self): """Closes all adapters and as such the session""" for v in self.adapters.values(): v.close() def mount(self, prefix, adapter): """Registers a connection adapter to a prefix. Adapters are sorted in descending order by prefix length. """ self.adapters[prefix] = adapter keys_to_move = [k for k in self.adapters if len(k) < len(prefix)] for key in keys_to_move: self.adapters[key] = self.adapters.pop(key) def __getstate__(self): state = {attr: getattr(self, attr, None) for attr in self.__attrs__} return state def __setstate__(self, state): for attr, value in state.items(): setattr(self, attr, value) def session(): """ Returns a :class:`Session` for context-management. .. deprecated:: 1.0.0 This method has been deprecated since version 1.0.0 and is only kept for backwards compatibility. New code should use :class:`~requests.sessions.Session` to create a session. This may be removed at a future date. :rtype: Session """ return Session() PK!è models.pynu[""" requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import datetime # Import encoding now, to avoid implicit import later. # Implicit import within threads may cause LookupError when standard library is in a ZIP, # such as in Embedded Python. See https://github.com/psf/requests/issues/3578. import encodings.idna # noqa: F401 from io import UnsupportedOperation from pip._vendor.urllib3.exceptions import ( DecodeError, LocationParseError, ProtocolError, ReadTimeoutError, SSLError, ) from pip._vendor.urllib3.fields import RequestField from pip._vendor.urllib3.filepost import encode_multipart_formdata from pip._vendor.urllib3.util import parse_url from ._internal_utils import to_native_string, unicode_is_ascii from .auth import HTTPBasicAuth from .compat import ( Callable, JSONDecodeError, Mapping, basestring, builtin_str, chardet, cookielib, ) from .compat import json as complexjson from .compat import urlencode, urlsplit, urlunparse from .cookies import _copy_cookie_jar, cookiejar_from_dict, get_cookie_header from .exceptions import ( ChunkedEncodingError, ConnectionError, ContentDecodingError, HTTPError, InvalidJSONError, InvalidURL, ) from .exceptions import JSONDecodeError as RequestsJSONDecodeError from .exceptions import MissingSchema from .exceptions import SSLError as RequestsSSLError from .exceptions import StreamConsumedError from .hooks import default_hooks from .status_codes import codes from .structures import CaseInsensitiveDict from .utils import ( check_header_validity, get_auth_from_url, guess_filename, guess_json_utf, iter_slices, parse_header_links, requote_uri, stream_decode_response_unicode, super_len, to_key_val_list, ) #: The set of HTTP status codes that indicate an automatically #: processable redirect. REDIRECT_STATI = ( codes.moved, # 301 codes.found, # 302 codes.other, # 303 codes.temporary_redirect, # 307 codes.permanent_redirect, # 308 ) DEFAULT_REDIRECT_LIMIT = 30 CONTENT_CHUNK_SIZE = 10 * 1024 ITER_CHUNK_SIZE = 512 class RequestEncodingMixin: @property def path_url(self): """Build the path URL to use.""" url = [] p = urlsplit(self.url) path = p.path if not path: path = "/" url.append(path) query = p.query if query: url.append("?") url.append(query) return "".join(url) @staticmethod def _encode_params(data): """Encode parameters in a piece of data. Will successfully encode parameters when passed as a dict or a list of 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary if parameters are supplied as a dict. """ if isinstance(data, (str, bytes)): return data elif hasattr(data, "read"): return data elif hasattr(data, "__iter__"): result = [] for k, vs in to_key_val_list(data): if isinstance(vs, basestring) or not hasattr(vs, "__iter__"): vs = [vs] for v in vs: if v is not None: result.append( ( k.encode("utf-8") if isinstance(k, str) else k, v.encode("utf-8") if isinstance(v, str) else v, ) ) return urlencode(result, doseq=True) else: return data @staticmethod def _encode_files(files, data): """Build the body for a multipart/form-data request. Will successfully encode files when passed as a dict or a list of tuples. Order is retained if data is a list of tuples but arbitrary if parameters are supplied as a dict. The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) or 4-tuples (filename, fileobj, contentype, custom_headers). """ if not files: raise ValueError("Files must be provided.") elif isinstance(data, basestring): raise ValueError("Data must not be a string.") new_fields = [] fields = to_key_val_list(data or {}) files = to_key_val_list(files or {}) for field, val in fields: if isinstance(val, basestring) or not hasattr(val, "__iter__"): val = [val] for v in val: if v is not None: # Don't call str() on bytestrings: in Py3 it all goes wrong. if not isinstance(v, bytes): v = str(v) new_fields.append( ( field.decode("utf-8") if isinstance(field, bytes) else field, v.encode("utf-8") if isinstance(v, str) else v, ) ) for k, v in files: # support for explicit filename ft = None fh = None if isinstance(v, (tuple, list)): if len(v) == 2: fn, fp = v elif len(v) == 3: fn, fp, ft = v else: fn, fp, ft, fh = v else: fn = guess_filename(v) or k fp = v if isinstance(fp, (str, bytes, bytearray)): fdata = fp elif hasattr(fp, "read"): fdata = fp.read() elif fp is None: continue else: fdata = fp rf = RequestField(name=k, data=fdata, filename=fn, headers=fh) rf.make_multipart(content_type=ft) new_fields.append(rf) body, content_type = encode_multipart_formdata(new_fields) return body, content_type class RequestHooksMixin: def register_hook(self, event, hook): """Properly register a hook.""" if event not in self.hooks: raise ValueError(f'Unsupported event specified, with event name "{event}"') if isinstance(hook, Callable): self.hooks[event].append(hook) elif hasattr(hook, "__iter__"): self.hooks[event].extend(h for h in hook if isinstance(h, Callable)) def deregister_hook(self, event, hook): """Deregister a previously registered hook. Returns True if the hook existed, False if not. """ try: self.hooks[event].remove(hook) return True except ValueError: return False class Request(RequestHooksMixin): """A user-created :class:`Request ` object. Used to prepare a :class:`PreparedRequest `, which is sent to the server. :param method: HTTP method to use. :param url: URL to send. :param headers: dictionary of headers to send. :param files: dictionary of {filename: fileobject} files to multipart upload. :param data: the body to attach to the request. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param json: json for the body to attach to the request (if files or data is not specified). :param params: URL parameters to append to the URL. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param auth: Auth handler or (user, pass) tuple. :param cookies: dictionary or CookieJar of cookies to attach to this request. :param hooks: dictionary of callback hooks, for internal usage. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() """ def __init__( self, method=None, url=None, headers=None, files=None, data=None, params=None, auth=None, cookies=None, hooks=None, json=None, ): # Default empty dicts for dict params. data = [] if data is None else data files = [] if files is None else files headers = {} if headers is None else headers params = {} if params is None else params hooks = {} if hooks is None else hooks self.hooks = default_hooks() for k, v in list(hooks.items()): self.register_hook(event=k, hook=v) self.method = method self.url = url self.headers = headers self.files = files self.data = data self.json = json self.params = params self.auth = auth self.cookies = cookies def __repr__(self): return f"" def prepare(self): """Constructs a :class:`PreparedRequest ` for transmission and returns it.""" p = PreparedRequest() p.prepare( method=self.method, url=self.url, headers=self.headers, files=self.files, data=self.data, json=self.json, params=self.params, auth=self.auth, cookies=self.cookies, hooks=self.hooks, ) return p class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): """The fully mutable :class:`PreparedRequest ` object, containing the exact bytes that will be sent to the server. Instances are generated from a :class:`Request ` object, and should not be instantiated manually; doing so may produce undesirable effects. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> r = req.prepare() >>> r >>> s = requests.Session() >>> s.send(r) """ def __init__(self): #: HTTP verb to send to the server. self.method = None #: HTTP URL to send the request to. self.url = None #: dictionary of HTTP headers. self.headers = None # The `CookieJar` used to create the Cookie header will be stored here # after prepare_cookies is called self._cookies = None #: request body to send to the server. self.body = None #: dictionary of callback hooks, for internal usage. self.hooks = default_hooks() #: integer denoting starting position of a readable file-like body. self._body_position = None def prepare( self, method=None, url=None, headers=None, files=None, data=None, params=None, auth=None, cookies=None, hooks=None, json=None, ): """Prepares the entire request with the given parameters.""" self.prepare_method(method) self.prepare_url(url, params) self.prepare_headers(headers) self.prepare_cookies(cookies) self.prepare_body(data, files, json) self.prepare_auth(auth, url) # Note that prepare_auth must be last to enable authentication schemes # such as OAuth to work on a fully prepared request. # This MUST go after prepare_auth. Authenticators could add a hook self.prepare_hooks(hooks) def __repr__(self): return f"" def copy(self): p = PreparedRequest() p.method = self.method p.url = self.url p.headers = self.headers.copy() if self.headers is not None else None p._cookies = _copy_cookie_jar(self._cookies) p.body = self.body p.hooks = self.hooks p._body_position = self._body_position return p def prepare_method(self, method): """Prepares the given HTTP method.""" self.method = method if self.method is not None: self.method = to_native_string(self.method.upper()) @staticmethod def _get_idna_encoded_host(host): from pip._vendor import idna try: host = idna.encode(host, uts46=True).decode("utf-8") except idna.IDNAError: raise UnicodeError return host def prepare_url(self, url, params): """Prepares the given HTTP URL.""" #: Accept objects that have string representations. #: We're unable to blindly call unicode/str functions #: as this will include the bytestring indicator (b'') #: on python 3.x. #: https://github.com/psf/requests/pull/2238 if isinstance(url, bytes): url = url.decode("utf8") else: url = str(url) # Remove leading whitespaces from url url = url.lstrip() # Don't do any URL preparation for non-HTTP schemes like `mailto`, # `data` etc to work around exceptions from `url_parse`, which # handles RFC 3986 only. if ":" in url and not url.lower().startswith("http"): self.url = url return # Support for unicode domain names and paths. try: scheme, auth, host, port, path, query, fragment = parse_url(url) except LocationParseError as e: raise InvalidURL(*e.args) if not scheme: raise MissingSchema( f"Invalid URL {url!r}: No scheme supplied. " f"Perhaps you meant https://{url}?" ) if not host: raise InvalidURL(f"Invalid URL {url!r}: No host supplied") # In general, we want to try IDNA encoding the hostname if the string contains # non-ASCII characters. This allows users to automatically get the correct IDNA # behaviour. For strings containing only ASCII characters, we need to also verify # it doesn't start with a wildcard (*), before allowing the unencoded hostname. if not unicode_is_ascii(host): try: host = self._get_idna_encoded_host(host) except UnicodeError: raise InvalidURL("URL has an invalid label.") elif host.startswith(("*", ".")): raise InvalidURL("URL has an invalid label.") # Carefully reconstruct the network location netloc = auth or "" if netloc: netloc += "@" netloc += host if port: netloc += f":{port}" # Bare domains aren't valid URLs. if not path: path = "/" if isinstance(params, (str, bytes)): params = to_native_string(params) enc_params = self._encode_params(params) if enc_params: if query: query = f"{query}&{enc_params}" else: query = enc_params url = requote_uri(urlunparse([scheme, netloc, path, None, query, fragment])) self.url = url def prepare_headers(self, headers): """Prepares the given HTTP headers.""" self.headers = CaseInsensitiveDict() if headers: for header in headers.items(): # Raise exception on invalid header value. check_header_validity(header) name, value = header self.headers[to_native_string(name)] = value def prepare_body(self, data, files, json=None): """Prepares the given HTTP body data.""" # Check if file, fo, generator, iterator. # If not, run through normal process. # Nottin' on you. body = None content_type = None if not data and json is not None: # urllib3 requires a bytes-like body. Python 2's json.dumps # provides this natively, but Python 3 gives a Unicode string. content_type = "application/json" try: body = complexjson.dumps(json, allow_nan=False) except ValueError as ve: raise InvalidJSONError(ve, request=self) if not isinstance(body, bytes): body = body.encode("utf-8") is_stream = all( [ hasattr(data, "__iter__"), not isinstance(data, (basestring, list, tuple, Mapping)), ] ) if is_stream: try: length = super_len(data) except (TypeError, AttributeError, UnsupportedOperation): length = None body = data if getattr(body, "tell", None) is not None: # Record the current file position before reading. # This will allow us to rewind a file in the event # of a redirect. try: self._body_position = body.tell() except OSError: # This differentiates from None, allowing us to catch # a failed `tell()` later when trying to rewind the body self._body_position = object() if files: raise NotImplementedError( "Streamed bodies and files are mutually exclusive." ) if length: self.headers["Content-Length"] = builtin_str(length) else: self.headers["Transfer-Encoding"] = "chunked" else: # Multi-part file uploads. if files: (body, content_type) = self._encode_files(files, data) else: if data: body = self._encode_params(data) if isinstance(data, basestring) or hasattr(data, "read"): content_type = None else: content_type = "application/x-www-form-urlencoded" self.prepare_content_length(body) # Add content-type if it wasn't explicitly provided. if content_type and ("content-type" not in self.headers): self.headers["Content-Type"] = content_type self.body = body def prepare_content_length(self, body): """Prepare Content-Length header based on request method and body""" if body is not None: length = super_len(body) if length: # If length exists, set it. Otherwise, we fallback # to Transfer-Encoding: chunked. self.headers["Content-Length"] = builtin_str(length) elif ( self.method not in ("GET", "HEAD") and self.headers.get("Content-Length") is None ): # Set Content-Length to 0 for methods that can have a body # but don't provide one. (i.e. not GET or HEAD) self.headers["Content-Length"] = "0" def prepare_auth(self, auth, url=""): """Prepares the given HTTP auth data.""" # If no Auth is explicitly provided, extract it from the URL first. if auth is None: url_auth = get_auth_from_url(self.url) auth = url_auth if any(url_auth) else None if auth: if isinstance(auth, tuple) and len(auth) == 2: # special-case basic HTTP auth auth = HTTPBasicAuth(*auth) # Allow auth to make its changes. r = auth(self) # Update self to reflect the auth changes. self.__dict__.update(r.__dict__) # Recompute Content-Length self.prepare_content_length(self.body) def prepare_cookies(self, cookies): """Prepares the given HTTP cookie data. This function eventually generates a ``Cookie`` header from the given cookies using cookielib. Due to cookielib's design, the header will not be regenerated if it already exists, meaning this function can only be called once for the life of the :class:`PreparedRequest ` object. Any subsequent calls to ``prepare_cookies`` will have no actual effect, unless the "Cookie" header is removed beforehand. """ if isinstance(cookies, cookielib.CookieJar): self._cookies = cookies else: self._cookies = cookiejar_from_dict(cookies) cookie_header = get_cookie_header(self._cookies, self) if cookie_header is not None: self.headers["Cookie"] = cookie_header def prepare_hooks(self, hooks): """Prepares the given hooks.""" # hooks can be passed as None to the prepare method and to this # method. To prevent iterating over None, simply use an empty list # if hooks is False-y hooks = hooks or [] for event in hooks: self.register_hook(event, hooks[event]) class Response: """The :class:`Response ` object, which contains a server's response to an HTTP request. """ __attrs__ = [ "_content", "status_code", "headers", "url", "history", "encoding", "reason", "cookies", "elapsed", "request", ] def __init__(self): self._content = False self._content_consumed = False self._next = None #: Integer Code of responded HTTP Status, e.g. 404 or 200. self.status_code = None #: Case-insensitive Dictionary of Response Headers. #: For example, ``headers['content-encoding']`` will return the #: value of a ``'Content-Encoding'`` response header. self.headers = CaseInsensitiveDict() #: File-like object representation of response (for advanced usage). #: Use of ``raw`` requires that ``stream=True`` be set on the request. #: This requirement does not apply for use internally to Requests. self.raw = None #: Final URL location of Response. self.url = None #: Encoding to decode with when accessing r.text. self.encoding = None #: A list of :class:`Response ` objects from #: the history of the Request. Any redirect responses will end #: up here. The list is sorted from the oldest to the most recent request. self.history = [] #: Textual reason of responded HTTP Status, e.g. "Not Found" or "OK". self.reason = None #: A CookieJar of Cookies the server sent back. self.cookies = cookiejar_from_dict({}) #: The amount of time elapsed between sending the request #: and the arrival of the response (as a timedelta). #: This property specifically measures the time taken between sending #: the first byte of the request and finishing parsing the headers. It #: is therefore unaffected by consuming the response content or the #: value of the ``stream`` keyword argument. self.elapsed = datetime.timedelta(0) #: The :class:`PreparedRequest ` object to which this #: is a response. self.request = None def __enter__(self): return self def __exit__(self, *args): self.close() def __getstate__(self): # Consume everything; accessing the content attribute makes # sure the content has been fully read. if not self._content_consumed: self.content return {attr: getattr(self, attr, None) for attr in self.__attrs__} def __setstate__(self, state): for name, value in state.items(): setattr(self, name, value) # pickled objects do not have .raw setattr(self, "_content_consumed", True) setattr(self, "raw", None) def __repr__(self): return f"" def __bool__(self): """Returns True if :attr:`status_code` is less than 400. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code, is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. """ return self.ok def __nonzero__(self): """Returns True if :attr:`status_code` is less than 400. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code, is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. """ return self.ok def __iter__(self): """Allows you to use a response as an iterator.""" return self.iter_content(128) @property def ok(self): """Returns True if :attr:`status_code` is less than 400, False if not. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. """ try: self.raise_for_status() except HTTPError: return False return True @property def is_redirect(self): """True if this Response is a well-formed HTTP redirect that could have been processed automatically (by :meth:`Session.resolve_redirects`). """ return "location" in self.headers and self.status_code in REDIRECT_STATI @property def is_permanent_redirect(self): """True if this Response one of the permanent versions of redirect.""" return "location" in self.headers and self.status_code in ( codes.moved_permanently, codes.permanent_redirect, ) @property def next(self): """Returns a PreparedRequest for the next request in a redirect chain, if there is one.""" return self._next @property def apparent_encoding(self): """The apparent encoding, provided by the charset_normalizer or chardet libraries.""" if chardet is not None: return chardet.detect(self.content)["encoding"] else: # If no character detection library is available, we'll fall back # to a standard Python utf-8 str. return "utf-8" def iter_content(self, chunk_size=1, decode_unicode=False): """Iterates over the response data. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. The chunk size is the number of bytes it should read into memory. This is not necessarily the length of each item returned as decoding can take place. chunk_size must be of type int or None. A value of None will function differently depending on the value of `stream`. stream=True will read data as it arrives in whatever size the chunks are received. If stream=False, data is returned as a single chunk. If decode_unicode is True, content will be decoded using the best available encoding based on the response. """ def generate(): # Special case for urllib3. if hasattr(self.raw, "stream"): try: yield from self.raw.stream(chunk_size, decode_content=True) except ProtocolError as e: raise ChunkedEncodingError(e) except DecodeError as e: raise ContentDecodingError(e) except ReadTimeoutError as e: raise ConnectionError(e) except SSLError as e: raise RequestsSSLError(e) else: # Standard file-like object. while True: chunk = self.raw.read(chunk_size) if not chunk: break yield chunk self._content_consumed = True if self._content_consumed and isinstance(self._content, bool): raise StreamConsumedError() elif chunk_size is not None and not isinstance(chunk_size, int): raise TypeError( f"chunk_size must be an int, it is instead a {type(chunk_size)}." ) # simulate reading small chunks of the content reused_chunks = iter_slices(self._content, chunk_size) stream_chunks = generate() chunks = reused_chunks if self._content_consumed else stream_chunks if decode_unicode: chunks = stream_decode_response_unicode(chunks, self) return chunks def iter_lines( self, chunk_size=ITER_CHUNK_SIZE, decode_unicode=False, delimiter=None ): """Iterates over the response data, one line at a time. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. .. note:: This method is not reentrant safe. """ pending = None for chunk in self.iter_content( chunk_size=chunk_size, decode_unicode=decode_unicode ): if pending is not None: chunk = pending + chunk if delimiter: lines = chunk.split(delimiter) else: lines = chunk.splitlines() if lines and lines[-1] and chunk and lines[-1][-1] == chunk[-1]: pending = lines.pop() else: pending = None yield from lines if pending is not None: yield pending @property def content(self): """Content of the response, in bytes.""" if self._content is False: # Read the contents. if self._content_consumed: raise RuntimeError("The content for this response was already consumed") if self.status_code == 0 or self.raw is None: self._content = None else: self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b"" self._content_consumed = True # don't need to release the connection; that's been handled by urllib3 # since we exhausted the data. return self._content @property def text(self): """Content of the response, in unicode. If Response.encoding is None, encoding will be guessed using ``charset_normalizer`` or ``chardet``. The encoding of the response content is determined based solely on HTTP headers, following RFC 2616 to the letter. If you can take advantage of non-HTTP knowledge to make a better guess at the encoding, you should set ``r.encoding`` appropriately before accessing this property. """ # Try charset from content-type content = None encoding = self.encoding if not self.content: return "" # Fallback to auto-detected encoding. if self.encoding is None: encoding = self.apparent_encoding # Decode unicode from given encoding. try: content = str(self.content, encoding, errors="replace") except (LookupError, TypeError): # A LookupError is raised if the encoding was not found which could # indicate a misspelling or similar mistake. # # A TypeError can be raised if encoding is None # # So we try blindly encoding. content = str(self.content, errors="replace") return content def json(self, **kwargs): r"""Decodes the JSON response body (if any) as a Python object. This may return a dictionary, list, etc. depending on what is in the response. :param \*\*kwargs: Optional arguments that ``json.loads`` takes. :raises requests.exceptions.JSONDecodeError: If the response body does not contain valid json. """ if not self.encoding and self.content and len(self.content) > 3: # No encoding set. JSON RFC 4627 section 3 states we should expect # UTF-8, -16 or -32. Detect which one to use; If the detection or # decoding fails, fall back to `self.text` (using charset_normalizer to make # a best guess). encoding = guess_json_utf(self.content) if encoding is not None: try: return complexjson.loads(self.content.decode(encoding), **kwargs) except UnicodeDecodeError: # Wrong UTF codec detected; usually because it's not UTF-8 # but some other 8-bit codec. This is an RFC violation, # and the server didn't bother to tell us what codec *was* # used. pass except JSONDecodeError as e: raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) try: return complexjson.loads(self.text, **kwargs) except JSONDecodeError as e: # Catch JSON-related errors and raise as requests.JSONDecodeError # This aliases json.JSONDecodeError and simplejson.JSONDecodeError raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) @property def links(self): """Returns the parsed header links of the response, if any.""" header = self.headers.get("link") resolved_links = {} if header: links = parse_header_links(header) for link in links: key = link.get("rel") or link.get("url") resolved_links[key] = link return resolved_links def raise_for_status(self): """Raises :class:`HTTPError`, if one occurred.""" http_error_msg = "" if isinstance(self.reason, bytes): # We attempt to decode utf-8 first because some servers # choose to localize their reason strings. If the string # isn't utf-8, we fall back to iso-8859-1 for all other # encodings. (See PR #3538) try: reason = self.reason.decode("utf-8") except UnicodeDecodeError: reason = self.reason.decode("iso-8859-1") else: reason = self.reason if 400 <= self.status_code < 500: http_error_msg = ( f"{self.status_code} Client Error: {reason} for url: {self.url}" ) elif 500 <= self.status_code < 600: http_error_msg = ( f"{self.status_code} Server Error: {reason} for url: {self.url}" ) if http_error_msg: raise HTTPError(http_error_msg, response=self) def close(self): """Releases the connection back to the pool. Once this method has been called the underlying ``raw`` object must not be accessed again. *Note: Should not normally need to be called explicitly.* """ if not self._content_consumed: self.raw.close() release_conn = getattr(self.raw, "release_conn", None) if release_conn is not None: release_conn() PK!~m__version__.pynu[# .-. .-. .-. . . .-. .-. .-. .-. # |( |- |.| | | |- `-. | `-. # ' ' `-' `-`.`-' `-' `-' ' `-' __title__ = "requests" __description__ = "Python HTTP for Humans." __url__ = "https://requests.readthedocs.io" __version__ = "2.32.5" __build__ = 0x023205 __author__ = "Kenneth Reitz" __author_email__ = "me@kennethreitz.org" __license__ = "Apache-2.0" __copyright__ = "Copyright Kenneth Reitz" __cake__ = "\u2728 \U0001f370 \u2728" PK!7=g=g adapters.pynu[""" requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket # noqa: F401 import typing import warnings from pip._vendor.urllib3.exceptions import ClosedPoolError, ConnectTimeoutError from pip._vendor.urllib3.exceptions import HTTPError as _HTTPError from pip._vendor.urllib3.exceptions import InvalidHeader as _InvalidHeader from pip._vendor.urllib3.exceptions import ( LocationValueError, MaxRetryError, NewConnectionError, ProtocolError, ) from pip._vendor.urllib3.exceptions import ProxyError as _ProxyError from pip._vendor.urllib3.exceptions import ReadTimeoutError, ResponseError from pip._vendor.urllib3.exceptions import SSLError as _SSLError from pip._vendor.urllib3.poolmanager import PoolManager, proxy_from_url from pip._vendor.urllib3.util import Timeout as TimeoutSauce from pip._vendor.urllib3.util import parse_url from pip._vendor.urllib3.util.retry import Retry from .auth import _basic_auth_str from .compat import basestring, urlparse from .cookies import extract_cookies_to_jar from .exceptions import ( ConnectionError, ConnectTimeout, InvalidHeader, InvalidProxyURL, InvalidSchema, InvalidURL, ProxyError, ReadTimeout, RetryError, SSLError, ) from .models import Response from .structures import CaseInsensitiveDict from .utils import ( DEFAULT_CA_BUNDLE_PATH, extract_zipped_paths, get_auth_from_url, get_encoding_from_headers, prepend_scheme_if_needed, select_proxy, urldefragauth, ) try: from pip._vendor.urllib3.contrib.socks import SOCKSProxyManager except ImportError: def SOCKSProxyManager(*args, **kwargs): raise InvalidSchema("Missing dependencies for SOCKS support.") if typing.TYPE_CHECKING: from .models import PreparedRequest DEFAULT_POOLBLOCK = False DEFAULT_POOLSIZE = 10 DEFAULT_RETRIES = 0 DEFAULT_POOL_TIMEOUT = None def _urllib3_request_context( request: "PreparedRequest", verify: "bool | str | None", client_cert: "typing.Tuple[str, str] | str | None", poolmanager: "PoolManager", ) -> "(typing.Dict[str, typing.Any], typing.Dict[str, typing.Any])": host_params = {} pool_kwargs = {} parsed_request_url = urlparse(request.url) scheme = parsed_request_url.scheme.lower() port = parsed_request_url.port cert_reqs = "CERT_REQUIRED" if verify is False: cert_reqs = "CERT_NONE" elif isinstance(verify, str): if not os.path.isdir(verify): pool_kwargs["ca_certs"] = verify else: pool_kwargs["ca_cert_dir"] = verify pool_kwargs["cert_reqs"] = cert_reqs if client_cert is not None: if isinstance(client_cert, tuple) and len(client_cert) == 2: pool_kwargs["cert_file"] = client_cert[0] pool_kwargs["key_file"] = client_cert[1] else: # According to our docs, we allow users to specify just the client # cert path pool_kwargs["cert_file"] = client_cert host_params = { "scheme": scheme, "host": parsed_request_url.hostname, "port": port, } return host_params, pool_kwargs class BaseAdapter: """The Base Transport Adapter""" def __init__(self): super().__init__() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. """ raise NotImplementedError def close(self): """Cleans up adapter specific items.""" raise NotImplementedError class HTTPAdapter(BaseAdapter): """The built-in HTTP Adapter for urllib3. Provides a general-case interface for Requests sessions to contact HTTP and HTTPS urls by implementing the Transport Adapter interface. This class will usually be created by the :class:`Session ` class under the covers. :param pool_connections: The number of urllib3 connection pools to cache. :param pool_maxsize: The maximum number of connections to save in the pool. :param max_retries: The maximum number of retries each connection should attempt. Note, this applies only to failed DNS lookups, socket connections and connection timeouts, never to requests where data has made it to the server. By default, Requests does not retry failed connections. If you need granular control over the conditions under which we retry a request, import urllib3's ``Retry`` class and pass that instead. :param pool_block: Whether the connection pool should block for connections. Usage:: >>> import requests >>> s = requests.Session() >>> a = requests.adapters.HTTPAdapter(max_retries=3) >>> s.mount('http://', a) """ __attrs__ = [ "max_retries", "config", "_pool_connections", "_pool_maxsize", "_pool_block", ] def __init__( self, pool_connections=DEFAULT_POOLSIZE, pool_maxsize=DEFAULT_POOLSIZE, max_retries=DEFAULT_RETRIES, pool_block=DEFAULT_POOLBLOCK, ): if max_retries == DEFAULT_RETRIES: self.max_retries = Retry(0, read=False) else: self.max_retries = Retry.from_int(max_retries) self.config = {} self.proxy_manager = {} super().__init__() self._pool_connections = pool_connections self._pool_maxsize = pool_maxsize self._pool_block = pool_block self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block) def __getstate__(self): return {attr: getattr(self, attr, None) for attr in self.__attrs__} def __setstate__(self, state): # Can't handle by adding 'proxy_manager' to self.__attrs__ because # self.poolmanager uses a lambda function, which isn't pickleable. self.proxy_manager = {} self.config = {} for attr, value in state.items(): setattr(self, attr, value) self.init_poolmanager( self._pool_connections, self._pool_maxsize, block=self._pool_block ) def init_poolmanager( self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs ): """Initializes a urllib3 PoolManager. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param connections: The number of urllib3 connection pools to cache. :param maxsize: The maximum number of connections to save in the pool. :param block: Block when no free connections are available. :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager. """ # save these values for pickling self._pool_connections = connections self._pool_maxsize = maxsize self._pool_block = block self.poolmanager = PoolManager( num_pools=connections, maxsize=maxsize, block=block, **pool_kwargs, ) def proxy_manager_for(self, proxy, **proxy_kwargs): """Return urllib3 ProxyManager for the given proxy. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param proxy: The proxy to return a urllib3 ProxyManager for. :param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager. :returns: ProxyManager :rtype: urllib3.ProxyManager """ if proxy in self.proxy_manager: manager = self.proxy_manager[proxy] elif proxy.lower().startswith("socks"): username, password = get_auth_from_url(proxy) manager = self.proxy_manager[proxy] = SOCKSProxyManager( proxy, username=username, password=password, num_pools=self._pool_connections, maxsize=self._pool_maxsize, block=self._pool_block, **proxy_kwargs, ) else: proxy_headers = self.proxy_headers(proxy) manager = self.proxy_manager[proxy] = proxy_from_url( proxy, proxy_headers=proxy_headers, num_pools=self._pool_connections, maxsize=self._pool_maxsize, block=self._pool_block, **proxy_kwargs, ) return manager def cert_verify(self, conn, url, verify, cert): """Verify a SSL certificate. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param conn: The urllib3 connection object associated with the cert. :param url: The requested URL. :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: The SSL certificate to verify. """ if url.lower().startswith("https") and verify: cert_loc = None # Allow self-specified cert location. if verify is not True: cert_loc = verify if not cert_loc: cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH) if not cert_loc or not os.path.exists(cert_loc): raise OSError( f"Could not find a suitable TLS CA certificate bundle, " f"invalid path: {cert_loc}" ) conn.cert_reqs = "CERT_REQUIRED" if not os.path.isdir(cert_loc): conn.ca_certs = cert_loc else: conn.ca_cert_dir = cert_loc else: conn.cert_reqs = "CERT_NONE" conn.ca_certs = None conn.ca_cert_dir = None if cert: if not isinstance(cert, basestring): conn.cert_file = cert[0] conn.key_file = cert[1] else: conn.cert_file = cert conn.key_file = None if conn.cert_file and not os.path.exists(conn.cert_file): raise OSError( f"Could not find the TLS certificate file, " f"invalid path: {conn.cert_file}" ) if conn.key_file and not os.path.exists(conn.key_file): raise OSError( f"Could not find the TLS key file, invalid path: {conn.key_file}" ) def build_response(self, req, resp): """Builds a :class:`Response ` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter ` :param req: The :class:`PreparedRequest ` used to generate the response. :param resp: The urllib3 response object. :rtype: requests.Response """ response = Response() # Fallback to None if there's no status_code, for whatever reason. response.status_code = getattr(resp, "status", None) # Make headers case-insensitive. response.headers = CaseInsensitiveDict(getattr(resp, "headers", {})) # Set encoding. response.encoding = get_encoding_from_headers(response.headers) response.raw = resp response.reason = response.raw.reason if isinstance(req.url, bytes): response.url = req.url.decode("utf-8") else: response.url = req.url # Add new cookies from the server. extract_cookies_to_jar(response.cookies, req, resp) # Give the Response some context. response.request = req response.connection = self return response def build_connection_pool_key_attributes(self, request, verify, cert=None): """Build the PoolKey attributes used by urllib3 to return a connection. This looks at the PreparedRequest, the user-specified verify value, and the value of the cert parameter to determine what PoolKey values to use to select a connection from a given urllib3 Connection Pool. The SSL related pool key arguments are not consistently set. As of this writing, use the following to determine what keys may be in that dictionary: * If ``verify`` is ``True``, ``"ssl_context"`` will be set and will be the default Requests SSL Context * If ``verify`` is ``False``, ``"ssl_context"`` will not be set but ``"cert_reqs"`` will be set * If ``verify`` is a string, (i.e., it is a user-specified trust bundle) ``"ca_certs"`` will be set if the string is not a directory recognized by :py:func:`os.path.isdir`, otherwise ``"ca_cert_dir"`` will be set. * If ``"cert"`` is specified, ``"cert_file"`` will always be set. If ``"cert"`` is a tuple with a second item, ``"key_file"`` will also be present To override these settings, one may subclass this class, call this method and use the above logic to change parameters as desired. For example, if one wishes to use a custom :py:class:`ssl.SSLContext` one must both set ``"ssl_context"`` and based on what else they require, alter the other keys to ensure the desired behaviour. :param request: The PreparedReqest being sent over the connection. :type request: :class:`~requests.models.PreparedRequest` :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. :param cert: (optional) Any user-provided SSL certificate for client authentication (a.k.a., mTLS). This may be a string (i.e., just the path to a file which holds both certificate and key) or a tuple of length 2 with the certificate file path and key file path. :returns: A tuple of two dictionaries. The first is the "host parameters" portion of the Pool Key including scheme, hostname, and port. The second is a dictionary of SSLContext related parameters. """ return _urllib3_request_context(request, verify, cert, self.poolmanager) def get_connection_with_tls_context(self, request, verify, proxies=None, cert=None): """Returns a urllib3 connection for the given request and TLS settings. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` object to be sent over the connection. :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. :param proxies: (optional) The proxies dictionary to apply to the request. :param cert: (optional) Any user-provided SSL certificate to be used for client authentication (a.k.a., mTLS). :rtype: urllib3.ConnectionPool """ proxy = select_proxy(request.url, proxies) try: host_params, pool_kwargs = self.build_connection_pool_key_attributes( request, verify, cert, ) except ValueError as e: raise InvalidURL(e, request=request) if proxy: proxy = prepend_scheme_if_needed(proxy, "http") proxy_url = parse_url(proxy) if not proxy_url.host: raise InvalidProxyURL( "Please check proxy URL. It is malformed " "and could be missing the host." ) proxy_manager = self.proxy_manager_for(proxy) conn = proxy_manager.connection_from_host( **host_params, pool_kwargs=pool_kwargs ) else: # Only scheme should be lower case conn = self.poolmanager.connection_from_host( **host_params, pool_kwargs=pool_kwargs ) return conn def get_connection(self, url, proxies=None): """DEPRECATED: Users should move to `get_connection_with_tls_context` for all subclasses of HTTPAdapter using Requests>=2.32.2. Returns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param url: The URL to connect to. :param proxies: (optional) A Requests-style dictionary of proxies used on this request. :rtype: urllib3.ConnectionPool """ warnings.warn( ( "`get_connection` has been deprecated in favor of " "`get_connection_with_tls_context`. Custom HTTPAdapter subclasses " "will need to migrate for Requests>=2.32.2. Please see " "https://github.com/psf/requests/pull/6710 for more details." ), DeprecationWarning, ) proxy = select_proxy(url, proxies) if proxy: proxy = prepend_scheme_if_needed(proxy, "http") proxy_url = parse_url(proxy) if not proxy_url.host: raise InvalidProxyURL( "Please check proxy URL. It is malformed " "and could be missing the host." ) proxy_manager = self.proxy_manager_for(proxy) conn = proxy_manager.connection_from_url(url) else: # Only scheme should be lower case parsed = urlparse(url) url = parsed.geturl() conn = self.poolmanager.connection_from_url(url) return conn def close(self): """Disposes of any internal state. Currently, this closes the PoolManager and any active ProxyManager, which closes any pooled connections. """ self.poolmanager.clear() for proxy in self.proxy_manager.values(): proxy.clear() def request_url(self, request, proxies): """Obtain the url to use when making the final request. If the message is being sent through a HTTP proxy, the full URL has to be used. Otherwise, we should only use the path portion of the URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` being sent. :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs. :rtype: str """ proxy = select_proxy(request.url, proxies) scheme = urlparse(request.url).scheme is_proxied_http_request = proxy and scheme != "https" using_socks_proxy = False if proxy: proxy_scheme = urlparse(proxy).scheme.lower() using_socks_proxy = proxy_scheme.startswith("socks") url = request.path_url if url.startswith("//"): # Don't confuse urllib3 url = f"/{url.lstrip('/')}" if is_proxied_http_request and not using_socks_proxy: url = urldefragauth(request.url) return url def add_headers(self, request, **kwargs): """Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter `. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` to add headers to. :param kwargs: The keyword arguments from the call to send(). """ pass def proxy_headers(self, proxy): """Returns a dictionary of the headers to add to any request sent through a proxy. This works with urllib3 magic to ensure that they are correctly sent to the proxy, rather than in a tunnelled request if CONNECT is being used. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param proxy: The url of the proxy being used for this request. :rtype: dict """ headers = {} username, password = get_auth_from_url(proxy) if username: headers["Proxy-Authorization"] = _basic_auth_str(username, password) return headers def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection_with_tls_context( request, verify, proxies=proxies, cert=cert ) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) raise ConnectionError(e, request=request) except ClosedPoolError as e: raise ConnectionError(e, request=request) except _ProxyError as e: raise ProxyError(e) except (_SSLError, _HTTPError) as e: if isinstance(e, _SSLError): # This branch is for urllib3 versions earlier than v1.22 raise SSLError(e, request=request) elif isinstance(e, ReadTimeoutError): raise ReadTimeout(e, request=request) elif isinstance(e, _InvalidHeader): raise InvalidHeader(e, request=request) else: raise return self.build_response(request, resp) PK!:Q(__pycache__/status_codes.cpython-312.pycnu[ 9r*jUdaddlmZiddddddd d d d d ddddddddddddddddddd d!d"d#d$id%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFidGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhididjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddZedZeeed<dZey)a The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. Example:: >>> import requests >>> requests.codes['temporary_redirect'] 307 >>> requests.codes.teapot 418 >>> requests.codes['\o/'] 200 Some codes have multiple names, and both upper- and lower-case versions of the names are allowed. For example, ``codes.ok``, ``codes.OK``, and ``codes.okay`` all correspond to the HTTP status code 200. ) LookupDictd)continuee)switching_protocolsf) processingz early-hintsg) checkpointz) uri_too_longrequest_uri_too_long)okokayall_okall_okayall_goodz\o/u✓)created)accepted)non_authoritative_infonon_authoritative_information) no_content) reset_contentreset)partial_contentpartial) multi_statusmultiple_status multi_statimultiple_stati)already_reported)im_usedi,)multiple_choicesi-)moved_permanentlymovedz\o-i.)foundi/) see_otherotheri0) not_modifiedi1) use_proxyi2) switch_proxyi3)temporary_redirecttemporary_moved temporaryi4)permanent_redirectresume_incompleteresumei) bad_requestbadi) unauthorizedi)payment_requiredpaymenti) forbiddeni) not_foundz-o-i)method_not_allowed not_allowedi)not_acceptablei)proxy_authentication_required proxy_authproxy_authenticationi)request_timeouttimeouti)conflicti)gonei)length_requiredi)precondition_failed preconditioni)request_entity_too_largecontent_too_largei)request_uri_too_larger i)unsupported_media_typeunsupported_media media_typei)requested_range_not_satisfiablerequested_rangerange_not_satisfiablei)expectation_failedi) im_a_teapotteapot i_am_a_teapoti)misdirected_requesti)unprocessable_entity unprocessableunprocessable_contenti)lockedi)failed_dependency dependencyi)unordered_collection unordered too_earlyi)upgrade_requiredupgradei)precondition_requiredrOi)too_many_requeststoo_manyi)header_fields_too_largefields_too_largei) no_responsenonei) retry_withretryi)$blocked_by_windows_parental_controlsparental_controlsi)unavailable_for_legal_reasons legal_reasonsi)client_closed_requesti)internal_server_error server_errorz/o\u✗i)not_implementedi) bad_gatewayi)service_unavailable unavailablei)gateway_timeouti)http_version_not_supported http_versioni)variant_also_negotiatesi)insufficient_storagei)bandwidth_limit_exceeded bandwidthi) not_extendedi)network_authentication_required network_authnetwork_authentication status_codes)namecodescdtjD]N\}}|D]D}tt|||j dr&tt|j |FPdt dtfdt2tdzdjfdttDzayday)N)\/codereturncNdjdt|D}d||fzS)Nz, c3(K|] }d|d yw)z``N).0ns D/opt/hc_python/lib/python3.12/site-packages/requests/status_codes.py z%_init..doc..us;lBqc*lsz* %d: %s)join_codes)rnamess rdocz_init..docts) ;fTl;;T5M)) c3.K|] }|yw)Nr)rrrs rrz_init..zs"H3t9s) ritemssetattrr startswithupperintstr__doc__rsorted)rtitlestitlers @r_initrms  fE E5$ '##K0u{{}d3' *#*#*   $"H"HHH  rN)r structuresrrrr__annotations__rrrrrs?(#Q Q  !Q  & Q   Q   1 Q  HQ Q Q  DQ Q  #Q  'Q  MQ  Q  !Q $ %Q & /'Q ()Q * +Q , -Q ./Q 0 1Q 2 ?3Q 4 5Q @ AQ B CQ D (EQ FGQ H IQ J .KQ L MQ N POQ P 'QQ RSQ TUQ V WQ X 0YQ Z :[Q \ 2]Q ^ F_Q ` aQ j kQ l 3mQ n !oQ p KqQ rsQ t ,uQ v ;wQ x (yQ z 2{Q | *}Q ~ 8Q @ AQ B CQ D FEQ F ;GQ H #IQ L AMQ N OQ P QQ R /SQ T UQ V 7WQ X %YQ Z "[Q \ 2]Q ^ _Q ` VaQ f$8z#8&rPK!K!__pycache__/hooks.cpython-312.pycnu[ 9r*jrUdZddlmZddlmZmZddlmZmZer ddl m Z ddl m Z dgZd ed <dd Z dd Zy )z requests.hooks ~~~~~~~~~~~~~~ This module provides the capabilities for the Requests hooks system. Available hooks: ``response``: The response generated from a Request. ) annotations)CallableIterable) TYPE_CHECKINGAny)_types)Responseresponsez list[str]HOOKSc6tDcic]}|gc}Scc}w)N)r )events =/opt/hc_python/lib/python3.12/site-packages/requests/hooks.py default_hooksrs#( )5%E2I5 )) )s c |xsi}|j|}|r(t|tr|g}|D]}||fi|}||}|S)z6Dispatches a hook dictionary on a given piece of data.)get isinstancer)keyhooks hook_datakwargs hooks_dict hook_listhook _hook_datas r dispatch_hookr s["Jr)sb #.% <y*  #   rPK!^*PP__pycache__/api.cpython-312.pycnu[ 9r*jdZddlmZddlmZddlmZddlmZer ddl m Z ddlm Z  dd Z d dd Zdd Zdd Z d ddZ d ddZ d ddZddZy )z requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. ) annotations) TYPE_CHECKING)sessions)Response)Unpack)_typesc tj5}|jd||d|cdddS#1swYyxYw)a Constructs and sends a :class:`Request `. :param method: method for the new :class:`Request` object: ``GET``, ``OPTIONS``, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:`Request`. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload. ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')`` or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content_type'`` is a string defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers to add for the file. :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How many seconds to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``True``. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. :param stream: (optional) if ``False``, the response content will be immediately downloaded. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :return: :class:`Response ` object :rtype: requests.Response Usage:: >>> import requests >>> req = requests.request('GET', 'https://httpbin.org/get') >>> req )methodurlN)rSessionrequest)r r kwargssessions ;/opt/hc_python/lib/python3.12/site-packages/requests/api.pyrrs7\    ww@f#@@   s4=Nc  td|fd|i|S)adSends a GET request. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response getparamsr)r rrs rrrJs 5# 7f 7 77c td|fi|S)zSends an OPTIONS request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response optionsrr rs rrrZs 9c ,V ,,rc @|jddtd|fi|S)akSends a HEAD request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. If `allow_redirects` is not provided, it will be set to `False` (as opposed to the default :meth:`request` behavior). :return: :class:`Response ` object :rtype: requests.Response allow_redirectsFhead) setdefaultrrs rrrfs' '/ 63 )& ))rc "td|f||d|S)aSends a POST request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response post)datajsonr)r r!r"rs rr r us" 63 ?T ? ??rc  td|fd|i|S)aSends a PUT request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response putr!rr r!rs rr$r$s 5# 3D 3F 33rc  td|fd|i|S)aSends a PATCH request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response patchr!rr%s rr'r's 7C 5d 5f 55rc td|fi|S)zSends a DELETE request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response deleterrs rr)r)s 8S +F ++r)r strr _t.UriTyperUnpack[_t.RequestKwargs]returnr)N)r r+rz _t.ParamsTyperzUnpack[_t.GetKwargs]r-r)r r+rr,r-r)NN) r r+r! _t.DataTyper"z _t.JsonTyperzUnpack[_t.PostKwargs]r-r)r r+r!r.rzUnpack[_t.DataKwargs]r-r)__doc__ __future__rtypingrrmodelsrtyping_extensionsrr _trrrrr r$r'r)r rrr6s# (/A /A /A,D/A /Af.2 8  8* 8=Q 8  8 - *"@ @ @ @$ @  @**.4 4&49N4 4$*.6 6&69N6 6" ,rPK!ZИss$__pycache__/adapters.cpython-312.pycnu[ 9r*jm2dZddlmZddlZddlZddlZddlZddlmZddl m Z m Z m Z m Z mZmZmZmZddl mZddl mZddl mZdd l mZdd lmZmZdd lmZdd lm Z dd l!m"Z"ddl#m$Z$ddl%m&Z&m'Z'ddl(m)Z)ddl*m+Z+m,Z,mZm-Z-m.Z.m/Z/mZm0Z0m1Z1mZddl2m3Z3ddl4m5Z5ddl6m7Z7m8Z8m9Z9m:Z:m;Z;mZ>ejrddlAmBZBddlmZCddlDmEZFddl2mGZGddlEmHZIdZJdZKdZLdZM d%dZNGd d!ZOGd"d#eOZPy#e?$rd$dZ>YawxYw)&z requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. ) annotationsN)Any)ClosedPoolErrorConnectTimeoutErrorLocationValueError MaxRetryErrorNewConnectionError ProtocolErrorReadTimeoutError ResponseError) HTTPError) InvalidHeader) ProxyError)SSLError) PoolManagerproxy_from_url)Timeout) parse_url)Retry)_basic_auth_str) basestringurlparse)extract_cookies_to_jar) ConnectionErrorConnectTimeoutrInvalidProxyURL InvalidSchema InvalidURLr ReadTimeout RetryErrorr)Response)CaseInsensitiveDict)DEFAULT_CA_BUNDLE_PATHget_auth_from_urlget_encoding_from_headersprepend_scheme_if_needed select_proxy urldefragauth)SOCKSProxyManagerctd)Nz'Missing dependencies for SOCKS support.)r)argskwargss @/opt/hc_python/lib/python3.12/site-packages/requests/adapters.pyr*r*BsEFF)HTTPConnectionPool)r)_types)PreparedRequest) is_preparedF ci}i}t|j}|jj}|j}d} |durd} n:t |t r*tjj|s||d<n||d<| |d<|4t |trt|dk(r|d|d <|d |d <n||d <||j|d }||fS) N CERT_REQUIREDF CERT_NONEca_certs ca_cert_dir cert_reqsr cert_filerkey_file)schemehostport) rurlr>lowerr@ isinstancestrospathisdirtuplelenhostname) requestverify client_cert poolmanager host_params pool_kwargsparsed_request_urlr>r@r:s r._urllib3_request_contextrRUs #%K"$K!'++.  & & , , .F  " "DI  FC ww}}V$&,K #)/K &(K  k5 )c+.>!.C'21~K $&1!nK #(3K $"++K  ##r/cZeZdZdZdfd Z d ddZddZxZS) BaseAdapterzThe Base Transport Adapterc"t|yN)super__init__)self __class__s r.rXzBaseAdapter.__init__}s r/ct)aCSends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. NotImplementedError)rYrKstreamtimeoutrLcertproxiess r.sendzBaseAdapter.sends ."!r/ct)z!Cleans up adapter specific items.r\)rYs r.closezBaseAdapter.closes!!r/returnNoneFNTNNrKr2r^boolr_z_t.TimeoutTyperL _t.VerifyTyper` _t.CertTyperadict[str, str] | Nonerfr")__name__ __module__ __qualname____doc__rXrbrd __classcell__rZs@r.rTrTzsj$ "& $ )-" "" "  "  "'" "2"r/rTceZdZUdZgdZded<ded<ded<ded <d ed <d ed <d ed<ded<eeeef d fd Z d!dZ d"dZ ef d#dZ d$dZ d%dZd&dZ d' d(dZ d) d*dZ d' d+dZd,dZ d-dZd.dZd/dZ d0 d1dZxZS)2 HTTPAdapteraThe built-in HTTP Adapter for urllib3. Provides a general-case interface for Requests sessions to contact HTTP and HTTPS urls by implementing the Transport Adapter interface. This class will usually be created by the :class:`Session ` class under the covers. :param pool_connections: The number of urllib3 connection pools to cache. :param pool_maxsize: The maximum number of connections to save in the pool. :param max_retries: The maximum number of retries each connection should attempt. Note, this applies only to failed DNS lookups, socket connections and connection timeouts, never to requests where data has made it to the server. By default, Requests does not retry failed connections. If you need granular control over the conditions under which we retry a request, import urllib3's ``Retry`` class and pass that instead. :param pool_block: Whether the connection pool should block for connections. Usage:: >>> import requests >>> s = requests.Session() >>> a = requests.adapters.HTTPAdapter(max_retries=3) >>> s.mount('http://', a) ) max_retriesconfig_pool_connections _pool_maxsize _pool_blockz list[str] __attrs__rrvdict[str, Any]rw proxy_managerintrxryrjrz _PoolManagerrNc|tk(rtdd|_ntj||_i|_i|_t |||_||_ ||_ |j|||y)NrF)readblock) DEFAULT_RETRIESrrvfrom_intrwr}rWrXrxryrzinit_poolmanager)rYpool_connections pool_maxsizerv pool_blockrZs r.rXzHTTPAdapter.__init__su / )$QU3D $~~k:D   !1)% . JOr/c X|jDcic]}|t||dc}Scc}wrV)r{getattr)rYattrs r. __getstate__zHTTPAdapter.__getstate__s,<@NNKNDgdD$//NKKKs'ci|_i|_|jD]\}}t||||j |j |j |jy)Nr)r}rwitemssetattrrrxryrz)rYstatervalues r. __setstate__zHTTPAdapter.__setstate__sa   ;;=KD% D$ &)   " "D$6$6d>N>N  r/c V||_||_||_td|||d||_y)aInitializes a urllib3 PoolManager. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param connections: The number of urllib3 connection pools to cache. :param maxsize: The maximum number of connections to save in the pool. :param block: Block when no free connections are available. :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager. ) num_poolsmaxsizerN)rxryrzrrN)rY connectionsrrrPs r.rzHTTPAdapter.init_poolmanagersA&"-$ & !   r/c ||jvr|j|}|S|jjdrOt|\}}t |f|||j |j |jd|x}|j|<|S|j|}t|f||j |j |jd|x}|j|<|S)aReturn urllib3 ProxyManager for the given proxy. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param proxy: The proxy to return a urllib3 ProxyManager for. :param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager. :returns: ProxyManager :rtype: urllib3.ProxyManager socks)usernamepasswordrrr) proxy_headersrrr) r}rB startswithr%r*rxryrzrr)rYproxy proxy_kwargsmanagerrrrs r.proxy_manager_forzHTTPAdapter.proxy_manager_for s  D&& &((/G.-[[] % %g .!25!9 Hh2C3!!00**&& 33 Gd((/(!..u5M2@3+00**&& 3  3 Gd((/r/c|jjdrw|rud}|dur|}|st}|rtjj |st d|d|_tjj|s||_ n||_ nd|_d|_ d|_ |rt|ts|d|_ |d|_n||_ d|_|jrAtjj |jst d |j|jrBtjj |jst d |jyyy) aAVerify a SSL certificate. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param conn: The urllib3 connection object associated with the cert. :param url: The requested URL. :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: The SSL certificate to verify. httpsNTzCCould not find a suitable TLS CA certificate bundle, invalid path: r6r7rrz7Could not find the TLS certificate file, invalid path: z/Could not find the TLS key file, invalid path: )rBrr$rErFexistsOSErrorr:rGr8r9rCrr<r=)rYconnrArLr`cert_locs r. cert_verifyzHTTPAdapter.cert_verify3sR 99; ! !' *vHT!!1277>>(#;%%-J0 -DN77==* ( #+ (DN DM#D  dJ/!%a $Q !% $ ~~bggnnT^^&D%%)^^$46}}RWW^^DMM%BEdmm_U&C} r/ct|sJt}t|dd|_t t|di|_t |j |_||_|jj|_ t|jtr!|jjd|_ n|j|_ t|j||||_||_|S)aBuilds a :class:`Response ` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter ` :param req: The :class:`PreparedRequest ` used to generate the response. :param resp: The urllib3 response object. :rtype: requests.Response statusNheaderszutf-8) _is_preparedr"r status_coder#rr&encodingrawreasonrCrAbytesdecodercookiesrK connection)rYreqrespresponses r.build_responsezHTTPAdapter.build_responsemsC   : 'tXt</wtY/KL6h6F6FG ",,-- cggu %77>>'2HL77HL x//d;"r/c2t||||jS)a Build the PoolKey attributes used by urllib3 to return a connection. This looks at the PreparedRequest, the user-specified verify value, and the value of the cert parameter to determine what PoolKey values to use to select a connection from a given urllib3 Connection Pool. The SSL related pool key arguments are not consistently set. As of this writing, use the following to determine what keys may be in that dictionary: * If ``verify`` is ``True``, ``"ssl_context"`` will be set and will be the default Requests SSL Context * If ``verify`` is ``False``, ``"ssl_context"`` will not be set but ``"cert_reqs"`` will be set * If ``verify`` is a string, (i.e., it is a user-specified trust bundle) ``"ca_certs"`` will be set if the string is not a directory recognized by :py:func:`os.path.isdir`, otherwise ``"ca_cert_dir"`` will be set. * If ``"cert"`` is specified, ``"cert_file"`` will always be set. If ``"cert"`` is a tuple with a second item, ``"key_file"`` will also be present To override these settings, one may subclass this class, call this method and use the above logic to change parameters as desired. For example, if one wishes to use a custom :py:class:`ssl.SSLContext` one must both set ``"ssl_context"`` and based on what else they require, alter the other keys to ensure the desired behaviour. :param request: The PreparedRequest being sent over the connection. :type request: :class:`~requests.models.PreparedRequest` :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. :param cert: (optional) Any user-provided SSL certificate for client authentication (a.k.a., mTLS). This may be a string (i.e., just the path to a file which holds both certificate and key) or a tuple of length 2 with the certificate file path and key file path. :returns: A tuple of two dictionaries. The first is the "host parameters" portion of the Pool Key including scheme, hostname, and port. The second is a dictionary of SSLContext related parameters. )rRrN)rYrKrLr`s r.$build_connection_pool_key_attributesz0HTTPAdapter.build_connection_pool_key_attributessd(t?O?OPPr/ct|sJt|j|} |j|||\}}|rWt |d}t|} | js td|j|} | jdi|d|i} | S|jjdi|d|i} | S#t$r}t ||d}~wwxYw)auReturns a urllib3 connection for the given request and TLS settings. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` object to be sent over the connection. :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. :param proxies: (optional) The proxies dictionary to apply to the request. :param cert: (optional) Any user-provided SSL certificate to be used for client authentication (a.k.a., mTLS). :rtype: urllib3.HTTPConnectionPool rKNhttpFPlease check proxy URL. It is malformed and could be missing the host.rPr) rr(rAr ValueErrorrr'rr?rrconnection_from_hostrN) rYrKrLrar`rrOrPe proxy_urlr}rs r.get_connection_with_tls_contextz+HTTPAdapter.get_connection_with_tls_contexts4G$$$W[['2 1'+'P'P( $K ,UF;E!%(I>>%5!2259M5=55+6D 94##88+6D ) 1Q0 0 1sB66 C? C  Ccftjdtt||}|rRt |d}t |}|j s td|j|}|j|}|St|}|j}|jj|}|S)aDEPRECATED: Users should move to `get_connection_with_tls_context` for all subclasses of HTTPAdapter using Requests>=2.32.2. Returns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param url: The URL to connect to. :param proxies: (optional) A Requests-style dictionary of proxies used on this request. :rtype: urllib3.HTTPConnectionPool z`get_connection` has been deprecated in favor of `get_connection_with_tls_context`. Custom HTTPAdapter subclasses will need to migrate for Requests>=2.32.2. Please see https://github.com/psf/requests/pull/6710 for more details.rr) warningswarnDeprecationWarningr(r'rr?rrconnection_from_urlrgeturlrN)rYrArarrr}rparseds r.get_connectionzHTTPAdapter.get_connections  N  S'* ,UF;E!%(I>>%5!2259M 44S9D c]F--/C##77`. :param request: The :class:`PreparedRequest ` being sent. :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs. :rtype: str rFr) rr(rArr>rBrpath_urlr)) rYrKrarr>is_proxied_http_requestusing_socks_proxy proxy_schemerAs r. request_urlzHTTPAdapter.request_url5s G$$$W[['2'++&--"'"=Fg,=! #E?11779L , 7 7 @  "+< ,C r/c y)a"Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter `. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` to add headers to. :param kwargs: The keyword arguments from the call to send(). Nr)rYrKr-s r. add_headerszHTTPAdapter.add_headersWs r/cHi}t|\}}|rt|||d<|S)aReturns a dictionary of the headers to add to any request sent through a proxy. This works with urllib3 magic to ensure that they are correctly sent to the proxy, rather than in a tunnelled request if CONNECT is being used. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param proxy: The url of the proxy being used for this request. :rtype: dict zProxy-Authorization)r%r)rYrrrrs r.rzHTTPAdapter.proxy_headerses2#%.u5( -$r}t'||d}~wt6$r}t9|d}~wt:t@f$r]}t|t:r t=||t|tBr tE||t|tFr tI||d}~wwxYw) aSends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response )rar`rN)r^r_rLr`razContent-Length)connectrzInvalid timeout za. Pass a (connect, read) timeout tuple, or a single float to set both timeouts to the same value.F) methodrAbodyrredirectassert_same_hostpreload_contentdecode_contentretriesr_chunked)&rrrrrrArrrrrCrH TimeoutSaucerurlopenrrvr rrrrrr rr r! _ProxyErrorr _SSLErrorrr _HTTPErrorr r _InvalidHeaderrr)rYrKr^r_rLr`rarrrArrrresolved_timeoutrerrs r.rbzHTTPAdapter.sendzs2G$$$ 177t8D w{{FD9w0    ||t+R/?7??/RS gu %  ' #/d#K  .& +G'J 3 <<~~\\!& %$((( Dh""7D11g" 1Q0 0 1(  &wi0PQ 2w' 8!#w7 7 6!(($78!!((,>?(G<<!((M2 G44!((K0 G44!((I.q'22!!W5 5 6!!W5 5 Q- :& !Y'q'22A/0!!W55A~.#Aw77 snD%EAE% E. D;;EEK). E;; K)CI  K) I## K)/ I::K) AK$$K)) rr~rr~rvz int | Retryrrjrfrg)rfr|)rr|rfrg) rr~rr~rrjrPrrfrg)rrDrrrfr) rrrArDrLrkr`rlrfrg)rr2rrrfr"rV)rKr2rLrkr`rlrf%tuple[dict[str, Any], dict[str, Any]])NN) rKr2rLrkrarmr`rlrfr0)rArDrarmrfr0re)rKr2rarmrfrD)rKr2r-rrfrg)rrDrfzdict[str, str]rhri)rnrorprqr{__annotations__DEFAULT_POOLSIZErDEFAULT_POOLBLOCKrXrrrrrrrrrrdrrrrbrrrss@r.rurus,4Iy !!!1,#2, PPP! P  P  P,L  "(          <$L88!8+88@K8 8t$NTX2Q&2Q0=2QEP2Q .2Qp*. 7 77' 7  7  7t:>))!6) )V & 1F   D  0"& $ )-r2 r2r2 r2  r2  r2'r2 r2r/ru)r,rr-rrfrg) rKr2rLzbool | str | NonerMztuple[str, str] | str | NonerNrrfr)Qrq __future__ros.pathrEsockettypingrrurllib3.exceptionsrrrrr r r r r rrrrrrrurllib3.poolmanagerrr urllib3.utilrrrurllib3.util.retryrauthrcompatrrrr exceptionsrrrrrr r!modelsr" structuresr#utilsr$r%r&r'r(r)urllib3.contrib.socksr* ImportError TYPE_CHECKINGurllib3.connectionpoolr0rr1_tr2r3rrrrDEFAULT_POOL_TIMEOUTrRrTrurr/r.rs#    7>84;0"$!(+   +G7 9?'/"$ "$ "$."$ "$ + "$J!"!"HN 2+N 2}GGGs.D DDPK!R`~ 22+__pycache__/_internal_utils.cpython-312.pycnu[ 9r*jdZddlZddlmZejdZejdZejdZejdZeefZ eefZ e e e e iZ dd e e zd e d e fd Zd e d efdZy)z requests._internal_utils ~~~~~~~~~~~~~~ Provides utility functions that are consumed internally by Requests which depend on extremely few external helpers (such as compat) N) builtin_strs^[^:\s][^:\r\n]*\Zz^[^:\s][^:\r\n]*\Zs^\S[^\r\n]*\Z|^\Zz^\S[^\r\n]*\Z|^\ZstringencodingreturncPt|tr|}|S|j|}|S)zGiven a string object, regardless of type, returns a representation of that string in the native string type, encoding and decoding where necessary. This assumes ASCII unless told otherwise. ) isinstancerdecode)rrouts G/opt/hc_python/lib/python3.12/site-packages/requests/_internal_utils.pyto_native_stringr s/ &+& JmmH% Ju_stringcjt|tsJ |jdy#t$rYywxYw)zDetermine if unicode string only contains ASCII characters. :param str u_string: unicode string to check. Must be unicode and not Python 2 `str`. :rtype: bool asciiTF)r strencodeUnicodeEncodeError)rs r unicode_is_asciir's: h $$ $  s & 22)r)__doc__recompatrcompile_VALID_HEADER_NAME_RE_BYTE_VALID_HEADER_NAME_RE_STR_VALID_HEADER_VALUE_RE_BYTE_VALID_HEADER_VALUE_RE_STR_HEADER_VALIDATORS_STR_HEADER_VALIDATORS_BYTEbytesrHEADER_VALIDATORSr boolrrr r$s 'RZZ(>?&BJJ'<=(bjj)>?'RZZ(<=35OP57RS "  S5[ C c  s t rPK!{9 ??!__pycache__/utils.cpython-312.pycnu[ 9r*jBUdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZddlmZmZmZmZmZmZddlmZmZdd lmZdd lmZdd l m!Z!m"Z"m#Z#m$Z$dd l%m&Z'dd l(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5ddl(m6Z7ddl8m9Z9ddl:m;Z;mZ>ddl?m@Z@erddlAmBZBddlmCZCddlm%ZDddlEmFZFmGZGmHZHdZIdeJd<ejZLdeJd<dddZMdeJd<edZNed ZOd!jejd"ed#$d%ZRdeJd&<e jd'k(rd\d(ZTd\d)Z/ d]d*ZUd^d+ZV d_ d`d,ZWdad-ZXdbd.ZYejdcd/Z[ ddd0Z\eded1Z]e dfd2Z] dgd3Z]dhd4Z^did5Z_d_djd6Z`dkd7Zadld8Zbdmd9Zcdnd:Zddod;Ze dpd<Zfe dqd=Zge drd>Zg dsd?Zgdtd@ZheidAZjdeJdB<dudCZkdudDZldvdEZmdwdFZndxdGZodydHZpejdzdIZqd{dJZrd|d}dKZsd~dLZt d ddMZudddNZvddOZwddPZxdQjdRZzezdSzZ{ezdTzZ|ddUZ}ddVZ~ddWZddXZ ddYZddZZdd[Zy)z requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. ) annotationsN) OrderedDict) GeneratorIterable) TYPE_CHECKINGAnyFinalTypeVarcastoverload) make_headers parse_url)certs __version__)_HEADER_VALIDATORS_BYTE_HEADER_VALIDATORS_STRHEADER_VALIDATORSto_native_string) SupportsItems) Mappingbytes getproxiesgetproxies_environment integer_types is_urllib3_1 proxy_bypassproxy_bypass_environmentquotestrunquoteurlparse urlunparse)parse_http_listcookiejar_from_dict)FileModeWarning InvalidHeader InvalidURLUnrewindableBodyError)CaseInsensitiveDict) CookieJar)BufferedWriter)_types)PreparedRequestRequestResponse)z.netrc_netrcr NETRC_FILESr!DEFAULT_CA_BUNDLE_PATHPi)httphttps DEFAULT_PORTS_KT_VTz, z,\s*T)accept_encodingzaccept-encodingDEFAULT_ACCEPT_ENCODINGwin32c ddl} |j|jd}t |j |dd}|j |dd}|r|sy|jd}td|}|D]j}|dk(rd|vry |jdd }|jd d }|jd d}tj||tjsjy y#t$rYywxYw#t tf$rYywxYw)NrFz;Software\Microsoft\Windows\CurrentVersion\Internet Settings ProxyEnable ProxyOverride;z.Tz\.*z.*?)winreg ImportErrorOpenKeyHKEY_CURRENT_USERint QueryValueExOSError ValueErrorsplitfilterreplacerematchI)hostrFinternetSettings proxyEnable proxyOverridetests =/opt/hc_python/lib/python3.12/site-packages/requests/utils.pyproxy_bypass_registryrZcs    %~~((N   f112BMRSTUVK"//0@/RSTUM- &++C0 t]3 !Dy d?<<U+D<<U+D<<T*DxxdBDD)"C  $  s#C(AC7( C43C47D D cBtr t|St|S)zReturn True, if the host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. )rrrZ)rTs rYrrs " #+D1 1(. .cFt|tr|jS|S)z/Returns an internal sequence dictionary update.) isinstance_SupportsItemsitems)ds rYdict_to_sequencerbs !^$wwy Hr\cd}d}ts!t|tr|jd}t |dr t |}n~t |dr |j }net |drY |j }tj|j}d|jvrtjdt t |drW |j#}t |d r:|8 |j%dd |j#}|j%|xsd|d}t)d||z S#tjt f$rYwxYw#t&$rd}Y?wxYw#t&$r||}YRwxYw) Nrutf-8__len__lenfilenoba%Requests has determined the content-length for this request using the binary size of the file: however, the file has been opened in text mode (i.e. without the 'b' flag in the mode). This may lead to an incorrect content-length. In Requests 3.0, support will be removed for files in text mode.tellseek)rr^r!encodehasattrrfrgosfstatst_sizemodewarningswarnr(ioUnsupportedOperationAttributeErrorrirjrLmax)o total_lengthcurrent_positionrgs rY super_lenr{syL Jq#. HHW q)1v E uu H  XXZF88F+33L!&&  2$ q& % vvx q&!l&: %FF1aL#$668LFF+0q1 q,!11 22e''8    X%#$L%% 0 '#/  0s6*D8E(.7E8EE E%$E%( E87E8c`t|tr|jd}tjj d}||f}n dt D} ddlm}m}d}|D]D}tjj|}tjj|sB|}n|yt|} | j} | y ||j| } | r't| r| drdnd} | | xsd| d xsdfSyy#|t f$r|rYywxYw#t"t$f$rYywxYw) z;Returns the Requests tuple auth for a given url from netrc.rdNETRCNc3&K|] }d| yw)z~/N).0fs rY z!get_netrc_auth..s9[Rs8[sr)NetrcParseErrornetrcrrk)r^rdecodernenvirongetr4rrpath expanduserexistsr#hostnameauthenticatorsanyrLrGrv) url raise_errors netrc_filenetrc_locationsrr netrc_pathrlocrirTr3login_is rYget_netrc_authrs; #ujj!(J%-9[9# 0  A''$$Q'Cww~~c"  !    c]{{ <  :&55d;F#f+%ay!aw-2vayB??&v )    (   s=A D#D+D>DDDDDD-,D-ct|dd}|rHt|ttfr1|ddk7r(|ddk7rtj j |Syyyy)z0Tries to guess the filename of the given object.nameNr<>)getattrr^r!rrnrbasename)objrs rYguess_filenamersX 3 %D 4#u.47c>d2hRUoww%%GV>.tr\cFtjj|r|Stjj|\}}|rytjj|sZtjj|\}}|sn5dj ||g}|r tjj|sZt j |s|St j|}||jvr|Stjj|jddd}tj|\}} tj||j|tj||S#tj|wxYw)zReplace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged. /r)suffix)rnrrrNjoinzipfile is_zipfileZipFilenamelistsplitexttempfilemkstempwritereadclose)rarchivememberprefixzip_filerfdextracted_paths rYextract_zipped_pathsr"s;  ww~~d ggmmD)OGV "''..1''--0 66*+ "''..1   g & w'H X&&(( WW  fll3/3 4R 8F!))8B X]]6*+    s %F F c#JKtjtjj |\}} tj |d5}|dddtj ||y#1swY xYw#t$rtj|wxYww)z-Write a file to the disk in an atomic fashion)dirwbN) rrrnrdirnamefdopenrP BaseExceptionremove)filenametmp_descriptortmp_name tmp_handlers rY atomic_openrHs (//BGGOOH4MNNH YY~t ,  - 8X&- ,  ( s47B#BA4B3B#4A=9B B  B#ct|yt|ttttfr t dt |S)aTake an object and test to see if it can be represented as a dictionary. Unless it can not be represented as such, return an OrderedDict, e.g., :: >>> from_key_val_list([('key', 'val')]) OrderedDict([('key', 'val')]) >>> from_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples >>> from_key_val_list({'key': 'val'}) OrderedDict([('key', 'val')]) :rtype: OrderedDict N+cannot encode objects that are not 2-tuples)r^r!rboolrJrMrvalues rYfrom_key_val_listrUs6( }%#udC01FGG u r\cyNrrs rYto_key_val_listrrs*-r\cyrrrs rYrrts r\c|yt|ttttfr t dt|t rt|jSt|S)aTake an object and test to see if it can be represented as a dictionary. If it can be, return a list of tuples, e.g., :: >>> to_key_val_list([('key', 'val')]) [('key', 'val')] >>> to_key_val_list({'key': 'val'}) [('key', 'val')] >>> to_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples :rtype: list Nr) r^r!rrrJrMr_listr`rs rYrrxsP& }%#udC01FGG%(EKKM"" ;r\cg}t|D]5}|dd|ddcxk(rdk(rnnt|dd}|j|7|S)aParse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing. It basically works like :func:`parse_set_header` just that items may appear multiple times and case sensitivity is preserved. The return value is a standard :class:`list`: >>> parse_list_header('token, "quoted value"') ['token', 'quoted value'] To create a header from the :class:`list` again, use the :func:`dump_header` function. :param value: a string with a list header. :return: :class:`list` :rtype: list Nrr")_parse_list_headerunquote_header_valueappend)rresultitems rYparse_list_headerrsT.F"5) 8tBCy 'C ''Qr 3D d* Mr\ci}t|D]H}d|vrd||< |jdd\}}|dd|ddcxk(rdk(rnnt|dd}|||<J|S)a^Parse lists of key, value pairs as described by RFC 2068 Section 2 and convert them into a python dict: >>> d = parse_dict_header('foo="is a fish", bar="as well"') >>> type(d) is dict True >>> sorted(d.items()) [('bar', 'as well'), ('foo', 'is a fish')] If there is no value for a key it will be `None`: >>> parse_dict_header('key_without_value') {'key_without_value': None} To create a header from the :class:`dict` again, use the :func:`dump_header` function. :param value: a string with a dict header. :return: :class:`dict` :rtype: dict =Nrrr)rrNr)rrrrs rYparse_dict_headerrsx,%'F"5) d?F4L jja( e !9bc )c )(q5Et * Mr\c|rF|d|dcxk(rdk(r5n|S|dd}|r|dddk7r"|jddjd dS|S) zUnquotes a header value. (Reversal of :func:`quote_header_value`). This does not use the real unquoting but what browsers are actually using for quoting. :param value: the header value to unquote. :rtype: str rrrrNrkz\\\z\")rP)r is_filenames rYrrsd qU2Y-#- La eBQi61==.66ucB B Lr\cX|Dcic]}|j|j}}|Scc}w)zReturns a key/value dictionary from a CookieJar. :param cj: CookieJar object to extract cookies from. :rtype: dict )rr)cjcookie cookie_dicts rYdict_from_cookiejarrs0<>>26;; ,2K> ?s'ct||S)zReturns a CookieJar from a key/value dictionary. :param cj: CookieJar to insert cookies into. :param cookie_dict: Dict of key/values to insert into CookieJar. :rtype: CookieJar r&)rrs rYadd_dict_to_cookiejarrs {B //r\c^tjdttjdtj }tjdtj }tjd}|j ||j |z|j |zS)zlReturns encodings from given content string. :param content: bytestring to extract encodings from. zIn requests 3.0, get_encodings_from_content will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)z!])flagsz+]z$^<\?xml.*?encoding=["\']*(.+?)["\'>])rrrsDeprecationWarningrQcompilerSfindall)content charset_re pragma_rexml_res rYget_encodings_from_contentr s  MM 1  @MJ IQSQUQUVI ZZ? @F 7#   G $ % .. ! "r\cB|jd}|dj|dd}}i}d}|D]j}|j}|s|jdx}dk7s-|d|j|}||dzdj|} | ||j<l||fS)zReturns content type and parameters from given header. :param header: string :return: tuple containing content type and dictionary of parameters. rBrrNz"' rr)rNstripfindlower) headertokens content_typeparams params_dict strip_charsparamidxkeyrs rY_parse_content_type_headerr#s\\# F!!9??,fQRj&L)+KK  UZZ_,c3+##K0C#')$**;7E',K $   $$r\c|jd}|syt|\}}d|vr|djdSd|vryd|vryy) z}Returns encodings from given HTTP Header Dict. :param headers: dictionary to extract encoding from. :rtype: str z content-typeNcharsetz'"textz ISO-8859-1zapplication/jsonrd)rrr)headersrrs rYget_encoding_from_headersr9s`;;~.L 5lCL&Fi &&u-- \)*r\c#K|j |Ed{ytj|jd}|D]}|j|}|s||jdd}|r|yy7ew)zStream decodes an iterator.NrPerrorsr\T)final)encodingcodecsgetincrementaldecoderr)iteratorrdecoderchunkrvs rYstream_decode_response_unicoder Rs  zz6f**1::6iHG ^^E " H 4 (B   sA<A:AA<"A<cyrrstring slice_lengths rY iter_slicesres$'r\cyrrrs rYrris"%r\c#Kd}||dkr t|}|t|kr||||z||z }|t|kryyw)z Iterate over slices of a string.rN)rf)rrposs rYrrmsY C|q06{ F S3-.. | F s AAAc`tjdt|jyg}t |j }|r t |j|S t |j|xsddS#t$r|j|Y9wxYw#t$r|jcYSwxYw)zReturns the requested content back in unicode. :param r: Response object to get unicode content from. Tried: 1. charset from content-type 2. fall back and replace all unicode characters :rtype: str zIn requests 3.0, get_unicode_from_response will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)NrdrPr) rrrsrrrrr! UnicodeErrorr TypeError)rtried_encodingsrs rYget_unicode_from_responserys MM 1   yy!#O)3H -qyy(+ + 199h1')DD  -  " "8 , - yys$A5B5BBB-,B-zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~UNRESERVED_SETc|jd}tdt|D]l}||dd}t|dk(rI|jr9 t t |d}|tvr|||ddz||<Vd||||<bd||||<nd j|S#t $rtd|dwxYw) zUn-escape any percent-escape sequences in a URI that are unreserved characters. This leaves all reserved, illegal and non-ASCII bytes encoded. :rtype: str %rrrkz"Invalid percent-escape sequence: ''Nr) rNrangerfisalnumchrrJrMr*rr)uripartsihcs rYunquote_unreservedr's IIcNE 1c%j ! !HQqM q6Q;199; LAr ON"uQx|+auQxj>a58*~E!H" 775> L #EaS!JKK Ls B''Ccpd}d} tt||S#t$rt||cYSwxYw)zRe-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. :rtype: str z!#$%&'()*+,/:;=?@[]~z!#$&'()*+,/:;=?@[]~)safe)r r'r*)r"safe_with_percentsafe_without_percents rY requote_urir,sJ/0 5',3DEE 5S344 5s 55c rtjdtj|d}|j d\}}tjdtjt t |d}tjdtj|d|z}||z||zk(S)zThis function allows you to check if an IP belongs to a network subnet Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24 returns False if ip = 192.168.1.1 and net = 192.168.100.0/24 :rtype: bool z=Lrr)structunpacksocket inet_atonrNdotted_netmaskrJ)ipnetipaddrnetaddrbitsnetmasknetworks rYaddress_in_networkr:s]]4!1!1"!5 6q 9FIIcNMGTmmD&"2"2>#d)3L"MNqQGmmD&"2"27";I)r0 inet_ntoar.pack)maskr7s rYr2r2s7 b4i1, ,D   FKKd3 44r\cN tj|y#t$rYywxYw)z :rtype: bool FT)r0r1rL) string_ips rYis_ipv4_addressrBs.#  s  $$c |jddk(rR t|jdd}|dks|dkDry t j |jddyy#t$rYywxYw#t $rYywxYw)zV Very simple check of the cidr format in no_proxy variable. :rtype: bool rrFr<rT)countrJrNrMr0r1rL)string_networkr?s rY is_valid_cidrrFs C A% ~++C034D !8tby    ^11#6q9 :     s"A('A7( A43A47 BBc#<K|du}d}|r2tjj|}|tj|< d|r(|tj|=y|tj|<yy#|r(|tj|=w|tj|<wwxYww)zSet the environment variable 'env_name' to 'value' Save previous value, yield, and then restore the previous value stored in the environment variable 'env_name'. If 'value' is None, do nothingN)rnrr)env_namer value_changed old_values rY set_environrKs%M IJJNN8, $ 81  JJx('0 8$ = JJx('0 8$ s;BA-+B-,BBcd d}|}||d}t|}|j}|y|rd|jddjdD}t |r)|D]#}t |rt ||sy||k(s#ynm|}|jr|d |jz }|D]H} | jd } || k(s|| k(ryd | z} |j| s|j| sHytd|5 t|} ddd ryy #ttjf$rd } Y)wxYw#1swY.xYw) zL Returns whether we should bypass proxies or not. :rtype: bool ctjj|xs-tjj|jSr)rnrrupper)rs rY get_proxyz(should_bypass_proxies..get_proxy3s-zz~~c"AbjjnnSYY[&AAr\Nno_proxyTc3&K|] }|s| ywrr)rrTs rYrz(should_bypass_proxies..EsX+O4SW$+Os r,:rCF)rr!return str | None)r#rrPrNrBrFr:portlstripendswithrKrrr0gaierror) rrPrO no_proxy_argparsedrno_proxy_hostsproxy_iphost_with_portrTbypasss rYshould_bypass_proxiesra*s]B LZ( c]FHY8+;+;C+D+J+J3+OX 8 $* *)(H=#) +&N{{Afkk]"33&{{3't#~'=Tz$$T*n.E.Ed.K ' Z . !(+F /   6??+ F  / .s*D< DD96D<8D99D<<Ec4t||riStS)zA Return a dict of environment proxies. :rtype: dict rP)rar)rrPs rYget_environ_proxiesrdis S84 |r\c.|xsi}t|}|j+|j|j|jdS|jdz|jz|jd|jzdg}d}|D]}||vs||}|S|S)zSelect a proxy for the url, if applicable. :param url: The url being for the request :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs Nallz://zall://)r#rrscheme)rproxiesurlparts proxy_keysproxy proxy_keys rY select_proxyrmus mG}H {{8??GKK,>?? %("3"338$$$ J E  I&E  L  Lr\cT||ni}tt|j}t|j}|j d}|j }|rOt||sBt||}|j ||j d}|r|j|||S)aThis method takes proxy information from a request and configuration input to resolve a mapping of target proxies. This will consider settings such as NO_PROXY to strip proxy configurations. :param request: Request or PreparedRequest :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs :param trust_env: Boolean declaring whether to trust environment configs :rtype: dict rPrcrf) r r!rr#rgrcopyrard setdefault) requestrh trust_envrrgrP new_proxiesenviron_proxiesrks rYresolve_proxiesrus!,g"G sGKK C c] ! !F{{:&H,,.K.sXF-cHE##FO,?,?,FG   " "65 1 r\c|dtS)zO Return a string representing the default user agent. :rtype: str rr)rs rYdefault_user_agentrws V1[M ""r\c:tttdddS)z9 :rtype: requests.structures.CaseInsensitiveDict z*/*z keep-alive)z User-AgentzAccept-EncodingAccept Connection)r,rwr=rr\rYdefault_headersr{s% ,.6&   r\cg}d}|j|}|s|Stjd|D]} |jdd\}}d|jdi}|jdD]:} |jd\}}|j|||j|<<|j ||S#t$r|d}}YwxYw#t$rY4wxYw) zReturn a list of parsed link headers proxies. i.e. Link: ; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" :rtype: list z '"z, * '"r)rrQrNrMr) rlinks replace_charsvalrrlinkrrs rYparse_header_linksrs#%EM KK &E  xx& "))C+KC!&syy':;\\#&E "[[- U.3[[-GD=) * '  T!'$ L "rC "  s#B?1C? CC CCasciirkc|dd}|tjtjfvry|ddtjk(ry|ddtjtj fvry|j t}|dk(ry |dk(r |dddtk(ry |d ddtk(ry |dk(r|ddtk(ry |d dtk(ryy)z :rtype: str Nzutf-32rz utf-8-sigrkzutf-16rrdz utf-16-berz utf-16-lez utf-32-bez utf-32-le) r BOM_UTF32_LE BOM_UTF32_BEBOM_UTF8 BOM_UTF16_LE BOM_UTF16_BErD_null_null2_null3)datasample nullcounts rYguess_json_utfrs"1XF &%%v':':;; bqzV__$ bqzf))6+>+>?? U#IA~A~ #A#;&  !$Q$<6 !A~ "1:  !":  r\ct|}|\}}}}}}} |j} | s|| }} |r#tt| } dj || g} ||}|d}t || |d|| fS)zGiven a URL that may or may not have a scheme, prepend the given scheme. Does not replace a present scheme with the one provided as an argument. :rtype: str @r)rnetlocr r!rr$) r new_schemer\rgauth_host_portrqueryfragmentrs rYprepend_scheme_if_neededrs s^F8>5FD%eX ]]F V c6"4.) ~ | vvtRA BBr\ct|} t|jt|jf}|S#tt f$rd}Y|SwxYw)z{Given a url with authentication components, extract them into a tuple of username,password. :rtype: (str,str) )rr)r#r"usernamepasswordrvr)rr\rs rYget_auth_from_urlr.sU c]F('&//*BC K I & Ks*9A AcB|\}}t||dt||dy)zVerifies that header parts don't contain leading whitespace reserved characters, or return characters. :param header: tuple, in the format (name, value). rrN)_validate_header_part)rrrs rYcheck_header_validityr?s% KD%&$*&%+r\c t|tr t|}n7t|tr t|}nt d|d|dt ||j|s|dk(rdnd}t d|d|y) Nz Header part (z) from z# must be of type str or bytes, not rrrzTInvalid leading whitespace, reserved character(s), or return character(s) in header z: )r^r!rrrr)typerR)r header_partheader_validator_index validator header_kinds rYrrJs +s#*+AB K '+,BC K?'&:115k1B0C E  ??; ' 6! ;f &&1]"[O E   (r\c~t|\}}}}}}|s||}}|jddd}t|||||dfS)zW Given a url remove the fragment and the authentication part. :rtype: str rrrr)r#rsplitr$)rrgrrrr _fragments rY urldefragauthrbsU 6>c]2FFD&% V ]]3 "2 &F vvtVUB? @@r\ct|jdd}|.t|jtr ||jyt d#t $r t dwxYw)zfMove file pointer back to its recorded starting position so it can be read again on redirect. rjNz;An error occurred when rewinding request body for redirect.z+Unable to rewind request body for redirect.)rbodyr^_body_positionrrLr+)prepared_request body_seeks rY rewind_bodyrssu(--vtrs#  #/1$ 4:( ,(!::) U)*ekkm+!#S1 u1 en en"& BHHWl489JKL" <<7$L / =  D3P+01 1 #'1 1 h&#L    ?: - -  A     H!@@F202%,2"*'& ' '!+'!' ' % %)%% %   '1 ' &T"M 05, 550 11,<~ : & " ># "L  g  @C<", +      0A"Sr\PK!m== __pycache__/auth.cpython-312.pycnu[ 9r*j/LUdZddlmZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z mZmZmZddlmZddlmZmZmZdd lmZdd lmZe rdd lmZdd l m Z dd lmZmZdZ de!d<dZ"de!d<ddZ#GddZ$Gdde$Z%Gdde%Z&Gdde$Z'y)z] requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. ) annotationsN) b64encode) TYPE_CHECKINGAnyFinalcastoverload)to_native_string) basestringstrurlparse)extract_cookies_to_jar)parse_dict_header) CookieJar)r)PreparedRequestResponsez!application/x-www-form-urlencodedrCONTENT_TYPE_FORM_URLENCODEDzmultipart/form-dataCONTENT_TYPE_MULTI_PARTc t|ts*tjd|dtt |}t|ts3tjdt |dtt |}t|t r|jd}t|t r|jd}dttdj||fjz}|S)zReturns a Basic Auth string.zpNon-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (zC) to a string or bytes object in the near future to avoid problems.)categoryzpNon-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (latin1zBasic :) isinstancer warningswarnDeprecationWarningr typeencoder rjoinstrip)usernamepasswordauthstrs Br'r)cjeZdZUdZded<ded<ed dZed dZddZddZdd Zdd Z y ) HTTPBasicAuthz?Attaches HTTP Basic Authentication to the given Request object. bytes | strr"r#cyNr7r-r"r#s r%__init__zHTTPBasicAuth.__init__[>Ar'cyr<r7r=s r%r>zHTTPBasicAuth.__init__]BEr'c ||_||_yr<)r"r#r=s r%r>zHTTPBasicAuth.__init__`s    r'c |t|jt|ddk(|jt|ddk(gSNr"r#allr"getattrr#r-others r%__eq__zHTTPBasicAuth.__eq__d>  D!AA  D!AA   r'c||k( Sr<r7rHs r%__ne__zHTTPBasicAuth.__ne__l5=  r'c`t|j|j|jd<|S)N Authorizationr&r"r#headersr,s r%r/zHTTPBasicAuth.__call__os$%4T]]DMM%R /"r'Nr"r r#r r1Noner"bytesr#rVr1rTr"r:r#r:r1rTrIobjectr1boolrIrr1rZr0) r3r4r5r6__annotations__r r>rJrMr/r7r'r%r9r9UsAI AA EE! !r'r9ceZdZdZddZy) HTTPProxyAuthz=Attaches HTTP Proxy Authentication to a given Request object.c`t|j|j|jd<|S)NzProxy-AuthorizationrQr,s r%r/zHTTPProxyAuth.__call__ws%+:4==$--+X '(r'Nr0r2r7r'r%r^r^ts Gr'r^ceZdZUdZded<ded<ded<ded<d ed <d ed <d ed<d ed<eddZeddZddZddZddZd dZ d!dZ d"dZ d#dZ d$dZ y)%HTTPDigestAuthz@Attaches HTTP Digest Authentication to the given Request object.r:r"r#zthreading.local _thread_localr last_nonceint nonce_countzdict[str, str]chalz int | Nonepos num_401_callscyr<r7r=s r%r>zHTTPDigestAuth.__init__r?r'cyr<r7r=s r%r>zHTTPDigestAuth.__init__rAr'cR||_||_tj|_yr<)r"r# threadinglocalrbr=s r%r>zHTTPDigestAuth.__init__s    &__.r'ct|jdsgd|j_d|j_d|j_i|j_d|j_d|j_yy)NinitTr)hasattrrbrorcrerfrgrh)r-s r%init_per_thread_statez$HTTPDigestAuth.init_per_thread_stateskt))62&*D   #,.D   )-.D   *&(D   #%)D   "/3D   , 3r'c P|jjd}|jjd}|jjjd}|jjjd}|jjjd}d|d}n|j}|dk(s|dk(rd*d } | n#|d k(rd*d } | n|d k(rd*d } | n |dk(rd*d} | yd+fd } d}t |}|j xsd}|j r|d|j z }|jd|d|j}|d|}|}|}||jjk(r |jxjdz c_ nd|j_ |jjd}t|jjjd}||jdz }|tjjdz }|tj dz }t#j$|dj'dd}|dk(r|d|d|}|s| ||d|}n0|dk(sd|j)dvr|d|d|d|}| ||}ny||j_ d|jd|d |d!|d"|d# }|r |d$|d#z }|r |d%|d#z }|r |d&|d#z }|r |d'|d(|d#z }d)|S),z :rtype: str realmnonceqop algorithmopaqueNMD5zMD5-SESSct|tr|jd}tj|dj SNutf-8Fusedforsecurity)rr rhashlibmd5 hexdigestxs r%md5_utf8z4HTTPDigestAuth.build_digest_header..md5_utf8s4a%)A{{1e<FFHHr'SHAct|tr|jd}tj|dj Sr{)rr rrsha1rrs r%sha_utf8z4HTTPDigestAuth.build_digest_header..sha_utf8s4a%)A||Au=GGIIr'zSHA-256ct|tr|jd}tj|dj Sr{)rr rrsha256rrs r% sha256_utf8z7HTTPDigestAuth.build_digest_header..sha256_utf84a%)A~~a?IIKKr'zSHA-512ct|tr|jd}tj|dj Sr{)rr rrsha512rrs r% sha512_utf8z7HTTPDigestAuth.build_digest_header..sha512_utf8rr'c|d|S)N:r7)sd hash_utf8s r%KDz.HTTPDigestAuth.build_digest_header..KDss!A3Z( (r'/?rr 08xr|Fr}auth,z:auth:z username="z ", realm="z ", nonce="z", uri="z ", response=""z , opaque="z , algorithm="z , digest="z, qop="auth", nc=z , cnonce="zDigest )rz str | bytesr1r )rr rr r1r )rbrfgetupperrpathqueryr"r#rcrer rtimectimeosurandomrrrsplit)r-methodurlrtrurvrwrx _algorithmrrrrrentdigp_parsedrA1A2HA1HA2ncvaluercnoncerespdignoncebitbasers @r%build_digest_headerz"HTTPDigestAuth.build_digest_headers ""''0""''0  %%))%0&&++// < ##((,,X6  J"*J  * ": I !I 5  J !I 9 $ L $I 9 $ L $I   )C=}}# >> a'( (D awa  7xq mm D&&11 1    * *a / *-.D   *''33C8 "".. / 6 6w ? U\\' "" TZZ\  )) RZZ]a7AACCRH  #se1UG1VH56Cq./G F]f #6'!F86#?Hh'G(-%z% 5'J6wiq 2   j* *D  mI;a0 0D  j* *D  'y 6(!D DDr'c @|jrd|j_yy)z)Reset num_401_calls counter on redirects.r N) is_redirectrbrh)r-r.kwargss r%handle_redirectzHTTPDigestAuth.handle_redirect s ==/0D   , r'c d|jcxkrdksnd|j_|S|jj?t |j j ddx}||jj|jjdd}d|jvr|jjd kr|jxjdz c_tjd tj }t|jd|d |j_|j |j#|j j%}t'd |j(}t+||j |j,|j/||j1t't2|j4t't2|j6}|r||jd<|j8j:|fi|} | j<j?||| _| Sd|j_|S)zo Takes the given response and tries digest-auth, if needed. :rtype: requests.Response iir Nseekzwww-authenticaterpdigestzdigest )flags)countrrP) status_coderbrhrgrGrequestbodyrRrlowerrecompile IGNORECASErsubrfcontentclosecopyr_cookiesrrawprepare_cookiesrr rr connectionsendhistoryappend) r-r.rrs_authpatprep cookie_jar _digest_auth_rs r% handle_401zHTTPDigestAuth.handle_401samm)c)/0D   ,H    ! ! -  ==JT''++,126 v||~ %$*<*<*J*JQ*N    , , 1 ,**Zr}}=C&7FRS8T&UD   # II GGI99>>#Dk4==9J ":qyy!%% @   ,33S$++&S$(((;L0< _-"""4262B JJ  a BJI+,(r'c |j|jjrS|jt t |j t t |j}|r||jd<t|jddx}||j_ nd|j_ |jd|j|jd|jd|j_|S)NrPtellresponser )rrrbrcrrr rrrRrGrrg register_hookrrrh)r-r.rrs r%r/zHTTPDigestAuth.__call__As ""$    ( (33S!((#T#quu%5L-9 /*AFFFD1 1D >%)VD   " &*D   "  DOO4  D$8$89+,(r'c |t|jt|ddk(|jt|ddk(gSrDrErHs r%rJzHTTPDigestAuth.__eq__YrKr'c||k( Sr<r7rHs r%rMzHTTPDigestAuth.__ne__arNr'NrSrUrW)r1rT)rr rr r1z str | None)r.rrrr1rT)r.rrrr1rr0rXr[)r3r4r5r6r\r r>rrrrrr/rJrMr7r'r%rara|szJ""O  O AA EE/ 4m ^1 .`0 !r'ra)r"r:r#r:r1r )(r6 __future__rrrrrlrrbase64rtypingrrrrr _internal_utilsr compatr r rcookiesrutilsrhttp.cookiejarrmodelsrrrr\rr&r)r9r^rar7r'r%rs#  <<---+$(1&IeI!66)XBBH>Mf!Xf!r'PK!7K "__pycache__/compat.cpython-312.pycnu[ 9r*j dZddlmZddlZddlZddlmZddlmZ  e e jdddk(Z dd ZeZej"Zedd k(Zedd k(Zd Z ddlZdZerdd lmZndd lmZddlmZddlmZmZmZddl m!Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1ddl2m3Z3m4Z4m5Z5m6Z6m7Z7e8Z9e8Z8e:Z:e8e:fZ;e ey#e ef$rdZ YwxYw#e$rddlZYwxYw)z requests.compat ~~~~~~~~~~~~~~~ This module previously handled import compatibility issues between Python 2 and Python 3. It remains for backwards compatibility until the next major version. ) annotationsN) ModuleType) __version__.Tchd}dD]}| tj|}|S#t$rY+wxYw)z-Find supported character detection libraries.N)chardetcharset_normalizer) importlib import_module ImportError)r libs >/opt/hc_python/lib/python3.12/site-packages/requests/compat.py_resolve_char_detectionr%sFG0 ? #11#61 N  s % 11F)JSONDecodeError) OrderedDict)CallableMappingMutableMapping) cookiejar)Morsel)StringIO) quote quote_plusunquote unquote_plus urldefrag urlencodeurljoinurlparseurlsplit urlunparse) getproxiesgetproxies_environmentparse_http_list proxy_bypassproxy_bypass_environment)returnzModuleType | None)?__doc__ __future__rr systypesrurllib3rurllib3_versionintsplit is_urllib3_1 TypeErrorAttributeErrorrr version_info_veris_py2is_py3has_simplejson simplejsonjsonr r collectionsrcollections.abcrrrhttpr cookielib http.cookiesrior urllib.parserrrrrr r!r"r#r$urllib.requestr%r&r'r(r)str builtin_strbytes basestringfloat numeric_types integer_typesrrNs$#   ,,,S1!45:L  " #  aA aAN*$$=='      5\ e  k >"LTs#C&C$ C! C!$ C0/C0PK!H4"__pycache__/models.cpython-312.pycnu[ 9r*j7UdZddlmZddlZddlZddlmZmZm Z m Z m Z ddl m Z ddlmZmZmZmZmZmZddlmZmZmZmZmZddlmZdd lmZdd lm Z d d l!m"Z"m#Z#d d l$m%Z&d dl'm(Z(d dl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1d dl)m2Z3d dl4m5Z5m6Z6m7Z7d dl8m9Z9m:Z:m;Z;mZ>m?Z?m@Z@d dl8m*ZAd dl8mZBd dlCmDZDd dlEmFZFd dlGmHZHd dlImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSerddlTmUZUddlVmWZWd dlXm$ZYd dlZm[Z[d dl4m\Z\eFjeFjeFjeFjeFjfZbdecd<d Zdd!ecd"<d#Zed!ecd$<d%Zfd!ecd&<Gd'd(ZgGd)d*ZhGd+d,ehZiGd-d.egehZjGd/d0Zky)1z` requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. ) annotationsN)Callable GeneratorIterableIteratorMapping)UnsupportedOperation) TYPE_CHECKINGAnyFinalLiteralcastoverload) DecodeErrorLocationParseError ProtocolErrorReadTimeoutErrorSSLError) RequestField)encode_multipart_formdata) parse_url)to_native_stringunicode_is_ascii) SupportsRead) HTTPBasicAuth)JSONDecodeError basestring builtin_strchardet cookielib urlencodeurlsplit urlunparse)json)_copy_cookie_jarcookiejar_from_dictget_cookie_header)ChunkedEncodingErrorConnectionErrorContentDecodingError HTTPErrorInvalidJSONError InvalidURL MissingSchemaStreamConsumedError)r)r) default_hooks)codes)CaseInsensitiveDict) check_header_validityget_auth_from_urlguess_filenameguess_json_utf iter_slicesparse_header_links requote_uristream_decode_response_unicode super_lento_key_val_list) CookieJar)Self)_types) HTTPAdapter)RequestsCookieJarzFinal[tuple[int, ...]]REDIRECT_STATIintDEFAULT_REDIRECT_LIMITi(CONTENT_CHUNK_SIZEiITER_CHUNK_SIZEceZdZUded<ed dZeed dZeed dZee ddZeeddZe ddZe dd Z y )RequestEncodingMixin str | Noneurlcg}ttt|j}|j}|sd}|j ||j }|r"|j d|j |dj|S)zBuild the path URL to use./?)r#rstrrLpathappendqueryjoin)selfrLprRrTs >/opt/hc_python/lib/python3.12/site-packages/requests/models.pypath_urlzRequestEncodingMixin.path_urlpsl T#txx( )vvD 4  JJsO JJu wws|cyNdatas rX_encode_paramsz#RequestEncodingMixin._encode_paramss*-rZcyr\r]r^s rXr`z#RequestEncodingMixin._encode_paramss.1rZcyr\r]r^s rXr`z#RequestEncodingMixin._encode_paramss(+rZcyr\r]r^s rXr`z#RequestEncodingMixin._encode_paramss47rZc t|ttfr|St|tr|St |drg}t |D]\}}t|t s t |ds|g}|D]Z}||jt|tr|jdn|t|tr|jdn|f\t|dS|S)zEncode parameters in a piece of data. Will successfully encode parameters when passed as a dict or a list of 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary if parameters are supplied as a dict. __iter__utf-8T)doseq) isinstancerQbytes _SupportsReadhasattrr=rrSencoder")r_resultkvsvs rXr`z#RequestEncodingMixin._encode_paramss dS%L )K m ,K T: &02F(.2b*-WR5LBA} 5?35G 1Q5?35G 1Q/V40 0KrZc |s tdt|tr tdg}t|xsi}t|xsi}|D]\}}t|ts t |ds|g}|D]u}|t|t s t |}|jt|t r|jdn|t|t r|jdn|fw|D]\}}d}d} t|ttfr1t|dk(r|\} } n.t|dk(r|\} } }n|\} } }} nt|xs|} |} t| t t tfr| } n&t| tr| j!} n| | } t#|| | | } | j%| |j| t'|\}}||fS) aBuild the body for a multipart/form-data request. Will successfully encode files when passed as a dict or a list of tuples. Order is retained if data is a list of tuples but arbitrary if parameters are supplied as a dict. The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) or 4-tuples (filename, fileobj, contentype, custom_headers). zFiles must be provided.zData must not be a string.reNrf)namer_filenameheaders) content_type) ValueErrorrhrr=rkrirQrSdecoderltuplelistlenr6 bytearrayrjreadrmake_multipartr)filesr_ new_fieldsfieldsfieldvalrprnftfhfnfpfdatarfbodyrws rX _encode_filesz"RequestEncodingMixin._encode_filess67 7 j )9: :=?  , , JE3#z*'#z2Je=%a/F%% *%7"LL1!&1;As1CAHHW-  !$DAqBB!eT]+q6Q;FBVq[!"JBB%&NBB#A&+!"sE956B . 152rJB   2  .   b !587zBl\!!rZNreturnrQ)r_rQrrQ)r_rirri)r__t.SupportsRead[str | bytes]rr)r_z _t.KVDataTyperrQ)r_z_t.EncodableDataTyperz*str | bytes | _t.SupportsRead[str | bytes])r _t.FilesTyper__t.RawDataType | Nonerztuple[bytes, str]) __name__ __module__ __qualname____annotations__propertyrYr staticmethodr`rr]rZrXrJrJms O (-- 11 +*+ %++77" 3>D"D"#8D" D"D"rZrJc4eZdZUded< ddZddZy)RequestHooksMixindict[str, list[_t.HookType]]hooksc||jvrtd|dt|tr|j|j |yt |dr&|j|j d|Dyy)zProperly register a hook.z.Unsupported event specified, with event name ""rec3BK|]}t|ts|ywr\)rhr).0hs rX z2RequestHooksMixin.register_hook.. s$P1 1h8OQsN)rrxrhrrSrkextendrVeventhooks rX register_hookzRequestHooksMixin.register_hookss  "MeWTUVW W dH % JJu  $ $T * T: & JJu  $ $$P$P P'rZc` |j|j|y#t$rYywxYw)ziDeregister a previously registered hook. Returns True if the hook existed, False if not. TF)rremoverxrs rXderegister_hookz!RequestHooksMixin.deregister_hooks3   JJu  $ $T *  s ! --N)rrQrz#Iterable[_t.HookType] | _t.HookTyperNone)rrQrz _t.HookTyperbool)rrrrrrr]rZrXrrs. '' Q Q C Q  Q rZrceZdZUdZded<ded<ded<ded <d ed <d ed <ded<ded<ded< d ddZddZddZy)Requesta{A user-created :class:`Request ` object. Used to prepare a :class:`PreparedRequest `, which is sent to the server. :param method: HTTP method to use. :param url: URL to send. :param headers: dictionary of headers to send. :param files: dictionary of {filename: fileobject} files to multipart upload. :param data: the body to attach to the request. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param json: json for the body to attach to the request (if files or data is not specified). :param params: URL parameters to append to the URL. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param auth: Auth handler or (user, pass) tuple. :param cookies: dictionary or CookieJar of cookies to attach to this request. :param hooks: dictionary of callback hooks, for internal usage. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() rKmethod_t.UriType | NonerLzMapping[str, str | bytes]rvrr _t.DataTyper_ _t.JsonTyper% _t.ParamsTypeparams _t.AuthTypeauth5RequestsCookieJar | CookieJar | dict[str, str] | NonecookiesNc D|gn|}|gn|}|in|}|in|}| in| } t|_t| jD]\} } |j | | ||_||_||_||_||_ | |_ ||_ ||_ ||_ y)N)rr)r1rr{itemsrrrLrvrr_r%rrr) rVrrLrvrr_rrrrr%rnrps rX__init__zRequest.__init__As\rtm"W~6m"_ 'DAq   QQ  /(        rZc"d|jdS)Nz rrVs rX__repr__zRequest.__repr__csDKK=++rZc t}|j|j|j|j|j |j |j|j|j|j|j |S)zXConstructs a :class:`PreparedRequest ` for transmission and returns it.) rrLrvrr_r%rrrr) PreparedRequestpreparerrLrvrr_r%rrrrrVrWs rXrzRequest.preparefsh   ;;LL**;;LL**  rZ NNNNNNNNNN)rrKrLrrvz_t.HeadersTyperrr_rrrrrrrr_t.HooksInputType | Noner%rrrrrr)rrr__doc__rrrrr]rZrXrrs6   &&      BB"!%"&" $ IM*.           G (    D,rZrc>eZdZUdZded<ded<ded<ded<d ed <d ed <d ed<ddZ d ddZd dZd!dZd"dZ e d#dZ d$dZ d%dZ d& d'dZd(dZ d) d*dZ d+dZd,dZy)-ra)The fully mutable :class:`PreparedRequest ` object, containing the exact bytes that will be sent to the server. Instances are generated from a :class:`Request ` object, and should not be instantiated manually; doing so may produce undesirable effects. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> r = req.prepare() >>> r >>> s = requests.Session() >>> s.send(r) rKrrLz CaseInsensitiveDict[str | bytes]rvz$RequestsCookieJar | CookieJar | None_cookies _t.BodyTyperrrzint | object | None_body_positioncvd|_d|_d|_d|_d|_t |_d|_yr\)rrLrvrrr1rrrs rXrzPreparedRequest.__init__s8    "_ "rZNc td|}|j||j|||j||j ||j ||| |j |||j| y)z6Prepares the entire request with the given parameters. _t.UriTypeN)rprepare_method prepare_urlprepare_headersprepare_cookies prepare_body prepare_auth prepare_hooks) rVrrLrvrr_rrrrr%s rXrzPreparedRequest.prepares|<% F# f% W% W% $t, $$ 5!rZc"d|jdS)Nz?DK #rZcddl} |j|djd}|S#|j$rtwxYw)NrT)uts46rf)idnarlry IDNAError UnicodeError)hostrs rX_get_idna_encoded_hostz&PreparedRequest._get_idna_encoded_hostsI ;;t4;077@D ~~   s "*Ac <t|tr|jd}n t|}|j }d|vr'|j j ds||_y t|\}}}}}}} |std|d|d|std|dt|s |j|}n|j d r td |xsd } | r| d z } | |z } |r| d|z } |sd }t|ttfr t!|}||j#|} nd } | r |r|d| }n| }t%t'|| |d || f}||_y#t$r} t| jd} ~ wwxYw#t$r td wxYw)zPrepares the given HTTP URL.utf8:httpNz Invalid URL z0: No scheme supplied. Perhaps you meant https://rOz: No host suppliedzURL has an invalid label.)*.rP@rN&)rhriryrQlstriplower startswithrLrrr.argsr/rrrrr`r:r$) rVrLrschemerrportrRrTfragmentenetloc enc_paramss rXrzPreparedRequest.prepare_urls c5 !**V$Cc(Cjjl #:ciik44V<DH  &>Gn ;FD$dE8sg&--0E4  |C72DEF F  % >2248__Z (89 9  cMF$  $j FD fsEl +%f-F  ,,V4JJ  ':,/"*ffdBx%PQRg" &aff% % &&  > !<== >s$*E#.F# F,E>>FFct|_|r>|jD]*}t||\}}||jt |<,yy)z Prepares the given HTTP headers.N)r3rvrr4r)rVrvheaderrtvalues rXrzPreparedRequest.prepare_headers3sK+, !--/%f-$ e7< -d34 * rZcd}d}|s=|;d} tj|d}t |t s|j d}t |txs t|d}|rt |tt tttfsw t|}|}t#|dd |j%|_|r t-d |r t/||j0d <||_yd |j0d <||_yt3d |} |r|j5|| \}}n8| r6|j7| }t |t8st |t:rd}nd}|j=||rd|j0vr||j0d<||_y#t$r}t||d}~wwxYw#ttt f$rd}Y6wxYw#t($rt+|_Y0wxYw)z"Prepares the given HTTP body data.Nzapplication/jsonF) allow_nan)requestrfretellz1Streamed bodies and files are mutually exclusive.Content-LengthchunkedzTransfer-Encodingrz!application/x-www-form-urlencodedz content-typez Content-Type) complexjsondumpsrxr-rhrirlrrkrQr{rzrr< TypeErrorAttributeErrorr getattrrrOSErrorobjectNotImplementedErrorrrvrrr`rrjprepare_content_lengthr) rVr_rr%rrwve is_iterablelengthraw_datas rXrzPreparedRequest.prepare_body>s (.L 9"((?dE*{{7+!x0MGD*4M z$eT5'0RS "4DtVT*63*.))+D' )G1 01, '3T:H'+'9'9%'J$|..x8D!$ 3z$ 7V'+ 'J  ' ' -t||!C/; ^, s 9&r488 9~/CD  3+1(D'3s;F F2%G F/ F**F/2G  G G+*G+c|'t|}|rt||jd<yy|jdvr,|jj dd|jd<yyy)z>Prepare Content-Length header based on request method and bodyNr)GETHEAD0)r<rrvrget)rVrrs rXrz&PreparedRequest.prepare_content_lengthsn  t_F2=V1D -. KK .   !12:.1DLL) * ; /rZch|2ttt|j}t |r|nd}|r|t |t rt|dk(r t|}n td|}||}|jj|j|j|jyy)z"Prepares the given HTTP auth data.NrrzCallable[..., PreparedRequest]) r5rrQrLanyrhrzr|r__dict__updaterr)rVrrLurl_auth auth_handlerrs rXrzPreparedRequest.prepare_auths <(c488)<=H"8}8$D $&3t9>,d3  $$DdK T"A MM  ,  ' ' 2 rZct|tjr||_nt ||_t d|j}t ||}|||jd<yy)aPrepares the given HTTP cookie data. This function eventually generates a ``Cookie`` header from the given cookies using cookielib. Due to cookielib's design, the header will not be regenerated if it already exists, meaning this function can only be called once for the life of the :class:`PreparedRequest ` object. Any subsequent calls to ``prepare_cookies`` will have no actual effect, unless the "Cookie" header is removed beforehand. r>NCookie)rhr!r>rr'rr(rv)rVr cookies_jar cookie_headers rXrzPreparedRequest.prepare_cookiess\ gy22 3#DM/8DM; 6 )+t<  $%2DLL " %rZcH|xsi}|D]}|j|||y)zPrepares the given hooks.N)r)rVrrs rXrzPreparedRequest.prepare_hookss+  E   ueEl 3rZrrr)rrKrLrrv Mapping[str, str | bytes] | Nonerrr_rrrrrrrrrr%rrrrr)rrKrr)rrQrrQ)rLrrrrr)rvrrrr\)r_rrrr%rrr)rrrr)rP)rrrLrrr)rrrr)rrrr)rrrrrrrrrrrrrrrrrrrr]rZrXrrxs(  O --22  ''''#&"!%48" $ IM*. """2 "  "  """G"("" ":4 @ P PP  Pd =KOLL(4Ld!Zd?d"Zd@d#Z dAd$Z dBd%Z dCd&Z dCd'Z dDd(ZedCd)ZedCd*ZedCd+ZedEd,ZedFd-Ze dG dHd/Ze dI dJd0Z dG dKd1Zeed.d2f dLd3Zeefd2d4 dMd5Zed.d2f dNd6ZedOd7ZedBd8ZdPd9ZedQd:Zd=d;Zd=d<Zy2)RResponsezhThe :class:`Response ` object, which contains a server's response to an HTTP request. zbytes | Literal[False] | None_contentr_content_consumedPreparedRequest | None_nextrE status_codezCaseInsensitiveDict[str]rvr rawrQrLrKencodingzlist[Response]historyreasonrBrzdatetime.timedeltaelapsedrrrA connection) rr#rvrLr&r%r'rr(rz list[str] __attrs__cd|_d|_d|_d|_t |_d|_d|_d|_g|_ d|_ ti|_ tjd|_d|_y)NFr)rr r"r#r3rvr$rLr%r&r'r'rdatetime timedeltar(rrs rXrzResponse.__init__s !&   +,    +2.  ))!,  rZc|Sr\r]rs rX __enter__zResponse.__enter__*s rZc$|jyr\)close)rVrs rX__exit__zResponse.__exit__-s  rZc |js |j|jDcic]}|t||dc}Scc}wr\)r contentr*r)rVattrs rX __getstate__zResponse.__getstate__0s>%% LL<@NNKNDgdD$//NKKKs?c|jD]\}}t|||t|ddt|ddy)Nr Tr$)rsetattr)rVstatertrs rX __setstate__zResponse.__setstate__8s= ;;=KD% D$ &) )40eT"rZc"d|jdS)Nz rs rX __nonzero__zResponse.__nonzero__MrArZc$|jdS)z,Allows you to use a response as an iterator.) iter_contentrs rXrezResponse.__iter__Ws  %%rZcD |jy#t$rYywxYw)axReturns True if :attr:`status_code` is less than 400, False if not. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. FT)raise_for_statusr,rs rXr?z Response.ok[s,   ! ! #  s  cFd|jvxr|jtvS)zTrue if this Response is a well-formed HTTP redirect that could have been processed automatically (by :meth:`Session.resolve_redirects`). location)rvr#rCrs rX is_redirectzResponse.is_redirectjs# T\\)Pd.>.>..PPrZczd|jvxr,|jtjtjfvS)z@True if this Response one of the permanent versions of redirect.rJ)rvr#r2moved_permanentlypermanent_redirectrs rXis_permanent_redirectzResponse.is_permanent_redirectqs?T\\) d.>.>  # #  $ $C /  rZc|jS)zTReturns a PreparedRequest for the next request in a redirect chain, if there is one.)r"rs rXnextz Response.nextyszzrZcTt"tj|jdSy)zOThe apparent encoding, provided by the charset_normalizer or chardet libraries.r%rf)r detectr4rs rXapparent_encodingzResponse.apparent_encoding~s'  >>$,,/ ; ;rZFcyr\r]rV chunk_sizedecode_unicodes rXrFzResponse.iter_contentsrZcyr\r]rVs rXrFzResponse.iter_contents!$rZc\dfd }jr$tjtr t (tt st dtdjr'ttj}t|}n|}|r t|}|S)aIterates over the response data. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. The chunk size is the number of bytes it should read into memory. This is not necessarily the length of each item returned as decoding can take place. chunk_size must be of type int or None. A value of None will function differently depending on the value of `stream`. stream=True will read data as it arrives in whatever size the chunks are received. If stream=False, data is returned as a single chunk. If decode_unicode is True, content will be decoded using encoding information from the response. If no encoding information is available, bytes will be returned. This can be bypassed by manually setting `encoding` on the response. c3Ktjdr. jjdEd{d_ y jj}|s d_ y|+78#t$r}t |d}~wt $r}t |d}~wt$r}t|d}~wt$r}t|d}~wwxYww)NstreamT)decode_content) rkr$r\rr)rr+rr*rRequestsSSLErrorr~r )rchunkrWrVs rXgeneratez'Response.iter_content..generatestxx* .#xxz$OOO"&*D "  HHMM*5E &*D " K P$2.q11"2.q11'-)!,,.*1--.s\C A6A4A64C4A66 C? B  C B!! C- B88 C CCCz+chunk_size must be an int, it is instead a r)rzGenerator[bytes, None, None]) r rhrrr0rErtyperrir8r;)rVrWrXr`r4chunkss`` rXrFzResponse.iter_contents* *.  ! !j&E%' '  #Jz3,G=d:>N=OqQ   ! !5$--0G *5FZF 3FDAF rZNcyr\r]rVrWrX delimiters rX iter_lineszResponse.iter_liness rZ)recyr\r]rds rXrfzResponse.iter_liness!$rZc#$Kd}|j||D]k}|td||z}|r|j|}n|j}|r&|dr!|r|dd|dk(r|j }nd}|Ed{m||yy7w)a[Iterates over the response data, one line at a time. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. The decode_unicode param works the same as in `iter_content`, with the same caveats. .. note:: This method is not reentrant safe. N)rWrXz str | bytes)rFrsplit splitlinespop)rVrWrXrependingr_liness rXrfzResponse.iter_liness '+&&!.' E"]GeO< I.((*rur2%)1K))+  # &  M  sA=B?BBc|jdurg|jr td|jdk(s |jd|_n-dj |j txsd|_d|_|jS)z"Content of the response, in bytes.Fz2The content for this response was already consumedrNrZT)rr  RuntimeErrorr#r$rUrFrGrs rXr4zResponse.contentsy ==E !%%"#WXX1$(8 $ #):):;M)N O VSV !%}}rZcd}|j}|jsy|j |j} t|j|xsdd}|S#tt f$rt|jd}Y|SwxYw)aContent of the response, in unicode. If Response.encoding is None, encoding will be guessed using ``charset_normalizer`` or ``chardet``. The encoding of the response content is determined based solely on HTTP headers, following RFC 2616 to the letter. If you can take advantage of non-HTTP knowledge to make a better guess at the encoding, you should set ``r.encoding`` appropriately before accessing this property. NrPrfreplace)errors)r%r4rTrQ LookupErrorr)rVr4r%s rXtextz Response.texts==|| == --H :$,,(;GINGY' :$,,y9G :sA&A=<A=c 6|jsk|jr_t|jdkDrGt|j}|0 t j |jj |fi|S t j |jfi|S#t$rY,t$r0}t|j|j|jd}~wwxYw#t$r0}t|j|j|jd}~wwxYw)aYDecodes the JSON response body (if any) as a Python object. This may return a dictionary, list, etc. depending on what is in the response. :param \*\*kwargs: Optional arguments that ``json.loads`` takes. :raises requests.exceptions.JSONDecodeError: If the response body does not contain valid json. rsN)r%r4r|r7rloadsryUnicodeDecodeErrorrRequestsJSONDecodeErrormsgdocposru)rVkwargsr%rs rXr%z Response.json?s}}#dll2Ca2G &dll3H# G&,,T\\-@-@-JUfUU ?$$TYY9&9 9* &G1!%%FFG  ?*!%%> > ?s6 .B9C C$C,+CC D(+DDc|jjd}i}|r>t|}|D].}|jdxs|jd}|*|||<0|S)z8Returns the parsed header links of the response, if any.linkrelrL)rvrr9)rVrresolved_linkslinksrkeys rXrzResponse.linksbse!!&)46 &v.Ehhuo8%?*.N3' rZcd}t|jtr |jjd}n |j}d|j cxkrdkr"nn|j d|d|j }n6d|j cxkrdkr!nn|j d |d|j }|r t|| y #t$r|jjd}YwxYw) z+Raises :class:`HTTPError`, if one occurred.rPrfz iso-8859-1iiz Client Error: z for url: iXz Server Error: )responseN)rhr'riryrxr#rLr,)rVhttp_error_msgr's rXrHzResponse.raise_for_statusts dkk5 )  :++G4[[F $"" (S (##$OF8:dhhZP D$$ *s *##$OF8:dhhZP  NT: : & :++L9 :sC$C*)C*c|js|jjt|jdd}||yy)zReleases the connection back to the pool. Once this method has been called the underlying ``raw`` object must not be accessed again. *Note: Should not normally need to be called explicitly.* release_connN)r r$r1r)rVrs rXr1zResponse.closes= %% HHNN txx>  # N $rZr)rr?)rr rr)rdict[str, Any])r9rrrr)rr)rIterator[bytes])rr!)rrK)rF)rW int | NonerXLiteral[False]rr)r)rWrrX Literal[True]rIterator[str | bytes])rWrrXrrr)rWrErXrrez bytes | Nonerr)rWrErXrrestr | bytes | Nonerr)rWrErXrrerrr)rri)r}r rr )rzdict[str, dict[str, str]])rrrrrr*rr/r2r6r:rr@rCrerr?rKrOrQrTrrFrHrfr4rur%rrHr1r]rZrXrrs,+ !! %% H H  K    Iy -^L#2&  QQ   KP$:H '($$$=J$ $$BG=$=:>= =~*)."& '    *$ )- $$& $ & $  $$*$(, &&&& &  &P$##J!?F";: rZr)lr __future__rr,encodings.idna encodingscollections.abcrrrrrior typingr r r r rrurllib3.exceptionsrrrrrurllib3.fieldsrurllib3.filepostr urllib3.utilr_internal_utilsrrr@rrjrrcompatrrrr r!r"r#r$r%rrr&r'r( exceptionsr)r*r+r,r-r.r/r0ryr^rr1 status_codesr2 structuresr3utilsr4r5r6r7r8r9r:r;r<r=http.cookiejarr>typing_extensionsr?rP_tadaptersrArBmovedfoundothertemporary_redirectrNrCrrFrGrHrJrrrrr]rZrXrsJ# LL#(6"?1   (   C4 +   (&%*  KK KK KK   *&! #C#O"O"d8ZZz_4*,=_4D BBrZPK!-s||$__pycache__/sessions.cpython-312.pycnu[ 9r*jȅBdZddlmZddlZddlZddlZddlmZddlm Z m Z m Z ddl m Z ddlmZmZmZdd lmZdd lmZdd lmZdd lmZdd lmZmZmZddlm Z m!Z!m"Z"m#Z#ddl$m%Z%m&Z&m'Z'm(Z(ddl)m*Z*m+Z+ddl,m-Z-m.Z.m/Z/m0Z0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7m8Z8m9Z9m:Z:m;Z;mZ>m?Z?m@Z@erddlAmBZBddlCmDZDmEZEddlFmZGddlmHZHejdk(r ejZKn ej ZKef d!dZLef d"dZMGddZNGddeNZOd#d ZPy)$z requests.sessions ~~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). ) annotationsN) OrderedDict) GeneratorMappingMutableMapping) timedelta) TYPE_CHECKINGAnycast)to_native_string) is_prepared) HTTPAdapter)_basic_auth_str) cookieliburljoinurlparse)RequestsCookieJarcookiejar_from_dictextract_cookies_to_jar merge_cookies)ChunkedEncodingErrorContentDecodingError InvalidSchemaTooManyRedirects) default_hooks dispatch_hook)DEFAULT_REDIRECT_LIMITREDIRECT_STATIPreparedRequestRequestResponse)codes)CaseInsensitiveDict) DEFAULT_PORTSdefault_headersget_auth_from_urlget_environ_proxiesget_netrc_auth requote_uriresolve_proxies rewind_bodyshould_bypass_proxiesto_key_val_list) CookieJar)SelfUnpack)_types) BaseAdapterwin32c||S||St|trt|ts|S|t|}|jt||j Dcgc] \}}| | }}}|D]}||=|Scc}}w)zDetermines appropriate setting for a given request, taking into account the explicit setting on that request, and the setting in the session. If a setting is a dictionary, they will be merged together using `dict_class` ) isinstancerr.updateitems)request_settingsession_setting dict_classmerged_settingkv none_keyskeys @/opt/hc_python/lib/python3.12/site-packages/requests/sessions.py merge_settingrBLs ?G,OW1U @AN//:;"0!5!5!7E!7v119!7IE 3   Fs ) B4Bc|||jdgk(r|S||jdgk(r|St|||S)zProperly merges both requests and session hooks. This is necessary because when request_hooks == {'response': []}, the merge breaks Session hooks entirely. response)getrB) request_hooks session_hooksr;s rA merge_hooksrHlsO 1 1* = C 1 1* = C  z BBceZdZUded<ded<ded<ddZddZdd Z d dd Z dd Z dd Z ddZ y )SessionRedirectMixinint max_redirectsbool trust_envrcookiesc yN)selfrequestkwargss rAsendzSessionRedirectMixin.sendsrIct|jr,|jd}|jd}t|dSy)z7Receives a Response. Returns a redirect URI or ``None``locationlatin1utf8N) is_redirectheadersencoder )rTresprYs rAget_redirect_targetz(SessionRedirectMixin.get_redirect_targets;   ||J/H x0H#Hf5 5rIct|}t|}|j|jk7ry|jdk(r,|jdvr|jdk(r|jdvry|j|jk7}|j|jk7}t j |jddf}|s|j|vr|j|vry|xs|S)zFDecide whether Authorization header should be removed when redirectingThttp)PNhttps)iNFN)rhostnameschemeportr%rE)rTold_urlnew_url old_parsed new_parsed changed_portchanged_scheme default_ports rAshould_strip_authz&SessionRedirectMixin.should_strip_authsg& g&   *"5"5 5    ':-!!W,;."*//9 #**j.?.??%))**;*;TBDI </</-~-rINc +Kg} |j|} t|jj} | r|j } | dd|_| j | |jt|j |jk\rtd|jd||j!| j#dr;t|j}dj%t'|j(| g} t| }|jd k(r| r|j+| }n|jr |j} |j-} |j.s t1|jt3| } n t3| } t'| | _|j5| ||j6t8j:t8j<fvr,d }|D]}| j>jA|d d| _!| j>}|jAd dtEd | jF}tI|||jtK||jL| jO||jQ| |}|jS| || jTduxr d|vxsd|v}|r tW| | }|r|nP|jX|f|||||dd| }tI|jL| |j|j|} || ryy#tttf$r |jjdYwxYww)zBReceives a Response. Returns a generator of Responses or Requests.NF)decode_contentz Exceeded z redirects.)rDz//:)fragment)Content-Lengthz Content-TypeTransfer-EncodingCookier/rurv)streamtimeoutverifycertproxiesallow_redirects)-r`rurlrtcopyhistoryappendcontentrr RuntimeErrorrawreadlenrMrclose startswithjoinr rf_replacegeturlnetlocrr*rebuild_method status_coder#temporary_redirectpermanent_redirectr]popbodyr _cookiesrrrPprepare_cookiesrebuild_proxies rebuild_auth_body_positionr,rW)rTr_reqrxryrzr{r|yield_requestsadapter_kwargshistr~previous_fragmentprepared_request parsed_rurlparsedpurged_headersheaderr] cookie_jar rewindables rAresolve_redirectsz&SessionRedirectMixin.resolve_redirectss) "&&t,$SWW-66"xxz  7DL KK  4 4<< D$6$66& 2 23;?$ JJL~~d#&txx0 hh 01C1C DcJKc]F"$):2CD$*OO!--/C ==dhh C(89!#&#3C#8     0$ 7((((( "Y,F$,,00>-(, %&..G KK$ ' k+;+D+DEJ ":sDHH = *dll 3  , ,Z 8**+;WEG   . 5 *88D G+M/Bg/M  ,-#C  tyy !#!#$) % 't||5EtxxP..t4 O)*> M 4 U 3 4s1A!M$$ L-0J9M$+M$-0M!M$ M!!M$c$|j}t|sJt|sJ|j}|j}|j}d|vr|j ||r|d=|j r t |nd}||j|yy)zWhen being redirected we may want to strip authentication from the request to avoid leaking credentials. This method intelligently removes and reapplies authentication where possible to avoid credential loss. AuthorizationN)rU _is_preparedr]r~rorOr) prepare_auth)rTrrDoriginal_requestr] original_urlr~new_auths rArz!SessionRedirectMixin.rebuild_auth5s$++,---,---"**'++ "" g %$*@*@s*S(+/..>#&d    ) )( 3 rIcFt|sJ|j}t|jj}t |||j }d|vr|d= t||\}}|jds|r|rt|||d<|S#t$rd\}}Y6wxYw)aThis method re-evaluates the proxy configuration by considering the environment variables. If we are redirected to a URL covered by NO_PROXY, we strip the proxy configuration. Otherwise, we set missing proxy keys for this URL (in case they were stripped by a previous redirect). This method also replaces the Proxy-Authorization header where necessary. :rtype: dict zProxy-AuthorizationNNrd) rr]rr~rfr+rOr'KeyErrorrr)rTrr|r]rf new_proxiesusernamepasswords rArz$SessionRedirectMixin.rebuild_proxiesNs ,---"***../66%&6P G +-. ,!2;v3F!G Hh   )h8-d+Zd0d,Zd?d-Zd@d.ZdAd/Zy )BSessionaA Requests session. Provides cookie persistence, connection-pooling, and configuration. Basic Usage:: >>> import requests >>> s = requests.Session() >>> s.get('https://httpbin.org/get') Or as a context manager:: >>> with requests.Session() as s: ... s.get('https://httpbin.org/get') zCaseInsensitiveDict[str]r] _t.AuthTypeauthrr|zdict[str, list[_t.HookType]]hookszMutableMapping[str, Any]paramsrNrxrrzrr{rLrMrOrrPz MutableMapping[str, BaseAdapter]adapters) r]rPrr|rrrzr{rrxrOrMz list[str] __attrs__c^t|_d|_i|_t |_i|_d|_d|_d|_ t|_ d|_ ti|_t|_|j#dt%|j#dt%y)NFTzhttps://zhttp://)r&r]rr|rrrrxrzr{rrMrOrrPrrmountrrTs rA__init__zSession.__init__s'(   #_     4 +2. $   :{}- 9km,rIc|SrRrSrs rA __enter__zSession.__enter__s rIc$|jyrR)r)rTargss rA__exit__zSession.__exit__s  rIc td|j}tt|j}|jxsi}t |t js t|}ttt|j|}|j}|jr|s|js t|}t}|j|j!||j"|j$|j&t)|j*|j*t,t)|j.|j.t)||j|t1|j2|j2 |S)aConstructs a :class:`PreparedRequest ` for transmission and returns it. The :class:`PreparedRequest` has settings merged from the :class:`Request ` instance and those of the :class:`Session`. :param request: :class:`Request` instance to prepare with this session's settings. :rtype: requests.PreparedRequest _t.UriType)r;) rr~filesdatajsonr]rrrPr)r r~rrrPr6rr/rrrrrOr)r prepareupperrrrrBr]r$rrHr)rTrUr~rrPmerged_cookiesrps rAprepare_requestzSession.prepare_requests"<-c7>>*//'R'9#6#67)'2G' +-t|| >$tyy!#&D   <<>--!:M!=tTYY/"gmmTZZ8  rINc vt|tr|jd}t|j ||||xsi||xsi|||  }|j |}t |sJ| xsi} |j|j| | ||}| | d}|j||j|fi|}|S)a Constructs a :class:`Request `, prepares it and sends it. Returns :class:`Response ` object. :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'filename': file-like-objects`` for multipart encoding upload. :param auth: (optional) Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How many seconds to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Set to True by default. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol or protocol and hostname to the URL of the proxy. :param hooks: (optional) Dictionary mapping hook name to one event or list of events, event must be callable. :param stream: (optional) whether to immediately download the response content. Defaults to ``False``. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. When set to ``False``, requests will accept any TLS certificate presented by the server, and will ignore hostname mismatches and/or expired certificates, which will make your application vulnerable to man-in-the-middle (MitM) attacks. Setting verify to ``False`` may be useful during local development or testing. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :rtype: requests.Response zutf-8) rr~r]rrrrrrPr)ryr}) r6bytesdecoder!rrrmerge_environment_settingsr~r7rW)rTrr~rrr]rPrrryr}r|rrxrzr{rrprepsettings send_kwargsr_s rArUzSession.request-s| c5 !**W%C<<>t>v>>rIc *|jd|fi|S)zSends a DELETE request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response DELETErrs rAdeletezSession.deletest||Hc4V44rIc |jd|j|jd|j|jd|jd|vr$t ||j |j |d<t|tr tdt|sJ|jdd}|jd}|j}|j|j}t!}|j"|fi|}t!|z } t%| |_t)d ||fi|}|j*r<|j*D]-} t-|j.| j0| j2/t-|j.||j2|r$|j4||fi|} | D cgc]} | } } ng} | r)| j7d || j}| |_|s% t9|j4||fd di||_|s |j>|Scc} w#t<$rY wxYw) zISend a given PreparedRequest. :rtype: requests.Response rxrzr{r|z#You can only send PreparedRequests.r}T)r~)secondsrDrr) rrxrzr{r+r|rOr6r! ValueErrorrrrEr get_adapterr~preferred_clockrWrelapsedrrrrPrUrrinsertnext_next StopIterationr) rTrUrVr}rxradapterstartrrr_genrs rArWz Session.sends (DKK0(DKK0&$)), F " /t~~ VF9  gw 'BC CG$$$!**%6=H% ""w{{"3 ! GLL +F +"#e+g.  *eQ 9& 9 99 &t||T\\488L" t||Waee< ($((G>v>C(+,tG,G  NN1a  AAI *D**1gUdUfU  II1-$!  s< H,8$H11 H=<H=c|jr||jdnd}t||}|*|jD]\}} |j || |dus|Dt j jdxs#t j jdxs|}t||j}t||j}t||j}t||j}||||dS)z^ Check the environment and merge it with some settings. :rtype: dict Nno_proxy)rTREQUESTS_CA_BUNDLECURL_CA_BUNDLE)r|rxrzr{) rOrEr(r8rosenvironrBr|rxrzr{) rTr~r|rxrzr{r env_proxiesr=r>s rArz"Session.merge_environment_settings?s >>292Ew{{:.4H-cHEK"'--/DAq&&q!,0 ~JJNN#78zz~~&67 6vt{{3vt{{3T499-"fPTUUrIc|jjD]6\}}|jj|js4|cSt d|)z~ Returns the appropriate connection adapter for the given URL. :rtype: requests.adapters.BaseAdapter z&No connection adapters were found for )rr8lowerrr)rTr~prefixr s rArzSession.get_adapterfsS $}}224OFGyy{%%flln5 5 DSGLMMrIcb|jjD]}|jy)z+Closes all adapters and as such the sessionN)rvaluesr)rTr>s rArz Session.closess"%%'A GGI(rIc||j|<|jDcgc]}t|t|ks|}}|D]*}|jj||j|<,ycc}w)zwRegisters a connection adapter to a prefix. Adapters are sorted in descending order by prefix length. N)rrr)rTrr r= keys_to_mover@s rArz Session.mountxsf !( f#'==I=aCFS[4H= IC!%!2!23!7DMM#  Js A1A1c Z|jDcic]}|t||d}}|Scc}wrR)rgetattr)rTattrstates rA __getstate__zSession.__getstate__s3=A^^L^TwtT400^L Ms(cN|jD]\}}t|||yrR)r8setattr)rTrrvalues rA __setstate__zSession.__setstate__s" ;;=KD% D$ &)rI)rr)rr0)rr rr)rUr!rr )NNNNNNNTNNNNNN)"rrr~rr _t.ParamsTyper _t.DataTyper]z_t.HeadersTyperPz5RequestsCookieJar | CookieJar | dict[str, str] | Nonerz _t.FilesTyperrryrr}rNr|rrz_t.HooksInputType | Nonerx bool | Nonerz_t.VerifyType | Noner{rr _t.JsonTyperr"rR)r~rrr$rVzUnpack[_t.GetKwargs]rr")r~rrVzUnpack[_t.RequestKwargs]rr"r) r~rrr%rr(rVzUnpack[_t.PostKwargs]rr")r~rrr%rVzUnpack[_t.DataKwargs]rr"r) r~rr|rrxr&rzr'r{rrdict[str, Any])r~rrr3)rrr r3rr)rr))rr)rr)rrr__doc__rrrrrrrUrErrrrrrrWrrrrrr#rSrIrArrs$&%   '' $$ L  O .. Iy =-~,d!% "&IM" "& $)-*."'+  #``` `  `  `G``` ``'`(``%` !`"#`$ %`J!%A AA' A  A$ 6 3! I II I ( I  I(48 = =%0 =CX =  =48 ? ?%0 ?CX ?  ?5M^%V %V'%V %V % %V  %V %VN N 8'rIrctS)aZ Returns a :class:`Session` for context-management. .. deprecated:: 1.0.0 This method has been deprecated since version 1.0.0 and is only kept for backwards compatibility. New code should use :class:`~requests.sessions.Session` to create a session. This may be removed at a future date. :rtype: Session )rrSrIrAsessionr,s  9rI)r9r r:r r;typerr )rF _t.HooksTyperGr.r;r-rr.)rr)Qr* __future__rrsystime collectionsrcollections.abcrrrdatetimertypingr r r _internal_utilsr r2rrrrrrcompatrrrrPrrrr exceptionsrrrrrrrmodelsrrr r!r" status_codesr# structuresr$utilsr%r&r'r(r)r*r+r,r-r.http.cookiejarr/typing_extensionsr0r1rs_tr3platform perf_counterrrBrHrKrr,rSrIrArBs+# #>>++-/!!00  0 +   (.%<<7''OiiODO+.<@F#CCCC C&I)I)X~'"~'B rIPK!+Ann#__pycache__/cookies.cpython-312.pycnu[ 9r*j-T dZddlmZddlZddlZddlZddlmZmZddl m Z m Z m Z ddl mZmZmZmZddlmZdd lmZdd lmZmZmZmZer dd lmZdd lmZddl Z Gd dZ!GddZ" d!dZ#d"dZ$ d# d$dZ%Gdde&Z'Gdde ee(e(dzfZ)d%dZ*d&dZ+d'dZ,ede Z-e d( d)dZ.e d* d+dZ. d( d,dZ. d-d Z/y).z requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `http.cookiejar.CookieJar` with requests. requests.utils imports from here, so be careful with imports. ) annotationsN)IteratorMutableMapping)Cookie CookieJar CookiePolicy) TYPE_CHECKINGAnyTypeVaroverload)to_native_string) is_prepared)Morsel cookieliburlparse urlunparse)SupportsKeysAndGetItem)PreparedRequestceZdZUdZded<ddZddZddZddZddZ dd Z dd Z ddd Z dd Z ddZddZeddZeddZeddZy ) MockRequestaWraps a `requests.PreparedRequest` to mimic a `urllib2.Request`. The code in `http.cookiejar.CookieJar` expects this interface in order to correctly manage cookie policies, i.e., determine whether a cookie can be set, given the domains of the request and the cookie. The original request object is read-only. The client is responsible for collecting the new headers via `get_new_headers()` and interpreting them appropriately. You probably want `get_cookie_header`, defined below. strtypect|sJ||_i|_t|jjj |_yN) _is_prepared_r _new_headersrurlschemer)selfrequests ?/opt/hc_python/lib/python3.12/site-packages/requests/cookies.py__init__zMockRequest.__init__-s9G$$$,.TWW[[)00 c|jSr)rr!s r#get_typezMockRequest.get_type3s yyr%cTt|jjjSr)rrrnetlocr's r#get_hostzMockRequest.get_host6s $+++r%c"|jSrr+r's r#get_origin_req_hostzMockRequest.get_origin_req_host9s}}r%c|jjjds|jjSt |jjdd}t |jj}t |j||j|j|j|jgS)NHostzutf-8)encoding) rheadersgetrrrrr pathparamsqueryfragment)r!hostparseds r# get_full_urlzMockRequest.get_full_url<sww""6*77;;  7'J$''++&        r%cyNTr's r#is_unverifiablezMockRequest.is_unverifiablePsr%cR||jjvxs||jvSr)rr2rr!names r# has_headerzMockRequest.has_headerSs%tww&C$$2C2C*CCr%Nc|jjj||jj||Sr)rr2r3r)r!rAdefaults r# get_headerzMockRequest.get_headerVs0ww""4):):)>)>tW)MNNr%ctd)zMcookiejar has no legitimate use for this method; add it back if you find one.z=Cookie headers should be added with add_unredirected_header())NotImplementedError)r!keyvals r# add_headerzMockRequest.add_headerYs! K  r%c"||j|<yrrr!rAvalues r#add_unredirected_headerz#MockRequest.add_unredirected_header_s"'$r%c|jSrrLr's r#get_new_headerszMockRequest.get_new_headersbs   r%c"|jSr)r>r's r# unverifiablezMockRequest.unverifiablees##%%r%c"|jSr)r.r's r#origin_req_hostzMockRequest.origin_req_hostis''))r%c"|jSrr-r's r#r8zMockRequest.hostms}}r%)r"rreturnNone)rWrrWbool)rArrWrZr)rArrD str | NonerWr[)rHrrIrrWrX)rArrNrrWrX)rWzdict[str, str])__name__ __module__ __qualname____doc____annotations__r$r(r+r.r:r>rBrErJrOrQpropertyrSrUr8r=r%r#rrs  I1 , (DO (!&&**r%rc(eZdZdZddZddZddZy) MockResponsezWraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. ...what? Basically, expose the parsed HTTP headers from the server response the way `http.cookiejar` expects to see them. c||_y)zMake a MockResponse for `cookiejar` to read. :param headers: a httplib.HTTPMessage or analogous carrying the headers N_headers)r!r2s r#r$zMockResponse.__init__ys   r%c|jSrrer's r#infozMockResponse.infos }}r%c:|jj|yr)rf getheadersr@s r#rjzMockResponse.getheaderss   &r%N)r2r rWrX)rWr )rArrWr )r\r]r^r_r$rhrjr=r%r#rcrcrs  'r%rcct|dr |jsyt|}t|jj}|j ||y)zExtract the cookies from the response into a CookieJar. :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar) :param request: our own requests.Request object :param response: urllib3.HTTPResponse object _original_responseN)hasattrrlrrcmsgextract_cookies)jarr"responsereqress r#extract_cookies_to_jarrtsJ H2 38S8S g C x2266 7CS!r%cxt|}|j||jjdS)zj Produce an appropriate Cookie header string to be sent with `request`, or None. :rtype: str r)radd_cookie_headerrQr3)rpr"rs r#get_cookie_headerrxs6 GA!    " "8 ,,r%cg}|D]h}|j|k7r|||jk7r%|||jk7r7|j|j|j|jfj|D]\}}}|j |||y)zkUnsets a cookie by name, by default over all domains and paths. Wraps CookieJar.clear(), is O(n). N)rAdomainr4appendclear) cookiejarrArzr4 clearablescookies r#remove_cookie_by_namers.0J ;;$    &FMM"9    3 6==&++v{{CD)dd+)r%ceZdZdZy)CookieConflictErrorzThere are two cookies that meet the criteria specified in the cookie jar. Use .get and .set and include domain and path args in order to be more specific. N)r\r]r^r_r=r%r#rrsr%rcleZdZUdZded< d ddZ ddZd dZd!dZd"dZ d#d Z d$d Z d%d Z d!d Z d!d Zd&dZ d' d(dZd)fd Zd*fd Zd+dZ d,dZd-dZd.fd Z d/fd Z d' d0dZ d' d1dZd2dZd3dZd4dZd5dZxZS)6RequestsCookieJaraCompatibility class; is a http.cookiejar.CookieJar, but exposes a dict interface. This is the CookieJar we create by default for requests and sessions that don't specify one, since some clients may expect response.cookies and session.cookies to support dict operations. Requests does not use the dict interface internally; it's just for compatibility with external client code. All requests code should work out of the box with externally provided instances of ``CookieJar``, e.g. ``LWPCookieJar`` and ``FileCookieJar``. Unlike a regular CookieJar, this class is pickleable. .. warning:: dictionary operations that are normally O(1) may be O(n). r_policycL |j|||S#t$r|cYSwxYw)zDict-like get() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. .. warning:: operation is O(n), not O(1). )_find_no_duplicatesKeyError)r!rArDrzr4s r#r3zRequestsCookieJar.gets0 ++D&$? ? N s  ##c |.t|||jd|jdyt|tr t |}n t ||fi|}|j ||S)zDict-like set() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. Nrzr4)rzr4)rr3 isinstancermorsel_to_cookie create_cookie set_cookie)r!rArNkwargscs r#setzRequestsCookieJar.setsg = !d6::h#7fjj>P   eV $ 'AdE4V4A r%c#HKt|D]}|jyw)zDict-like iterkeys() that returns an iterator of names of cookies from the jar. .. seealso:: itervalues() and iteritems(). N)iterrAr!rs r#iterkeyszRequestsCookieJar.iterkeyss 4jF++ ! "c4t|jS)zDict-like keys() that returns a list of names of cookies from the jar. .. seealso:: values() and items(). )listrr's r#keyszRequestsCookieJar.keyss DMMO$$r%c#HKt|D]}|jyw)zDict-like itervalues() that returns an iterator of values of cookies from the jar. .. seealso:: iterkeys() and iteritems(). N)rrNrs r# itervalueszRequestsCookieJar.itervalues s 4jF,, !rc4t|jS)zDict-like values() that returns a list of values of cookies from the jar. .. seealso:: keys() and items(). )rrr's r#valueszRequestsCookieJar.valuess DOO%&&r%c#`Kt|D]}|j|jfyw)zDict-like iteritems() that returns an iterator of name-value tuples from the jar. .. seealso:: iterkeys() and itervalues(). N)rrArNrs r# iteritemszRequestsCookieJar.iteritemss) 4jF++v||+ +!s,.c4t|jS)zDict-like items() that returns a list of name-value tuples from the jar. Allows client-code to call ``dict(RequestsCookieJar)`` and get a vanilla python dict of key value pairs. .. seealso:: keys() and values(). )rrr's r#itemszRequestsCookieJar.items%sDNN$%%r%c~g}t|D],}|j|vs|j|j.|S)z2Utility method to list all the domains in the jar.rrzr{r!domainsrs r# list_domainszRequestsCookieJar.list_domains.s84jF}}G+v}}-!r%c~g}t|D],}|j|vs|j|j.|S)z0Utility method to list all the paths in the jar.)rr4r{)r!pathsrs r# list_pathszRequestsCookieJar.list_paths6s84jF{{%' V[[)! r%cg}t|D]9}|j|j|vry|j|j;y)zvReturns True if there are multiple domains in the jar. Returns False otherwise. :rtype: bool TFrrs r#multiple_domainsz"RequestsCookieJar.multiple_domains>sD  4jF}}(V]]g-E NN6== )!r%ci}t|D]?}||j|k(s||j|k(s'|j||j<A|S)zTakes as an argument an optional domain and path and returns a plain old Python dict of name-value pairs of cookies that meet the requirements. :rtype: dict )rrzr4rNrA)r!rzr4 dictionaryrs r#get_dictzRequestsCookieJar.get_dictKsQ-/ 4jF&--6"9  t 3*0,, 6;;' ! r%c t|S)zDRequestCookieJar's __iter__ comes from CookieJar not MutableMapping.)super__iter__)r! __class__s r#rzRequestsCookieJar.__iter__\sw!!r%cB t||S#t$rYywxYwr<)r __contains__r)r!rArs r#rzRequestsCookieJar.__contains__`s* 7'- -"  s  c$|j|S)zDict-like __getitem__() for compatibility with client code. Throws exception if there are more than one cookie with name. In that case, use the more explicit get() method instead. .. warning:: operation is O(n), not O(1). )rr@s r# __getitem__zRequestsCookieJar.__getitem__fs''--r%c(|j||y)zDict-like __setitem__ for compatibility with client code. Throws exception if there is already a cookie of that name in the jar. In that case, use the more explicit set() method instead. N)rrMs r# __setitem__zRequestsCookieJar.__setitem__os ur%ct||y)zqDeletes a cookie given a name. Wraps ``http.cookiejar.CookieJar``'s ``remove_cookie_by_name()``. N)rr@s r# __delitem__zRequestsCookieJar.__delitem__xs dD)r%c|jx}9|jdr(|jdr|jdd|_t ||g|i|S)N"z\")rN startswithendswithreplacerr)r!rargsrrNrs r#rzRequestsCookieJar.set_cookie~sXll "U /  %s# ==3FLw!&:4:6::r%ct|tjr,|D]&}|jt j|(yt ||y)zAUpdates this jar with cookies from another CookieJar or dict-likeN)rrrrcopyrupdate)r!otherrrs r#rzRequestsCookieJar.updatesB eY00 1 & 12  GN5 !r%ct|D]C}|j|k(s||j|k(s%||j|k(s7|jcSt d|d|d|)aRequests uses this method internally to get cookie values. If there are conflicting cookies, _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown if there are conflicting cookies. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :return: cookie.value name= , domain=, path=)rrArzr4rNr)r!rArzr4rs r#_findzRequestsCookieJar._findsh4jF{{d">V]]f%<|v{{d':%||+ ! thizIJJr%cd}t|D]R}|j|k(s||j|k(s%||j|k(s7|t d||j }T||St d|d|d|)aBoth ``__get_item__`` and ``get`` call this function: it's never used elsewhere in Requests. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :raises KeyError: if cookie is not found :raises CookieConflictError: if there are multiple cookies that match name and optionally domain and path :return: cookie.value Nz&There are multiple cookies with name, rrr)rrArzr4rrNr)r!rArzr4toReturnrs r#rz%RequestsCookieJar._find_no_duplicatess4jF{{d">V]]f%<|v{{d':#/"5"H Q#$*<<!  OthizIJJr%c\|jj}|jd|S)4Unlike a normal CookieJar, this class is pickleable. _cookies_lock)__dict__rpopr!states r# __getstate__zRequestsCookieJar.__getstate__s% ""$ /" r%c|jj|d|jvrtj|_yy)rrN)rr threadingRLockrrs r# __setstate__zRequestsCookieJar.__setstate__s4 U# $-- /!*!2D  0r%czt}|j|j|j||S)z(Return a copy of this RequestsCookieJar.)r set_policy get_policyr)r!new_cjs r#rzRequestsCookieJar.copys0"$$//+, d r%c|jS)z&Return the CookiePolicy instance used.)rr's r#rzRequestsCookieJar.get_policys ||r%)NNN) rArrDr[rzr[r4r[rWr[)rArrN#str | Morsel[dict[str, str]] | Nonerr rWz Cookie | None)rWz Iterator[str])rWz list[str])rWzIterator[str | None])rWzlist[str | None])rWz Iterator[tuple[str, str | None]])rWzlist[tuple[str, str | None]]rYNN)rzr[r4r[rWzdict[str, str | None])rWzIterator[Cookie])rAobjectrWrZ)rArrWr[)rArrNrrWrX)rArrWrX)rrrr rr rWrX)rz,CookieJar | SupportsKeysAndGetItem[str, str]rWrX)rArrzr[r4r[rWr[)rArrzr[r4r[rWr)rWdict[str, Any])rrrWrX)rWr)rWr)r\r]r^r_r`r3rrrrrrrrrrrrrrrrrrrrrrrr __classcell__)rs@r#rrs" #!      $ COR *%',& =A /9 "" . C * ;"A" "HLKK!+K:DK K.HLKK!+K:DK K>3 r%rc|yt|ddx}r|Stj|}|j|D]&}|jtj|(|S)Nr)getattrrr|r)rp copy_methodnew_jarrs r#_copy_cookie_jarrsb {c6400{0}iinG MMO499V,- Nr%c fd||ddddddddddidd }t|t|z }|rtd t||j|t |d |d <t |d |d <|d j d|d<t |d|d<t jdi|S)zMake a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). rNr/FTHttpOnly) versionrArNportrzr4secureexpiresdiscardcomment comment_urlrestrfc2109z2create_cookie() got unexpected keyword arguments: rport_specifiedrzdomain_specified.domain_initial_dotr4path_specifiedr=)r TypeErrorrrrZrrr)rArNrresultbadargss r#rrsT"F &kCK'G@g P   MM&#F6N3F !%fX&6!7F #)(#3#>#>s#CF  #F6N3F     %f %%r%cd}|dr. ttjt|dz}n3|dr.d}t j tj |d|}t|dt|dd|d ||j|d dd |d idt|d |j|dxsd S#t$rtd|ddwxYw)zBConvert a Morsel object into a Cookie containing the one k/v pair.Nzmax-agez max-age: z must be integerrz%a, %d-%b-%Y %H:%M:%S GMTrFrzr4rhttponlyrrr) rrrrzrrAr4rrrrrNr) inttime ValueErrorrcalendartimegmstrptimerrZrHrN)morselr time_templates r#rrsG i M$))+F9,=(>>?G  3 //$--y0A="QR y! *+h ZZ F^ &, -F8$%lly!&Q   Miy(9'::JKL L Ms ,CC _CookieJarT)boundcyrr= cookie_dictr} overwrites r#cookiejar_from_dictr 3s r%cyrr=rs r#r r ;s r%c| t}|E|Dcgc]}|j}}|D]'}|s||vs |jt|||)|Scc}w)aCReturns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. :rtype: CookieJar )rrArr)r r}r rnames_from_jarrAs r#r r Csk%' 4=>I&&++I>DT7$$]4T9J%KL   ?sAc&t|tjs tdt|trt ||d}|St|tjr1t |ddx}r |||S|D]}|j||S)zAdd cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. :rtype: CookieJar z!You can only merge into CookieJarF)r}r rN)rrrrdictr rr)r}cookies update_method cookie_in_jars r# merge_cookiesr\s i!4!4 5<=='4 '9PUV   GY00 1#Ix> >= > ' " ") $$]3") r%)rprr"rrqr rWrX)rprr"rrWr[r) r}rrArrzr[r4r[rWrX)rpCookieJar | NonerWr)rArrNrrr rWr)rz Morsel[Any]rWrr<)r dict[str, str] | Noner}rXr rZrWr)T)r rr}rr rZrWr)r rr}rr rZrWr)r}rrz!dict[str, str] | CookieJar | NonerWr)0r_ __future__rrrrcollections.abcrrhttp.cookiejarrrrtypingr r r r _internal_utilsr_typesrrcompatrrrr _typeshedrmodelsrrrrcrtrxr RuntimeErrorrrrrrrrr rr=r%r#r!s# 4::88-/;;0'PPf''*" ","8;" "$-TX,, #,-7,FP, ,*, ] >#sTz/#B]@ "&J:m95  &   &  #'& 2#Dr%PK!qѵ@@$__pycache__/packages.cpython-312.pycnu[ 9r*jddlZddlmZdD]bZeeee<eejD];Zeek(sejedsejeejde<=deejZ eejD]aZee k(seje dsejeZ e ejde<eje dZe ejde<cyy)N)chardet)urllib3idna.zrequests.packages.r)syscompatrpackage __import__localslistmodulesmod startswith__name__target imported_modreplace@/opt/hc_python/lib/python3.12/site-packages/requests/packages.pyrs  #G"7+FHWCKK  '>S^^wiqM:69kk#6FCKK,SE2 3! #    FCKK  &=CNNfXQ<8;;s+L6BCKK,SE2 3++fi0C6BCKK,SE2 3 !rPK!MzDD"__pycache__/_types.cpython-312.pycnu[ 9r*jDUdZddlmZddlmZmZmZmZmZddl m Z m Z m Z m Z mZmZeddZeddZed dZeGd d e eZeGd d e eefZedge fZded<eeeeezfZded<dEdZe rddlmZddl m Z mZddlmZmZddl m!Z!ddl"m#Z#ddl$m%Z%m&Z&ddl'm(Z(Gdde%Z)ee*zZ+ded<ee*ze,ze-zZ.ded<ee*ze,ze-zeee*ze,ze-zzdzZ/ded <ee.e/fe0e0e.e/fd!fzee0e.e/fzeze*zdzZ1ded"<ee0e e fee e fzZ2ded#<e2eze*zZ3ded$<eee*zZ4ded%<e3e4zZ5ded&<e2ee*ezzeze*zezeee*zzdzZ6ded'<e*ezee*ezzee*ezzdzZ7ded(<eeee*zfdzZ8ded)<e#eeefzZ9ded*<edzZ:ded+<eee*zeze*zZ;ded,<e0e:e;fZded/<e;ezZ?ded0<eee?fee0ee?fzdzZ@ded1<e0eefe!zee%ge%fzdzZAded2<e-e0e-dze-dzfzdzZBded3<eeefZCded4<eDeeEefdzZFded5<eGezZHded6<ee0eefzdzZIded7<deGze,ze-zezed8zeed8fzZJded8<Gd9d:ed;<ZKGd=d>eKd;<ZLGd?d@eKd;<ZMGdAdBeKd;<ZNGdCdDeKd;<ZOyy)Fz requests._types ~~~~~~~~~~~~~~~ This module contains type aliases used internally by the Requests library. These types are not part of the public API and must not be relied upon by external code. ) annotations)CallableIterableMappingMutableMappingSequence) TYPE_CHECKINGAnyProtocol TypeAliasTypeVarruntime_checkable_T_coT) covariant_KT_co_VT_coceZdZdddZy) SupportsReadcyN)selflengths >/opt/hc_python/lib/python3.12/site-packages/requests/_types.pyreadzSupportsRead.reads3N).)rintreturnr)__name__ __module__ __qualname__rrrrrrs6rrceZdZddZy) SupportsItemscyrr)rs ritemszSupportsItems.items"srN)rzIterable[tuple[_KT_co, _VT_co]])rr r!r%rrrr#r# s;rr#Responser HookTypeHooksInputTypecLtr|jduxr|jduSy)z1Verify a PreparedRequest has been fully prepared.NT)r urlmethod)requests r is_preparedr-*s%{{$&E7>>+EE r) CookieJar)r TypedDict)BufferTypeIs)AuthBase)RequestsCookieJar)PreparedRequestr&)CaseInsensitiveDictc&eZdZUdZded<ded<y)_ValidatedRequesta{Subtype asserting a PreparedRequest has been fully prepared before calling. The override suppression is required because mutable attribute types are invariant (Liskov), but we only narrow after preparation is complete. This is the explicit contract for Requests but Python's typing doesn't have a better way to represent the requirement. strr*r+Nrr r!__doc____annotations__rrrr8r8@s  rr8UriType_ParamsMappingKeyTypeN_ParamsMappingValueType. ParamsType KVDataType RawDataTypeStreamDataTypeEncodableDataTypeDataTypeBodyType HeadersType CookiesType _FileName _FileContent_FileSpecBasic_FileSpecWithContentType_FileSpecWithHeaders _FileSpec FilesTypeAuthType TimeoutType ProxiesType HooksType VerifyTypeCertTypeJsonTypec|eZdZUded<ded<ded<ded<d ed <d ed <d ed<ded<ded<ded<ded<y)BaseRequestKwargsrGheadersz5RequestsCookieJar | CookieJar | dict[str, str] | NonecookiesrOfilesrPauthrQtimeoutboolallow_redirectszdict[str, str] | NoneproxieszHooksInputType | Nonehooksz bool | NonestreamzVerifyType | NoneverifyrUcertNrr r!r<rrrrXrXsBFF&&$$!!rrXF)totalc0eZdZUdZded<ded<ded<y) RequestKwargsz2kwargs for request(), options(), head(), delete().r@paramsrEdatarVjsonNr:rrrrhrhs@rrhc"eZdZUded<ded<y) GetKwargsrErjrVrkNrerrrrmrms rrmceZdZUded<y) PostKwargsr@riNrerrrrorosrroc&eZdZUdZded<ded<y) DataKwargszkwargs for put(), patch().r@rirVrkNr:rrrrqrqs(rrq)r,r5rzTypeIs[_ValidatedRequest])Pr; __future__rcollections.abcrrrrrtypingr r r r r rrrrrr#r'r<r9r(r-http.cookiejarr.r/typing_extensionsr0r1r\r3rZr4modelsr5r& structuresr6r8bytesr=rfloatr>r?tupler@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRdictlistrSr^rTrUrVrXrhrmrorqrrrr~s%#QQ 4( T * T *78E?77-F$GG$NY +-DDE +-DDEsJ K L 5.0GGH I J         %U38_5 c3h8OOJ O'#-5K5 ,S5[ 9NI9#.#?y?  53;         sU{ #  $    i  hus{++l53;.GG$N i%S#+%56=K=.c1BBKB:Iy%*3;7#=EL)E %i&= >NI>*/ <0L*MiM&+<&9#&>cAR&RR') ~%(@@CWWy Y(5i+@"AADHy c3h("X.?.P%QQTXX i#U54<+E%FFMKM+CH5K5T(^ 34t;Iy; 3JJ &c3h/$6Hi6          :    #z/ "  # i IU )%U&e&eCrPK!'8WW&__pycache__/structures.cpython-312.pycnu[ 9r*j&dZddlmZddlmZddlmZmZmZddl m Z m Z m Z m Z ddlmZe dZe d ZGd d eeefe eZGd d eeefZy)zO requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. ) annotations) OrderedDict)IterableIteratorMapping)AnyGenericTypeVaroverload)MutableMapping_VT_DczeZdZUdZded< d ddZddZddZddZdd Z dd Z dd Z dd Z dd Z ddZy)CaseInsensitiveDictaA case-insensitive ``dict``-like object. Implements all methods and operations of ``MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive:: cid = CaseInsensitiveDict() cid['Accept'] = 'application/json' cid['aCCEPT'] == 'application/json' # True list(cid) == ['Accept'] # True For example, ``headers['content-encoding']`` will return the value of a ``'Content-Encoding'`` response header, regardless of how the header name was originally stored. If the constructor, ``.update``, or equality comparison operations are given keys that have equal ``.lower()``s, the behavior is undefined. z!OrderedDict[str, tuple[str, _VT]]_storeNc Pt|_|i}|j|fi|yN)rrupdate)selfdatakwargss B/opt/hc_python/lib/python3.12/site-packages/requests/structures.py__init__zCaseInsensitiveDict.__init__1s* "m <D D#F#cB||f|j|j<yrrlower)rkeyvalues r __setitem__zCaseInsensitiveDict.__setitem__;s%(< CIIK rcB|j|jdS)Nr rrrs r __getitem__zCaseInsensitiveDict.__getitem__@s{{399;'**rc:|j|j=yrrr#s r __delitem__zCaseInsensitiveDict.__delitem__Cs KK $rcDd|jjDS)Nc3&K|] \}}| ywr).0casedkey_s r z/CaseInsensitiveDict.__iter__..GsA,@[Xq,@s)rvaluesrs r__iter__zCaseInsensitiveDict.__iter__FsADKK,>,>,@AArc,t|jSr)lenrr/s r__len__zCaseInsensitiveDict.__len__Is4;;rcDd|jjDS)z.Like iteritems(), but with all lowercase keys.c30K|]\}}||dfyw)r Nr))r*lowerkeykeyvals rr-z2CaseInsensitiveDict.lower_items..Ns!T@S*<8V6!9%@Ss)ritemsr/s r lower_itemszCaseInsensitiveDict.lower_itemsLsT @Q@Q@STTrct|tr t|}ntSt |j t |j k(Sr) isinstancerrNotImplementeddictr9)rother other_dicts r__eq__zCaseInsensitiveDict.__eq__PsC eW %3Fu3MJ! !D$$&'4 0F0F0H+IIIrcHt|jjSr)rrr.r/s rcopyzCaseInsensitiveDict.copyYs"4;;#5#5#788rcFtt|jSr)strr=r8r/s r__repr__zCaseInsensitiveDict.__repr__\s4 %&&rr)rz4Mapping[str, _VT] | Iterable[tuple[str, _VT]] | NonerrreturnNone)rrDr rrFrG)rrDrFr)rrDrFrG)rFz Iterator[str])rFint)rFzIterator[tuple[str, _VT]])r>objectrFbool)rFzCaseInsensitiveDict[_VT]rFrD)__name__ __module__ __qualname____doc____annotations__rr!r$r&r0r3r9r@rBrEr)rrrrsg4 .-FJ$B$$  $0 +%B UJ9'rrczeZdZUdZded<d d fd Zd dZddZddZe d ddZ e dd Z d dd Z xZ S) LookupDictzDictionary lookup object.rnamec0||_t| yr)rSsuperr)rrS __class__s rrzLookupDict.__init__es  rc"d|jdS)Nz )rSr/s rrEzLookupDict.__repr__is499+R((rc||jvr|j|Stdt|jd|d)N'z' object has no attribute ')__dict__AttributeErrortyperLr#s r __getattr__zLookupDict.__getattr__lsJ $-- ==% % DJ''((CC5J rc:|jj|dSrrZgetr#s rr$zLookupDict.__getitem__vs}}  d++rcyrr)rrdefaults rr`zLookupDict.get{sADrcyrr)rbs rr`zLookupDict.get~srnse##7722" en T]I'.c2GCLI'X"/c3h"/rPK!u]b&__pycache__/exceptions.cpython-312.pycnu[ 9r*jdZddlmZddlmZmZddlmZddl m Z er ddl m Z mZmZGdd eZGd d eZGd d ee Z GddeZGddeZGddeZGddeZGddeZGddeeZGddeZGddeZGddeZGd d!eeZGd"d#eeZGd$d%eeZGd&d'eeZGd(d)eZ Gd*d+eZ!Gd,d-eeZ"Gd.d/ee#Z$Gd0d1eZ%Gd2d3eZ&Gd4d5e'Z(Gd6d7e(e)Z*Gd8d9e(Z+y:);z` requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. ) annotations) TYPE_CHECKINGAny) HTTPError)JSONDecodeError)PreparedRequestRequestResponsec:eZdZUdZded<ded<dfd ZxZS)RequestExceptionzTThere was an ambiguous exception that occurred while handling your request. zResponse | Noneresponsez Request | PreparedRequest | Nonerequestc|jdd}||_|jdd|_|)|jst|dr|j|_t ||i|y)zBInitialize RequestException with `request` and `response` objects.rNr)poprrhasattrsuper__init__)selfargskwargsr __class__s B/opt/hc_python/lib/python3.12/site-packages/requests/exceptions.pyrzRequestException.__init__s`$*JJz4$@  zz)T2   99U#++DL $)&)rrrrreturnNone)__name__ __module__ __qualname____doc____annotations__r __classcell__)rs@rr r s  --**rr ceZdZdZy)InvalidJSONErrorzA JSON error occurred.Nrrr r!rrr%r%& rr%c eZdZdZddZddZy)rz"Couldn't decode the text into jsoncvtj|g|tj|g|ji|y)a Construct the JSONDecodeError instance first with all args. Then use it's args to construct the IOError so that the json specific args aren't used as IOError specific args and the error message from JSONDecodeError is preserved. N)CompatJSONDecodeErrorrr%r)rrrs rrzJSONDecodeError.__init__-s3 &&t3d3!!$==f=rc,tj|S)aa The __reduce__ method called when pickling the object must be the one from the JSONDecodeError (be it json/simplejson) as it expects all the arguments for instantiation, not just one like the IOError, and the MRO would by default call the __reduce__ method from the IOError due to the inheritance order. )r+ __reduce__)rs rr-zJSONDecodeError.__reduce__7s%//55rNr)rztuple[Any, ...] | str)rrr r!rr-r'rrrr*s,>6rrceZdZdZy)rzAn HTTP error occurred.Nr&r'rrrrB!rrceZdZdZy)ConnectionErrorzA Connection error occurred.Nr&r'rrr1r1Fs&rr1ceZdZdZy) ProxyErrorzA proxy error occurred.Nr&r'rrr3r3Jr/rr3ceZdZdZy)SSLErrorzAn SSL error occurred.Nr&r'rrr5r5Nr(rr5ceZdZdZy)TimeoutzThe request timed out. Catching this error will catch both :exc:`~requests.exceptions.ConnectTimeout` and :exc:`~requests.exceptions.ReadTimeout` errors. Nr&r'rrr7r7Rsrr7ceZdZdZy)ConnectTimeoutzThe request timed out while trying to connect to the remote server. Requests that produced this error are safe to retry. Nr&r'rrr9r9[srr9ceZdZdZy) ReadTimeoutz@The server did not send any data in the allotted amount of time.Nr&r'rrr;r;bJrr;ceZdZdZy) URLRequiredz*A valid URL is required to make a request.Nr&r'rrr>r>fs4rr>ceZdZdZy)TooManyRedirectszToo many redirects.Nr&r'rrr@r@jsrr@ceZdZdZy) MissingSchemaz/The URL scheme (e.g. http or https) is missing.Nr&r'rrrBrBns9rrBceZdZdZy) InvalidSchemaz9The URL scheme provided is either invalid or unsupported.Nr&r'rrrDrDrsCrrDceZdZdZy) InvalidURLz%The URL provided was somehow invalid.Nr&r'rrrFrFvs/rrFceZdZdZy) InvalidHeaderz.The header value provided was somehow invalid.Nr&r'rrrHrHzs8rrHceZdZdZy)InvalidProxyURLz"The proxy URL provided is invalid.Nr&r'rrrJrJ~,rrJceZdZdZy)ChunkedEncodingErrorz?The server declared chunked encoding but sent an invalid chunk.Nr&r'rrrMrMsIrrMceZdZdZy)ContentDecodingErrorz"Failed to decode response content.Nr&r'rrrOrOrKrrOceZdZdZy)StreamConsumedErrorz3The content for this response was already consumed.Nr&r'rrrQrQs=rrQceZdZdZy) RetryErrorzCustom retries logic failedNr&r'rrrSrSs%rrSceZdZdZy)UnrewindableBodyErrorz;Requests encountered an error when trying to rewind a body.Nr&r'rrrUrUsErrUceZdZdZy)RequestsWarningzBase warning for Requests.Nr&r'rrrWrWs$rrWceZdZdZy)FileModeWarningzJA file was opened in text mode, but Requests determined its binary length.Nr&r'rrrYrYsTrrYceZdZdZy)RequestsDependencyWarningz@An imported dependency doesn't match the expected version range.Nr&r'rrr[r[r<rr[N),r! __future__rtypingrrurllib3.exceptionsr BaseHTTPErrorcompatrr+modelsr r r IOErrorr r%r1r3r5r7r9r;r>r@ ValueErrorrBrDrFrHrJrMrO TypeErrorrQrSrUWarningrWDeprecationWarningrYr[r'rrrgs}#%9<::*w*$!'!6&(=60" "'&'""!!_gK'K5"5':$j:D$jD0!:09$j9-j-J+J-+]->*I>&!&F,F%g%Uo'9UKKrPK!: __pycache__/help.cpython-312.pycnu[ 9r*jrdZddlZddlZddlZddlZddlmZddlZddlZddl m Z  ddl Z ddlZ ddlmZddlZddlZdZdeeeffd Zd Zed k(reyy#e $rdZ Y)>)K)KL& " 8 #!)!8!8!: < '!)!8!8!:!*"/E FFreturnc X tjtjd}t }dt j i}ddi}ddi}trdtj i}trdtj i}ddd}tr-tj tjjdd}dttddi}dttddi}tj}d||dndi} ||| t dutdu||||||dt"id S#t$rddd}YwxYw) z&Generate information for a bug report.)systemreleaserrNr )ropenssl_versionxr) rr system_sslusing_pyopensslusing_charset_normalizer pyOpenSSLurllib3chardetcharset_normalizer cryptographyidnarequests)rr$r%OSErrorr r,rr.r-OpenSSLSSLOPENSSL_VERSION_NUMBERgetattrr/r0sslrrequests_version) platform_infoimplementation_info urllib3_infocharset_normalizer_info chardet_infopyopenssl_infocryptography_info idna_infor(system_ssl_infos rinforBEsd  oo''') *+w223L($/+4d*;L#,.@.L.L"M!7#6#67 -N**")++"D"DQ!G  7<; 743I++J z7MZNSUVO"-%$D0$+tO#5) '  E     s)DD)(D)cVttjtddy)z)Pretty-print the bug information as JSON.T) sort_keysindentN)printjsondumpsrBr!rmainrKs $**TVtA 67r!__main__)__doc__rHrr7rtypingrr0r,r rr8r. ImportErrorr-urllib3.contribrr/r3r dictstrrBrK__name__rJr!rrTs-   -) G@8d38n8v8  zFg G IGLs3AA,A9A)(A),A65A69 BBPK!1Zww$__pycache__/__init__.cpython-312.pycnu[ 9r*j" ^dZddlmZddlZddlZddlmZ ddlmZ  ddl mZ  ddZ ddZ e eje e  ddlZeed ds%ddlmZej,ddlmZeeddlmZej6deddlZddlmZddlmZm Z ddlm!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)mZddl*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2ddlm3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;mZ>m?Z?m@Z@ddlAmBZBmCZCddlDmEZEdZFejeHjeej6de5dy#e $rdZ Y0wxYw#e $rdZ Y7wxYw#eef$r+ej"d ejd e d e d eYGwxYw#e $rdZYOwxYw#e $rY,wxYw) a Requests HTTP Library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> r.status_code 200 >>> b'Python is a programming language' in r.content True ... or POST: >>> payload = dict(key1='value1', key2='value2') >>> r = requests.post('https://httpbin.org/post', data=payload) >>> print(r.text) { ... "form": { "key1": "value1", "key2": "value2" }, ... } The other HTTP methods are supported - see `requests.api`. Full documentation is at . :copyright: (c) 2017 by Kenneth Reitz. :license: Apache 2.0, see LICENSE for more details. ) annotationsN)RequestsDependencyWarning) __version__cb|jddd}|dgk7sJt|dk(r|jd|\}}}t|t|t|}}}|dk\sJ|dk(r|dk\sJ|rN|jddd\}}}t|t|t|}}}d|||fcxkrd ksJJy|rN|jddd\}}}t|t|t|}}}d |||fcxkrd ksJJyt j d t y) N.dev0r)r rr )rr)r rr)rrzYUnable to find acceptable character detection dependency (chardet or charset_normalizer).)splitlenappendintwarningswarnr)urllib3_versionchardet_versioncharset_normalizer_versionurllib3_version_listmajorminorpatchs @/opt/hc_python/lib/python3.12/site-packages/requests/__init__.pycheck_compatibilityr<s_ +005bq9 E7 ** *  A%##C(/E5%e*c%j#e*%5E A:: z{{3o33C8!<ue!%j#e*c%jeuUE51=I===== #>8>>sCBQGue!%j#e*c%jeuUE51=I=====  / % c ttt|jd}|gdkr!d|d}t j |tyy#t$rYywxYw)Nr)rr rzOld version of cryptography (z) may cause slowdown.)listmaprr ValueErrorrrr)cryptography_versioncryptography_version_listwarnings r_check_cryptographyr'csk$(S2L2F2L2LS2Q)R$S!!9,12K1LLab g89- s)A A A z urllib3 (z) or chardet (z)/charset_normalizer (z$) doesn't match a supported version!HAS_SNIF) pyopenssl)DependencyWarningignore) NullHandler)packagesutils) __author____author_email__ __build____cake__ __copyright____description__ __license__ __title____url__r)deletegetheadoptionsrpostputrequest) ConnectionErrorConnectTimeoutFileModeWarning HTTPErrorJSONDecodeError ReadTimeoutRequestExceptionTimeoutTooManyRedirects URLRequired)PreparedRequestRequestResponse)Sessionsession)codes)r?r@rBrCrIrDrJrErKrLrFrGrHrNr8r9r:r;r-rr<r=r>rMr.defaultT)r)rstrr str | NonerrQreturnNone)r$rPrRrS)J__doc__ __future__rrurllib3 exceptionsrcharset_normalizerrr ImportErrorchardetrrr'AssertionErrorr#rsslgetattrurllib3.contribr)inject_into_urllib3 cryptographyr$urllib3.exceptionsr* simplefilterloggingr,r-r.r/r0r1r2r3r4r5r6r7apir8r9r:r;rr<r=r>r?r@rArBrCrDrErFrGrHmodelsrIrJrKsessionsrLrM status_codesrN__all__ getLogger__name__ addHandlerrrrns !F#1&L6 $ $ $ !+$  $ N : "   3 5 )-% %%'  01 1h 12   GFF   76& 8(&&{}5i>Q&!%& O|  #HMM G''()  23M2NO- - "    scEEE F/F#EEEE .FFF F#F  F##F,+F,PK!D**'__pycache__/__version__.cpython-312.pycnu[ 9r*j,dZdZdZdZdZdZdZdZdZd Z y ) requestszPython HTTP for Humans.zhttps://requests.readthedocs.ioz2.34.2i4z Kenneth Reitzzme@kennethreitz.orgz Apache-2.0zCopyright Kenneth Reitzu ✨ 🍰 ✨N) __title____description____url__ __version__ __build__ __author____author_email__ __license__ __copyright____cake__C/opt/hc_python/lib/python3.12/site-packages/requests/__version__.pyrs:  + +   ( ) %rPK!4||!__pycache__/certs.cpython-312.pycnu[ 9r*j:dZddlmZedk(reeyy)uF requests.certs ~~~~~~~~~~~~~~ This module returns the preferred default CA certificate bundle. There is only one — the one from the certifi package. If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a separately packaged CA bundle. )where__main__N)__doc__certifir__name__print=/opt/hc_python/lib/python3.12/site-packages/requests/certs.pyr s%  z %'Nr PK!"Ο compat.pynu[""" requests.compat ~~~~~~~~~~~~~~~ This module previously handled import compatibility issues between Python 2 and Python 3. It remains for backwards compatibility until the next major version. """ import sys # ------- # urllib3 # ------- from pip._vendor.urllib3 import __version__ as urllib3_version # Detect which major version of urllib3 is being used. try: is_urllib3_1 = int(urllib3_version.split(".")[0]) == 1 except (TypeError, AttributeError): # If we can't discern a version, prefer old functionality. is_urllib3_1 = True # ------------------- # Character Detection # ------------------- def _resolve_char_detection(): """Find supported character detection libraries.""" chardet = None return chardet chardet = _resolve_char_detection() # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = _ver[0] == 2 #: Python 3.x? is_py3 = _ver[0] == 3 # Note: We've patched out simplejson support in pip because it prevents # upgrading simplejson on Windows. import json from json import JSONDecodeError # Keep OrderedDict for backwards compatibility. from collections import OrderedDict from collections.abc import Callable, Mapping, MutableMapping from http import cookiejar as cookielib from http.cookies import Morsel from io import StringIO # -------------- # Legacy Imports # -------------- from urllib.parse import ( quote, quote_plus, unquote, unquote_plus, urldefrag, urlencode, urljoin, urlparse, urlsplit, urlunparse, ) from urllib.request import ( getproxies, getproxies_environment, parse_http_list, proxy_bypass, proxy_bypass_environment, ) builtin_str = str str = str bytes = bytes basestring = (str, bytes) numeric_types = (int, float) integer_types = (int,) PK!py.typednu[PK!(_internal_utils.pynu[""" requests._internal_utils ~~~~~~~~~~~~~~ Provides utility functions that are consumed internally by Requests which depend on extremely few external helpers (such as compat) """ import re from .compat import builtin_str _VALID_HEADER_NAME_RE_BYTE = re.compile(rb"^[^:\s][^:\r\n]*$") _VALID_HEADER_NAME_RE_STR = re.compile(r"^[^:\s][^:\r\n]*$") _VALID_HEADER_VALUE_RE_BYTE = re.compile(rb"^\S[^\r\n]*$|^$") _VALID_HEADER_VALUE_RE_STR = re.compile(r"^\S[^\r\n]*$|^$") _HEADER_VALIDATORS_STR = (_VALID_HEADER_NAME_RE_STR, _VALID_HEADER_VALUE_RE_STR) _HEADER_VALIDATORS_BYTE = (_VALID_HEADER_NAME_RE_BYTE, _VALID_HEADER_VALUE_RE_BYTE) HEADER_VALIDATORS = { bytes: _HEADER_VALIDATORS_BYTE, str: _HEADER_VALIDATORS_STR, } def to_native_string(string, encoding="ascii"): """Given a string object, regardless of type, returns a representation of that string in the native string type, encoding and decoding where necessary. This assumes ASCII unless told otherwise. """ if isinstance(string, builtin_str): out = string else: out = string.decode(encoding) return out def unicode_is_ascii(u_string): """Determine if unicode string only contains ASCII characters. :param str u_string: unicode string to check. Must be unicode and not Python 2 `str`. :rtype: bool """ assert isinstance(u_string, str) try: u_string.encode("ascii") return True except UnicodeEncodeError: return False PK!=`: exceptions.pynu[""" requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from pip._vendor.urllib3.exceptions import HTTPError as BaseHTTPError from .compat import JSONDecodeError as CompatJSONDecodeError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. """ def __init__(self, *args, **kwargs): """Initialize RequestException with `request` and `response` objects.""" response = kwargs.pop("response", None) self.response = response self.request = kwargs.pop("request", None) if response is not None and not self.request and hasattr(response, "request"): self.request = self.response.request super().__init__(*args, **kwargs) class InvalidJSONError(RequestException): """A JSON error occurred.""" class JSONDecodeError(InvalidJSONError, CompatJSONDecodeError): """Couldn't decode the text into json""" def __init__(self, *args, **kwargs): """ Construct the JSONDecodeError instance first with all args. Then use it's args to construct the IOError so that the json specific args aren't used as IOError specific args and the error message from JSONDecodeError is preserved. """ CompatJSONDecodeError.__init__(self, *args) InvalidJSONError.__init__(self, *self.args, **kwargs) def __reduce__(self): """ The __reduce__ method called when pickling the object must be the one from the JSONDecodeError (be it json/simplejson) as it expects all the arguments for instantiation, not just one like the IOError, and the MRO would by default call the __reduce__ method from the IOError due to the inheritance order. """ return CompatJSONDecodeError.__reduce__(self) class HTTPError(RequestException): """An HTTP error occurred.""" class ConnectionError(RequestException): """A Connection error occurred.""" class ProxyError(ConnectionError): """A proxy error occurred.""" class SSLError(ConnectionError): """An SSL error occurred.""" class Timeout(RequestException): """The request timed out. Catching this error will catch both :exc:`~requests.exceptions.ConnectTimeout` and :exc:`~requests.exceptions.ReadTimeout` errors. """ class ConnectTimeout(ConnectionError, Timeout): """The request timed out while trying to connect to the remote server. Requests that produced this error are safe to retry. """ class ReadTimeout(Timeout): """The server did not send any data in the allotted amount of time.""" class URLRequired(RequestException): """A valid URL is required to make a request.""" class TooManyRedirects(RequestException): """Too many redirects.""" class MissingSchema(RequestException, ValueError): """The URL scheme (e.g. http or https) is missing.""" class InvalidSchema(RequestException, ValueError): """The URL scheme provided is either invalid or unsupported.""" class InvalidURL(RequestException, ValueError): """The URL provided was somehow invalid.""" class InvalidHeader(RequestException, ValueError): """The header value provided was somehow invalid.""" class InvalidProxyURL(InvalidURL): """The proxy URL provided is invalid.""" class ChunkedEncodingError(RequestException): """The server declared chunked encoding but sent an invalid chunk.""" class ContentDecodingError(RequestException, BaseHTTPError): """Failed to decode response content.""" class StreamConsumedError(RequestException, TypeError): """The content for this response was already consumed.""" class RetryError(RequestException): """Custom retries logic failed""" class UnrewindableBodyError(RequestException): """Requests encountered an error when trying to rewind a body.""" # Warnings class RequestsWarning(Warning): """Base warning for Requests.""" class FileModeWarning(RequestsWarning, DeprecationWarning): """A file was opened in text mode, but Requests determined its binary length.""" class RequestsDependencyWarning(RequestsWarning): """An imported dependency doesn't match the expected version range.""" PK!s611api.pynu[""" requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request `. :param method: method for the new :class:`Request` object: ``GET``, ``OPTIONS``, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:`Request`. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload. ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')`` or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content_type'`` is a string defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers to add for the file. :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How many seconds to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``True``. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. :param stream: (optional) if ``False``, the response content will be immediately downloaded. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :return: :class:`Response ` object :rtype: requests.Response Usage:: >>> import requests >>> req = requests.request('GET', 'https://httpbin.org/get') >>> req """ # By using the 'with' statement we are sure the session is closed, thus we # avoid leaving sockets open which can trigger a ResourceWarning in some # cases, and look like a memory leak in others. with sessions.Session() as session: return session.request(method=method, url=url, **kwargs) def get(url, params=None, **kwargs): r"""Sends a GET request. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response """ return request("get", url, params=params, **kwargs) def options(url, **kwargs): r"""Sends an OPTIONS request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response """ return request("options", url, **kwargs) def head(url, **kwargs): r"""Sends a HEAD request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. If `allow_redirects` is not provided, it will be set to `False` (as opposed to the default :meth:`request` behavior). :return: :class:`Response ` object :rtype: requests.Response """ kwargs.setdefault("allow_redirects", False) return request("head", url, **kwargs) def post(url, data=None, json=None, **kwargs): r"""Sends a POST request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response """ return request("post", url, data=data, json=json, **kwargs) def put(url, data=None, **kwargs): r"""Sends a PUT request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response """ return request("put", url, data=data, **kwargs) def patch(url, data=None, **kwargs): r"""Sends a PATCH request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response """ return request("patch", url, data=data, **kwargs) def delete(url, **kwargs): r"""Sends a DELETE request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response """ return request("delete", url, **kwargs) PK!QL` ` structures.pynu[""" requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ from collections import OrderedDict from .compat import Mapping, MutableMapping class CaseInsensitiveDict(MutableMapping): """A case-insensitive ``dict``-like object. Implements all methods and operations of ``MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive:: cid = CaseInsensitiveDict() cid['Accept'] = 'application/json' cid['aCCEPT'] == 'application/json' # True list(cid) == ['Accept'] # True For example, ``headers['content-encoding']`` will return the value of a ``'Content-Encoding'`` response header, regardless of how the header name was originally stored. If the constructor, ``.update``, or equality comparison operations are given keys that have equal ``.lower()``s, the behavior is undefined. """ def __init__(self, data=None, **kwargs): self._store = OrderedDict() if data is None: data = {} self.update(data, **kwargs) def __setitem__(self, key, value): # Use the lowercased key for lookups, but store the actual # key alongside the value. self._store[key.lower()] = (key, value) def __getitem__(self, key): return self._store[key.lower()][1] def __delitem__(self, key): del self._store[key.lower()] def __iter__(self): return (casedkey for casedkey, mappedvalue in self._store.values()) def __len__(self): return len(self._store) def lower_items(self): """Like iteritems(), but with all lowercase keys.""" return ((lowerkey, keyval[1]) for (lowerkey, keyval) in self._store.items()) def __eq__(self, other): if isinstance(other, Mapping): other = CaseInsensitiveDict(other) else: return NotImplemented # Compare insensitively return dict(self.lower_items()) == dict(other.lower_items()) # Copy is required def copy(self): return CaseInsensitiveDict(self._store.values()) def __repr__(self): return str(dict(self.items())) class LookupDict(dict): """Dictionary lookup object.""" def __init__(self, name=None): self.name = name super().__init__() def __repr__(self): return f"" def __getitem__(self, key): # We allow fall-through here, so values default to None return self.__dict__.get(key, None) def get(self, key, default=None): return self.__dict__.get(key, default) PK!certs.pynu[#!/usr/bin/env python """ requests.certs ~~~~~~~~~~~~~~ This module returns the preferred default CA certificate bundle. There is only one — the one from the certifi package. If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a separately packaged CA bundle. """ from pip._vendor.certifi import where if __name__ == "__main__": print(where()) PK!\gQɁɁutils.pynu[""" requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import codecs import contextlib import io import os import re import socket import struct import sys import tempfile import warnings import zipfile from collections import OrderedDict from pip._vendor.urllib3.util import make_headers, parse_url from . import certs from .__version__ import __version__ # to_native_string is unused here, but imported here for backwards compatibility from ._internal_utils import ( # noqa: F401 _HEADER_VALIDATORS_BYTE, _HEADER_VALIDATORS_STR, HEADER_VALIDATORS, to_native_string, ) from .compat import ( Mapping, basestring, bytes, getproxies, getproxies_environment, integer_types, is_urllib3_1, ) from .compat import parse_http_list as _parse_list_header from .compat import ( proxy_bypass, proxy_bypass_environment, quote, str, unquote, urlparse, urlunparse, ) from .cookies import cookiejar_from_dict from .exceptions import ( FileModeWarning, InvalidHeader, InvalidURL, UnrewindableBodyError, ) from .structures import CaseInsensitiveDict NETRC_FILES = (".netrc", "_netrc") DEFAULT_CA_BUNDLE_PATH = certs.where() DEFAULT_PORTS = {"http": 80, "https": 443} # Ensure that ', ' is used to preserve previous delimiter behavior. DEFAULT_ACCEPT_ENCODING = ", ".join( re.split(r",\s*", make_headers(accept_encoding=True)["accept-encoding"]) ) if sys.platform == "win32": # provide a proxy_bypass version on Windows without DNS lookups def proxy_bypass_registry(host): try: import winreg except ImportError: return False try: internetSettings = winreg.OpenKey( winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Internet Settings", ) # ProxyEnable could be REG_SZ or REG_DWORD, normalizing it proxyEnable = int(winreg.QueryValueEx(internetSettings, "ProxyEnable")[0]) # ProxyOverride is almost always a string proxyOverride = winreg.QueryValueEx(internetSettings, "ProxyOverride")[0] except (OSError, ValueError): return False if not proxyEnable or not proxyOverride: return False # make a check value list from the registry entry: replace the # '' string by the localhost entry and the corresponding # canonical entry. proxyOverride = proxyOverride.split(";") # filter out empty strings to avoid re.match return true in the following code. proxyOverride = filter(None, proxyOverride) # now check if we match one of the registry values. for test in proxyOverride: if test == "": if "." not in host: return True test = test.replace(".", r"\.") # mask dots test = test.replace("*", r".*") # change glob sequence test = test.replace("?", r".") # change glob char if re.match(test, host, re.I): return True return False def proxy_bypass(host): # noqa """Return True, if the host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. """ if getproxies_environment(): return proxy_bypass_environment(host) else: return proxy_bypass_registry(host) def dict_to_sequence(d): """Returns an internal sequence dictionary update.""" if hasattr(d, "items"): d = d.items() return d def super_len(o): total_length = None current_position = 0 if not is_urllib3_1 and isinstance(o, str): # urllib3 2.x+ treats all strings as utf-8 instead # of latin-1 (iso-8859-1) like http.client. o = o.encode("utf-8") if hasattr(o, "__len__"): total_length = len(o) elif hasattr(o, "len"): total_length = o.len elif hasattr(o, "fileno"): try: fileno = o.fileno() except (io.UnsupportedOperation, AttributeError): # AttributeError is a surprising exception, seeing as how we've just checked # that `hasattr(o, 'fileno')`. It happens for objects obtained via # `Tarfile.extractfile()`, per issue 5229. pass else: total_length = os.fstat(fileno).st_size # Having used fstat to determine the file length, we need to # confirm that this file was opened up in binary mode. if "b" not in o.mode: warnings.warn( ( "Requests has determined the content-length for this " "request using the binary size of the file: however, the " "file has been opened in text mode (i.e. without the 'b' " "flag in the mode). This may lead to an incorrect " "content-length. In Requests 3.0, support will be removed " "for files in text mode." ), FileModeWarning, ) if hasattr(o, "tell"): try: current_position = o.tell() except OSError: # This can happen in some weird situations, such as when the file # is actually a special file descriptor like stdin. In this # instance, we don't know what the length is, so set it to zero and # let requests chunk it instead. if total_length is not None: current_position = total_length else: if hasattr(o, "seek") and total_length is None: # StringIO and BytesIO have seek but no usable fileno try: # seek to end of file o.seek(0, 2) total_length = o.tell() # seek back to current position to support # partially read file-like objects o.seek(current_position or 0) except OSError: total_length = 0 if total_length is None: total_length = 0 return max(0, total_length - current_position) def get_netrc_auth(url, raise_errors=False): """Returns the Requests tuple auth for a given url from netrc.""" netrc_file = os.environ.get("NETRC") if netrc_file is not None: netrc_locations = (netrc_file,) else: netrc_locations = (f"~/{f}" for f in NETRC_FILES) try: from netrc import NetrcParseError, netrc netrc_path = None for f in netrc_locations: loc = os.path.expanduser(f) if os.path.exists(loc): netrc_path = loc break # Abort early if there isn't one. if netrc_path is None: return ri = urlparse(url) host = ri.hostname try: _netrc = netrc(netrc_path).authenticators(host) if _netrc: # Return with login / password login_i = 0 if _netrc[0] else 1 return (_netrc[login_i], _netrc[2]) except (NetrcParseError, OSError): # If there was a parsing error or a permissions issue reading the file, # we'll just skip netrc auth unless explicitly asked to raise errors. if raise_errors: raise # App Engine hackiness. except (ImportError, AttributeError): pass def guess_filename(obj): """Tries to guess the filename of the given object.""" name = getattr(obj, "name", None) if name and isinstance(name, basestring) and name[0] != "<" and name[-1] != ">": return os.path.basename(name) def extract_zipped_paths(path): """Replace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged. """ if os.path.exists(path): # this is already a valid path, no need to do anything further return path # find the first valid part of the provided path and treat that as a zip archive # assume the rest of the path is the name of a member in the archive archive, member = os.path.split(path) while archive and not os.path.exists(archive): archive, prefix = os.path.split(archive) if not prefix: # If we don't check for an empty prefix after the split (in other words, archive remains unchanged after the split), # we _can_ end up in an infinite loop on a rare corner case affecting a small number of users break member = "/".join([prefix, member]) if not zipfile.is_zipfile(archive): return path zip_file = zipfile.ZipFile(archive) if member not in zip_file.namelist(): return path # we have a valid zip archive and a valid member of that archive tmp = tempfile.gettempdir() extracted_path = os.path.join(tmp, member.split("/")[-1]) if not os.path.exists(extracted_path): # use read + write to avoid the creating nested folders, we only want the file, avoids mkdir racing condition with atomic_open(extracted_path) as file_handler: file_handler.write(zip_file.read(member)) return extracted_path @contextlib.contextmanager def atomic_open(filename): """Write a file to the disk in an atomic fashion""" tmp_descriptor, tmp_name = tempfile.mkstemp(dir=os.path.dirname(filename)) try: with os.fdopen(tmp_descriptor, "wb") as tmp_handler: yield tmp_handler os.replace(tmp_name, filename) except BaseException: os.remove(tmp_name) raise def from_key_val_list(value): """Take an object and test to see if it can be represented as a dictionary. Unless it can not be represented as such, return an OrderedDict, e.g., :: >>> from_key_val_list([('key', 'val')]) OrderedDict([('key', 'val')]) >>> from_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples >>> from_key_val_list({'key': 'val'}) OrderedDict([('key', 'val')]) :rtype: OrderedDict """ if value is None: return None if isinstance(value, (str, bytes, bool, int)): raise ValueError("cannot encode objects that are not 2-tuples") return OrderedDict(value) def to_key_val_list(value): """Take an object and test to see if it can be represented as a dictionary. If it can be, return a list of tuples, e.g., :: >>> to_key_val_list([('key', 'val')]) [('key', 'val')] >>> to_key_val_list({'key': 'val'}) [('key', 'val')] >>> to_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples :rtype: list """ if value is None: return None if isinstance(value, (str, bytes, bool, int)): raise ValueError("cannot encode objects that are not 2-tuples") if isinstance(value, Mapping): value = value.items() return list(value) # From mitsuhiko/werkzeug (used with permission). def parse_list_header(value): """Parse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing. It basically works like :func:`parse_set_header` just that items may appear multiple times and case sensitivity is preserved. The return value is a standard :class:`list`: >>> parse_list_header('token, "quoted value"') ['token', 'quoted value'] To create a header from the :class:`list` again, use the :func:`dump_header` function. :param value: a string with a list header. :return: :class:`list` :rtype: list """ result = [] for item in _parse_list_header(value): if item[:1] == item[-1:] == '"': item = unquote_header_value(item[1:-1]) result.append(item) return result # From mitsuhiko/werkzeug (used with permission). def parse_dict_header(value): """Parse lists of key, value pairs as described by RFC 2068 Section 2 and convert them into a python dict: >>> d = parse_dict_header('foo="is a fish", bar="as well"') >>> type(d) is dict True >>> sorted(d.items()) [('bar', 'as well'), ('foo', 'is a fish')] If there is no value for a key it will be `None`: >>> parse_dict_header('key_without_value') {'key_without_value': None} To create a header from the :class:`dict` again, use the :func:`dump_header` function. :param value: a string with a dict header. :return: :class:`dict` :rtype: dict """ result = {} for item in _parse_list_header(value): if "=" not in item: result[item] = None continue name, value = item.split("=", 1) if value[:1] == value[-1:] == '"': value = unquote_header_value(value[1:-1]) result[name] = value return result # From mitsuhiko/werkzeug (used with permission). def unquote_header_value(value, is_filename=False): r"""Unquotes a header value. (Reversal of :func:`quote_header_value`). This does not use the real unquoting but what browsers are actually using for quoting. :param value: the header value to unquote. :rtype: str """ if value and value[0] == value[-1] == '"': # this is not the real unquoting, but fixing this so that the # RFC is met will result in bugs with internet explorer and # probably some other browsers as well. IE for example is # uploading files with "C:\foo\bar.txt" as filename value = value[1:-1] # if this is a filename and the starting characters look like # a UNC path, then just return the value without quotes. Using the # replace sequence below on a UNC path has the effect of turning # the leading double slash into a single slash and then # _fix_ie_filename() doesn't work correctly. See #458. if not is_filename or value[:2] != "\\\\": return value.replace("\\\\", "\\").replace('\\"', '"') return value def dict_from_cookiejar(cj): """Returns a key/value dictionary from a CookieJar. :param cj: CookieJar object to extract cookies from. :rtype: dict """ cookie_dict = {cookie.name: cookie.value for cookie in cj} return cookie_dict def add_dict_to_cookiejar(cj, cookie_dict): """Returns a CookieJar from a key/value dictionary. :param cj: CookieJar to insert cookies into. :param cookie_dict: Dict of key/values to insert into CookieJar. :rtype: CookieJar """ return cookiejar_from_dict(cookie_dict, cj) def get_encodings_from_content(content): """Returns encodings from given content string. :param content: bytestring to extract encodings from. """ warnings.warn( ( "In requests 3.0, get_encodings_from_content will be removed. For " "more information, please see the discussion on issue #2266. (This" " warning should only appear once.)" ), DeprecationWarning, ) charset_re = re.compile(r']', flags=re.I) pragma_re = re.compile(r']', flags=re.I) xml_re = re.compile(r'^<\?xml.*?encoding=["\']*(.+?)["\'>]') return ( charset_re.findall(content) + pragma_re.findall(content) + xml_re.findall(content) ) def _parse_content_type_header(header): """Returns content type and parameters from given header :param header: string :return: tuple containing content type and dictionary of parameters """ tokens = header.split(";") content_type, params = tokens[0].strip(), tokens[1:] params_dict = {} items_to_strip = "\"' " for param in params: param = param.strip() if param: key, value = param, True index_of_equals = param.find("=") if index_of_equals != -1: key = param[:index_of_equals].strip(items_to_strip) value = param[index_of_equals + 1 :].strip(items_to_strip) params_dict[key.lower()] = value return content_type, params_dict def get_encoding_from_headers(headers): """Returns encodings from given HTTP Header Dict. :param headers: dictionary to extract encoding from. :rtype: str """ content_type = headers.get("content-type") if not content_type: return None content_type, params = _parse_content_type_header(content_type) if "charset" in params: return params["charset"].strip("'\"") if "text" in content_type: return "ISO-8859-1" if "application/json" in content_type: # Assume UTF-8 based on RFC 4627: https://www.ietf.org/rfc/rfc4627.txt since the charset was unset return "utf-8" def stream_decode_response_unicode(iterator, r): """Stream decodes an iterator.""" if r.encoding is None: yield from iterator return decoder = codecs.getincrementaldecoder(r.encoding)(errors="replace") for chunk in iterator: rv = decoder.decode(chunk) if rv: yield rv rv = decoder.decode(b"", final=True) if rv: yield rv def iter_slices(string, slice_length): """Iterate over slices of a string.""" pos = 0 if slice_length is None or slice_length <= 0: slice_length = len(string) while pos < len(string): yield string[pos : pos + slice_length] pos += slice_length def get_unicode_from_response(r): """Returns the requested content back in unicode. :param r: Response object to get unicode content from. Tried: 1. charset from content-type 2. fall back and replace all unicode characters :rtype: str """ warnings.warn( ( "In requests 3.0, get_unicode_from_response will be removed. For " "more information, please see the discussion on issue #2266. (This" " warning should only appear once.)" ), DeprecationWarning, ) tried_encodings = [] # Try charset from content-type encoding = get_encoding_from_headers(r.headers) if encoding: try: return str(r.content, encoding) except UnicodeError: tried_encodings.append(encoding) # Fall back: try: return str(r.content, encoding, errors="replace") except TypeError: return r.content # The unreserved URI characters (RFC 3986) UNRESERVED_SET = frozenset( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + "0123456789-._~" ) def unquote_unreserved(uri): """Un-escape any percent-escape sequences in a URI that are unreserved characters. This leaves all reserved, illegal and non-ASCII bytes encoded. :rtype: str """ parts = uri.split("%") for i in range(1, len(parts)): h = parts[i][0:2] if len(h) == 2 and h.isalnum(): try: c = chr(int(h, 16)) except ValueError: raise InvalidURL(f"Invalid percent-escape sequence: '{h}'") if c in UNRESERVED_SET: parts[i] = c + parts[i][2:] else: parts[i] = f"%{parts[i]}" else: parts[i] = f"%{parts[i]}" return "".join(parts) def requote_uri(uri): """Re-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. :rtype: str """ safe_with_percent = "!#$%&'()*+,/:;=?@[]~" safe_without_percent = "!#$&'()*+,/:;=?@[]~" try: # Unquote only the unreserved characters # Then quote only illegal characters (do not quote reserved, # unreserved, or '%') return quote(unquote_unreserved(uri), safe=safe_with_percent) except InvalidURL: # We couldn't unquote the given URI, so let's try quoting it, but # there may be unquoted '%'s in the URI. We need to make sure they're # properly quoted so they do not cause issues elsewhere. return quote(uri, safe=safe_without_percent) def address_in_network(ip, net): """This function allows you to check if an IP belongs to a network subnet Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24 returns False if ip = 192.168.1.1 and net = 192.168.100.0/24 :rtype: bool """ ipaddr = struct.unpack("=L", socket.inet_aton(ip))[0] netaddr, bits = net.split("/") netmask = struct.unpack("=L", socket.inet_aton(dotted_netmask(int(bits))))[0] network = struct.unpack("=L", socket.inet_aton(netaddr))[0] & netmask return (ipaddr & netmask) == (network & netmask) def dotted_netmask(mask): """Converts mask from /xx format to xxx.xxx.xxx.xxx Example: if mask is 24 function returns 255.255.255.0 :rtype: str """ bits = 0xFFFFFFFF ^ (1 << 32 - mask) - 1 return socket.inet_ntoa(struct.pack(">I", bits)) def is_ipv4_address(string_ip): """ :rtype: bool """ try: socket.inet_aton(string_ip) except OSError: return False return True def is_valid_cidr(string_network): """ Very simple check of the cidr format in no_proxy variable. :rtype: bool """ if string_network.count("/") == 1: try: mask = int(string_network.split("/")[1]) except ValueError: return False if mask < 1 or mask > 32: return False try: socket.inet_aton(string_network.split("/")[0]) except OSError: return False else: return False return True @contextlib.contextmanager def set_environ(env_name, value): """Set the environment variable 'env_name' to 'value' Save previous value, yield, and then restore the previous value stored in the environment variable 'env_name'. If 'value' is None, do nothing""" value_changed = value is not None if value_changed: old_value = os.environ.get(env_name) os.environ[env_name] = value try: yield finally: if value_changed: if old_value is None: del os.environ[env_name] else: os.environ[env_name] = old_value def should_bypass_proxies(url, no_proxy): """ Returns whether we should bypass proxies or not. :rtype: bool """ # Prioritize lowercase environment variables over uppercase # to keep a consistent behaviour with other http projects (curl, wget). def get_proxy(key): return os.environ.get(key) or os.environ.get(key.upper()) # First check whether no_proxy is defined. If it is, check that the URL # we're getting isn't in the no_proxy list. no_proxy_arg = no_proxy if no_proxy is None: no_proxy = get_proxy("no_proxy") parsed = urlparse(url) if parsed.hostname is None: # URLs don't always have hostnames, e.g. file:/// urls. return True if no_proxy: # We need to check whether we match here. We need to see if we match # the end of the hostname, both with and without the port. no_proxy = (host for host in no_proxy.replace(" ", "").split(",") if host) if is_ipv4_address(parsed.hostname): for proxy_ip in no_proxy: if is_valid_cidr(proxy_ip): if address_in_network(parsed.hostname, proxy_ip): return True elif parsed.hostname == proxy_ip: # If no_proxy ip was defined in plain IP notation instead of cidr notation & # matches the IP of the index return True else: host_with_port = parsed.hostname if parsed.port: host_with_port += f":{parsed.port}" for host in no_proxy: if parsed.hostname.endswith(host) or host_with_port.endswith(host): # The URL does match something in no_proxy, so we don't want # to apply the proxies on this URL. return True with set_environ("no_proxy", no_proxy_arg): # parsed.hostname can be `None` in cases such as a file URI. try: bypass = proxy_bypass(parsed.hostname) except (TypeError, socket.gaierror): bypass = False if bypass: return True return False def get_environ_proxies(url, no_proxy=None): """ Return a dict of environment proxies. :rtype: dict """ if should_bypass_proxies(url, no_proxy=no_proxy): return {} else: return getproxies() def select_proxy(url, proxies): """Select a proxy for the url, if applicable. :param url: The url being for the request :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs """ proxies = proxies or {} urlparts = urlparse(url) if urlparts.hostname is None: return proxies.get(urlparts.scheme, proxies.get("all")) proxy_keys = [ urlparts.scheme + "://" + urlparts.hostname, urlparts.scheme, "all://" + urlparts.hostname, "all", ] proxy = None for proxy_key in proxy_keys: if proxy_key in proxies: proxy = proxies[proxy_key] break return proxy def resolve_proxies(request, proxies, trust_env=True): """This method takes proxy information from a request and configuration input to resolve a mapping of target proxies. This will consider settings such as NO_PROXY to strip proxy configurations. :param request: Request or PreparedRequest :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs :param trust_env: Boolean declaring whether to trust environment configs :rtype: dict """ proxies = proxies if proxies is not None else {} url = request.url scheme = urlparse(url).scheme no_proxy = proxies.get("no_proxy") new_proxies = proxies.copy() if trust_env and not should_bypass_proxies(url, no_proxy=no_proxy): environ_proxies = get_environ_proxies(url, no_proxy=no_proxy) proxy = environ_proxies.get(scheme, environ_proxies.get("all")) if proxy: new_proxies.setdefault(scheme, proxy) return new_proxies def default_user_agent(name="python-requests"): """ Return a string representing the default user agent. :rtype: str """ return f"{name}/{__version__}" def default_headers(): """ :rtype: requests.structures.CaseInsensitiveDict """ return CaseInsensitiveDict( { "User-Agent": default_user_agent(), "Accept-Encoding": DEFAULT_ACCEPT_ENCODING, "Accept": "*/*", "Connection": "keep-alive", } ) def parse_header_links(value): """Return a list of parsed link headers proxies. i.e. Link: ; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" :rtype: list """ links = [] replace_chars = " '\"" value = value.strip(replace_chars) if not value: return links for val in re.split(", *<", value): try: url, params = val.split(";", 1) except ValueError: url, params = val, "" link = {"url": url.strip("<> '\"")} for param in params.split(";"): try: key, value = param.split("=") except ValueError: break link[key.strip(replace_chars)] = value.strip(replace_chars) links.append(link) return links # Null bytes; no need to recreate these on each call to guess_json_utf _null = "\x00".encode("ascii") # encoding to ASCII for Python 3 _null2 = _null * 2 _null3 = _null * 3 def guess_json_utf(data): """ :rtype: str """ # JSON always starts with two ASCII characters, so detection is as # easy as counting the nulls and from their location and count # determine the encoding. Also detect a BOM, if present. sample = data[:4] if sample in (codecs.BOM_UTF32_LE, codecs.BOM_UTF32_BE): return "utf-32" # BOM included if sample[:3] == codecs.BOM_UTF8: return "utf-8-sig" # BOM included, MS style (discouraged) if sample[:2] in (codecs.BOM_UTF16_LE, codecs.BOM_UTF16_BE): return "utf-16" # BOM included nullcount = sample.count(_null) if nullcount == 0: return "utf-8" if nullcount == 2: if sample[::2] == _null2: # 1st and 3rd are null return "utf-16-be" if sample[1::2] == _null2: # 2nd and 4th are null return "utf-16-le" # Did not detect 2 valid UTF-16 ascii-range characters if nullcount == 3: if sample[:3] == _null3: return "utf-32-be" if sample[1:] == _null3: return "utf-32-le" # Did not detect a valid UTF-32 ascii-range character return None def prepend_scheme_if_needed(url, new_scheme): """Given a URL that may or may not have a scheme, prepend the given scheme. Does not replace a present scheme with the one provided as an argument. :rtype: str """ parsed = parse_url(url) scheme, auth, host, port, path, query, fragment = parsed # A defect in urlparse determines that there isn't a netloc present in some # urls. We previously assumed parsing was overly cautious, and swapped the # netloc and path. Due to a lack of tests on the original defect, this is # maintained with parse_url for backwards compatibility. netloc = parsed.netloc if not netloc: netloc, path = path, netloc if auth: # parse_url doesn't provide the netloc with auth # so we'll add it ourselves. netloc = "@".join([auth, netloc]) if scheme is None: scheme = new_scheme if path is None: path = "" return urlunparse((scheme, netloc, path, "", query, fragment)) def get_auth_from_url(url): """Given a url with authentication components, extract them into a tuple of username,password. :rtype: (str,str) """ parsed = urlparse(url) try: auth = (unquote(parsed.username), unquote(parsed.password)) except (AttributeError, TypeError): auth = ("", "") return auth def check_header_validity(header): """Verifies that header parts don't contain leading whitespace reserved characters, or return characters. :param header: tuple, in the format (name, value). """ name, value = header _validate_header_part(header, name, 0) _validate_header_part(header, value, 1) def _validate_header_part(header, header_part, header_validator_index): if isinstance(header_part, str): validator = _HEADER_VALIDATORS_STR[header_validator_index] elif isinstance(header_part, bytes): validator = _HEADER_VALIDATORS_BYTE[header_validator_index] else: raise InvalidHeader( f"Header part ({header_part!r}) from {header} " f"must be of type str or bytes, not {type(header_part)}" ) if not validator.match(header_part): header_kind = "name" if header_validator_index == 0 else "value" raise InvalidHeader( f"Invalid leading whitespace, reserved character(s), or return " f"character(s) in header {header_kind}: {header_part!r}" ) def urldefragauth(url): """ Given a url remove the fragment and the authentication part. :rtype: str """ scheme, netloc, path, params, query, fragment = urlparse(url) # see func:`prepend_scheme_if_needed` if not netloc: netloc, path = path, netloc netloc = netloc.rsplit("@", 1)[-1] return urlunparse((scheme, netloc, path, params, query, "")) def rewind_body(prepared_request): """Move file pointer back to its recorded starting position so it can be read again on redirect. """ body_seek = getattr(prepared_request.body, "seek", None) if body_seek is not None and isinstance( prepared_request._body_position, integer_types ): try: body_seek(prepared_request._body_position) except OSError: raise UnrewindableBodyError( "An error occurred when rewinding request body for redirect." ) else: raise UnrewindableBodyError("Unable to rewind request body for redirect.") PK! # __init__.pynu[# __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP Library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> r.status_code 200 >>> b'Python is a programming language' in r.content True ... or POST: >>> payload = dict(key1='value1', key2='value2') >>> r = requests.post('https://httpbin.org/post', data=payload) >>> print(r.text) { ... "form": { "key1": "value1", "key2": "value2" }, ... } The other HTTP methods are supported - see `requests.api`. Full documentation is at . :copyright: (c) 2017 by Kenneth Reitz. :license: Apache 2.0, see LICENSE for more details. """ import warnings from pip._vendor import urllib3 from .exceptions import RequestsDependencyWarning charset_normalizer_version = None chardet_version = None def check_compatibility(urllib3_version, chardet_version, charset_normalizer_version): urllib3_version = urllib3_version.split(".") assert urllib3_version != ["dev"] # Verify urllib3 isn't installed from git. # Sometimes, urllib3 only reports its version as 16.1. if len(urllib3_version) == 2: urllib3_version.append("0") # Check urllib3 for compatibility. major, minor, patch = urllib3_version # noqa: F811 major, minor, patch = int(major), int(minor), int(patch) # urllib3 >= 1.21.1 assert major >= 1 if major == 1: assert minor >= 21 # Check charset_normalizer for compatibility. if chardet_version: major, minor, patch = chardet_version.split(".")[:3] major, minor, patch = int(major), int(minor), int(patch) # chardet_version >= 3.0.2, < 6.0.0 assert (3, 0, 2) <= (major, minor, patch) < (6, 0, 0) elif charset_normalizer_version: major, minor, patch = charset_normalizer_version.split(".")[:3] major, minor, patch = int(major), int(minor), int(patch) # charset_normalizer >= 2.0.0 < 4.0.0 assert (2, 0, 0) <= (major, minor, patch) < (4, 0, 0) else: # pip does not need or use character detection pass def _check_cryptography(cryptography_version): # cryptography < 1.3.4 try: cryptography_version = list(map(int, cryptography_version.split("."))) except ValueError: return if cryptography_version < [1, 3, 4]: warning = "Old version of cryptography ({}) may cause slowdown.".format( cryptography_version ) warnings.warn(warning, RequestsDependencyWarning) # Check imported dependencies for compatibility. try: check_compatibility( urllib3.__version__, chardet_version, charset_normalizer_version ) except (AssertionError, ValueError): warnings.warn( "urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported " "version!".format( urllib3.__version__, chardet_version, charset_normalizer_version ), RequestsDependencyWarning, ) # Attempt to enable urllib3's fallback for SNI support # if the standard library doesn't support SNI or the # 'ssl' library isn't available. try: # Note: This logic prevents upgrading cryptography on Windows, if imported # as part of pip. from pip._internal.utils.compat import WINDOWS if not WINDOWS: raise ImportError("pip internals: don't import cryptography on Windows") try: import ssl except ImportError: ssl = None if not getattr(ssl, "HAS_SNI", False): from pip._vendor.urllib3.contrib import pyopenssl pyopenssl.inject_into_urllib3() # Check cryptography version from cryptography import __version__ as cryptography_version _check_cryptography(cryptography_version) except ImportError: pass # urllib3's DependencyWarnings should be silenced. from pip._vendor.urllib3.exceptions import DependencyWarning warnings.simplefilter("ignore", DependencyWarning) # Set default logging handler to avoid "No handler found" warnings. import logging from logging import NullHandler from . import packages, utils from .__version__ import ( __author__, __author_email__, __build__, __cake__, __copyright__, __description__, __license__, __title__, __url__, __version__, ) from .api import delete, get, head, options, patch, post, put, request from .exceptions import ( ConnectionError, ConnectTimeout, FileModeWarning, HTTPError, JSONDecodeError, ReadTimeout, RequestException, Timeout, TooManyRedirects, URLRequired, ) from .models import PreparedRequest, Request, Response from .sessions import Session, session from .status_codes import codes logging.getLogger(__name__).addHandler(NullHandler()) # FileModeWarnings go off per the default. warnings.simplefilter("default", FileModeWarning, append=True) PK![ۀ _types.pynu[""" requests._types ~~~~~~~~~~~~~~~ This module contains type aliases used internally by the Requests library. These types are not part of the public API and must not be relied upon by external code. """ from __future__ import annotations from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence from typing import ( TYPE_CHECKING, Any, Protocol, TypeAlias, TypeVar, runtime_checkable, ) _T_co = TypeVar("_T_co", covariant=True) _KT_co = TypeVar("_KT_co", covariant=True) _VT_co = TypeVar("_VT_co", covariant=True) @runtime_checkable class SupportsRead(Protocol[_T_co]): def read(self, length: int = ..., /) -> _T_co: ... @runtime_checkable class SupportsItems(Protocol[_KT_co, _VT_co]): def items(self) -> Iterable[tuple[_KT_co, _VT_co]]: ... # These are needed at runtime for default_hooks() return type HookType: TypeAlias = Callable[["Response"], Any] HooksInputType: TypeAlias = Mapping[str, Iterable[HookType] | HookType] def is_prepared(request: PreparedRequest) -> TypeIs[_ValidatedRequest]: """Verify a PreparedRequest has been fully prepared.""" if TYPE_CHECKING: return request.url is not None and request.method is not None # noop at runtime to avoid AssertionError return True if TYPE_CHECKING: from http.cookiejar import CookieJar from typing import TypeAlias, TypedDict from typing_extensions import ( Buffer, # TODO: move to collections.abc when Python >= 3.12 TypeIs, # TODO: move to typing when Python >= 3.13 ) from .auth import AuthBase from .cookies import RequestsCookieJar from .models import PreparedRequest, Response from .structures import CaseInsensitiveDict class _ValidatedRequest(PreparedRequest): """Subtype asserting a PreparedRequest has been fully prepared before calling. The override suppression is required because mutable attribute types are invariant (Liskov), but we only narrow after preparation is complete. This is the explicit contract for Requests but Python's typing doesn't have a better way to represent the requirement. """ url: str # type: ignore[reportIncompatibleVariableOverride] method: str # type: ignore[reportIncompatibleVariableOverride] # Type aliases for core API concepts (ordered by request() signature) UriType: TypeAlias = str | bytes _ParamsMappingKeyType: TypeAlias = str | bytes | int | float _ParamsMappingValueType: TypeAlias = ( str | bytes | int | float | Iterable[str | bytes | int | float] | None ) ParamsType: TypeAlias = ( SupportsItems[_ParamsMappingKeyType, _ParamsMappingValueType] | tuple[tuple[_ParamsMappingKeyType, _ParamsMappingValueType], ...] | Iterable[tuple[_ParamsMappingKeyType, _ParamsMappingValueType]] | str | bytes | None ) KVDataType: TypeAlias = Iterable[tuple[Any, Any]] | SupportsItems[Any, Any] RawDataType: TypeAlias = KVDataType | str | bytes StreamDataType: TypeAlias = SupportsRead[str | bytes] EncodableDataType: TypeAlias = RawDataType | StreamDataType DataType: TypeAlias = ( KVDataType | Iterable[bytes | str] | str | bytes | Buffer | SupportsRead[str | bytes] | None ) BodyType: TypeAlias = ( bytes | str | Iterable[bytes | str] | SupportsRead[bytes | str] | None ) HeadersType: TypeAlias = Mapping[str, str | bytes] | None CookiesType: TypeAlias = RequestsCookieJar | Mapping[str, str] # Building blocks for FilesType _FileName: TypeAlias = str | None _FileContent: TypeAlias = SupportsRead[str | bytes] | str | bytes _FileSpecBasic: TypeAlias = tuple[_FileName, _FileContent] _FileSpecWithContentType: TypeAlias = tuple[_FileName, _FileContent, str] _FileSpecWithHeaders: TypeAlias = tuple[ _FileName, _FileContent, str, CaseInsensitiveDict[str] | Mapping[str, str] ] _FileSpec: TypeAlias = ( _FileContent | _FileSpecBasic | _FileSpecWithContentType | _FileSpecWithHeaders ) FilesType: TypeAlias = ( Mapping[str, _FileSpec] | Iterable[tuple[str, _FileSpec]] | None ) AuthType: TypeAlias = ( tuple[str, str] | AuthBase | Callable[[PreparedRequest], PreparedRequest] | None ) TimeoutType: TypeAlias = float | tuple[float | None, float | None] | None ProxiesType: TypeAlias = MutableMapping[str, str] HooksType: TypeAlias = dict[str, list[HookType]] | None VerifyType: TypeAlias = bool | str CertType: TypeAlias = str | tuple[str, str] | None JsonType: TypeAlias = ( None | bool | int | float | str | Sequence["JsonType"] | Mapping[str, "JsonType"] ) # TypedDicts for Unpack kwargs (PEP 692) class BaseRequestKwargs(TypedDict, total=False): headers: HeadersType cookies: RequestsCookieJar | CookieJar | dict[str, str] | None files: FilesType auth: AuthType timeout: TimeoutType allow_redirects: bool proxies: dict[str, str] | None hooks: HooksInputType | None stream: bool | None verify: VerifyType | None cert: CertType class RequestKwargs(BaseRequestKwargs, total=False): """kwargs for request(), options(), head(), delete().""" params: ParamsType data: DataType json: JsonType class GetKwargs(BaseRequestKwargs, total=False): data: DataType json: JsonType class PostKwargs(BaseRequestKwargs, total=False): params: ParamsType class DataKwargs(BaseRequestKwargs, total=False): """kwargs for put(), patch().""" params: ParamsType json: JsonType PK!Iestatus_codes.pynu[r""" The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. Example:: >>> import requests >>> requests.codes['temporary_redirect'] 307 >>> requests.codes.teapot 418 >>> requests.codes['\o/'] 200 Some codes have multiple names, and both upper- and lower-case versions of the names are allowed. For example, ``codes.ok``, ``codes.OK``, and ``codes.okay`` all correspond to the HTTP status code 200. """ from .structures import LookupDict _codes = { # Informational. 100: ("continue",), 101: ("switching_protocols",), 102: ("processing", "early-hints"), 103: ("checkpoint",), 122: ("uri_too_long", "request_uri_too_long"), 200: ("ok", "okay", "all_ok", "all_okay", "all_good", "\\o/", "✓"), 201: ("created",), 202: ("accepted",), 203: ("non_authoritative_info", "non_authoritative_information"), 204: ("no_content",), 205: ("reset_content", "reset"), 206: ("partial_content", "partial"), 207: ("multi_status", "multiple_status", "multi_stati", "multiple_stati"), 208: ("already_reported",), 226: ("im_used",), # Redirection. 300: ("multiple_choices",), 301: ("moved_permanently", "moved", "\\o-"), 302: ("found",), 303: ("see_other", "other"), 304: ("not_modified",), 305: ("use_proxy",), 306: ("switch_proxy",), 307: ("temporary_redirect", "temporary_moved", "temporary"), 308: ( "permanent_redirect", "resume_incomplete", "resume", ), # "resume" and "resume_incomplete" to be removed in 3.0 # Client Error. 400: ("bad_request", "bad"), 401: ("unauthorized",), 402: ("payment_required", "payment"), 403: ("forbidden",), 404: ("not_found", "-o-"), 405: ("method_not_allowed", "not_allowed"), 406: ("not_acceptable",), 407: ("proxy_authentication_required", "proxy_auth", "proxy_authentication"), 408: ("request_timeout", "timeout"), 409: ("conflict",), 410: ("gone",), 411: ("length_required",), 412: ("precondition_failed", "precondition"), 413: ("request_entity_too_large", "content_too_large"), 414: ("request_uri_too_large", "uri_too_long"), 415: ("unsupported_media_type", "unsupported_media", "media_type"), 416: ( "requested_range_not_satisfiable", "requested_range", "range_not_satisfiable", ), 417: ("expectation_failed",), 418: ("im_a_teapot", "teapot", "i_am_a_teapot"), 421: ("misdirected_request",), 422: ("unprocessable_entity", "unprocessable", "unprocessable_content"), 423: ("locked",), 424: ("failed_dependency", "dependency"), 425: ("unordered_collection", "unordered", "too_early"), 426: ("upgrade_required", "upgrade"), 428: ("precondition_required", "precondition"), 429: ("too_many_requests", "too_many"), 431: ("header_fields_too_large", "fields_too_large"), 444: ("no_response", "none"), 449: ("retry_with", "retry"), 450: ("blocked_by_windows_parental_controls", "parental_controls"), 451: ("unavailable_for_legal_reasons", "legal_reasons"), 499: ("client_closed_request",), # Server Error. 500: ("internal_server_error", "server_error", "/o\\", "✗"), 501: ("not_implemented",), 502: ("bad_gateway",), 503: ("service_unavailable", "unavailable"), 504: ("gateway_timeout",), 505: ("http_version_not_supported", "http_version"), 506: ("variant_also_negotiates",), 507: ("insufficient_storage",), 509: ("bandwidth_limit_exceeded", "bandwidth"), 510: ("not_extended",), 511: ("network_authentication_required", "network_auth", "network_authentication"), } codes = LookupDict(name="status_codes") def _init(): for code, titles in _codes.items(): for title in titles: setattr(codes, title, code) if not title.startswith(("\\", "/")): setattr(codes, title.upper(), code) def doc(code): names = ", ".join(f"``{n}``" for n in _codes[code]) return "* %d: %s" % (code, names) global __doc__ __doc__ = ( __doc__ + "\n" + "\n".join(doc(code) for code in sorted(_codes)) if __doc__ is not None else None ) _init() PK!V!! packages.pynu[import sys from .compat import chardet # This code exists for backwards compatibility reasons. # I don't like it either. Just look the other way. :) for package in ("urllib3", "idna"): vendored_package = "pip._vendor." + package locals()[package] = __import__(vendored_package) # This traversal is apparently necessary such that the identities are # preserved (requests.packages.urllib3.* is urllib3.*) for mod in list(sys.modules): if mod == vendored_package or mod.startswith(vendored_package + '.'): unprefixed_mod = mod[len("pip._vendor."):] sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod] if chardet is not None: target = chardet.__name__ for mod in list(sys.modules): if mod == target or mod.startswith(f"{target}."): imported_mod = sys.modules[mod] sys.modules[f"requests.packages.{mod}"] = imported_mod mod = mod.replace(target, "chardet") sys.modules[f"requests.packages.{mod}"] = imported_mod PK!؞HH cookies.pynu[""" requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `http.cookiejar.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import calendar import copy import time from ._internal_utils import to_native_string from .compat import Morsel, MutableMapping, cookielib, urlparse, urlunparse try: import threading except ImportError: import dummy_threading as threading class MockRequest: """Wraps a `requests.Request` to mimic a `urllib2.Request`. The code in `http.cookiejar.CookieJar` expects this interface in order to correctly manage cookie policies, i.e., determine whether a cookie can be set, given the domains of the request and the cookie. The original request object is read-only. The client is responsible for collecting the new headers via `get_new_headers()` and interpreting them appropriately. You probably want `get_cookie_header`, defined below. """ def __init__(self, request): self._r = request self._new_headers = {} self.type = urlparse(self._r.url).scheme def get_type(self): return self.type def get_host(self): return urlparse(self._r.url).netloc def get_origin_req_host(self): return self.get_host() def get_full_url(self): # Only return the response's URL if the user hadn't set the Host # header if not self._r.headers.get("Host"): return self._r.url # If they did set it, retrieve it and reconstruct the expected domain host = to_native_string(self._r.headers["Host"], encoding="utf-8") parsed = urlparse(self._r.url) # Reconstruct the URL as we expect it return urlunparse( [ parsed.scheme, host, parsed.path, parsed.params, parsed.query, parsed.fragment, ] ) def is_unverifiable(self): return True def has_header(self, name): return name in self._r.headers or name in self._new_headers def get_header(self, name, default=None): return self._r.headers.get(name, self._new_headers.get(name, default)) def add_header(self, key, val): """cookiejar has no legitimate use for this method; add it back if you find one.""" raise NotImplementedError( "Cookie headers should be added with add_unredirected_header()" ) def add_unredirected_header(self, name, value): self._new_headers[name] = value def get_new_headers(self): return self._new_headers @property def unverifiable(self): return self.is_unverifiable() @property def origin_req_host(self): return self.get_origin_req_host() @property def host(self): return self.get_host() class MockResponse: """Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. ...what? Basically, expose the parsed HTTP headers from the server response the way `http.cookiejar` expects to see them. """ def __init__(self, headers): """Make a MockResponse for `cookiejar` to read. :param headers: a httplib.HTTPMessage or analogous carrying the headers """ self._headers = headers def info(self): return self._headers def getheaders(self, name): self._headers.getheaders(name) def extract_cookies_to_jar(jar, request, response): """Extract the cookies from the response into a CookieJar. :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar) :param request: our own requests.Request object :param response: urllib3.HTTPResponse object """ if not (hasattr(response, "_original_response") and response._original_response): return # the _original_response field is the wrapped httplib.HTTPResponse object, req = MockRequest(request) # pull out the HTTPMessage with the headers and put it in the mock: res = MockResponse(response._original_response.msg) jar.extract_cookies(res, req) def get_cookie_header(jar, request): """ Produce an appropriate Cookie header string to be sent with `request`, or None. :rtype: str """ r = MockRequest(request) jar.add_cookie_header(r) return r.get_new_headers().get("Cookie") def remove_cookie_by_name(cookiejar, name, domain=None, path=None): """Unsets a cookie by name, by default over all domains and paths. Wraps CookieJar.clear(), is O(n). """ clearables = [] for cookie in cookiejar: if cookie.name != name: continue if domain is not None and domain != cookie.domain: continue if path is not None and path != cookie.path: continue clearables.append((cookie.domain, cookie.path, cookie.name)) for domain, path, name in clearables: cookiejar.clear(domain, path, name) class CookieConflictError(RuntimeError): """There are two cookies that meet the criteria specified in the cookie jar. Use .get and .set and include domain and path args in order to be more specific. """ class RequestsCookieJar(cookielib.CookieJar, MutableMapping): """Compatibility class; is a http.cookiejar.CookieJar, but exposes a dict interface. This is the CookieJar we create by default for requests and sessions that don't specify one, since some clients may expect response.cookies and session.cookies to support dict operations. Requests does not use the dict interface internally; it's just for compatibility with external client code. All requests code should work out of the box with externally provided instances of ``CookieJar``, e.g. ``LWPCookieJar`` and ``FileCookieJar``. Unlike a regular CookieJar, this class is pickleable. .. warning:: dictionary operations that are normally O(1) may be O(n). """ def get(self, name, default=None, domain=None, path=None): """Dict-like get() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. .. warning:: operation is O(n), not O(1). """ try: return self._find_no_duplicates(name, domain, path) except KeyError: return default def set(self, name, value, **kwargs): """Dict-like set() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. """ # support client code that unsets cookies by assignment of a None value: if value is None: remove_cookie_by_name( self, name, domain=kwargs.get("domain"), path=kwargs.get("path") ) return if isinstance(value, Morsel): c = morsel_to_cookie(value) else: c = create_cookie(name, value, **kwargs) self.set_cookie(c) return c def iterkeys(self): """Dict-like iterkeys() that returns an iterator of names of cookies from the jar. .. seealso:: itervalues() and iteritems(). """ for cookie in iter(self): yield cookie.name def keys(self): """Dict-like keys() that returns a list of names of cookies from the jar. .. seealso:: values() and items(). """ return list(self.iterkeys()) def itervalues(self): """Dict-like itervalues() that returns an iterator of values of cookies from the jar. .. seealso:: iterkeys() and iteritems(). """ for cookie in iter(self): yield cookie.value def values(self): """Dict-like values() that returns a list of values of cookies from the jar. .. seealso:: keys() and items(). """ return list(self.itervalues()) def iteritems(self): """Dict-like iteritems() that returns an iterator of name-value tuples from the jar. .. seealso:: iterkeys() and itervalues(). """ for cookie in iter(self): yield cookie.name, cookie.value def items(self): """Dict-like items() that returns a list of name-value tuples from the jar. Allows client-code to call ``dict(RequestsCookieJar)`` and get a vanilla python dict of key value pairs. .. seealso:: keys() and values(). """ return list(self.iteritems()) def list_domains(self): """Utility method to list all the domains in the jar.""" domains = [] for cookie in iter(self): if cookie.domain not in domains: domains.append(cookie.domain) return domains def list_paths(self): """Utility method to list all the paths in the jar.""" paths = [] for cookie in iter(self): if cookie.path not in paths: paths.append(cookie.path) return paths def multiple_domains(self): """Returns True if there are multiple domains in the jar. Returns False otherwise. :rtype: bool """ domains = [] for cookie in iter(self): if cookie.domain is not None and cookie.domain in domains: return True domains.append(cookie.domain) return False # there is only one domain in jar def get_dict(self, domain=None, path=None): """Takes as an argument an optional domain and path and returns a plain old Python dict of name-value pairs of cookies that meet the requirements. :rtype: dict """ dictionary = {} for cookie in iter(self): if (domain is None or cookie.domain == domain) and ( path is None or cookie.path == path ): dictionary[cookie.name] = cookie.value return dictionary def __contains__(self, name): try: return super().__contains__(name) except CookieConflictError: return True def __getitem__(self, name): """Dict-like __getitem__() for compatibility with client code. Throws exception if there are more than one cookie with name. In that case, use the more explicit get() method instead. .. warning:: operation is O(n), not O(1). """ return self._find_no_duplicates(name) def __setitem__(self, name, value): """Dict-like __setitem__ for compatibility with client code. Throws exception if there is already a cookie of that name in the jar. In that case, use the more explicit set() method instead. """ self.set(name, value) def __delitem__(self, name): """Deletes a cookie given a name. Wraps ``http.cookiejar.CookieJar``'s ``remove_cookie_by_name()``. """ remove_cookie_by_name(self, name) def set_cookie(self, cookie, *args, **kwargs): if ( hasattr(cookie.value, "startswith") and cookie.value.startswith('"') and cookie.value.endswith('"') ): cookie.value = cookie.value.replace('\\"', "") return super().set_cookie(cookie, *args, **kwargs) def update(self, other): """Updates this jar with cookies from another CookieJar or dict-like""" if isinstance(other, cookielib.CookieJar): for cookie in other: self.set_cookie(copy.copy(cookie)) else: super().update(other) def _find(self, name, domain=None, path=None): """Requests uses this method internally to get cookie values. If there are conflicting cookies, _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown if there are conflicting cookies. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :return: cookie.value """ for cookie in iter(self): if cookie.name == name: if domain is None or cookie.domain == domain: if path is None or cookie.path == path: return cookie.value raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}") def _find_no_duplicates(self, name, domain=None, path=None): """Both ``__get_item__`` and ``get`` call this function: it's never used elsewhere in Requests. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :raises KeyError: if cookie is not found :raises CookieConflictError: if there are multiple cookies that match name and optionally domain and path :return: cookie.value """ toReturn = None for cookie in iter(self): if cookie.name == name: if domain is None or cookie.domain == domain: if path is None or cookie.path == path: if toReturn is not None: # if there are multiple cookies that meet passed in criteria raise CookieConflictError( f"There are multiple cookies with name, {name!r}" ) # we will eventually return this as long as no cookie conflict toReturn = cookie.value if toReturn: return toReturn raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}") def __getstate__(self): """Unlike a normal CookieJar, this class is pickleable.""" state = self.__dict__.copy() # remove the unpickleable RLock object state.pop("_cookies_lock") return state def __setstate__(self, state): """Unlike a normal CookieJar, this class is pickleable.""" self.__dict__.update(state) if "_cookies_lock" not in self.__dict__: self._cookies_lock = threading.RLock() def copy(self): """Return a copy of this RequestsCookieJar.""" new_cj = RequestsCookieJar() new_cj.set_policy(self.get_policy()) new_cj.update(self) return new_cj def get_policy(self): """Return the CookiePolicy instance used.""" return self._policy def _copy_cookie_jar(jar): if jar is None: return None if hasattr(jar, "copy"): # We're dealing with an instance of RequestsCookieJar return jar.copy() # We're dealing with a generic CookieJar instance new_jar = copy.copy(jar) new_jar.clear() for cookie in jar: new_jar.set_cookie(copy.copy(cookie)) return new_jar def create_cookie(name, value, **kwargs): """Make a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). """ result = { "version": 0, "name": name, "value": value, "port": None, "domain": "", "path": "/", "secure": False, "expires": None, "discard": True, "comment": None, "comment_url": None, "rest": {"HttpOnly": None}, "rfc2109": False, } badargs = set(kwargs) - set(result) if badargs: raise TypeError( f"create_cookie() got unexpected keyword arguments: {list(badargs)}" ) result.update(kwargs) result["port_specified"] = bool(result["port"]) result["domain_specified"] = bool(result["domain"]) result["domain_initial_dot"] = result["domain"].startswith(".") result["path_specified"] = bool(result["path"]) return cookielib.Cookie(**result) def morsel_to_cookie(morsel): """Convert a Morsel object into a Cookie containing the one k/v pair.""" expires = None if morsel["max-age"]: try: expires = int(time.time() + int(morsel["max-age"])) except ValueError: raise TypeError(f"max-age: {morsel['max-age']} must be integer") elif morsel["expires"]: time_template = "%a, %d-%b-%Y %H:%M:%S GMT" expires = calendar.timegm(time.strptime(morsel["expires"], time_template)) return create_cookie( comment=morsel["comment"], comment_url=bool(morsel["comment"]), discard=False, domain=morsel["domain"], expires=expires, name=morsel.key, path=morsel["path"], port=None, rest={"HttpOnly": morsel["httponly"]}, rfc2109=False, secure=bool(morsel["secure"]), value=morsel.value, version=morsel["version"] or 0, ) def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True): """Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. :rtype: CookieJar """ if cookiejar is None: cookiejar = RequestsCookieJar() if cookie_dict is not None: names_from_jar = [cookie.name for cookie in cookiejar] for name in cookie_dict: if overwrite or (name not in names_from_jar): cookiejar.set_cookie(create_cookie(name, cookie_dict[name])) return cookiejar def merge_cookies(cookiejar, cookies): """Add cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. :rtype: CookieJar """ if not isinstance(cookiejar, cookielib.CookieJar): raise ValueError("You can only merge into CookieJar") if isinstance(cookies, dict): cookiejar = cookiejar_from_dict(cookies, cookiejar=cookiejar, overwrite=False) elif isinstance(cookies, cookielib.CookieJar): try: cookiejar.update(cookies) except AttributeError: for cookie_in_jar in cookies: cookiejar.set_cookie(cookie_in_jar) return cookiejar PK!5help.pynu["""Module containing bug report helper(s).""" import json import platform import ssl import sys from pip._vendor import idna from pip._vendor import urllib3 from . import __version__ as requests_version charset_normalizer = None chardet = None try: from pip._vendor.urllib3.contrib import pyopenssl except ImportError: pyopenssl = None OpenSSL = None cryptography = None else: import cryptography import OpenSSL def _implementation(): """Return a dict with the Python implementation and version. Provide both the name and the version of the Python implementation currently running. For example, on CPython 3.10.3 it will return {'name': 'CPython', 'version': '3.10.3'}. This function works best on CPython and PyPy: in particular, it probably doesn't work for Jython or IronPython. Future investigation should be done to work out the correct shape of the code for those platforms. """ implementation = platform.python_implementation() if implementation == "CPython": implementation_version = platform.python_version() elif implementation == "PyPy": implementation_version = "{}.{}.{}".format( sys.pypy_version_info.major, sys.pypy_version_info.minor, sys.pypy_version_info.micro, ) if sys.pypy_version_info.releaselevel != "final": implementation_version = "".join( [implementation_version, sys.pypy_version_info.releaselevel] ) elif implementation == "Jython": implementation_version = platform.python_version() # Complete Guess elif implementation == "IronPython": implementation_version = platform.python_version() # Complete Guess else: implementation_version = "Unknown" return {"name": implementation, "version": implementation_version} def info(): """Generate information for a bug report.""" try: platform_info = { "system": platform.system(), "release": platform.release(), } except OSError: platform_info = { "system": "Unknown", "release": "Unknown", } implementation_info = _implementation() urllib3_info = {"version": urllib3.__version__} charset_normalizer_info = {"version": None} chardet_info = {"version": None} if charset_normalizer: charset_normalizer_info = {"version": charset_normalizer.__version__} if chardet: chardet_info = {"version": chardet.__version__} pyopenssl_info = { "version": None, "openssl_version": "", } if OpenSSL: pyopenssl_info = { "version": OpenSSL.__version__, "openssl_version": f"{OpenSSL.SSL.OPENSSL_VERSION_NUMBER:x}", } cryptography_info = { "version": getattr(cryptography, "__version__", ""), } idna_info = { "version": getattr(idna, "__version__", ""), } system_ssl = ssl.OPENSSL_VERSION_NUMBER system_ssl_info = {"version": f"{system_ssl:x}" if system_ssl is not None else ""} return { "platform": platform_info, "implementation": implementation_info, "system_ssl": system_ssl_info, "using_pyopenssl": pyopenssl is not None, "using_charset_normalizer": chardet is None, "pyOpenSSL": pyopenssl_info, "urllib3": urllib3_info, "chardet": chardet_info, "charset_normalizer": charset_normalizer_info, "cryptography": cryptography_info, "idna": idna_info, "requests": { "version": requests_version, }, } def main(): """Pretty-print the bug information as JSON.""" print(json.dumps(info(), sort_keys=True, indent=2)) if __name__ == "__main__": main() PK!ލ''auth.pynu[""" requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import hashlib import os import re import threading import time import warnings from base64 import b64encode from ._internal_utils import to_native_string from .compat import basestring, str, urlparse from .cookies import extract_cookies_to_jar from .utils import parse_dict_header CONTENT_TYPE_FORM_URLENCODED = "application/x-www-form-urlencoded" CONTENT_TYPE_MULTI_PART = "multipart/form-data" def _basic_auth_str(username, password): """Returns a Basic Auth string.""" # "I want us to put a big-ol' comment on top of it that # says that this behaviour is dumb but we need to preserve # it because people are relying on it." # - Lukasa # # These are here solely to maintain backwards compatibility # for things like ints. This will be removed in 3.0.0. if not isinstance(username, basestring): warnings.warn( "Non-string usernames will no longer be supported in Requests " "3.0.0. Please convert the object you've passed in ({!r}) to " "a string or bytes object in the near future to avoid " "problems.".format(username), category=DeprecationWarning, ) username = str(username) if not isinstance(password, basestring): warnings.warn( "Non-string passwords will no longer be supported in Requests " "3.0.0. Please convert the object you've passed in ({!r}) to " "a string or bytes object in the near future to avoid " "problems.".format(type(password)), category=DeprecationWarning, ) password = str(password) # -- End Removal -- if isinstance(username, str): username = username.encode("latin1") if isinstance(password, str): password = password.encode("latin1") authstr = "Basic " + to_native_string( b64encode(b":".join((username, password))).strip() ) return authstr class AuthBase: """Base class that all auth implementations derive from""" def __call__(self, r): raise NotImplementedError("Auth hooks must be callable.") class HTTPBasicAuth(AuthBase): """Attaches HTTP Basic Authentication to the given Request object.""" def __init__(self, username, password): self.username = username self.password = password def __eq__(self, other): return all( [ self.username == getattr(other, "username", None), self.password == getattr(other, "password", None), ] ) def __ne__(self, other): return not self == other def __call__(self, r): r.headers["Authorization"] = _basic_auth_str(self.username, self.password) return r class HTTPProxyAuth(HTTPBasicAuth): """Attaches HTTP Proxy Authentication to a given Request object.""" def __call__(self, r): r.headers["Proxy-Authorization"] = _basic_auth_str(self.username, self.password) return r class HTTPDigestAuth(AuthBase): """Attaches HTTP Digest Authentication to the given Request object.""" def __init__(self, username, password): self.username = username self.password = password # Keep state in per-thread local storage self._thread_local = threading.local() def init_per_thread_state(self): # Ensure state is initialized just once per-thread if not hasattr(self._thread_local, "init"): self._thread_local.init = True self._thread_local.last_nonce = "" self._thread_local.nonce_count = 0 self._thread_local.chal = {} self._thread_local.pos = None self._thread_local.num_401_calls = None def build_digest_header(self, method, url): """ :rtype: str """ realm = self._thread_local.chal["realm"] nonce = self._thread_local.chal["nonce"] qop = self._thread_local.chal.get("qop") algorithm = self._thread_local.chal.get("algorithm") opaque = self._thread_local.chal.get("opaque") hash_utf8 = None if algorithm is None: _algorithm = "MD5" else: _algorithm = algorithm.upper() # lambdas assume digest modules are imported at the top level if _algorithm == "MD5" or _algorithm == "MD5-SESS": def md5_utf8(x): if isinstance(x, str): x = x.encode("utf-8") return hashlib.md5(x).hexdigest() hash_utf8 = md5_utf8 elif _algorithm == "SHA": def sha_utf8(x): if isinstance(x, str): x = x.encode("utf-8") return hashlib.sha1(x).hexdigest() hash_utf8 = sha_utf8 elif _algorithm == "SHA-256": def sha256_utf8(x): if isinstance(x, str): x = x.encode("utf-8") return hashlib.sha256(x).hexdigest() hash_utf8 = sha256_utf8 elif _algorithm == "SHA-512": def sha512_utf8(x): if isinstance(x, str): x = x.encode("utf-8") return hashlib.sha512(x).hexdigest() hash_utf8 = sha512_utf8 KD = lambda s, d: hash_utf8(f"{s}:{d}") # noqa:E731 if hash_utf8 is None: return None # XXX not implemented yet entdig = None p_parsed = urlparse(url) #: path is request-uri defined in RFC 2616 which should not be empty path = p_parsed.path or "/" if p_parsed.query: path += f"?{p_parsed.query}" A1 = f"{self.username}:{realm}:{self.password}" A2 = f"{method}:{path}" HA1 = hash_utf8(A1) HA2 = hash_utf8(A2) if nonce == self._thread_local.last_nonce: self._thread_local.nonce_count += 1 else: self._thread_local.nonce_count = 1 ncvalue = f"{self._thread_local.nonce_count:08x}" s = str(self._thread_local.nonce_count).encode("utf-8") s += nonce.encode("utf-8") s += time.ctime().encode("utf-8") s += os.urandom(8) cnonce = hashlib.sha1(s).hexdigest()[:16] if _algorithm == "MD5-SESS": HA1 = hash_utf8(f"{HA1}:{nonce}:{cnonce}") if not qop: respdig = KD(HA1, f"{nonce}:{HA2}") elif qop == "auth" or "auth" in qop.split(","): noncebit = f"{nonce}:{ncvalue}:{cnonce}:auth:{HA2}" respdig = KD(HA1, noncebit) else: # XXX handle auth-int. return None self._thread_local.last_nonce = nonce # XXX should the partial digests be encoded too? base = ( f'username="{self.username}", realm="{realm}", nonce="{nonce}", ' f'uri="{path}", response="{respdig}"' ) if opaque: base += f', opaque="{opaque}"' if algorithm: base += f', algorithm="{algorithm}"' if entdig: base += f', digest="{entdig}"' if qop: base += f', qop="auth", nc={ncvalue}, cnonce="{cnonce}"' return f"Digest {base}" def handle_redirect(self, r, **kwargs): """Reset num_401_calls counter on redirects.""" if r.is_redirect: self._thread_local.num_401_calls = 1 def handle_401(self, r, **kwargs): """ Takes the given response and tries digest-auth, if needed. :rtype: requests.Response """ # If response is not 4xx, do not auth # See https://github.com/psf/requests/issues/3772 if not 400 <= r.status_code < 500: self._thread_local.num_401_calls = 1 return r if self._thread_local.pos is not None: # Rewind the file position indicator of the body to where # it was to resend the request. r.request.body.seek(self._thread_local.pos) s_auth = r.headers.get("www-authenticate", "") if "digest" in s_auth.lower() and self._thread_local.num_401_calls < 2: self._thread_local.num_401_calls += 1 pat = re.compile(r"digest ", flags=re.IGNORECASE) self._thread_local.chal = parse_dict_header(pat.sub("", s_auth, count=1)) # Consume content and release the original connection # to allow our new request to reuse the same one. r.content r.close() prep = r.request.copy() extract_cookies_to_jar(prep._cookies, r.request, r.raw) prep.prepare_cookies(prep._cookies) prep.headers["Authorization"] = self.build_digest_header( prep.method, prep.url ) _r = r.connection.send(prep, **kwargs) _r.history.append(r) _r.request = prep return _r self._thread_local.num_401_calls = 1 return r def __call__(self, r): # Initialize per-thread state, if needed self.init_per_thread_state() # If we have a saved nonce, skip the 401 if self._thread_local.last_nonce: r.headers["Authorization"] = self.build_digest_header(r.method, r.url) try: self._thread_local.pos = r.body.tell() except AttributeError: # In the case of HTTPDigestAuth being reused and the body of # the previous request was a file-like object, pos has the # file position of the previous body. Ensure it's set to # None. self._thread_local.pos = None r.register_hook("response", self.handle_401) r.register_hook("response", self.handle_redirect) self._thread_local.num_401_calls = 1 return r def __eq__(self, other): return all( [ self.username == getattr(other, "username", None), self.password == getattr(other, "password", None), ] ) def __ne__(self, other): return not self == other PK!Ghooks.pynu[""" requests.hooks ~~~~~~~~~~~~~~ This module provides the capabilities for the Requests hooks system. Available hooks: ``response``: The response generated from a Request. """ HOOKS = ["response"] def default_hooks(): return {event: [] for event in HOOKS} # TODO: response is the only one def dispatch_hook(key, hooks, hook_data, **kwargs): """Dispatches a hook dictionary on a given piece of data.""" hooks = hooks or {} hooks = hooks.get(key) if hooks: if hasattr(hooks, "__call__"): hooks = [hooks] for hook in hooks: _hook_data = hook(hook_data, **kwargs) if _hook_data is not None: hook_data = _hook_data return hook_data PK!]< C C help.pyonu[ abc@s dZddlmZddlZddlZddlZddlZddlmZddlm Z ddlm Z ddl m Z ydd lmZWn#ek rdZdZdZnXddlZddlZd Zd Zd Zed kr endS(s'Module containing bug report helper(s).i(tprint_functionN(tidna(turllib3(tchardeti(t __version__(t pyopensslcCstj}|dkr'tj}n|dkrdtjjtjjtjjf}tjjdkrdj |tjjg}qn<|dkrtj}n!|dkrtj}nd}i|d 6|d 6S( sReturn a dict with the Python implementation and version. Provide both the name and the version of the Python implementation currently running. For example, on CPython 2.7.5 it will return {'name': 'CPython', 'version': '2.7.5'}. This function works best on CPython and PyPy: in particular, it probably doesn't work for Jython or IronPython. Future investigation should be done to work out the correct shape of the code for those platforms. tCPythontPyPys%s.%s.%stfinalttJythont IronPythontUnknowntnametversion( tplatformtpython_implementationtpython_versiontsystpypy_version_infotmajortminortmicrot releaseleveltjoin(timplementationtimplementation_version((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/help.pyt_implementations       c Csqy$itjd6tjd6}Wn%tk rKidd6dd6}nXt}itjd6}itjd6}idd6dd6}t rit jd6dt j j d6}nit t ddd6}it tddd6}t td d}i|dk rd|ndd6}i |d 6|d 6|d 6tdk d 6|d6|d6|d6|d6|d6itd6d6S(s&Generate information for a bug report.tsystemtreleaseR RR topenssl_versions%xRtOPENSSL_VERSION_NUMBERRRt system_ssltusing_pyopensslt pyOpenSSLRRt cryptographyRtrequestsN(RRRtIOErrorRRRRtNonetOpenSSLtSSLRtgetattrR#RtsslRtrequests_version( t platform_infotimplementation_infot urllib3_infot chardet_infotpyopenssl_infotcryptography_infot idna_infoR tsystem_ssl_info((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/help.pytinfo;sJ       cCs&ttjtdtdddS(s)Pretty-print the bug information as JSON.t sort_keystindentiN(tprinttjsontdumpsR4tTrue(((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/help.pytmainrst__main__(t__doc__t __future__RR8RRR*t pip._vendorRRRR RR+tpackages.urllib3.contribRt ImportErrorR&R'R#RR4R;t__name__(((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/help.pyts,         ! 7  PK!ϢIt%% models.pycnu[ Rec@sdZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z mZmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%m&Z&ddl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1ddl2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>ddl2m?Z@ddlAmBZBeBjCeBjDeBjEeBjFeBjGfZHdZIddZJdZKdeLfdYZMdeLfdYZNdeNfdYZOdeMeNfdYZPdeLfd YZQdS(!s` requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. iN(t RequestField(tencode_multipart_formdata(t parse_url(t DecodeErrortReadTimeoutErrort ProtocolErrortLocationParseError(tUnsupportedOperationi(t default_hooks(tCaseInsensitiveDict(t HTTPBasicAuth(tcookiejar_from_dicttget_cookie_headert_copy_cookie_jar(t HTTPErrort MissingSchemat InvalidURLtChunkedEncodingErrortContentDecodingErrortConnectionErrortStreamConsumedError(tto_native_stringtunicode_is_ascii( tguess_filenametget_auth_from_urlt requote_uritstream_decode_response_unicodetto_key_val_listtparse_header_linkst iter_slicestguess_json_utft super_lentcheck_header_validity( tCallabletMappingt cookielibt urlunparseturlsplitt urlencodetstrtbytestis_py2tchardett builtin_strt basestring(tjson(tcodesii iitRequestEncodingMixincBs5eZedZedZedZRS(cCssg}t|j}|j}|s-d}n|j||j}|rf|jd|j|ndj|S(sBuild the path URL to use.t/t?t(R%turltpathtappendtquerytjoin(tselfR3tpR4R6((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pytpath_url=s     cCst|ttfr|St|dr,|St|drg}xt|D]\}}t|tsyt|d r|g}nxl|D]d}|dk r|jt|tr|jdn|t|tr|jdn|fqqWqNWt |dt S|SdS(sEncode parameters in a piece of data. Will successfully encode parameters when passed as a dict or a list of 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary if parameters are supplied as a dict. treadt__iter__sutf-8tdoseqN( t isinstanceR'R(thasattrRR,tNoneR5tencodeR&tTrue(tdatatresulttktvstv((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt_encode_paramsRs    !3c Cs|stdnt|tr3tdng}t|pEi}t|pWi}x|D]\}}t|tst|d r|g}nx|D]}|d k rt|tst|}n|jt|tr|j dn|t|tr|j dn|fqqWqdWx<|D]4\}}d }d } t|t t frt |dkr|\} } qt |dkr|\} } }q|\} } }} nt|p|} |} t| tttfr| } n6t| dr| j} n| d kr#q3n| } td|d | d | d | } | jd ||j| q3Wt|\}}||fS(sBuild the body for a multipart/form-data request. Will successfully encode files when passed as a dict or a list of tuples. Order is retained if data is a list of tuples but arbitrary if parameters are supplied as a dict. The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) or 4-tuples (filename, fileobj, contentype, custom_headers). sFiles must be provided.sData must not be a string.R<sutf-8iiR;tnameRCtfilenametheaderst content_typeN(t ValueErrorR>R,RR?R@R(R'R5tdecodeRAttupletlisttlenRt bytearrayR;Rtmake_multipartR(tfilesRCt new_fieldstfieldstfieldtvalRGREtfttfhtfntfptfdatatrftbodyRL((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt _encode_filesmsP    !3  !(t__name__t __module__tpropertyR:t staticmethodRHR`(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR/<stRequestHooksMixincBseZdZdZRS(cCs|||jkr"td|nt|trH|j|j|n0t|drx|j|jd|DndS(sProperly register a hook.s1Unsupported event specified, with event name "%s"R<css$|]}t|tr|VqdS(N(R>R!(t.0th((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pys sN(thooksRMR>R!R5R?textend(R8teventthook((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt register_hooks cCs5y|j|j|tSWntk r0tSXdS(siDeregister a previously registered hook. Returns True if the hook existed, False if not. N(RhtremoveRBRMtFalse(R8RjRk((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pytderegister_hooks  (RaRbRlRo(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRes tRequestc BsGeZdZddddddddddd ZdZdZRS(s{A user-created :class:`Request ` object. Used to prepare a :class:`PreparedRequest `, which is sent to the server. :param method: HTTP method to use. :param url: URL to send. :param headers: dictionary of headers to send. :param files: dictionary of {filename: fileobject} files to multipart upload. :param data: the body to attach to the request. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param json: json for the body to attach to the request (if files or data is not specified). :param params: URL parameters to append to the URL. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param auth: Auth handler or (user, pass) tuple. :param cookies: dictionary or CookieJar of cookies to attach to this request. :param hooks: dictionary of callback hooks, for internal usage. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() c Cs|dkrgn|}|dkr*gn|}|dkrBin|}|dkrZin|}| dkrrin| } t|_x6t| jD]"\} } |jd| d| qW||_||_||_||_ ||_ | |_ ||_ ||_ ||_dS(NRjRk(R@RRhRPtitemsRltmethodR3RKRTRCR-tparamstauthtcookies( R8RrR3RKRTRCRsRtRuRhR-RERG((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt__init__s"         cCs d|jS(Ns(Rr(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt__repr__scCsqt}|jd|jd|jd|jd|jd|jd|jd|jd|j d |j d |j |S( sXConstructs a :class:`PreparedRequest ` for transmission and returns it.RrR3RKRTRCR-RsRtRuRh( tPreparedRequesttprepareRrR3RKRTRCR-RsRtRuRh(R8R9((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRys            N(RaRbt__doc__R@RvRwRy(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRps  Rxc BseZdZdZddddddddddd ZdZdZdZe dZ dZ dZ dd Z d Zd d Zd ZdZRS(sThe fully mutable :class:`PreparedRequest ` object, containing the exact bytes that will be sent to the server. Generated from either a :class:`Request ` object or manually. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> r = req.prepare() >>> r >>> s = requests.Session() >>> s.send(r) cCsFd|_d|_d|_d|_d|_t|_d|_dS(N( R@RrR3RKt_cookiesR_RRht_body_position(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRv#s      c Csk|j||j|||j||j||j||| |j|||j| dS(s6Prepares the entire request with the given parameters.N(tprepare_methodt prepare_urltprepare_headerstprepare_cookiest prepare_bodyt prepare_autht prepare_hooks( R8RrR3RKRTRCRsRtRuRhR-((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRy4s   cCs d|jS(Ns(Rr(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRwFscCst}|j|_|j|_|jdk r?|jjnd|_t|j|_|j|_|j |_ |j |_ |S(N( RxRrR3RKR@tcopyR R{R_RhR|(R8R9((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRIs   '   cCs7||_|jdk r3t|jj|_ndS(sPrepares the given HTTP method.N(RrR@Rtupper(R8Rr((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR}Ts cCsSddlm}y"|j|dtjd}Wn|jk rNtnX|S(Ni(tidnatuts46sutf-8(t pip._vendorRRARBRNt IDNAErrort UnicodeError(thostR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt_get_idna_encoded_hostZs " cCst|tr!|jd}ntr3t|n t|}|j}d|krz|jjd rz||_ dSy%t |\}}}}}}} Wn"t k r} t | j nX|sd} | jt|d} t| n|st d|nt|sRy|j|}Wqptk rNt dqpXn|jdrpt dn|pyd } | r| d 7} n| |7} |r| dt|7} n|sd }ntrst|tr|jd }nt| tr | jd } nt|tr.|jd }nt|trO|jd }nt| trs| jd } qsnt|ttfrt|}n|j|} | r|rd || f}q| }ntt|| |d|| g}||_ dS(sPrepares the given HTTP URL.tutf8t:thttpNsDInvalid URL {0!r}: No schema supplied. Perhaps you meant http://{0}?s Invalid URL %r: No host suppliedsURL has an invalid label.u*R2t@R0sutf-8s%s&%s(R>R(RNR)tunicodeR'tlstriptlowert startswithR3RRRtargstformatRRRRRRARHRR$R@(R8R3RstschemeRtRtportR4R6tfragmentteterrortnetloct enc_params((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR~dsh " %       $cCsYt|_|rUx@|jD]/}t||\}}||jt|R(RAtallR?R,RPROR"Rt TypeErrortAttributeErrorRtgetattrRR|tIOErrortOSErrortobjecttNotImplementedErrorR+RKR`RHtprepare_content_lengthR_(R8RCRTR-R_RLt is_streamtlength((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRsJ "    cCsr|dk r7t|}|rnt||jdPrepare Content-Length header based on request method and bodysContent-LengthtGETtHEADt0N(RR(R@RR+RKRrtget(R8R_R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR s   'R2cCs|dkr6t|j}t|r-|nd}n|rt|trlt|dkrlt|}n||}|jj |j|j |j ndS(s"Prepares the given HTTP auth data.iN( R@RR3tanyR>RORQR t__dict__tupdateRR_(R8RtR3turl_authtr((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs ! cCs_t|tjr||_nt||_t|j|}|dk r[||jd` object. Any subsequent calls to ``prepare_cookies`` will have no actual effect, unless the "Cookie" header is removed beforehand. tCookieN(R>R#t CookieJarR{R R R@RK(R8Rut cookie_header((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR-s   cCs5|p g}x"|D]}|j|||qWdS(sPrepares the given hooks.N(Rl(R8RhRj((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRAs  N(RaRbRzRvR@RyRwRR}RdRR~RRRRRR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRxs    V E  tResponsec Bs7eZdZddddddddd d g Zd Zd Zd ZdZdZdZ dZ dZ dZ e dZe dZe dZe dZe dZdedZeed"dZe dZe dZdZe dZd Zd!ZRS(#shThe :class:`Response ` object, which contains a server's response to an HTTP request. t_contentt status_codeRKR3thistorytencodingtreasonRutelapsedtrequestcCst|_t|_d|_d|_t|_d|_d|_ d|_ g|_ d|_ t i|_tjd|_d|_dS(Ni(RnRt_content_consumedR@t_nextRR RKtrawR3RRRR Rutdatetimet timedeltaRR(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRvUs          cCs|S(N((R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt __enter__scGs|jdS(N(tclose(R8R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt__exit__scs*jsjnfdjDS(Ncs%i|]}t|d|qS(N(RR@(Rftattr(R8(s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pys s (Rtcontentt __attrs__(R8((R8s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt __getstate__s  cCsQx*|jD]\}}t|||q Wt|dtt|dddS(NRR(RqtsetattrRBR@(R8tstateRIR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt __setstate__scCs d|jS(Ns(R(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRwscCs|jS(skReturns True if :attr:`status_code` is less than 400. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code, is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. (tok(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt__bool__scCs|jS(skReturns True if :attr:`status_code` is less than 400. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code, is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. (R(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt __nonzero__scCs |jdS(s,Allows you to use a response as an iterator.i(t iter_content(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR<scCs'y|jWntk r"tSXtS(sxReturns True if :attr:`status_code` is less than 400, False if not. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. (traise_for_statusRRnRB(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs  cCsd|jko|jtkS(sTrue if this Response is a well-formed HTTP redirect that could have been processed automatically (by :meth:`Session.resolve_redirects`). tlocation(RKRtREDIRECT_STATI(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt is_redirectscCs(d|jko'|jtjtjfkS(s@True if this Response one of the permanent versions of redirect.R(RKRR.tmoved_permanentlytpermanent_redirect(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pytis_permanent_redirectscCs|jS(sTReturns a PreparedRequest for the next request in a redirect chain, if there is one.(R(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pytnextscCstj|jdS(s7The apparent encoding, provided by the chardet library.R(R*tdetectR(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pytapparent_encodingsicsfd}jr9tjtr9tn5dk rntt rntdtnt j}|}jr|n|}|rt |}n|S(sIterates over the response data. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. The chunk size is the number of bytes it should read into memory. This is not necessarily the length of each item returned as decoding can take place. chunk_size must be of type int or None. A value of None will function differently depending on the value of `stream`. stream=True will read data as it arrives in whatever size the chunks are received. If stream=False, data is returned as a single chunk. If decode_unicode is True, content will be decoded using the best available encoding based on the response. c3stjdry,x%jjdtD] }|Vq.WWqtk r_}t|qtk r}}t|qtk r}t |qXn.x+trjj }|sPn|VqWt_ dS(Ntstreamtdecode_content( R?RRRBRRRRRRR;R(tchunkR(t chunk_sizeR8(s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pytgenerates    s.chunk_size must be an int, it is instead a %s.N( RR>RtboolRR@tintRttypeRR(R8Rtdecode_unicodeRt reused_chunkst stream_chunkstchunks((RR8s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs  ccsd}x|jd|d|D]}|dk r>||}n|rV|j|}n |j}|r|dr|r|dd|dkr|j}nd}x|D] }|VqWqW|dk r|VndS(sIterates over the response data, one line at a time. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. .. note:: This method is not reentrant safe. RRiN(R@Rtsplitt splitlinestpop(R8RRt delimitertpendingRtlinestline((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt iter_liness   .   cCs|jtkru|jr'tdn|jdksE|jdkrQd|_qudj|jt pld|_nt |_|jS(s"Content of the response, in bytes.s2The content for this response was already consumediR2N( RRnRt RuntimeErrorRRR@R7RtCONTENT_CHUNK_SIZERB(R8((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR0s   $ cCsd}|j}|js"tdS|jdkr=|j}nyt|j|dd}Wn,ttfk rt|jdd}nX|S(sContent of the response, in unicode. If Response.encoding is None, encoding will be guessed using ``chardet``. The encoding of the response content is determined based solely on HTTP headers, following RFC 2616 to the letter. If you can take advantage of non-HTTP knowledge to make a better guess at the encoding, you should set ``r.encoding`` appropriately before accessing this property. R2terrorstreplaceN(R@RRR'Rt LookupErrorR(R8RR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyttextDs    cKs|j r}|jr}t|jdkr}t|j}|dk r}y tj|jj||SWqztk rvqzXq}ntj|j |S(sReturns the json-encoded content of a response, if any. :param \*\*kwargs: Optional arguments that ``json.loads`` takes. :raises ValueError: If the response body does not contain valid json. iN( RRRQRR@RtloadsRNtUnicodeDecodeErrorR(R8tkwargsR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR-js(   cCsj|jjd}i}|rft|}x9|D].}|jdpR|jd}|||RR(RNRRR3R(R8thttp_error_msgR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs  cCsH|js|jjnt|jdd}|dk rD|ndS(sReleases the connection back to the pool. Once this method has been called the underlying ``raw`` object must not be accessed again. *Note: Should not normally need to be called explicitly.* t release_connN(RRRRR@(R8R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs   N(RaRbRzRRvRRRRRwRRR<RcRRRRRRnRtITER_CHUNK_SIZER@RRRR-RRR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRKs2 /      7&  (RRzRtsystencodings.idnat encodingstpip._vendor.urllib3.fieldsRtpip._vendor.urllib3.filepostRtpip._vendor.urllib3.utilRtpip._vendor.urllib3.exceptionsRRRRtioRRhRt structuresR RtR RuR R R t exceptionsRRRRRRRt_internal_utilsRRtutilsRRRRRRRRRR tcompatR!R"R#R$R%R&R'R(R)R*R+R,R-Rt status_codesR.tmovedtfoundtotherttemporary_redirectRRtDEFAULT_REDIRECT_LIMITRRRR/ReRpRxR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/models.pyts@   "4FR  rJs (tHOOKS(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/hooks.pyt default_hooksscKsx|p i}|j|}|rtt|dr<|g}nx5|D]*}|||}|dk rC|}qCqCWn|S(s6Dispatches a hook dictionary on a given piece of data.t__call__N(tgetthasattrtNone(tkeythookst hook_datatkwargsthookt _hook_data((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/hooks.pyt dispatch_hooks    N(t__doc__RRR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/hooks.pyt s  PK!'::api.pycnu[ Rec@sqdZddlmZdZd dZdZdZd d dZd dZ d d Z d Z d S( s requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. i(tsessionsc Ks2tj }|jd|d||SWdQXdS(s Constructs and sends a :class:`Request `. :param method: method for the new :class:`Request` object: ``GET``, ``OPTIONS``, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:`Request`. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload. ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')`` or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers to add for the file. :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How many seconds to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``True``. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. :param stream: (optional) if ``False``, the response content will be immediately downloaded. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :return: :class:`Response ` object :rtype: requests.Response Usage:: >>> import requests >>> req = requests.request('GET', 'https://httpbin.org/get') >>> req tmethodturlN(RtSessiontrequest(RRtkwargstsession((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRs,cKs&|jdttd|d||S(sdSends a GET request. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tallow_redirectstgettparams(t setdefaulttTrueR(RR R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/api.pyR@s cKs |jdttd||S(sSends an OPTIONS request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response Rtoptions(R R R(RR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/api.pyR Os cKs |jdttd||S(skSends a HEAD request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. If `allow_redirects` is not provided, it will be set to `False` (as opposed to the default :meth:`request` behavior). :return: :class:`Response ` object :rtype: requests.Response Rthead(R tFalseR(RR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/api.pyR \s cKstd|d|d||S(sSends a POST request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tposttdatatjson(R(RRRR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRks cKstd|d||S(sSends a PUT request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tputR(R(RRR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRzs cKstd|d||S(sSends a PATCH request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tpatchR(R(RRR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRs cKstd||S(sSends a DELETE request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tdelete(R(RR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRs N( t__doc__tRRtNoneRR R RRRR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/api.pyt s 0    PK!;̵BB packages.pyonu[ abc@sddlZxdD]ZdeZeeees   PK!wrr models.pyonu[ abc@sdZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZmZmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZdd lmZmZm Z m!Z!m"Z"m#Z#m$Z$ddl%m&Z&m'Z'ddl(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2ddl3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=ddl3m>Z?ddl@mAZAeAjBeAjCeAjDeAjEeAjFfZGdZHddZIdZJdeKfdYZLdeKfdYZMdeMfdYZNdeLeMfdYZOdeKfd YZPdS(!s` requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. iN(t RequestField(tencode_multipart_formdata(t parse_url(t DecodeErrortReadTimeoutErrort ProtocolErrortLocationParseError(tUnsupportedOperationi(t default_hooks(tCaseInsensitiveDict(t HTTPBasicAuth(tcookiejar_from_dicttget_cookie_headert_copy_cookie_jar(t HTTPErrort MissingSchemat InvalidURLtChunkedEncodingErrortContentDecodingErrortConnectionErrortStreamConsumedError(tto_native_stringtunicode_is_ascii( tguess_filenametget_auth_from_urlt requote_uritstream_decode_response_unicodetto_key_val_listtparse_header_linkst iter_slicestguess_json_utft super_lentcheck_header_validity( t cookielibt urlunparseturlsplitt urlencodetstrtbytestis_py2tchardett builtin_strt basestring(tjson(tcodesii iitRequestEncodingMixincBs5eZedZedZedZRS(cCssg}t|j}|j}|s-d}n|j||j}|rf|jd|j|ndj|S(sBuild the path URL to use.t/t?t(R#turltpathtappendtquerytjoin(tselfR1tpR2R4((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pytpath_url=s     cCst|ttfr|St|dr,|St|drg}xt|D]\}}t|tsyt|d r|g}nxl|D]d}|dk r|jt|tr|jdn|t|tr|jdn|fqqWqNWt |dt S|SdS(sEncode parameters in a piece of data. Will successfully encode parameters when passed as a dict or a list of 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary if parameters are supplied as a dict. treadt__iter__sutf-8tdoseqN( t isinstanceR%R&thasattrRR*tNoneR3tencodeR$tTrue(tdatatresulttktvstv((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt_encode_paramsRs    !3c Cs]|stdnt|tr3tdng}t|pEi}t|pWi}x|D]\}}t|tst|d r|g}nx|D]}|d k rt|tst|}n|jt|tr|j dn|t|tr|j dn|fqqWqdWx|D] \}}d }d } t|t t frt |dkr|\} } qt |dkr|\} } }q|\} } }} nt|p|} |} t| tttfr| } n | j} td|d| d | d | } | jd ||j| q3Wt|\}}||fS( sBuild the body for a multipart/form-data request. Will successfully encode files when passed as a dict or a list of tuples. Order is retained if data is a list of tuples but arbitrary if parameters are supplied as a dict. The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) or 4-tuples (filename, fileobj, contentype, custom_headers). sFiles must be provided.sData must not be a string.R:sutf-8iitnameRAtfilenametheaderst content_typeN(t ValueErrorR<R*RR=R>R&R%R3tdecodeR?ttupletlisttlenRt bytearrayR9Rtmake_multipartR(tfilesRAt new_fieldstfieldstfieldtvalRERCtfttfhtfntfptfdatatrftbodyRJ((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt _encode_filesmsH    !3  !(t__name__t __module__tpropertyR8t staticmethodRFR^(((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR-<stRequestHooksMixincBseZdZdZRS(cCs||jkr"td|nt|tjrK|j|j|n0t|dr{|j|jd|DndS(sProperly register a hook.s1Unsupported event specified, with event name "%s"R:css'|]}t|tjr|VqdS(N(R<t collectionstCallable(t.0th((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pys sN(thooksRKR<RdReR3R=textend(R6teventthook((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt register_hooks cCs5y|j|j|tSWntk r0tSXdS(siDeregister a previously registered hook. Returns True if the hook existed, False if not. N(RhtremoveR@RKtFalse(R6RjRk((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pytderegister_hooks  (R_R`RlRo(((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRcs tRequestc BsGeZdZddddddddddd ZdZdZRS(sA user-created :class:`Request ` object. Used to prepare a :class:`PreparedRequest `, which is sent to the server. :param method: HTTP method to use. :param url: URL to send. :param headers: dictionary of headers to send. :param files: dictionary of {filename: fileobject} files to multipart upload. :param data: the body to attach to the request. If a dictionary is provided, form-encoding will take place. :param json: json for the body to attach to the request (if files or data is not specified). :param params: dictionary of URL parameters to append to the URL. :param auth: Auth handler or (user, pass) tuple. :param cookies: dictionary or CookieJar of cookies to attach to this request. :param hooks: dictionary of callback hooks, for internal usage. Usage:: >>> import requests >>> req = requests.Request('GET', 'http://httpbin.org/get') >>> req.prepare() c Cs|dkrgn|}|dkr*gn|}|dkrBin|}|dkrZin|}| dkrrin| } t|_x6t| jD]"\} } |jd| d| qW||_||_||_||_ ||_ | |_ ||_ ||_ ||_dS(NRjRk(R>RRhRNtitemsRltmethodR1RIRRRAR+tparamstauthtcookies( R6RrR1RIRRRARsRtRuRhR+RCRE((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt__init__s"         cCs d|jS(Ns(Rr(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt__repr__scCsqt}|jd|jd|jd|jd|jd|jd|jd|jd|j d |j d |j |S( sXConstructs a :class:`PreparedRequest ` for transmission and returns it.RrR1RIRRRAR+RsRtRuRh( tPreparedRequesttprepareRrR1RIRRRAR+RsRtRuRh(R6R7((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRys            N(R_R`t__doc__R>RvRwRy(((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRps  Rxc BseZdZdZddddddddddd ZdZdZdZe dZ dZ dZ dd Z d Zd d Zd ZdZRS(sThe fully mutable :class:`PreparedRequest ` object, containing the exact bytes that will be sent to the server. Generated from either a :class:`Request ` object or manually. Usage:: >>> import requests >>> req = requests.Request('GET', 'http://httpbin.org/get') >>> r = req.prepare() >>> s = requests.Session() >>> s.send(r) cCsFd|_d|_d|_d|_d|_t|_d|_dS(N( R>RrR1RIt_cookiesR]RRht_body_position(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRvs      c Csk|j||j|||j||j||j||| |j|||j| dS(s6Prepares the entire request with the given parameters.N(tprepare_methodt prepare_urltprepare_headerstprepare_cookiest prepare_bodyt prepare_autht prepare_hooks( R6RrR1RIRRRARsRtRuRhR+((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRy+s   cCs d|jS(Ns(Rr(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRw=scCst}|j|_|j|_|jdk r?|jjnd|_t|j|_|j|_|j |_ |j |_ |S(N( RxRrR1RIR>tcopyR R{R]RhR|(R6R7((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR@s   '   cCs7||_|jdk r3t|jj|_ndS(sPrepares the given HTTP method.N(RrR>Rtupper(R6Rr((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR}Ks cCsOddl}y"|j|dtjd}Wn|jk rJtnX|S(Nituts46sutf-8(tidnaR?R@RLt IDNAErrort UnicodeError(thostR((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt_get_idna_encoded_hostQs  " cCst|tr!|jd}ntr3t|n t|}|j}d|krz|jjd rz||_ dSy%t |\}}}}}}} Wn"t k r} t | j nX|sd} | jt|d} t| n|st d|nt|sRy|j|}Wqptk rNt dqpXn|jdrpt dn|pyd } | r| d 7} n| |7} |r| dt|7} n|sd }ntrst|tr|jd }nt| tr | jd } nt|tr.|jd }nt|trO|jd }nt| trs| jd } qsnt|ttfrt|}n|j|} | r|rd || f}q| }ntt|| |d|| g}||_ dS(sPrepares the given HTTP URL.tutf8t:thttpNsDInvalid URL {0!r}: No schema supplied. Perhaps you meant http://{0}?s Invalid URL %r: No host suppliedsURL has an invalid label.u*R0t@R.sutf-8s%s&%s(R<R&RLR'tunicodeR%tlstriptlowert startswithR1RRRtargstformatRRRRRR?RFRR"R>(R6R1RstschemeRtRtportR2R4tfragmentteterrortnetloct enc_params((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR~[sh " %       $cCsYt|_|rUx@|jD]/}t||\}}||jt|t complexjsontdumpsR<R&R?tallR=R*RNRMRdtMappingRt TypeErrortAttributeErrorRtgetattrRR|tIOErrortOSErrortobjecttNotImplementedErrorR)RIR^RFtprepare_content_lengthR](R6RARRR+R]RJt is_streamtlength((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRsJ %    cCsr|dk r7t|}|rnt||jdPrepare Content-Length header based on request method and bodysContent-LengthtGETtHEADt0N(RR(R>RR)RIRrtget(R6R]R((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs   'R0cCs|dkr6t|j}t|r-|nd}n|rt|trlt|dkrlt|}n||}|jj |j|j |j ndS(s"Prepares the given HTTP auth data.iN( R>RR1tanyR<RMROR t__dict__tupdateRR](R6RtR1turl_authtr((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs ! cCs_t|tjr||_nt||_t|j|}|dk r[||jd` object. Any subsequent calls to ``prepare_cookies`` will have no actual effect, unless the "Cookie" header is removed beforehand. tCookieN(R<R!t CookieJarR{R R R>RI(R6Rut cookie_header((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR$s   cCs5|p g}x"|D]}|j|||qWdS(sPrepares the given hooks.N(Rl(R6RhRj((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR8s  N(R_R`RzRvR>RyRwRR}RbRR~RRRRRR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRxs    V E  tResponsec Bs7eZdZddddddddd d g Zd Zd Zd ZdZdZdZ dZ dZ dZ e dZe dZe dZe dZe dZdedZed"d"dZe dZe dZdZe dZd Zd!ZRS(#shThe :class:`Response ` object, which contains a server's response to an HTTP request. t_contentt status_codeRIR1thistorytencodingtreasonRutelapsedtrequestcCst|_t|_d|_d|_t|_d|_d|_ d|_ g|_ d|_ t i|_tjd|_d|_dS(Ni(RnRt_content_consumedR>t_nextRR RItrawR1RRRR Rutdatetimet timedeltaRR(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRvLs          cCs|S(N((R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt __enter__{scGs|jdS(N(tclose(R6R((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt__exit__~scs0jsjntfdjDS(Nc3s'|]}|t|dfVqdS(N(RR>(Rftattr(R6(s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pys s(Rtcontenttdictt __attrs__(R6((R6s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt __getstate__s    cCsQx*|jD]\}}t|||q Wt|dtt|dddS(NRR(RqtsetattrR@R>(R6tstateRGR((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt __setstate__scCs d|jS(Ns(R(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRwscCs|jS(skReturns True if :attr:`status_code` is less than 400. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code, is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. (tok(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt__bool__scCs|jS(skReturns True if :attr:`status_code` is less than 400. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code, is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. (R(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt __nonzero__scCs |jdS(s,Allows you to use a response as an iterator.i(t iter_content(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR:scCs'y|jWntk r"tSXtS(skReturns True if :attr:`status_code` is less than 400. This attribute checks if the status code of the response is between 400 and 600 to see if there was a client error or a server error. If the status code, is between 200 and 400, this will return True. This is **not** a check to see if the response code is ``200 OK``. (traise_for_statusRRnR@(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs  cCsd|jko|jtkS(sTrue if this Response is a well-formed HTTP redirect that could have been processed automatically (by :meth:`Session.resolve_redirects`). tlocation(RIRtREDIRECT_STATI(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt is_redirectscCs(d|jko'|jtjtjfkS(s@True if this Response one of the permanent versions of redirect.R(RIRR,tmoved_permanentlytpermanent_redirect(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pytis_permanent_redirectscCs|jS(sTReturns a PreparedRequest for the next request in a redirect chain, if there is one.(R(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pytnextscCstj|jdS(s7The apparent encoding, provided by the chardet library.R(R(tdetectR(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pytapparent_encodingsicsfd}jr9tjtr9tn5dk rntt rntdtnt j}|}jr|n|}|rt |}n|S(sIterates over the response data. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. The chunk size is the number of bytes it should read into memory. This is not necessarily the length of each item returned as decoding can take place. chunk_size must be of type int or None. A value of None will function differently depending on the value of `stream`. stream=True will read data as it arrives in whatever size the chunks are received. If stream=False, data is returned as a single chunk. If decode_unicode is True, content will be decoded using the best available encoding based on the response. c3stjdry,x%jjdtD] }|Vq.WWqtk r_}t|qtk r}}t|qtk r}t |qXn.x+trjj }|sPn|VqWt_ dS(Ntstreamtdecode_content( R=RRR@RRRRRRR9R(tchunkR(t chunk_sizeR6(s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pytgenerates    s.chunk_size must be an int, it is instead a %s.N( RR<RtboolRR>tintRttypeRR(R6Rtdecode_unicodeRt reused_chunkst stream_chunkstchunks((RR6s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs  ccsd}x|jd|d|D]}|dk r>||}n|rV|j|}n |j}|r|dr|r|dd|dkr|j}nd}x|D] }|VqWqW|dk r|VndS(sIterates over the response data, one line at a time. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. .. note:: This method is not reentrant safe. RRiN(R>Rtsplitt splitlinestpop(R6RRt delimitertpendingRtlinestline((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyt iter_lines s   .   cCs|jtkr{|jr'tdn|jdksE|jdkrQd|_q{tj|j t prt|_nt |_|jS(s"Content of the response, in bytes.s2The content for this response was already consumediN( RRnRt RuntimeErrorRRR>R&R5RtCONTENT_CHUNK_SIZER@(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR*s   * cCsd}|j}|js"tdS|jdkr=|j}nyt|j|dd}Wn,ttfk rt|jdd}nX|S(sContent of the response, in unicode. If Response.encoding is None, encoding will be guessed using ``chardet``. The encoding of the response content is determined based solely on HTTP headers, following RFC 2616 to the letter. If you can take advantage of non-HTTP knowledge to make a better guess at the encoding, you should set ``r.encoding`` appropriately before accessing this property. R0terrorstreplaceN(R>RRR%Rt LookupErrorR(R6RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyttext>s    cKs|j r}|jr}t|jdkr}t|j}|dk r}y tj|jj||SWqztk rvqzXq}ntj|j |S(sReturns the json-encoded content of a response, if any. :param \*\*kwargs: Optional arguments that ``json.loads`` takes. :raises ValueError: If the response body does not contain valid json. iN( RRRORR>RtloadsRLtUnicodeDecodeErrorR(R6tkwargsR((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyR+ds(   cCsj|jjd}i}|rft|}x9|D].}|jdpR|jd}|||(R6R((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRs   N(R_R`RzRRvRRRRRwRRR:RaRRRRRRnRtITER_CHUNK_SIZER>RRRR+RRR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pyRBs2 /     7&  (QRzRdRtsystencodings.idnat encodingstpip._vendor.urllib3.fieldsRtpip._vendor.urllib3.filepostRtpip._vendor.urllib3.utilRtpip._vendor.urllib3.exceptionsRRRRtioRRhRt structuresR RtR RuR R R t exceptionsRRRRRRRt_internal_utilsRRtutilsRRRRRRRRRR tcompatR!R"R#R$R%R&R'R(R)R*R+Rt status_codesR,tmovedtfoundtotherttemporary_redirectRRtDEFAULT_REDIRECT_LIMITRRRR-RcRpRxR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.pytsB    "4FF  nF;PK!|LLstatus_codes.pycnu[ Rec@sdaddlmZiDdd6dd6dd6dd 6dd 6dd6dd6dd6dd6dd6dd!6dd$6dd)6dd+6dd-6dd/6dd36dd56dd86dd:6dd<6dd>6ddB6ddF6ddI6ddK6ddN6ddP6ddS6ddV6ddX6dd\6dd_6dda6ddc6dde6ddh6ddj6ddl6ddp6ddt6ddv6ddz6dd|6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6ZeddZdZedS(s The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. Example:: >>> import requests >>> requests.codes['temporary_redirect'] 307 >>> requests.codes.teapot 418 >>> requests.codes['\o/'] 200 Some codes have multiple names, and both upper- and lower-case versions of the names are allowed. For example, ``codes.ok``, ``codes.OK``, and ``codes.okay`` all correspond to the HTTP status code 200. i(t LookupDicttcontinueidtswitching_protocolsiet processingift checkpointigt uri_too_longtrequest_uri_too_longiztoktokaytall_oktall_okaytall_goods\o/s✓itcreateditaccepteditnon_authoritative_infotnon_authoritative_informationit no_contentit reset_contenttresetitpartial_contenttpartialit multi_statustmultiple_statust multi_statitmultiple_statiitalready_reporteditim_useditmultiple_choicesi,tmoved_permanentlytmoveds\o-i-tfoundi.t see_othertotheri/t not_modifiedi0t use_proxyi1t switch_proxyi2ttemporary_redirectttemporary_movedt temporaryi3tpermanent_redirecttresume_incompletetresumei4t bad_requesttbadit unauthorizeditpayment_requiredtpaymentit forbiddenit not_founds-o-itmethod_not_allowedt not_alloweditnot_acceptableitproxy_authentication_requiredt proxy_authtproxy_authenticationitrequest_timeoutttimeoutitconflictitgoneitlength_requireditprecondition_failedt preconditionitrequest_entity_too_largeitrequest_uri_too_largeitunsupported_media_typetunsupported_mediat media_typeitrequested_range_not_satisfiabletrequested_rangetrange_not_satisfiableitexpectation_failedit im_a_teapottteapott i_am_a_teapotitmisdirected_requestitunprocessable_entityt unprocessableitlockeditfailed_dependencyt dependencyitunordered_collectiont unordereditupgrade_requiredtupgradeitprecondition_requiredittoo_many_requeststtoo_manyitheader_fields_too_largetfields_too_largeit no_responsetnoneit retry_withtretryit$blocked_by_windows_parental_controlstparental_controlsitunavailable_for_legal_reasonst legal_reasonsitclient_closed_requestitinternal_server_errort server_errors/o\s✗itnot_implementedit bad_gatewayitservice_unavailablet unavailableitgateway_timeoutithttp_version_not_supportedt http_versionitvariant_also_negotiatesitinsufficient_storageitbandwidth_limit_exceededt bandwidthit not_extendeditnetwork_authentication_requiredt network_authtnetwork_authenticationitnamet status_codescsxctjD]U\}}xF|D]>}tt|||jds tt|j|q q Wq Wdtdk rtddjfdt tDndadS(Ns\t/cSs+djdt|D}d||fS(Ns, css|]}d|VqdS(s``%s``N((t.0tn((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.pys sss* %d: %s(tjoint_codes(tcodetnames((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.pytdocrss c3s|]}|VqdS(N((RvRz(R|(s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.pys xs(s\Ru( Rytitemstsetattrtcodest startswithtuppert__doc__tNoneRxtsorted(Rzttitlesttitle((R|s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.pyt_initks ! N(R(R(R(R(RR(RRR R R s\o/s✓(R (R (RR(R(RR(RR(RRRR(R(R(R(RRs\o-(R(RR (R!(R"(R#(R$R%R&(R'R(R)(R*R+(R,(R-R.(R/(R0s-o-(R1R2(R3(R4R5R6(R7R8(R9(R:(R;(R<R=(R>(R?(R@RARB(RCRDRE(RF(RGRHRI(RJ(RKRL(RM(RNRO(RPRQ(RRRS(RTR=(RURV(RWRX(RYRZ(R[R\(R]R^(R_R`(Ra(RbRcs/o\s✗(Rd(Re(RfRg(Rh(RiRj(Rk(Rl(RmRn(Ro(RpRqRr(Rt structuresRRyRR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.pyts  PK!u_@gg __init__.pyonu[ abc@stdZddlmZddlmZddlZddlmZdZyeejejWn9e e fk rej dj ejejenXdd l mZejd edd lmZmZmZmZdd lmZmZmZmZdd lmZmZddlmZddlmZddlmZmZmZddl m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(ddl)m*Z*m+Z+ddl,m-Z-ddlm.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6ddl7Z7yddl7m8Z8Wn*e9k r@de7j:fdYZ8nXe7j;e<j=e8ejde4de>dS(s Requests HTTP Library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> r.status_code 200 >>> 'Python is a programming language' in r.content True ... or POST: >>> payload = dict(key1='value1', key2='value2') >>> r = requests.post('http://httpbin.org/post', data=payload) >>> print(r.text) { ... "form": { "key2": "value2", "key1": "value1" }, ... } The other HTTP methods are supported - see `requests.api`. Full documentation is at . :copyright: (c) 2017 by Kenneth Reitz. :license: Apache 2.0, see LICENSE for more details. i(turllib3(tchardetNi(tRequestsDependencyWarningcCs|jd}t|dkr1|jdn|\}}}t|t|t|}}}|jdd \}}}t|t|t|}}}dS(Nt.it0i(tsplittlentappendtint(turllib3_versiontchardet_versiontmajortminortpatch((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/__init__.pytcheck_compatibility1s&&sAurllib3 ({0}) or chardet ({1}) doesn't match a supported version!(tDependencyWarningtignore(t __title__t__description__t__url__t __version__(t __build__t __author__t__author_email__t __license__(t __copyright__t__cake__(tutils(tpackages(tRequesttResponsetPreparedRequest(trequesttgettheadtpostR tputtdeletetoptions(tsessiontSession(tcodes( tRequestExceptiontTimeoutt URLRequiredtTooManyRedirectst HTTPErrortConnectionErrortFileModeWarningtConnectTimeoutt ReadTimeout(t NullHandlerR3cBseZdZRS(cCsdS(N((tselftrecord((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/__init__.pytemitss(t__name__t __module__R6(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/__init__.pyR3rstdefaultR(?t__doc__t pip._vendorRRtwarningst exceptionsRRRtAssertionErrort ValueErrortwarntformattpip._vendor.urllib3.exceptionsRt simplefilterRRRRRRRRRtRRtmodelsRRRtapiR R!R"R#R R$R%R&tsessionsR'R(t status_codesR)R*R+R,R-R.R/R0R1R2tloggingR3t ImportErrortHandlert getLoggerR7t addHandlertTrue(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/__init__.pyt)s<    "":@  PK!>l55 compat.pyonu[ abc@s5dZddlmZddlZejZeddkZeddkZddlZerGddl m Z m Z m Z m Z mZmZmZmZmZddlmZmZmZmZmZdd lmZddlZdd lmZdd lmZdd lmZe Z!e Z"e#Z e$Z$e%e&e'fZ(e%e&fZ)ner1dd l*mZmZmZmZmZm Z m Z m Z m Z mZddl+mZmZmZmZmZddl,m-Zdd l.mZdd l/mZdd l0mZe Z!e Z e"Z"e e"fZ$e%e'fZ(e%fZ)ndS(sq requests.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. i(tchardetNiii( tquotetunquotet quote_plust unquote_plust urlencodet getproxiest proxy_bypasstproxy_bypass_environmenttgetproxies_environment(turlparset urlunparseturljointurlsplitt urldefrag(tparse_http_list(tMorsel(tStringIO(t OrderedDict( R R R R RRRRRR(RRRRR (t cookiejar(1t__doc__t pip._vendorRtsyst version_infot_vertis_py2tis_py3tjsonturllibRRRRRRRRR R R R R Rturllib2Rt cookielibtCookieRRt)pip._vendor.urllib3.packages.ordered_dictRtstrt builtin_strtbytestunicodet basestringtinttlongtfloatt numeric_typest integer_typest urllib.parseturllib.requestthttpRt http.cookiestiot collections(((s?/usr/lib/python2.7/site-packages/pip/_vendor/requests/compat.pyt sB   @( F(  PK!6structures.pycnu[ Rec@s\dZddlmZddlmZmZdefdYZdefdYZd S( sO requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. i(t OrderedDicti(tMappingtMutableMappingtCaseInsensitiveDictcBskeZdZd dZdZdZdZdZdZ dZ dZ d Z d Z RS( sA case-insensitive ``dict``-like object. Implements all methods and operations of ``MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive:: cid = CaseInsensitiveDict() cid['Accept'] = 'application/json' cid['aCCEPT'] == 'application/json' # True list(cid) == ['Accept'] # True For example, ``headers['content-encoding']`` will return the value of a ``'Content-Encoding'`` response header, regardless of how the header name was originally stored. If the constructor, ``.update``, or equality comparison operations are given keys that have equal ``.lower()``s, the behavior is undefined. cKs5t|_|dkr!i}n|j||dS(N(Rt_storetNonetupdate(tselftdatatkwargs((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__init__*s   cCs||f|j|j<s(Rtvalues(R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__iter__;scCs t|jS(N(tlenR(R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__len__>scCsd|jjDS(s.Like iteritems(), but with all lowercase keys.css%|]\}}||dfVqdS(iN((Rtlowerkeytkeyval((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pys Ds(Rtitems(R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt lower_itemsAscCsDt|trt|}ntSt|jt|jkS(N(t isinstanceRRtNotImplementedtdictR(Rtother((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__eq__IscCst|jjS(N(RRR(R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pytcopyRscCstt|jS(N(tstrRR(R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__repr__UsN(t__name__t __module__t__doc__RR RRRRRRR R!R#(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyRs        t LookupDictcBs8eZdZddZdZdZddZRS(sDictionary lookup object.cCs ||_tt|jdS(N(tnametsuperR'R (RR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyR \s cCs d|jS(Ns (R((R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyR#`scCs|jj|dS(N(t__dict__tgetR(RR ((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyRcscCs|jj||S(N(R*R+(RR tdefault((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyR+hsN(R$R%R&RR R#RR+(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyR'Ys    N( R&t collectionsRtcompatRRRRR'(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/structures.pytsJPK!2ۄWW cookies.pyonu[ abc@sQdZddlZddlZddlZddlZddlmZddlmZm Z m Z m Z yddl Z Wne k rddlZ nXdefdYZdefd YZd Zd Zddd Zd efdYZdejejfdYZdZdZdZdedZdZ dS(s requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. iNi(tto_native_string(t cookielibturlparset urlunparsetMorselt MockRequestcBseZdZdZdZdZdZdZdZdZ ddZ d Z d Z d Zed Zed ZedZRS(sWraps a `requests.Request` to mimic a `urllib2.Request`. The code in `cookielib.CookieJar` expects this interface in order to correctly manage cookie policies, i.e., determine whether a cookie can be set, given the domains of the request and the cookie. The original request object is read-only. The client is responsible for collecting the new headers via `get_new_headers()` and interpreting them appropriately. You probably want `get_cookie_header`, defined below. cCs.||_i|_t|jjj|_dS(N(t_rt _new_headersRturltschemettype(tselftrequest((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt__init__&s  cCs|jS(N(R (R ((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pytget_type+scCst|jjjS(N(RRRtnetloc(R ((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pytget_host.scCs |jS(N(R(R ((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pytget_origin_req_host1scCsx|jjjds|jjSt|jjddd}t|jj}t|j||j|j |j |j gS(NtHosttencodingsutf-8( RtheaderstgetRRRRR tpathtparamstquerytfragment(R thosttparsed((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt get_full_url4s cCstS(N(tTrue(R ((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pytis_unverifiableBscCs||jjkp||jkS(N(RRR(R tname((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt has_headerEscCs%|jjj||jj||S(N(RRRR(R Rtdefault((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt get_headerHscCstddS(sMcookielib has no legitimate use for this method; add it back if you find one.s=Cookie headers should be added with add_unredirected_header()N(tNotImplementedError(R tkeytval((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt add_headerKscCs||j|(RR'RQtresulttbadargsterr((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyROs0   cCs!d}|dr_y$ttjt|d}Wqtk r[td|dqXn2|drd}tjtj|d|}ntd|ddt |ddt d|dd|d |j d |d d dd i|d d6dt dt |dd|j d|dpd S(sBConvert a Morsel object into a Cookie containing the one k/v pair.smax-agesmax-age: %s must be integerRs%a, %d-%b-%Y %H:%M:%S GMTRRRRBRRRRthttponlyRRRR'RiN( R/tintttimet ValueErrorRtcalendarttimegmtstrptimeRORR`R$R'(tmorselRt time_template((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyRNs0 $       cCs|dkrt}n|dk rg|D]}|j^q+}x@|D]5}|s_||krG|jt|||qGqGWn|S(s-Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. N(R/RJRRPRO(t cookie_dictREt overwriteRGtnames_from_jarR((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pytcookiejar_from_dicts    $cCst|tjs!tdnt|trKt|d|dt}nXt|tjry|j|Wqtk rx|D]}|j |qWqXn|S(sAdd cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. s!You can only merge into CookieJarRER( RMRRoRRRR`RqtAttributeErrorRP(REtcookiest cookie_in_jar((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt merge_cookies s  (!R.RpRRt collectionst_internal_utilsRtcompatRRRRRzt ImportErrortdummy_threadingtobjectRR1R=RAR/RHt RuntimeErrorRIRotMutableMappingRJRRORNRRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt s,    " H    # PK!ik{h{h cookies.pycnu[ Rec@sHdZddlZddlZddlZddlmZddlmZmZm Z m Z m Z yddl Z Wne k rddlZ nXdefdYZdefd YZd Zd Zeed Zd efdYZdeje fdYZdZdZdZeedZdZdS(s requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. iNi(tto_native_string(t cookielibturlparset urlunparsetMorseltMutableMappingt MockRequestcBseZdZdZdZdZdZdZdZdZ ddZ d Z d Z d Zed Zed ZedZRS(sWraps a `requests.Request` to mimic a `urllib2.Request`. The code in `cookielib.CookieJar` expects this interface in order to correctly manage cookie policies, i.e., determine whether a cookie can be set, given the domains of the request and the cookie. The original request object is read-only. The client is responsible for collecting the new headers via `get_new_headers()` and interpreting them appropriately. You probably want `get_cookie_header`, defined below. cCs.||_i|_t|jjj|_dS(N(t_rt _new_headersRturltschemettype(tselftrequest((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt__init__%s  cCs|jS(N(R (R ((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pytget_type*scCst|jjjS(N(RRR tnetloc(R ((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pytget_host-scCs |jS(N(R(R ((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pytget_origin_req_host0scCsx|jjjds|jjSt|jjddd}t|jj}t|j||j|j |j |j gS(NtHosttencodingsutf-8( RtheaderstgetR RRRR tpathtparamstquerytfragment(R thosttparsed((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt get_full_url3s cCstS(N(tTrue(R ((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pytis_unverifiableAscCs||jjkp||jkS(N(RRR(R tname((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt has_headerDscCs%|jjj||jj||S(N(RRRR(R R tdefault((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt get_headerGscCstddS(sMcookielib has no legitimate use for this method; add it back if you find one.s=Cookie headers should be added with add_unredirected_header()N(tNotImplementedError(R tkeytval((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt add_headerJscCs||j|RBR0RIt RuntimeErrorRJRpRKRRPRORRR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/cookies.pyt s*   ( H    $ PK!j5ddhelp.pycnu[ Rec@s dZddlmZddlZddlZddlZddlZddlmZddlm Z ddlm Z ddl m Z ydd lmZWn#ek rdZdZdZnXddlZddlZd Zd Zd Zed kr endS(s'Module containing bug report helper(s).i(tprint_functionN(tidna(turllib3(tchardeti(t __version__(t pyopensslcCstj}|dkr'tj}n|dkrdtjjtjjtjjf}tjjdkrdj |tjjg}qn<|dkrtj}n!|dkrtj}nd}i|d 6|d 6S( sReturn a dict with the Python implementation and version. Provide both the name and the version of the Python implementation currently running. For example, on CPython 2.7.5 it will return {'name': 'CPython', 'version': '2.7.5'}. This function works best on CPython and PyPy: in particular, it probably doesn't work for Jython or IronPython. Future investigation should be done to work out the correct shape of the code for those platforms. tCPythontPyPys%s.%s.%stfinalttJythont IronPythontUnknowntnametversion( tplatformtpython_implementationtpython_versiontsystpypy_version_infotmajortminortmicrot releaseleveltjoin(timplementationtimplementation_version((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/help.pyt_implementations       c Cshy$itjd6tjd6}Wn%tk rKidd6dd6}nXt}itjd6}itjd6}idd6dd6}t rit jd6dt j j d6}nit t ddd6}it tddd6}tj }i|dk rd|ndd6}i |d 6|d 6|d 6tdk d 6|d 6|d6|d6|d6|d6itd6d6S(s&Generate information for a bug report.tsystemtreleaseR RR topenssl_versions%xRRRt system_ssltusing_pyopensslt pyOpenSSLRRt cryptographyRtrequestsN(RRRtIOErrorRRRRtNonetOpenSSLtSSLtOPENSSL_VERSION_NUMBERtgetattrR"RtsslRtrequests_version( t platform_infotimplementation_infot urllib3_infot chardet_infotpyopenssl_infotcryptography_infot idna_infoRtsystem_ssl_info((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/help.pytinfo;sJ        cCs&ttjtdtdddS(s)Pretty-print the bug information as JSON.t sort_keystindentiN(tprinttjsontdumpsR4tTrue(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/help.pytmainqst__main__(t__doc__t __future__RR8RRR*t pip._vendorRRRR RR+tpip._vendor.urllib3.contribRt ImportErrorR%R&R"RR4R;t__name__(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/help.pyts,         ! 6  PK!G_internal_utils.pyonu[ abc@s;dZddlmZmZmZddZdZdS(s requests._internal_utils ~~~~~~~~~~~~~~ Provides utility functions that are consumed internally by Requests which depend on extremely few external helpers (such as compat) i(tis_py2t builtin_strtstrtasciicCsCt|tr|}n'tr0|j|}n|j|}|S(sGiven a string object, regardless of type, returns a representation of that string in the native string type, encoding and decoding where necessary. This assumes ASCII unless told otherwise. (t isinstanceRRtencodetdecode(tstringtencodingtout((sH/usr/lib/python2.7/site-packages/pip/_vendor/requests/_internal_utils.pytto_native_strings  cCs.y|jdtSWntk r)tSXdS(sDetermine if unicode string only contains ASCII characters. :param str u_string: unicode string to check. Must be unicode and not Python 2 `str`. :rtype: bool RN(RtTruetUnicodeEncodeErrortFalse(tu_string((sH/usr/lib/python2.7/site-packages/pip/_vendor/requests/_internal_utils.pytunicode_is_asciis   N(t__doc__tcompatRRRR R(((sH/usr/lib/python2.7/site-packages/pip/_vendor/requests/_internal_utils.pyt s PK!*@__version__.pycnu[ Rec@s@dZdZdZdZdZdZdZdZdZd Z d S( trequestssPython HTTP for Humans.shttps://requests.readthedocs.ios2.24.0i$s Kenneth Reitzsme@kennethreitz.orgs Apache 2.0sCopyright 2020 Kenneth Reitzu ✨ 🍰 ✨N( t __title__t__description__t__url__t __version__t __build__t __author__t__author_email__t __license__t __copyright__t__cake__(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/__version__.pytsPK!f certs.pycnu[ Rec@s1dZddlmZedkr-eGHndS(sF requests.certs ~~~~~~~~~~~~~~ This module returns the preferred default CA certificate bundle. There is only one — the one from the certifi package. If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a separately packaged CA bundle. i(twheret__main__N(t__doc__tpip._vendor.certifiRt__name__(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/certs.pyts PK!դ& packages.pycnu[ Rec@sddlZxdD]ZdeZeeees   PK!_internal_utils.pycnu[ Rec@s;dZddlmZmZmZddZdZdS(s requests._internal_utils ~~~~~~~~~~~~~~ Provides utility functions that are consumed internally by Requests which depend on extremely few external helpers (such as compat) i(tis_py2t builtin_strtstrtasciicCsCt|tr|}n'tr0|j|}n|j|}|S(sGiven a string object, regardless of type, returns a representation of that string in the native string type, encoding and decoding where necessary. This assumes ASCII unless told otherwise. (t isinstanceRRtencodetdecode(tstringtencodingtout((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/_internal_utils.pytto_native_strings  cCsCt|tsty|jdtSWntk r>tSXdS(sDetermine if unicode string only contains ASCII characters. :param str u_string: unicode string to check. Must be unicode and not Python 2 `str`. :rtype: bool RN(RRtAssertionErrorRtTruetUnicodeEncodeErrortFalse(tu_string((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/_internal_utils.pytunicode_is_asciis   N(t__doc__tcompatRRRR R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/_internal_utils.pyt s PK!y compat.pycnu[ Rec@scdZddlmZddlZejZeddkZeddkZddlZerYddl m Z m Z m Z m Z mZmZmZmZmZddlmZmZmZmZmZdd lmZddlZdd lmZdd lmZdd lmZm Z m!Z!m"Z"e#Z$e#Z%e&Z#e'Z'e(e)e*fZ+e(e)fZ,ner_dd l-mZmZmZmZmZm Z m Z m Z m Z mZddl.mZmZmZmZmZddl/m0Zdd l1mZdd l2mZddlm"Z"ddl3mZm Z m!Z!e#Z$e#Z#e%Z%e#e%fZ'e(e*fZ+e(fZ,ndS(sq requests.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. i(tchardetNiii( tquotetunquotet quote_plust unquote_plust urlencodet getproxiest proxy_bypasstproxy_bypass_environmenttgetproxies_environment(turlparset urlunparseturljointurlsplitt urldefrag(tparse_http_list(tMorsel(tStringIO(tCallabletMappingtMutableMappingt OrderedDict( R R R R RRRRRR(RRRRR (t cookiejar(R(RRR(4t__doc__t pip._vendorRtsyst version_infot_vertis_py2tis_py3tjsonturllibRRRRRRRRR R R R R Rturllib2Rt cookielibtCookieRRt collectionsRRRRtstrt builtin_strtbytestunicodet basestringtinttlongtfloatt numeric_typest integer_typest urllib.parseturllib.requestthttpRt http.cookiestiotcollections.abc(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/compat.pyt sD   @( "F(  PK!E=&&auth.pyonu[ abc@sdZddlZddlZddlZddlZddlZddlZddlmZddl m Z m Z m Z ddl mZddlmZddlmZd Zd Zd Zd efd YZdefdYZdefdYZdefdYZdS(s] requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. iN(t b64encodei(turlparsetstrt basestring(textract_cookies_to_jar(tto_native_string(tparse_dict_headers!application/x-www-form-urlencodedsmultipart/form-datacCst|ts:tjdj|dtt|}nt|tsttjdj|dtt|}nt|tr|jd}nt|tr|jd}ndtt dj ||fj }|S(sReturns a Basic Auth string.sNon-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in ({0!r}) to a string or bytes object in the near future to avoid problems.tcategorysNon-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in ({0!r}) to a string or bytes object in the near future to avoid problems.tlatin1sBasic t:( t isinstanceRtwarningstwarntformattDeprecationWarningRtencodeRRtjointstrip(tusernametpasswordtauthstr((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt_basic_auth_strs&   %tAuthBasecBseZdZdZRS(s4Base class that all auth implementations derive fromcCstddS(NsAuth hooks must be callable.(tNotImplementedError(tselftr((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt__call__Ks(t__name__t __module__t__doc__R(((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyRHst HTTPBasicAuthcBs2eZdZdZdZdZdZRS(s?Attaches HTTP Basic Authentication to the given Request object.cCs||_||_dS(N(RR(RRR((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt__init__Rs cCs:t|jt|ddk|jt|ddkgS(NRR(tallRtgetattrtNoneR(Rtother((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt__eq__VscCs ||k S(N((RR#((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt__ne__\scCs t|j|j|jd<|S(Nt Authorization(RRRtheaders(RR((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyR_s(RRRRR$R%R(((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyROs    t HTTPProxyAuthcBseZdZdZRS(s=Attaches HTTP Proxy Authentication to a given Request object.cCs t|j|j|jd<|S(NsProxy-Authorization(RRRR'(RR((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyRgs(RRRR(((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyR(dstHTTPDigestAuthcBsVeZdZdZdZdZdZdZdZdZ dZ RS( s@Attaches HTTP Digest Authentication to the given Request object.cCs%||_||_tj|_dS(N(RRt threadingtlocalt _thread_local(RRR((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyRos  cCsat|jds]t|j_d|j_d|j_i|j_d|j_d|j_ ndS(Ntinitti( thasattrR,tTrueR-t last_noncet nonce_counttchalR"tpost num_401_calls(R((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytinit_per_thread_stateus     csN|jjd}|jjd}|jjjd}|jjjd}|jjjd}d|dkrzd}n |j}|dks|dkrd} | n|d krd } | nfd } dkrdSd} t|} | jp d }| jr+|d | j7}nd|j||j f}d||f}|}|}||jj kr|jj d7_ n d|j_ d|jj }t |jj j d}||j d7}|tjj d7}|tjd7}tj|jd }|dkrJd|||f}n|sl| |d||f}nP|dksd|jdkrd|||d|f}| ||}ndS||j_ d|j||||f}|r|d|7}n|r|d|7}n| r)|d| 7}n|rF|d||f7}nd|S(s :rtype: str trealmtnoncetqopt algorithmtopaquetMD5sMD5-SESScSs4t|tr!|jd}ntj|jS(Nsutf-8(R RRthashlibtmd5t hexdigest(tx((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytmd5_utf8stSHAcSs4t|tr!|jd}ntj|jS(Nsutf-8(R RRR=tsha1R?(R@((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytsha_utf8scsd||fS(Ns%s:%s((tstd(t hash_utf8(s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytR.t/t?s%s:%s:%ss%s:%sis%08xsutf-8iitautht,s%s:%s:%s:%s:%ss>username="%s", realm="%s", nonce="%s", uri="%s", response="%s"s , opaque="%s"s, algorithm="%s"s , digest="%s"s , qop="auth", nc=%s, cnonce="%s"s Digest %sN(R,R3tgetR"tupperRtpathtqueryRRR1R2RRttimetctimetosturandomR=RCR?tsplit(RtmethodturlR7R8R9R:R;t _algorithmRARDtKDtentdigtp_parsedROtA1tA2tHA1tHA2tncvalueREtcnoncetrespdigtnoncebittbase((RGs=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytbuild_digest_headersr               ! cKs|jrd|j_ndS(s)Reset num_401_calls counter on redirects.iN(t is_redirectR,R5(RRtkwargs((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pythandle_redirects cKsd|jkodkns/d|j_|S|jjd k r]|jjj|jjn|jj dd}d|j kr~|jjdkr~|jjd7_t j dd t j }t|jd|d d|j_|j|j|jj}t|j|j|j|j|j|j|j|j|jd <|jj||}|jj|||_|Sd|j_|S( so Takes the given response and tries digest-auth, if needed. :rtype: requests.Response iiiswww-authenticateR.tdigestisdigest tflagstcountR&N(t status_codeR,R5R4R"trequesttbodytseekR'RMtlowertretcompilet IGNORECASERtsubR3tcontenttclosetcopyRt_cookiestrawtprepare_cookiesReRVRWt connectiontsendthistorytappend(RRRgts_authtpattprept_r((s=/usr/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt handle_401s.  $$   cCs|j|jjr8|j|j|j|jds$       ,PK!6dWdW sessions.pyonu[ abc@s+dZddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z m Z mZmZddlmZmZmZmZdd lmZmZmZdd lmZmZdd lmZdd lmZm Z dd l!m"Z"m#Z#m$Z$m%Z%ddl&m'Z'ddl(m)Z)ddlm*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2ddlm3Z3ej4dkry ej5Z6Wne7k rej8Z6nXn ejZ6e dZ9e dZ:de;fdYZ<de<fdYZ=dZ>dS(s requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). iN(tMapping(t timedeltai(t_basic_auth_str(t cookielibtis_py3t OrderedDictturljointurlparse(tcookiejar_from_dicttextract_cookies_to_jartRequestsCookieJart merge_cookies(tRequesttPreparedRequesttDEFAULT_REDIRECT_LIMIT(t default_hookst dispatch_hook(tto_native_string(tto_key_val_listtdefault_headers(tTooManyRedirectst InvalidSchematChunkedEncodingErrortContentDecodingError(tCaseInsensitiveDict(t HTTPAdapter(t requote_uritget_environ_proxiestget_netrc_authtshould_bypass_proxiestget_auth_from_urlt rewind_bodyt DEFAULT_PORTS(tcodes(tREDIRECT_STATItWindowscCs|dkr|S|dkr |St|to;t|tsB|S|t|}|jt|g|jD]\}}|dkrt|^qt}x|D] }||=qW|S(sDetermines appropriate setting for a given request, taking into account the explicit setting on that request, and the setting in the session. If a setting is a dictionary, they will be merged together using `dict_class` N(tNonet isinstanceRRtupdatetitems(trequest_settingtsession_settingt dict_classtmerged_settingtktvt none_keystkey((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt merge_setting2s  1  cCsZ|dks!|jdgkr%|S|dksF|jdgkrJ|St|||S(sProperly merges both requests and session hooks. This is necessary because when request_hooks == {'response': []}, the merge breaks Session hooks entirely. tresponseN(R$tgetR0(t request_hookst session_hooksR*((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt merge_hooksQs !!tSessionRedirectMixincBsPeZdZdZededdedZdZdZ dZ RS(cCs?|jr;|jd}tr.|jd}nt|dSdS(s7Receives a Response. Returns a redirect URI or ``None``tlocationtlatin1tutf8N(t is_redirecttheadersRtencodeRR$(tselftrespR7((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytget_redirect_targetbs    cCst|}t|}|j|jkr.tS|jdkrn|jdkrn|jdkrn|jdkrntS|j|jk}|j|jk}tj|jddf}| r|j|kr|j|krtS|p|S(sFDecide whether Authorization header should be removed when redirectingthttpiPthttpsiN(iPN(iN( RthostnametTruetschemetportR$tFalseR R2(R=told_urltnew_urlt old_parsedt new_parsedt changed_porttchanged_schemet default_port((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytshould_strip_authxs  c ksg} |j|} x| r|j} | j|| d|_y |jWn-tttfk r~|jj dt nXt |j|j krt d|j d|n|j| jdrt|j} dt| j| f} nt| }|j} |js3t|jt| } n t| } t| | _|j| ||jtjtjfkrd}x!|D]}| jj|dqWd| _ n| j}y |d =Wnt!k rnXt"| j#||jt$| j#|j%| j&| j#|j'| |}|j(| || j)dk oVd|kpVd |k}|rlt*| n| }|r|Vq|j+|d |d |d |d|d|dt | }t"|j%| |j|j|} |VqWdS(sBReceives a Response. Returns a generator of Responses or Requests.itdecode_contentsExceeded %s redirects.R1s//s%s:%ssContent-Lengths Content-TypesTransfer-EncodingtCookietstreamttimeouttverifytcerttproxiestallow_redirectsN(sContent-Lengths Content-TypesTransfer-Encoding(,R?tcopytappendthistorytcontentRRt RuntimeErrortrawtreadRFtlent max_redirectsRtcloset startswithRturlRRDtgeturltnetlocRRtrebuild_methodt status_codeR!ttemporary_redirecttpermanent_redirectR;tpopR$tbodytKeyErrorR t_cookiesR tcookiestprepare_cookiestrebuild_proxiest rebuild_autht_body_positionRtsend(R=R>treqRQRRRSRTRUtyield_requeststadapter_kwargsthistRbtprepared_requestt parsed_rurltparsedtpurged_headerstheaderR;t rewindable((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytresolve_redirectssr                 cCs{|j}|j}d|kr@|j|jj|r@|d=n|jrUt|nd}|dk rw|j|ndS(sWhen being redirected we may want to strip authentication from the request to avoid leaking credentials. This method intelligently removes and reapplies authentication where possible to avoid credential loss. t AuthorizationN(R;RbRNtrequestt trust_envRR$t prepare_auth(R=RwR1R;Rbtnew_auth((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRps  $  c Cs5|dk r|ni}|j}|j}t|j}|j}|jd}t|d|}|jr| rt |d|} | j|| jd} | r|j || qnd|kr|d=nyt ||\} } Wnt k rd\} } nX| r1| r1t | | |d>> import requests >>> s = requests.Session() >>> s.get('http://httpbin.org/get') Or as a context manager:: >>> with requests.Session() as s: >>> s.get('http://httpbin.org/get') R;RmtauthRUthookstparamsRSRTtprefetchtadaptersRQRR_cCst|_d|_i|_t|_i|_t|_ t |_ d|_ t |_t |_ti|_t|_|jdt|jdtdS(Nshttps://shttp://(RR;R$RRURRRRFRQRCRSRTRR_RRRmRRtmountR(R=((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt__init__js           cCs|S(N((R=((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt __enter__scGs|jdS(N(R`(R=targs((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt__exit__scCs*|jp i}t|tjs0t|}nttt|j|}|j}|jr| r|j rt |j }nt }|j d|j jd|j d|jd|jd|jdt|j|jdtdt|j|jd t||jd |d t|j|j |S( sConstructs a :class:`PreparedRequest ` for transmission and returns it. The :class:`PreparedRequest` has settings merged from the :class:`Request ` instance and those of the :class:`Session`. :param request: :class:`Request` instance to prepare with this session's settings. :rtype: requests.PreparedRequest RRbtfilestdatatjsonR;R*RRRmR(RmR%Rt CookieJarRR R RRRRbR tprepareRtupperRRRR0R;RRR5R(R=RRmtmerged_cookiesRtp((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytprepare_requests*        cCstd|jd|d|d|d|p-id|d|p?id|d |d | }|j|}| poi} |j|j| | ||}i| d 6| d 6}|j||j||}|S( sConstructs a :class:`Request `, prepares it and sends it. Returns :class:`Response ` object. :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'filename': file-like-objects`` for multipart encoding upload. :param auth: (optional) Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Set to True by default. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol or protocol and hostname to the URL of the proxy. :param stream: (optional) whether to immediately download the response content. Defaults to ``False``. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :rtype: requests.Response RRbR;RRRRRRmRRRRV(R RRtmerge_environment_settingsRbR&Rr(R=RRbRRR;RmRRRRRVRURRQRSRTRRstpreptsettingst send_kwargsR>((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRs*)       cKs#|jdt|jd||S(sSends a GET request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RVR(RRCR(R=Rbtkwargs((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyR2scKs#|jdt|jd||S(sSends a OPTIONS request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RVtOPTIONS(RRCR(R=RbR((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytoptions!scKs#|jdt|jd||S(sSends a HEAD request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RVR(RRFR(R=RbR((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pythead,scKs|jd|d|d||S(sSends a POST request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RRR(R(R=RbRRR((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytpost7s cKs|jd|d||S(sYSends a PUT request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response tPUTR(R(R=RbRR((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytputCs cKs|jd|d||S(s[Sends a PATCH request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response tPATCHR(R(R=RbRR((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytpatchNs cKs|jd||S(sSends a DELETE request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response tDELETE(R(R=RbR((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytdeleteYsc Ks|jd|j|jd|j|jd|j|jd|jt|trjtdn|jdt }|j d}|j }|j d|j }t}|j||}t|} td| |_td |||}|jr1x-|jD]} t|j| j| jq Wnt|j||j|j|||} |r{g| D]} | ^qing} | r| jd || j}| |_n|sy(t|j||d t ||_Wqtk rqXn|s|jn|S( sISend a given PreparedRequest. :rtype: requests.Response RQRSRTRUs#You can only send PreparedRequests.RVRbtsecondsR1iRt(RRQRSRTRUR%R t ValueErrorRiRCR2Rt get_adapterRbtpreferred_clockRrRtelapsedRRYR RmRR\R}tinserttnextt_nextt StopIterationRZ( R=RRRVRQRtadaptertstarttrRR>tgenRY((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRrcsB     %  (  c Cs|jr|dk r$|jdnd}t|d|}x*|jD]\}} |j|| qIW|tks|dkrtjjdptjjd}qnt ||j }t ||j }t ||j }t ||j }i|d6|d6|d6|d6S( s^ Check the environment and merge it with some settings. :rtype: dict RtREQUESTS_CA_BUNDLEtCURL_CA_BUNDLERSRURQRTN(RR$R2RR'RRCtostenvironR0RURQRSRT( R=RbRURQRSRTRt env_proxiesR,R-((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRs !cCsMx6|jjD]%\}}|jj|r|SqWtd|dS(s~ Returns the appropriate connection adapter for the given URL. :rtype: requests.adapters.BaseAdapter s*No connection adapters were found for '%s'N(RR'tlowerRaR(R=RbtprefixR((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRscCs(x!|jjD]}|jqWdS(s+Closes all adapters and as such the sessionN(RtvaluesR`(R=R-((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyR`scCso||j|s(tdictt __attrs__(R=tstate((R=sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt __getstate__scCs1x*|jD]\}}t|||q WdS(N(R'tsetattr(R=RRtvalue((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt __setstate__sN(RRt__doc__RRRRRR$RCRR2RRRRRRRrRRR`RRR(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRQs2  7   ) D  I    cCstS(sQ Returns a :class:`Session` for context-management. :rtype: Session (R(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytsessions(?RRtplatformttimet collectionsRtdatetimeRRRtcompatRRRRRRmRR R R tmodelsR R RRRRt_internal_utilsRtutilsRRt exceptionsRRRRt structuresRRRRRRRRRR t status_codesR!R"tsystemt perf_counterRtAttributeErrortclockR0R5tobjectR6RR(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt s<   (""4     PK!E~0~0auth.pycnu[ Rec@sdZddlZddlZddlZddlZddlZddlZddlmZddl m Z m Z m Z ddl mZddlmZddlmZd Zd Zd Zd efd YZdefdYZdefdYZdefdYZdS(s] requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. iN(t b64encodei(turlparsetstrt basestring(textract_cookies_to_jar(tto_native_string(tparse_dict_headers!application/x-www-form-urlencodedsmultipart/form-datacCst|ts:tjdj|dtt|}nt|tsztjdjt|dtt|}nt|tr|jd}nt|tr|jd}ndt t dj ||fj }|S(sReturns a Basic Auth string.sNon-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in ({!r}) to a string or bytes object in the near future to avoid problems.tcategorysNon-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in ({!r}) to a string or bytes object in the near future to avoid problems.tlatin1sBasic t:( t isinstanceRtwarningstwarntformattDeprecationWarningRttypetencodeRRtjointstrip(tusernametpasswordtauthstr((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt_basic_auth_strs&  %tAuthBasecBseZdZdZRS(s4Base class that all auth implementations derive fromcCstddS(NsAuth hooks must be callable.(tNotImplementedError(tselftr((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt__call__Ks(t__name__t __module__t__doc__R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyRHst HTTPBasicAuthcBs2eZdZdZdZdZdZRS(s?Attaches HTTP Basic Authentication to the given Request object.cCs||_||_dS(N(RR(RRR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt__init__Rs cCs:t|jt|ddk|jt|ddkgS(NRR(tallRtgetattrtNoneR(Rtother((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt__eq__VscCs ||k S(N((RR$((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt__ne__\scCs t|j|j|jd<|S(Nt Authorization(RRRtheaders(RR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyR_s(RRRR R%R&R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyROs    t HTTPProxyAuthcBseZdZdZRS(s=Attaches HTTP Proxy Authentication to a given Request object.cCs t|j|j|jd<|S(NsProxy-Authorization(RRRR((RR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyRgs(RRRR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyR)dstHTTPDigestAuthcBsVeZdZdZdZdZdZdZdZdZ dZ RS( s@Attaches HTTP Digest Authentication to the given Request object.cCs%||_||_tj|_dS(N(RRt threadingtlocalt _thread_local(RRR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyR os  cCsat|jds]t|j_d|j_d|j_i|j_d|j_d|j_ ndS(Ntinitti( thasattrR-tTrueR.t last_noncet nonce_counttchalR#tpost num_401_calls(R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytinit_per_thread_stateus     cs|jjd}|jjd}|jjjd}|jjjd}|jjjd}d"|d"krzd}n |j}|dks|dkrd} | nZ|d krd } | n<|d krd } | n|d kr d} | nfd} d"kr)d"Sd"}t|}|jpGd}|jrg|d|j7}nd|j||j f}d||f}|}|}||jj kr|jj d7_ n d|j_ d|jj }t |jj j d}||j d7}|tjj d7}|tjd7}tj|jd }|dkrd|||f}n|s| |d||f}nP|dksd|jdkrd|||d|f}| ||}nd"S||j_ d|j||||f}|r7|d|7}n|rN|d|7}n|re|d|7}n|r|d ||f7}nd!|S(#s :rtype: str trealmtnoncetqopt algorithmtopaquetMD5sMD5-SESScSs4t|tr!|jd}ntj|jS(Nsutf-8(R RRthashlibtmd5t hexdigest(tx((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytmd5_utf8stSHAcSs4t|tr!|jd}ntj|jS(Nsutf-8(R RRR>tsha1R@(RA((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytsha_utf8ssSHA-256cSs4t|tr!|jd}ntj|jS(Nsutf-8(R RRR>tsha256R@(RA((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt sha256_utf8ssSHA-512cSs4t|tr!|jd}ntj|jS(Nsutf-8(R RRR>tsha512R@(RA((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt sha512_utf8scsd||fS(Ns%s:%s((tstd(t hash_utf8(s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytR/t/t?s%s:%s:%ss%s:%sis%08xsutf-8iitautht,s%s:%s:%s:%s:%ss>username="%s", realm="%s", nonce="%s", uri="%s", response="%s"s , opaque="%s"s, algorithm="%s"s , digest="%s"s , qop="auth", nc=%s, cnonce="%s"s Digest %sN(R-R4tgetR#tupperRtpathtqueryRRR2R3RRttimetctimetosturandomR>RDR@tsplit(RtmethodturlR8R9R:R;R<t _algorithmRBRERGRItKDtentdigtp_parsedRTtA1tA2tHA1tHA2tncvalueRJtcnoncetrespdigtnoncebittbase((RLs/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pytbuild_digest_headers~                     ! cKs|jrd|j_ndS(s)Reset num_401_calls counter on redirects.iN(t is_redirectR-R6(RRtkwargs((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pythandle_redirects cKsd|jkodkns/d|j_|S|jjd k r]|jjj|jjn|jj dd}d|j kr~|jjdkr~|jjd7_t j dd t j }t|jd|d d|j_|j|j|jj}t|j|j|j|j|j|j|j|j|jd <|jj||}|jj|||_|Sd|j_|S( so Takes the given response and tries digest-auth, if needed. :rtype: requests.Response iiiswww-authenticateR/tdigestisdigest tflagstcountR'N(t status_codeR-R6R5R#trequesttbodytseekR(RRtlowertretcompilet IGNORECASERtsubR4tcontenttclosetcopyRt_cookiestrawtprepare_cookiesRjR[R\t connectiontsendthistorytappend(RRRlts_authtpattprept_r((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyt handle_401s.  $$   cCs|j|jjr8|j|j|j|jdR+R tbase64RtcompatRRRtcookiesRt_internal_utilsRtutilsRtCONTENT_TYPE_FORM_URLENCODEDtCONTENT_TYPE_MULTI_PARTRtobjectRRR)R*(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/auth.pyts$       ,PK! ; hooks.pyonu[ abc@s%dZdgZdZdZdS(s requests.hooks ~~~~~~~~~~~~~~ This module provides the capabilities for the Requests hooks system. Available hooks: ``response``: The response generated from a Request. tresponsecCstdtDS(Ncss|]}|gfVqdS(N((t.0tevent((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/hooks.pys s(tdicttHOOKS(((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/hooks.pyt default_hooksscKs{|p t}|j|}|rwt|dr?|g}nx5|D]*}|||}|dk rF|}qFqFWn|S(s6Dispatches a hook dictionary on a given piece of data.t__call__N(RtgetthasattrtNone(tkeythookst hook_datatkwargsthookt _hook_data((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/hooks.pyt dispatch_hooks   N(t__doc__RRR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/hooks.pyt s  PK!aww utils.pycnu[ Rec@s{dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddlmZddlmZddlmZddlmZdd lmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#dd l$m%Z%dd l&m'Z'dd l(m)Z)m*Z*m+Z+m,Z,dCZ-ej.Z/idd6dd6Z0ej1dkrdZ2dZndZ3dZ4e5dZ6dZ7dZ8dZ9dZ:dZ;dZ<e5dZ=d Z>d!Z?d"Z@d#ZAd$ZBd%ZCd&ZDd'ZEeFd(d)ZGd*ZHd+ZId,ZJd-ZKd.ZLd/ZMejNd0ZOd1ZPdd2ZRd3ZSd4d5ZTd6ZUd7ZVd8jWd9ZXeXd:ZYeXd;ZZd<Z[d=Z\d>Z]ej^d?Z_ej^d?Z`d@ZadAZbdBZcdS(Ds requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. iN(t OrderedDicti(t __version__(tcerts(tto_native_string(tparse_http_list(tquoteturlparsetbyteststrtunquotet getproxiest proxy_bypasst urlunparset basestringt integer_typestis_py3tproxy_bypass_environmenttgetproxies_environmenttMapping(tcookiejar_from_dict(tCaseInsensitiveDict(t InvalidURLt InvalidHeadertFileModeWarningtUnrewindableBodyErrors.netrct_netrciPthttpithttpstwin32cCsAy%trddl}n ddl}Wntk r9tSXyK|j|jd}t|j|dd}|j|dd}Wnt k rtSX| s| rtS|j d}x|D]w}|dkrd|krt Sn|j dd }|j d d }|j d d}t j||t jrt SqWtS( Nis;Software\Microsoft\Windows\CurrentVersion\Internet Settingst ProxyEnableit ProxyOverridet;st.s\.t*s.*t?(Rtwinregt_winregt ImportErrortFalsetOpenKeytHKEY_CURRENT_USERtintt QueryValueExtOSErrortsplittTruetreplacetretmatchtI(thostR#tinternetSettingst proxyEnablet proxyOverridettest((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytproxy_bypass_registry0s8         cCs!trt|St|SdS(sReturn True, if the host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. N(RRR7(R2((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyR Ws  cCs"t|dr|j}n|S(s/Returns an internal sequence dictionary update.titems(thasattrR8(td((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytdict_to_sequencecscCsd}d}t|dr*t|}nt|drE|j}nmt|dry|j}Wntjk rzqXtj|j}d|j krt j dt qnt|drty|j }Wn,ttfk r|dk rq|}qqqtXt|drt|dkrty3|jdd |j }|j|pIdWqqttfk rmd}qqXqtn|dkrd}ntd||S( Nit__len__tlentfilenotbs%Requests has determined the content-length for this request using the binary size of the file: however, the file has been opened in text mode (i.e. without the 'b' flag in the mode). This may lead to an incorrect content-length. In Requests 3.0, support will be removed for files in text mode.ttelltseeki(tNoneR9R=R>tiotUnsupportedOperationtostfstattst_sizetmodetwarningstwarnRR@R+tIOErrorRAtmax(tot total_lengthtcurrent_positionR>((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt super_lenls@       c CseyGddlm}m}d}x^tD]V}ytjjdj|}Wntk r_dSXtjj |r&|}Pq&q&W|dkrdSt |}d}t |t r|j d}n|jj|d} yG||j| } | r| drdnd} | | | d fSWn#|tfk rE|rFqFnXWnttfk r`nXdS( s;Returns the Requests tuple auth for a given url from netrc.i(tnetrctNetrcParseErrors~/{}Nt:tasciiiii(RQRRRBt NETRC_FILESREtpatht expandusertformattKeyErrortexistsRt isinstanceRtdecodetnetlocR,tauthenticatorsRKR%tAttributeError( turlt raise_errorsRQRRt netrc_pathtftloctritsplitstrR2Rtlogin_i((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_netrc_auths8    cCs[t|dd}|rWt|trW|ddkrW|ddkrWtjj|SdS(s0Tries to guess the filename of the given object.tnameitN(tgetattrRBR[R RERVtbasename(tobjRi((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytguess_filenames%cCs tjj|r|Stjj|\}}xJ|rztjj| rztjj|\}}dj||g}q1Wtj|s|Stj|}||jkr|St j }tjj||jd}tjj|s|j |d|}n|S(sReplace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged. t/RV( RERVRZR,tjointzipfilet is_zipfiletZipFiletnamelistttempfilet gettempdirtextract(RVtarchivetmembertprefixtzip_filettmptextracted_path((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytextract_zipped_pathss  cCsD|dkrdSt|ttttfr:tdnt|S(sTake an object and test to see if it can be represented as a dictionary. Unless it can not be represented as such, return an OrderedDict, e.g., :: >>> from_key_val_list([('key', 'val')]) OrderedDict([('key', 'val')]) >>> from_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples >>> from_key_val_list({'key': 'val'}) OrderedDict([('key', 'val')]) :rtype: OrderedDict s+cannot encode objects that are not 2-tuplesN(RBR[RRtboolR)t ValueErrorR(tvalue((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytfrom_key_val_lists  cCsb|dkrdSt|ttttfr:tdnt|trX|j}nt |S(sTake an object and test to see if it can be represented as a dictionary. If it can be, return a list of tuples, e.g., :: >>> to_key_val_list([('key', 'val')]) [('key', 'val')] >>> to_key_val_list({'key': 'val'}) [('key', 'val')] >>> to_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples :rtype: list s+cannot encode objects that are not 2-tuplesN( RBR[RRRR)RRR8tlist(R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytto_key_val_lists cCshg}x[t|D]M}|d |dko8dknrSt|dd!}n|j|qW|S(sParse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing. It basically works like :func:`parse_set_header` just that items may appear multiple times and case sensitivity is preserved. The return value is a standard :class:`list`: >>> parse_list_header('token, "quoted value"') ['token', 'quoted value'] To create a header from the :class:`list` again, use the :func:`dump_header` function. :param value: a string with a list header. :return: :class:`list` :rtype: list iit"(t_parse_list_headertunquote_header_valuetappend(Rtresulttitem((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytparse_list_header=s $cCsi}xt|D]~}d|kr5d||>> d = parse_dict_header('foo="is a fish", bar="as well"') >>> type(d) is dict True >>> sorted(d.items()) [('bar', 'as well'), ('foo', 'is a fish')] If there is no value for a key it will be `None`: >>> parse_dict_header('key_without_value') {'key_without_value': None} To create a header from the :class:`dict` again, use the :func:`dump_header` function. :param value: a string with a dict header. :return: :class:`dict` :rtype: dict t=iiRN(RRBR,R(RRRRi((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytparse_dict_header]s  $cCsq|rm|d|dko%dknrm|dd!}| sN|d dkrm|jddjddSn|S( sUnquotes a header value. (Reversal of :func:`quote_header_value`). This does not use the real unquoting but what browsers are actually using for quoting. :param value: the header value to unquote. :rtype: str iiRiis\\s\s\"(R.(Rt is_filename((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyRs * cCs+i}x|D]}|j||j]tflagss+]s$^<\?xml.*?encoding=["\']*(.+?)["\'>](RIRJtDeprecationWarningR/tcompileR1tfindall(tcontentt charset_ret pragma_retxml_re((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_encodings_from_contentsc Cs|jd}|dj|d}}i}d}x|D]}|j}|r=|t}}|jd} | dkr|| j|}|| dj|}n|||jdA}tjtjd|S(sConverts mask from /xx format to xxx.xxx.xxx.xxx Example: if mask is 24 function returns 255.255.255.0 :rtype: str Iii s>I(Rt inet_ntoaRtpack(tmaskR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyRwscCs-ytj|Wntjk r(tSXtS(s :rtype: bool (RRterrorR&R-(t string_ip((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytis_ipv4_addresss cCs|jddkryt|jdd}Wntk rFtSX|dks_|dkrctSytj|jddWqtjk rtSXntStS(sV Very simple check of the cidr format in no_proxy variable. :rtype: bool Rpii i( tcountR)R,RR&RRRR-(tstring_networkR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt is_valid_cidrs ccst|dk }|r4tjj|}|tj|}t|rt|j|rtSq|j|krtSqWq3|j}|j r|dj |j 7}nx6|D]+}|jj |s(|j |rtSqWnt d|;yt |j}Wn ttjfk rxt}nXWdQX|rtStS( sL Returns whether we should bypass proxies or not. :rtype: bool cSs(tjj|p'tjj|jS(N(RERRtupper(tk((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytRtno_proxycss|]}|r|VqdS(N((t.0R2((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pys st Rt,s:{}N(RBRthostnameR-R.R,RRRtportRXtendswithRR RRtgaierrorR&( R`Rt get_proxyt no_proxy_argtparsedtproxy_ipthost_with_portR2tbypass((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytshould_bypass_proxiess<   %      ! cCs!t|d|riStSdS(sA Return a dict of environment proxies. :rtype: dict RN(RR (R`R((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_environ_proxiesscCs|p i}t|}|jdkrC|j|j|jdS|jd|j|jd|jdg}d}x(|D] }||krz||}PqzqzW|S(sSelect a proxy for the url, if applicable. :param url: The url being for the request :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs talls://sall://N(RRRBRtscheme(R`tproxiesturlpartst proxy_keystproxyt proxy_key((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt select_proxys       spython-requestscCsd|tfS(sO Return a string representing the default user agent. :rtype: str s%s/%s(R(Ri((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytdefault_user_agentscCs2titd6djd d6dd6dd 6S( s9 :rtype: requests.structures.CaseInsensitiveDict s User-Agents, tgziptdeflatesAccept-Encodings*/*tAccepts keep-alivet Connection(R R (RR Rq(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytdefault_headers's  c Cs g}d}|j|}|s%|Sxtjd|D]}y|jdd\}}Wntk rz|d}}nXi|jdd6}xa|jdD]P}y|jd\}}Wntk rPnX|j|||j|; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" :rtype: list s '"s, * '"R`R(RR/R,RR( Rtlinkst replace_charstvalR`RtlinkRR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytparse_header_links3s&   sRTiicCs|d }|tjtjfkr&dS|d tjkr=dS|d tjtjfkr]dS|jt}|dkr|dS|dkr|d d dtkrd S|d d dtkrd Sn|dkr|d t krd S|d t krdSnd S(s :rtype: str isutf-32is utf-8-sigisutf-16isutf-8Ns utf-16-beis utf-16-les utf-32-bes utf-32-le( Rt BOM_UTF32_LEt BOM_UTF32_BEtBOM_UTF8t BOM_UTF16_LEt BOM_UTF16_BERt_nullt_null2t_null3RB(tdatatsamplet nullcount((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytguess_json_utf^s*    cCsSt||\}}}}}}|s7||}}nt||||||fS(sGiven a URL that may or may not have a scheme, prepend the given scheme. Does not replace a present scheme with the one provided as an argument. :rtype: str (RR (R`t new_schemeRR]RVRtquerytfragment((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytprepend_scheme_if_needed~s!cCsRt|}y"t|jt|jf}Wnttfk rMd}nX|S(s{Given a url with authentication components, extract them into a tuple of username,password. :rtype: (str,str) R(RR(RR tusernametpasswordR_R(R`Rtauth((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_auth_from_urls  " s^\S[^\r\n]*$|^$cCs|\}}t|tr$t}nt}y&|j|sOtd|nWn0tk rtd||t|fnXdS(sVerifies that header value is a string which doesn't contain leading whitespace or return characters. This prevents unintended header injection. :param header: tuple, in the format (name, value). s7Invalid return character or leading space in header: %ss>Value for header {%s: %s} must be of type str or bytes, not %sN(R[Rt_CLEAN_HEADER_REGEX_BYTEt_CLEAN_HEADER_REGEX_STRR0RRttype(RRiRtpat((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytcheck_header_validitys   cCsft|\}}}}}}|s4||}}n|jddd}t|||||dfS(sW Given a url remove the fragment and the authentication part. :rtype: str t@iiR(RtrsplitR (R`RR]RVRR"R#((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt urldefragauths cCs}t|jdd}|dk rmt|jtrmy||jWqyttfk ritdqyXn tddS(sfMove file pointer back to its recorded starting position so it can be read again on redirect. RAs;An error occurred when rewinding request body for redirect.s+Unable to rewind request body for redirect.N( RltbodyRBR[t_body_positionRRKR+R(tprepared_requestt body_seek((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt rewind_bodys(s.netrcR(dt__doc__Rt contextlibRCRER/RRtsysRvRIRrt collectionsRRRRt_internal_utilsRtcompatRRRRRRR R R R R RRRRRtcookiesRt structuresRt exceptionsRRRRRUtwheretDEFAULT_CA_BUNDLE_PATHt DEFAULT_PORTStplatformR7R;RPR&RhRoRRRRRRRRRRRRRRt frozensetRRRRRRRtcontextmanagerRRRBRR R RRtencodeRRRR R$R(RR)R*R-R0R5(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt s           ^"  ' = 3    #       %      =  &      PK!jFKK__version__.pyonu[ abc@s@dZdZdZdZdZdZdZdZdZd Z d S( trequestssPython HTTP for Humans.shttp://python-requests.orgs2.18.4is Kenneth Reitzsme@kennethreitz.orgs Apache 2.0sCopyright 2017 Kenneth Reitzu ✨ 🍰 ✨N( t __title__t__description__t__url__t __version__t __build__t __author__t__author_email__t __license__t __copyright__t__cake__(((sD/usr/lib/python2.7/site-packages/pip/_vendor/requests/__version__.pytsPK!$R#R#exceptions.pycnu[ Rec@s,dZddlmZdefdYZdefdYZdefdYZd efd YZd efd YZd efdYZ dee fdYZ de fdYZ defdYZ defdYZ deefdYZdeefdYZdeefdYZdeefdYZdefd YZd!efd"YZd#eefd$YZd%eefd&YZd'efd(YZd)efd*YZd+efd,YZd-eefd.YZd/efd0YZd1S(2s` requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. i(t HTTPErrortRequestExceptioncBseZdZdZRS(sTThere was an ambiguous exception that occurred while handling your request. cOs|jdd}||_|jdd|_|dk rg|j rgt|drg|jj|_ntt|j||dS(sBInitialize RequestException with `request` and `response` objects.tresponsetrequestN(tpoptNoneRRthasattrtsuperRt__init__(tselftargstkwargsR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRs (t__name__t __module__t__doc__R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR sRcBseZdZRS(sAn HTTP error occurred.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRstConnectionErrorcBseZdZRS(sA Connection error occurred.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR st ProxyErrorcBseZdZRS(sA proxy error occurred.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR$stSSLErrorcBseZdZRS(sAn SSL error occurred.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR(stTimeoutcBseZdZRS(sThe request timed out. Catching this error will catch both :exc:`~requests.exceptions.ConnectTimeout` and :exc:`~requests.exceptions.ReadTimeout` errors. (R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR,stConnectTimeoutcBseZdZRS(sThe request timed out while trying to connect to the remote server. Requests that produced this error are safe to retry. (R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR5st ReadTimeoutcBseZdZRS(s@The server did not send any data in the allotted amount of time.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR<st URLRequiredcBseZdZRS(s*A valid URL is required to make a request.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR@stTooManyRedirectscBseZdZRS(sToo many redirects.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRDst MissingSchemacBseZdZRS(s/The URL schema (e.g. http or https) is missing.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRHst InvalidSchemacBseZdZRS(s"See defaults.py for valid schemas.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRLst InvalidURLcBseZdZRS(s%The URL provided was somehow invalid.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRPst InvalidHeadercBseZdZRS(s.The header value provided was somehow invalid.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRTstInvalidProxyURLcBseZdZRS(s"The proxy URL provided is invalid.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRXstChunkedEncodingErrorcBseZdZRS(s?The server declared chunked encoding but sent an invalid chunk.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR\stContentDecodingErrorcBseZdZRS(s"Failed to decode response content.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR`stStreamConsumedErrorcBseZdZRS(s3The content for this response was already consumed.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRdst RetryErrorcBseZdZRS(sCustom retries logic failed(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRhstUnrewindableBodyErrorcBseZdZRS(s;Requests encountered an error when trying to rewind a body.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR lstRequestsWarningcBseZdZRS(sBase warning for Requests.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR!rstFileModeWarningcBseZdZRS(sJA file was opened in text mode, but Requests determined its binary length.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR"vstRequestsDependencyWarningcBseZdZRS(s@An imported dependency doesn't match the expected version range.(R R R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR#zsN(Rtpip._vendor.urllib3.exceptionsRt BaseHTTPErrortIOErrorRRRRRRRRRt ValueErrorRRRRRRRt TypeErrorRRR tWarningR!tDeprecationWarningR"R#(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyts0 PK!LĜ\bb sessions.pycnu[ Rec@s(dZddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z m Z mZmZddlmZmZmZmZdd lmZmZmZdd lmZmZdd lmZdd lmZm Z m!Z!dd l"m#Z#m$Z$m%Z%m&Z&ddl'm(Z(ddl)m*Z*ddlm+Z+m,Z,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2ddlm3Z3ej4dkry ej5Z6Wne7k rej8Z6nXn ejZ6edZ9edZ:de;fdYZ<de<fdYZ=dZ>dS(s requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). iN(t timedelta(t OrderedDicti(t_basic_auth_str(t cookielibtis_py3turljointurlparsetMapping(tcookiejar_from_dicttextract_cookies_to_jartRequestsCookieJart merge_cookies(tRequesttPreparedRequesttDEFAULT_REDIRECT_LIMIT(t default_hookst dispatch_hook(tto_native_string(tto_key_val_listtdefault_headerst DEFAULT_PORTS(tTooManyRedirectst InvalidSchematChunkedEncodingErrortContentDecodingError(tCaseInsensitiveDict(t HTTPAdapter(t requote_uritget_environ_proxiestget_netrc_authtshould_bypass_proxiestget_auth_from_urlt rewind_body(tcodes(tREDIRECT_STATItwin32cCs|dkr|S|dkr |St|to;t|tsB|S|t|}|jt|g|jD]\}}|dkrt|^qt}x|D] }||=qW|S(sDetermines appropriate setting for a given request, taking into account the explicit setting on that request, and the setting in the session. If a setting is a dictionary, they will be merged together using `dict_class` N(tNonet isinstanceRRtupdatetitems(trequest_settingtsession_settingt dict_classtmerged_settingtktvt none_keystkey((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt merge_setting2s  1  cCsZ|dks!|jdgkr%|S|dksF|jdgkrJ|St|||S(sProperly merges both requests and session hooks. This is necessary because when request_hooks == {'response': []}, the merge breaks Session hooks entirely. tresponseN(R$tgetR0(t request_hookst session_hooksR*((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt merge_hooksQs !!tSessionRedirectMixincBsPeZdZdZededdedZdZdZ dZ RS(cCs?|jr;|jd}tr.|jd}nt|dSdS(s7Receives a Response. Returns a redirect URI or ``None``tlocationtlatin1tutf8N(t is_redirecttheadersRtencodeRR$(tselftrespR7((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytget_redirect_targetbs    cCst|}t|}|j|jkr.tS|jdkrn|jdkrn|jdkrn|jdkrntS|j|jk}|j|jk}tj|jddf}| r|j|kr|j|krtS|p|S(sFDecide whether Authorization header should be removed when redirectingthttpiPthttpsiN(iPN(iN( RthostnametTruetschemetportR$tFalseRR2(R=told_urltnew_urlt old_parsedt new_parsedt changed_porttchanged_schemet default_port((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytshould_strip_authws  c ks4g} |j|} t|jj} x| r/|j} | j|| d|_y |jWn-tt t fk r|j j dt nXt|j|jkrtdj|jd|n|j| jdrt|j}djt|j| g} nt| }|jdkrI| rI|jd| }n|jr^|j} n|j} |jst|jt| } n t| } t| | _|j| ||jtjtj fkr d}x!|D]}| j!j"|dqWd| _$n| j!}|j"d dt%| j&||j t'| j&|j(| j)| j&|j*| |}|j+| || j,dk od |kpd |k}|rt-| n| }|r|Vq*|j.|d |d|d|d|d|dt | }t%|j(| |j |j|} |Vq*WdS(sBReceives a Response. Returns a generator of Responses or Requests.itdecode_contentsExceeded {} redirects.R1s//t:ttfragmentsContent-Lengths Content-TypesTransfer-EncodingtCookietstreamttimeouttverifytcerttproxiestallow_redirectsN(sContent-Lengths Content-TypesTransfer-Encoding(/R?RturlRRtcopytappendthistorytcontentRRt RuntimeErrortrawtreadRFtlent max_redirectsRtformattcloset startswithtjoinRRDt_replacetgeturltnetlocRRtrebuild_methodt status_codeR!ttemporary_redirecttpermanent_redirectR;tpopR$tbodyR t_cookiesR tcookiestprepare_cookiestrebuild_proxiest rebuild_autht_body_positionR tsend(R=R>treqRTRURVRWRXtyield_requeststadapter_kwargsthistRZtprevious_fragmenttprepared_requestt parsed_rurltparsedtpurged_headerstheaderR;t rewindable((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytresolve_redirectssv     ! !           cCs{|j}|j}d|kr@|j|jj|r@|d=n|jrUt|nd}|dk rw|j|ndS(sWhen being redirected we may want to strip authentication from the request to avoid leaking credentials. This method intelligently removes and reapplies authentication where possible to avoid credential loss. t AuthorizationN(R;RZRNtrequestt trust_envRR$t prepare_auth(R=R}R1R;RZtnew_auth((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRus  $  c Cs5|dk r|ni}|j}|j}t|j}|j}|jd}t|d|}|jr| rt |d|} | j|| jd} | r|j || qnd|kr|d=nyt ||\} } Wnt k rd\} } nX| r1| r1t | | |d>> import requests >>> s = requests.Session() >>> s.get('https://httpbin.org/get') Or as a context manager:: >>> with requests.Session() as s: ... s.get('https://httpbin.org/get') R;RrtauthRXthookstparamsRVRWtadaptersRTRRccCst|_d|_i|_t|_i|_t|_ t |_ d|_ t |_t |_ti|_t|_|jdt|jdtdS(Nshttps://shttp://(RR;R$RRXRRRRFRTRCRVRWRRcRRRrRRtmountR(R=((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt__init__js           cCs|S(N((R=((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt __enter__scGs|jdS(N(Re(R=targs((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt__exit__scCs*|jp i}t|tjs0t|}nttt|j|}|j}|jr| r|j rt |j }nt }|j d|j jd|j d|jd|jd|jdt|j|jdtdt|j|jd t||jd |d t|j|j |S( sConstructs a :class:`PreparedRequest ` for transmission and returns it. The :class:`PreparedRequest` has settings merged from the :class:`Request ` instance and those of the :class:`Session`. :param request: :class:`Request` instance to prepare with this session's settings. :rtype: requests.PreparedRequest RRZtfilestdatatjsonR;R*RRRrR(RrR%Rt CookieJarRR R RRRRZR tprepareRtupperRRRR0R;RRR5R(R=RRrtmerged_cookiesRtp((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytprepare_requests*        cCstd|jd|d|d|d|p-id|d|p?id|d |d | }|j|}| poi} |j|j| | ||}i| d 6| d 6}|j||j||}|S( sConstructs a :class:`Request `, prepares it and sends it. Returns :class:`Response ` object. :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'filename': file-like-objects`` for multipart encoding upload. :param auth: (optional) Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Set to True by default. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol or protocol and hostname to the URL of the proxy. :param stream: (optional) whether to immediately download the response content. Defaults to ``False``. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :rtype: requests.Response RRZR;RRRRRRrRRURY(R RRtmerge_environment_settingsRZR&Rw(R=RRZRRR;RrRRRURYRXRRTRVRWRRxtpreptsettingst send_kwargsR>((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRs*)       cKs#|jdt|jd||S(sSends a GET request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RYR(RRCR(R=RZtkwargs((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyR2scKs#|jdt|jd||S(sSends a OPTIONS request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RYtOPTIONS(RRCR(R=RZR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytoptions!scKs#|jdt|jd||S(sSends a HEAD request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RYR(RRFR(R=RZR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pythead,scKs|jd|d|d||S(sSends a POST request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RRR(R(R=RZRRR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytpost7s cKs|jd|d||S(suSends a PUT request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response tPUTR(R(R=RZRR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytputDs cKs|jd|d||S(swSends a PATCH request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response tPATCHR(R(R=RZRR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytpatchPs cKs|jd||S(sSends a DELETE request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response tDELETE(R(R=RZR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytdelete\sc Ks |jd|j|jd|j|jd|j|jd|jt|trjtdn|jdt }|j d}|j }|j d|j }t}|j||}t|} td| |_td |||}|jr1x-|jD]} t|j| j| jq Wnt|j||j|r~|j|||} g| D] } | ^qi} ng} | r| jd || j}| |_n|sy(t|j||d t ||_Wqtk rqXn|s|jn|S( sISend a given PreparedRequest. :rtype: requests.Response RTRVRWRXs#You can only send PreparedRequests.RYRZtsecondsR1iRy(RRTRVRWRXR%R t ValueErrorRoRCR2Rt get_adapterRZtpreferred_clockRwRtelapsedRR]R RrRR`Rtinserttnextt_nextt StopIterationR^( R=RRRYRTRtadaptertstarttrRR>tgenR]((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRwfsF       (  c Cs|jr|dk r$|jdnd}t|d|}x*|jD]\}} |j|| qIW|tks|dkrtjjdptjjd}qnt ||j }t ||j }t ||j }t ||j }i|d6|d6|d6|d6S( s^ Check the environment and merge it with some settings. :rtype: dict RtREQUESTS_CA_BUNDLEtCURL_CA_BUNDLERVRXRTRWN(RR$R2RR'RRCtostenvironR0RXRTRVRW( R=RZRXRTRVRWRt env_proxiesR,R-((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRs !cCsXx<|jjD]+\}}|jj|jr|SqWtdj|dS(s~ Returns the appropriate connection adapter for the given URL. :rtype: requests.adapters.BaseAdapter s*No connection adapters were found for {!r}N(RR'tlowerRfRRd(R=RZtprefixR((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRscCs(x!|jjD]}|jqWdS(s+Closes all adapters and as such the sessionN(RtvaluesRe(R=R-((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRescCso||j|s (t __attrs__(R=tstate((R=s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt __getstate__scCs1x*|jD]\}}t|||q WdS(N(R'tsetattr(R=RRtvalue((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt __setstate__sN(RRt__doc__RRRRRR$RCRR2RRRRRRRwRRReRRR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRQs2   7   ) D  K    cCstS(sZ Returns a :class:`Session` for context-management. .. deprecated:: 1.0.0 This method has been deprecated since version 1.0.0 and is only kept for backwards compatibility. New code should use :class:`~requests.sessions.Session` to create a session. This may be removed at a future date. :rtype: Session (R(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytsessions (?RRtsysttimetdatetimeRt collectionsRRRtcompatRRRRRRrRR R R tmodelsR R RRRRt_internal_utilsRtutilsRRRt exceptionsRRRRt structuresRRRRRRRRR t status_codesR!R"tplatformt perf_counterRtAttributeErrortclockR0R5tobjectR6RR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt s<   ("".     PK!\++structures.pyonu[ abc@sUdZddlZddlmZdejfdYZdefdYZdS( sO requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. iNi(t OrderedDicttCaseInsensitiveDictcBskeZdZd dZdZdZdZdZdZ dZ dZ d Z d Z RS( sA case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive:: cid = CaseInsensitiveDict() cid['Accept'] = 'application/json' cid['aCCEPT'] == 'application/json' # True list(cid) == ['Accept'] # True For example, ``headers['content-encoding']`` will return the value of a ``'Content-Encoding'`` response header, regardless of how the header name was originally stored. If the constructor, ``.update``, or equality comparison operations are given keys that have equal ``.lower()``s, the behavior is undefined. cKs5t|_|dkr!i}n|j||dS(N(Rt_storetNonetupdate(tselftdatatkwargs((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__init__*s   cCs||f|j|j<s(Rtvalues(R((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__iter__;scCs t|jS(N(tlenR(R((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__len__>scCsd|jjDS(s.Like iteritems(), but with all lowercase keys.css%|]\}}||dfVqdS(iN((Rtlowerkeytkeyval((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pys Ds(Rtitems(R((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt lower_itemsAscCsGt|tjr!t|}ntSt|jt|jkS(N(t isinstancet collectionstMappingRtNotImplementedtdictR(Rtother((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__eq__IscCst|jjS(N(RRR(R((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pytcopyRscCstt|jS(N(tstrRR(R((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyt__repr__UsN(t__name__t __module__t__doc__RRR R RRRRR R!R#(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyRs        t LookupDictcBs8eZdZddZdZdZddZRS(sDictionary lookup object.cCs ||_tt|jdS(N(tnametsuperR'R(RR(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyR\s cCs d|jS(Ns (R((R((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyR#`scCs|jj|dS(N(t__dict__tgetR(RR ((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyR cscCs|jj||S(N(R*R+(RR tdefault((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyR+hsN(R$R%R&RRR#R R+(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyR'Ys    (R&RtcompatRtMutableMappingRRR'(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/structures.pyts JPK!Nexceptions.pyonu[ abc@sdZddlmZdefdYZdefdYZdefdYZd efd YZd efd YZd efdYZ dee fdYZ de fdYZ defdYZ defdYZ deefdYZdeefdYZdeefdYZdeefdYZdefd YZd!eefd"YZd#eefd$YZd%efd&YZd'efd(YZd)efd*YZd+eefd,YZd-efd.YZd/S(0s` requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. i(t HTTPErrortRequestExceptioncBseZdZdZRS(sTThere was an ambiguous exception that occurred while handling your request. cOs|jdd}||_|jdd|_|dk rg|j rgt|drg|jj|_ntt|j||dS(sBInitialize RequestException with `request` and `response` objects.tresponsetrequestN(tpoptNoneRRthasattrtsuperRt__init__(tselftargstkwargsR((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRs (t__name__t __module__t__doc__R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR sRcBseZdZRS(sAn HTTP error occurred.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRstConnectionErrorcBseZdZRS(sA Connection error occurred.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR st ProxyErrorcBseZdZRS(sA proxy error occurred.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR$stSSLErrorcBseZdZRS(sAn SSL error occurred.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR(stTimeoutcBseZdZRS(sThe request timed out. Catching this error will catch both :exc:`~requests.exceptions.ConnectTimeout` and :exc:`~requests.exceptions.ReadTimeout` errors. (R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR,stConnectTimeoutcBseZdZRS(sThe request timed out while trying to connect to the remote server. Requests that produced this error are safe to retry. (R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR5st ReadTimeoutcBseZdZRS(s@The server did not send any data in the allotted amount of time.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR<st URLRequiredcBseZdZRS(s*A valid URL is required to make a request.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR@stTooManyRedirectscBseZdZRS(sToo many redirects.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRDst MissingSchemacBseZdZRS(s/The URL schema (e.g. http or https) is missing.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRHst InvalidSchemacBseZdZRS(s"See defaults.py for valid schemas.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRLst InvalidURLcBseZdZRS(s%The URL provided was somehow invalid.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRPst InvalidHeadercBseZdZRS(s.The header value provided was somehow invalid.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRTstChunkedEncodingErrorcBseZdZRS(s?The server declared chunked encoding but sent an invalid chunk.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRXstContentDecodingErrorcBseZdZRS(s!Failed to decode response content(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR\stStreamConsumedErrorcBseZdZRS(s2The content for this response was already consumed(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR`st RetryErrorcBseZdZRS(sCustom retries logic failed(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRdstUnrewindableBodyErrorcBseZdZRS(s:Requests encountered an error when trying to rewind a body(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyRhstRequestsWarningcBseZdZRS(sBase warning for Requests.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR nstFileModeWarningcBseZdZRS(sJA file was opened in text mode, but Requests determined its binary length.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR!sstRequestsDependencyWarningcBseZdZRS(s@An imported dependency doesn't match the expected version range.(R R R(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyR"xsN(Rtpip._vendor.urllib3.exceptionsRt BaseHTTPErrortIOErrorRRRRRRRRRt ValueErrorRRRRRRt TypeErrorRRRtWarningR tDeprecationWarningR!R"(((sC/usr/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.pyts. PK!-6QQ adapters.pycnu[ Rec@sgdZddlZddlZddlmZmZddlmZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!m"Z"ddl#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0m1Z1m2Z2mZmZm3Z3m4Z4m5Z5m6Z6ddl7m8Z8yddl9m:Z:Wne;k rdZ:nXe<Z=dZ>dZ?dZAdeBfd YZCd!eCfd"YZDdS(#s requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. iN(t PoolManagertproxy_from_url(t HTTPResponse(t parse_url(tTimeout(tRetry(tClosedPoolError(tConnectTimeoutError(t HTTPError(t MaxRetryError(tNewConnectionError(t ProxyError(t ProtocolError(tReadTimeoutError(tSSLError(t ResponseError(tLocationValueErrori(tResponse(turlparset basestring(tDEFAULT_CA_BUNDLE_PATHtextract_zipped_pathstget_encoding_from_headerstprepend_scheme_if_neededtget_auth_from_urlt urldefragautht select_proxy(tCaseInsensitiveDict(textract_cookies_to_jar( tConnectionErrortConnectTimeoutt ReadTimeoutRR t RetryErrort InvalidSchematInvalidProxyURLt InvalidURL(t_basic_auth_str(tSOCKSProxyManagercOstddS(Ns'Missing dependencies for SOCKS support.(R!(targstkwargs((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR%.si it BaseAdaptercBs8eZdZdZededddZdZRS(sThe Base Transport AdaptercCstt|jdS(N(tsuperR(t__init__(tself((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR*:scCs tdS(sCSends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. N(tNotImplementedError(R+trequesttstreamttimeouttverifytcerttproxies((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytsend=scCs tdS(s!Cleans up adapter specific items.N(R,(R+((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytcloseOsN( t__name__t __module__t__doc__R*tFalsetNonetTrueR3R4(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR(7s   t HTTPAdaptercBseZdZdddddgZeeeedZdZdZ ed Z d Z d Z d Z dd ZdZdZdZdZededddZRS(sThe built-in HTTP Adapter for urllib3. Provides a general-case interface for Requests sessions to contact HTTP and HTTPS urls by implementing the Transport Adapter interface. This class will usually be created by the :class:`Session ` class under the covers. :param pool_connections: The number of urllib3 connection pools to cache. :param pool_maxsize: The maximum number of connections to save in the pool. :param max_retries: The maximum number of retries each connection should attempt. Note, this applies only to failed DNS lookups, socket connections and connection timeouts, never to requests where data has made it to the server. By default, Requests does not retry failed connections. If you need granular control over the conditions under which we retry a request, import urllib3's ``Retry`` class and pass that instead. :param pool_block: Whether the connection pool should block for connections. Usage:: >>> import requests >>> s = requests.Session() >>> a = requests.adapters.HTTPAdapter(max_retries=3) >>> s.mount('http://', a) t max_retriestconfigt_pool_connectionst _pool_maxsizet _pool_blockcCs|tkr$tddt|_ntj||_i|_i|_tt|j ||_ ||_ ||_ |j ||d|dS(Nitreadtblock(tDEFAULT_RETRIESRR8R<tfrom_intR=t proxy_managerR)R;R*R>R?R@tinit_poolmanager(R+tpool_connectionst pool_maxsizeR<t pool_block((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR*qs      csfdjDS(Ncs%i|]}t|d|qS(N(tgetattrR9(t.0tattr(R+(s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pys s (t __attrs__(R+((R+s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt __getstate__scCsbi|_i|_x*|jD]\}}t|||qW|j|j|jd|jdS(NRB(RER=titemstsetattrRFR>R?R@(R+tstateRLtvalue((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt __setstate__s   c KsF||_||_||_td|d|d|dt||_dS(sInitializes a urllib3 PoolManager. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param connections: The number of urllib3 connection pools to cache. :param maxsize: The maximum number of connections to save in the pool. :param block: Block when no free connections are available. :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager. t num_poolstmaxsizeRBtstrictN(R>R?R@RR:t poolmanager(R+t connectionsRURBt pool_kwargs((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyRFs   c Ks||jkr|j|}n|jjdrt|\}}t|d|d|d|jd|jd|j|}|j|`. :param proxy: The proxy to return a urllib3 ProxyManager for. :param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager. :returns: ProxyManager :rtype: urllib3.ProxyManager tsockstusernametpasswordRTRURBt proxy_headers( REtlowert startswithRR%R>R?R@R]R(R+tproxyt proxy_kwargstmanagerR[R\R]((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytproxy_manager_fors*     cCs|jjdr|rd }|tk r6|}n|sKtt}n| setjj| r}t dj |nd|_ tjj |s||_ q||_nd|_ d |_ d |_|rt|ts|d|_|d|_n||_d |_|jrItjj|j rIt dj |jn|jrtjj|j rt dj |jqnd S( sAVerify a SSL certificate. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param conn: The urllib3 connection object associated with the cert. :param url: The requested URL. :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: The SSL certificate to verify. thttpssECould not find a suitable TLS CA certificate bundle, invalid path: {}t CERT_REQUIREDt CERT_NONEiis9Could not find the TLS certificate file, invalid path: {}s1Could not find the TLS key file, invalid path: {}N(R^R_R9R:RRtostpathtexiststIOErrortformatt cert_reqstisdirtca_certst ca_cert_dirt isinstanceRt cert_filetkey_file(R+tconnturlR0R1tcert_loc((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt cert_verifys8               cCst}t|dd|_tt|di|_t|j|_||_|jj |_ t |j t r|j j d|_ n |j |_ t|j||||_||_|S(sBuilds a :class:`Response ` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter ` :param req: The :class:`PreparedRequest ` used to generate the response. :param resp: The urllib3 response object. :rtype: requests.Response tstatustheaderssutf-8N(RRJR9t status_codeRRxRtencodingtrawtreasonRpRttbytestdecodeRtcookiesR-t connection(R+treqtresptresponse((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytbuild_responses     cCst||}|rit|d}t|}|jsHtdn|j|}|j|}n*t|}|j}|j j|}|S(sReturns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param url: The URL to connect to. :param proxies: (optional) A Requests-style dictionary of proxies used on this request. :rtype: urllib3.ConnectionPool thttpsFPlease check proxy URL. It is malformed and could be missing the host.( RRRthostR"Rctconnection_from_urlRtgeturlRW(R+RtR2R`t proxy_urlRERstparsed((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytget_connection$s     cCs5|jjx!|jjD]}|jqWdS(sDisposes of any internal state. Currently, this closes the PoolManager and any active ProxyManager, which closes any pooled connections. N(RWtclearREtvalues(R+R`((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR4?s c Cst|j|}t|jj}|o3|dk}t}|rit|jj}|jd}n|j}|r| rt|j}n|S(s?Obtain the url to use when making the final request. If the message is being sent through a HTTP proxy, the full URL has to be used. Otherwise, we should only use the path portion of the URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` being sent. :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs. :rtype: str RdRZ( RRtRtschemeR8R^R_tpath_urlR( R+R-R2R`Rtis_proxied_http_requesttusing_socks_proxyt proxy_schemeRt((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt request_urlIs  cKsdS(s"Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter `. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` to add headers to. :param kwargs: The keyword arguments from the call to send(). N((R+R-R'((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt add_headersfs cCs8i}t|\}}|r4t|||d`. :param proxy: The url of the proxy being used for this request. :rtype: dict sProxy-Authorization(RR$(R+R`RxR[R\((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR]ts cCsy|j|j|}Wn%tk r@}t|d|nX|j||j|||j||} |j|d|d|d|d|d||jdkpd|j k } t |t ry%|\} } t d| d | }WqEt k r}d j|} t | qEXn't |t r0nt d|d |}y| s|jd |jd | d |jd|j dtdtdtdtd|jd| }nft|dr|j}n|jdt}y"|j|j| dtx-|j jD]\}}|j||qW|jx^|jD]S}|jtt|djd|jd|j||jdq2W|jdy|j dt}Wnt!k r|j }nXt"j#|d|d|dtdt}Wn|j$nXWnt%t&j'fk r<} t(| d|n{t)k r}t |j*t+rt |j*t,st-|d|qnt |j*t.rt/|d|nt |j*t0rt1|d|nt |j*t2rt3|d|nt(|d|nt4k r5}t(|d|nt0k rS}t1|ndt2t5fk r}t |t2rt3|d|qt |t6rt7|d|qnX|j8||S(sSends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response R-R.R/R0R1R2sContent-LengthtconnectRAsrInvalid timeout {}. Pass a (connect, read) timeout tuple, or a single float to set both timeouts to the same valuetmethodRttbodyRxtredirecttassert_same_hosttpreload_contenttdecode_contenttretriest proxy_pooltskip_accept_encodingisutf-8s s0 t bufferingtpoolRN(9RRtRR#RvRRRR9RxRpttuplet TimeoutSaucet ValueErrorRkturlopenRR8R<thasattrRt _get_conntDEFAULT_POOL_TIMEOUTt putrequestR:ROt putheadert endheadersR3thextlentencodet getresponset TypeErrorRt from_httplibR4R tsocketterrorRR R|RR RRR t _ProxyErrorR t _SSLErrorRRt _HTTPErrorR RR(R+R-R.R/R0R1R2RsteRttchunkedRRAterrRtlow_conntheaderRRtitr((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR3s+           &       N(R5R6R7RMtDEFAULT_POOLSIZERCtDEFAULT_POOLBLOCKR*RNRSRFRcRvRR9RR4RRR]R8R:R3(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR;Ts$      % 4 %    (ER7tos.pathRgRtpip._vendor.urllib3.poolmanagerRRtpip._vendor.urllib3.responseRtpip._vendor.urllib3.utilRRRtpip._vendor.urllib3.util.retryRtpip._vendor.urllib3.exceptionsRRRRR R R RR R RRRRtmodelsRtcompatRRtutilsRRRRRRRt structuresRRRt exceptionsRRRR R!R"R#tauthR$t!pip._vendor.urllib3.contrib.socksR%t ImportErrorR8RRRCR9RtobjectR(R;(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt sF  4@  PK!wL&d&d utils.pyonu[ abc@s\dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddl mZddlmZddlmZddlmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!dd l"m#Z#dd l$m%Z%dd l&m'Z'm(Z(m)Z)m*Z*d@Z+ej,Z-idd6dd6Z.ej/dkrdZ0dZndZ1dZ2e3dZ4dZ5dZ6dZ7dZ8dZ9e3dZ:dZ;dZ<d Z=d!Z>d"Z?d#Z@d$ZAeBd%d&ZCd'ZDd(ZEd)ZFd*ZGd+ZHd,ZIejJd-ZKd.ZLdd/ZNd0ZOd1d2ZPd3ZQd4ZRd5jSd6ZTeTd7ZUeTd8ZVd9ZWd:ZXd;ZYejZd<Z[ejZd<Z\d=Z]d>Z^d?Z_dS(As requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. iNi(t __version__(tcerts(tto_native_string(tparse_http_list(tquoteturlparsetbyteststrt OrderedDicttunquotet getproxiest proxy_bypasst urlunparset basestringt integer_typestis_py3tproxy_bypass_environmenttgetproxies_environment(tcookiejar_from_dict(tCaseInsensitiveDict(t InvalidURLt InvalidHeadertFileModeWarningtUnrewindableBodyErrors.netrct_netrciPthttpithttpstWindowscCs"trddl}n ddl}yE|j|jd}|j|dd}|j|dd}Wntk rztSX| s| rtS|jd}x|D]w}|dkrd|krt Sn|j dd }|j d d }|j d d}t j ||t j rt SqWtS( Nis;Software\Microsoft\Windows\CurrentVersion\Internet Settingst ProxyEnableit ProxyOverridet;st.s\.t*s.*t?(Rtwinregt_winregtOpenKeytHKEY_CURRENT_USERt QueryValueExtOSErrortFalsetsplittTruetreplacetretmatchtI(thostR"tinternetSettingst proxyEnablet proxyOverridettest((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytproxy_bypass_registry.s2          cCs!trt|St|SdS(sReturn True, if the host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. N(RRR4(R/((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyR Os  cCs"t|dr|j}n|S(s/Returns an internal sequence dictionary update.titems(thasattrR5(td((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytdict_to_sequence[scCsd}d}t|dr*t|}nt|drE|j}nmt|dry|j}Wntjk rzqXtj|j}d|j krt j dt qnt|drty|j }Wn,ttfk r|dk rq|}qqqtXt|drt|dkrty3|jdd |j }|j|pIdWqqttfk rmd}qqXqtn|dkrd}ntd||S( Nit__len__tlentfilenotbs%Requests has determined the content-length for this request using the binary size of the file: however, the file has been opened in text mode (i.e. without the 'b' flag in the mode). This may lead to an incorrect content-length. In Requests 3.0, support will be removed for files in text mode.ttelltseeki(tNoneR6R:R;tiotUnsupportedOperationtostfstattst_sizetmodetwarningstwarnRR=R'tIOErrorR>tmax(tot total_lengthtcurrent_positionR;((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt super_lends@       c CseyGddlm}m}d}x^tD]V}ytjjdj|}Wntk r_dSXtjj |r&|}Pq&q&W|dkrdSt |}d}t |t r|j d}n|jj|d} yG||j| } | r| drdnd} | | | d fSWn#|tfk rE|rFqFnXWnttfk r`nXdS( s;Returns the Requests tuple auth for a given url from netrc.i(tnetrctNetrcParseErrors~/{0}Nt:tasciiiii(RNROR?t NETRC_FILESRBtpatht expandusertformattKeyErrortexistsRt isinstanceRtdecodetnetlocR)tauthenticatorsRHt ImportErrortAttributeError( turlt raise_errorsRNROt netrc_pathtftloctritsplitstrR/Rtlogin_i((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_netrc_auths8    cCs[t|dd}|rWt|trW|ddkrW|ddkrWtjj|SdS(s0Tries to guess the filename of the given object.tnameitN(tgetattrR?RXR RBRStbasename(tobjRg((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytguess_filenames%cCsD|dkrdSt|ttttfr:tdnt|S(sTake an object and test to see if it can be represented as a dictionary. Unless it can not be represented as such, return an OrderedDict, e.g., :: >>> from_key_val_list([('key', 'val')]) OrderedDict([('key', 'val')]) >>> from_key_val_list('string') ValueError: need more than 1 value to unpack >>> from_key_val_list({'key': 'val'}) OrderedDict([('key', 'val')]) :rtype: OrderedDict s+cannot encode objects that are not 2-tuplesN(R?RXRRtbooltintt ValueErrorR(tvalue((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytfrom_key_val_lists  cCse|dkrdSt|ttttfr:tdnt|tjr[|j }nt |S(sTake an object and test to see if it can be represented as a dictionary. If it can be, return a list of tuples, e.g., :: >>> to_key_val_list([('key', 'val')]) [('key', 'val')] >>> to_key_val_list({'key': 'val'}) [('key', 'val')] >>> to_key_val_list('string') ValueError: cannot encode objects that are not 2-tuples. :rtype: list s+cannot encode objects that are not 2-tuplesN( R?RXRRRnRoRpt collectionstMappingR5tlist(Rq((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytto_key_val_lists cCshg}x[t|D]M}|d |dko8dknrSt|dd!}n|j|qW|S(sParse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing. It basically works like :func:`parse_set_header` just that items may appear multiple times and case sensitivity is preserved. The return value is a standard :class:`list`: >>> parse_list_header('token, "quoted value"') ['token', 'quoted value'] To create a header from the :class:`list` again, use the :func:`dump_header` function. :param value: a string with a list header. :return: :class:`list` :rtype: list iit"(t_parse_list_headertunquote_header_valuetappend(Rqtresulttitem((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytparse_list_headers $cCsi}xt|D]~}d|kr5d||>> d = parse_dict_header('foo="is a fish", bar="as well"') >>> type(d) is dict True >>> sorted(d.items()) [('bar', 'as well'), ('foo', 'is a fish')] If there is no value for a key it will be `None`: >>> parse_dict_header('key_without_value') {'key_without_value': None} To create a header from the :class:`dict` again, use the :func:`dump_header` function. :param value: a string with a dict header. :return: :class:`dict` :rtype: dict t=iiRwN(RxR?R)Ry(RqR{R|Rg((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytparse_dict_header1s  $cCsq|rm|d|dko%dknrm|dd!}| sN|d dkrm|jddjddSn|S( sUnquotes a header value. (Reversal of :func:`quote_header_value`). This does not use the real unquoting but what browsers are actually using for quoting. :param value: the header value to unquote. :rtype: str iiRwiis\\s\s\"(R+(Rqt is_filename((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyRyTs * cCs+i}x|D]}|j||j/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytdict_from_cookiejarms cCs t||S(sReturns a CookieJar from a key/value dictionary. :param cj: CookieJar to insert cookies into. :param cookie_dict: Dict of key/values to insert into CookieJar. :rtype: CookieJar (R(RR((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytadd_dict_to_cookiejar|scCsvtjdttjddtj}tjddtj}tjd}|j||j||j|S(slReturns encodings from given content string. :param content: bytestring to extract encodings from. sIn requests 3.0, get_encodings_from_content will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)s!]tflagss+]s$^<\?xml.*?encoding=["\']*(.+?)["\'>](RFRGtDeprecationWarningR,tcompileR.tfindall(tcontentt charset_ret pragma_retxml_re((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_encodings_from_contentscCs_|jd}|sdStj|\}}d|krK|djdSd|kr[dSdS(s}Returns encodings from given HTTP Header Dict. :param headers: dictionary to extract encoding from. :rtype: str s content-typetcharsets'"ttexts ISO-8859-1N(tgetR?tcgit parse_headertstrip(theaderst content_typetparams((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_encoding_from_headerss  ccs|jdkr)x|D] }|VqWdStj|jdd}x+|D]#}|j|}|rK|VqKqKW|jddt}|r|VndS(sStream decodes a iterator.NterrorsR+ttfinal(tencodingR?tcodecstgetincrementaldecoderRYR*(titeratortrR|tdecodertchunktrv((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytstream_decode_response_unicodes    ccsdd}|dks|dkr-t|}nx0|t|kr_||||!V||7}q0WdS(s Iterate over slices of a string.iN(R?R:(tstringt slice_lengthtpos((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt iter_slicess cCstjdtg}t|j}|rcyt|j|SWqctk r_|j|qcXnyt|j|ddSWnt k r|jSXdS(sReturns the requested content back in unicode. :param r: Response object to get unicode content from. Tried: 1. charset from content-type 2. fall back and replace all unicode characters :rtype: str sIn requests 3.0, get_unicode_from_response will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)RR+N( RFRGRRRRRt UnicodeErrorRzt TypeError(Rttried_encodingsR((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_unicode_from_responses   t4ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzs0123456789-._~cCs|jd}xtdt|D]}||dd!}t|dkr|jrytt|d}Wn!tk rtd|nX|tkr|||d||/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytunquote_unreserveds  cCsKd}d}ytt|d|SWntk rFt|d|SXdS(sRe-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. :rtype: str s!#$%&'()*+,/:;=?@[]~s!#$&'()*+,/:;=?@[]~tsafeN(RRR(Rtsafe_with_percenttsafe_without_percent((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt requote_uri s  cCstjdtj|d}|jd\}}tjdtjtt|d}tjdtj|d|@}||@||@kS(sThis function allows you to check if an IP belongs to a network subnet Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24 returns False if ip = 192.168.1.1 and net = 192.168.100.0/24 :rtype: bool s=Lit/(tstructtunpacktsockett inet_atonR)tdotted_netmaskRo(tiptnettipaddrtnetaddrtbitstnetmasktnetwork((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytaddress_in_network#s +#cCs/ddd|>dA}tjtjd|S(sConverts mask from /xx format to xxx.xxx.xxx.xxx Example: if mask is 24 function returns 255.255.255.0 :rtype: str Iii s>I(Rt inet_ntoaRtpack(tmaskR((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyR2scCs-ytj|Wntjk r(tSXtS(s :rtype: bool (RRterrorR(R*(t string_ip((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytis_ipv4_address=s cCs|jddkryt|jdd}Wntk rFtSX|dks_|dkrctSytj|jddWqtjk rtSXntStS(sV Very simple check of the cidr format in no_proxy variable. :rtype: bool Rii i( tcountRoR)RpR(RRRR*(tstring_networkR((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt is_valid_cidrHs ccst|dk }|r4tjj|}|tj|/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt set_environ`s    c Cscd}|}|d kr*|d}nt|j}|r d|jddjdD}|jdd}t|rx|D]8}t|rt||rtSq||krtSqWq x@|D]5}|j |s|jddj |rtSqWnt d|8yt |}Wn t t jfk rNt}nXWd QX|r_tStS( sL Returns whether we should bypass proxies or not. :rtype: bool cSs(tjj|p'tjj|jS(N(RBRRtupper(tk((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt|Rtno_proxycss|]}|r|VqdS(N((t.0R/((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pys st Rt,RPiN(R?RRZR+R)RRRR*tendswithRR RRtgaierrorR(( R^Rt get_proxyt no_proxy_argRZRtproxy_ipR/tbypass((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytshould_bypass_proxiesvs4  %      + cCs!t|d|riStSdS(sA Return a dict of environment proxies. :rtype: dict RN(RR (R^R((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_environ_proxiesscCs|p i}t|}|jdkrC|j|j|jdS|jd|j|jd|jdg}d}x(|D] }||krz||}PqzqzW|S(sSelect a proxy for the url, if applicable. :param url: The url being for the request :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs talls://sall://N(RthostnameR?Rtscheme(R^tproxiesturlpartst proxy_keystproxyt proxy_key((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt select_proxys       spython-requestscCsd|tfS(sO Return a string representing the default user agent. :rtype: str s%s/%s(R(Rg((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytdefault_user_agentscCs2titd6djd d6dd6dd 6S( s9 :rtype: requests.structures.CaseInsensitiveDict s User-Agents, tgziptdeflatesAccept-Encodings*/*tAccepts keep-alivet Connection(RR(RRR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytdefault_headerss  c Csg}d}xtjd|D]}y|jdd\}}Wntk ra|d}}nXi|jdd6}xa|jdD]P}y|jd\}}Wntk rPnX|j|||j|; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" :rtype: list s '"s, * '"R^R~(R,R)RpRRz( Rqtlinkst replace_charstvalR^Rtlinktparamtkey((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytparse_header_linkss    sRQiicCs|d }|tjtjfkr&dS|d tjkr=dS|d tjtjfkr]dS|jt}|dkr|dS|dkr|d d dtkrd S|d d dtkrd Sn|dkr|d t krd S|d t krdSnd S(s :rtype: str isutf-32is utf-8-sigisutf-16isutf-8Ns utf-16-beis utf-16-les utf-32-bes utf-32-le( Rt BOM_UTF32_LEt BOM_UTF32_BEtBOM_UTF8t BOM_UTF16_LEt BOM_UTF16_BERt_nullt_null2t_null3R?(tdatatsamplet nullcount((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytguess_json_utfs*    cCsSt||\}}}}}}|s7||}}nt||||||fS(sGiven a URL that may or may not have a scheme, prepend the given scheme. Does not replace a present scheme with the one provided as an argument. :rtype: str (RR (R^t new_schemeRRZRSRtquerytfragment((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytprepend_scheme_if_needed1s!cCsRt|}y"t|jt|jf}Wnttfk rMd}nX|S(s{Given a url with authentication components, extract them into a tuple of username,password. :rtype: (str,str) R(RR(RR tusernametpasswordR]R(R^tparsedtauth((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytget_auth_from_urlBs  " s^\S[^\r\n]*$|^$cCs|\}}t|tr$t}nt}y&|j|sOtd|nWn0tk rtd||t|fnXdS(sVerifies that header value is a string which doesn't contain leading whitespace or return characters. This prevents unintended header injection. :param header: tuple, in the format (name, value). s7Invalid return character or leading space in header: %ss>Value for header {%s: %s} must be of type str or bytes, not %sN(RXRt_CLEAN_HEADER_REGEX_BYTEt_CLEAN_HEADER_REGEX_STRR-RRttype(theaderRgRqtpat((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pytcheck_header_validityWs   cCsft|\}}}}}}|s4||}}n|jddd}t|||||dfS(sW Given a url remove the fragment and the authentication part. :rtype: str t@iiR(RtrsplitR (R^RRZRSRR R ((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt urldefragauthls cCs}t|jdd}|dk rmt|jtrmy||jWqyttfk ritdqyXn tddS(sfMove file pointer back to its recorded starting position so it can be read again on redirect. R>s;An error occurred when rewinding request body for redirect.s+Unable to rewind request body for redirect.N( RjtbodyR?RXt_body_positionRRHR'R(tprepared_requestt body_seek((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt rewind_body}s(s.netrcR(`t__doc__RRRst contextlibR@RBtplatformR,RRRFRRRt_internal_utilsRtcompatRRxRRRRRR R R R R RRRRtcookiesRt structuresRt exceptionsRRRRRRtwheretDEFAULT_CA_BUNDLE_PATHt DEFAULT_PORTStsystemR4R8RMR(RfRmRrRvR}RRyRRRRRRRt frozensetRRRRRRRtcontextmanagerRRR?RRRRRtencodeRRRR RRRRRRRR!(((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/utils.pyt s           ^"  ! = 3    #      %      9  "      PK!:<#J#J adapters.pyonu[ abc@s5dZddlZddlZddlmZmZddlmZddl m Z ddl m Z ddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZm Z ddl!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-m.Z.m/Z/mZmZm0Z0m1Z1ddl2m3Z3yddl4m5Z5Wne6k rdZ5nXe7Z8dZ9dZ:dZ<de=fdYZ>de>fd YZ?dS(!s requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. iN(t PoolManagertproxy_from_url(t HTTPResponse(tTimeout(tRetry(tClosedPoolError(tConnectTimeoutError(t HTTPError(t MaxRetryError(tNewConnectionError(t ProxyError(t ProtocolError(tReadTimeoutError(tSSLError(t ResponseErrori(tResponse(turlparset basestring(tDEFAULT_CA_BUNDLE_PATHtget_encoding_from_headerstprepend_scheme_if_neededtget_auth_from_urlt urldefragautht select_proxy(tCaseInsensitiveDict(textract_cookies_to_jar(tConnectionErrortConnectTimeoutt ReadTimeoutR R t RetryErrort InvalidSchema(t_basic_auth_str(tSOCKSProxyManagercOstddS(Ns'Missing dependencies for SOCKS support.(R(targstkwargs((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR +si it BaseAdaptercBs8eZdZdZededddZdZRS(sThe Base Transport AdaptercCstt|jdS(N(tsuperR#t__init__(tself((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR%7scCs tdS(sCSends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. N(tNotImplementedError(R&trequesttstreamttimeouttverifytcerttproxies((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytsend:scCs tdS(s!Cleans up adapter specific items.N(R'(R&((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytcloseLsN( t__name__t __module__t__doc__R%tFalsetNonetTrueR.R/(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR#4s   t HTTPAdaptercBseZdZdddddgZeeeedZdZdZ ed Z d Z d Z d Z dd ZdZdZdZdZededddZRS(sThe built-in HTTP Adapter for urllib3. Provides a general-case interface for Requests sessions to contact HTTP and HTTPS urls by implementing the Transport Adapter interface. This class will usually be created by the :class:`Session ` class under the covers. :param pool_connections: The number of urllib3 connection pools to cache. :param pool_maxsize: The maximum number of connections to save in the pool. :param max_retries: The maximum number of retries each connection should attempt. Note, this applies only to failed DNS lookups, socket connections and connection timeouts, never to requests where data has made it to the server. By default, Requests does not retry failed connections. If you need granular control over the conditions under which we retry a request, import urllib3's ``Retry`` class and pass that instead. :param pool_block: Whether the connection pool should block for connections. Usage:: >>> import requests >>> s = requests.Session() >>> a = requests.adapters.HTTPAdapter(max_retries=3) >>> s.mount('http://', a) t max_retriestconfigt_pool_connectionst _pool_maxsizet _pool_blockcCs|tkr$tddt|_ntj||_i|_i|_tt|j ||_ ||_ ||_ |j ||d|dS(Nitreadtblock(tDEFAULT_RETRIESRR3R7tfrom_intR8t proxy_managerR$R6R%R9R:R;tinit_poolmanager(R&tpool_connectionst pool_maxsizeR7t pool_block((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR%ns      cstfdjDS(Nc3s'|]}|t|dfVqdS(N(tgetattrR4(t.0tattr(R&(sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pys s(tdictt __attrs__(R&((R&sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt __getstate__scCsbi|_i|_x*|jD]\}}t|||qW|j|j|jd|jdS(NR=(R@R8titemstsetattrRAR9R:R;(R&tstateRGtvalue((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt __setstate__s   c KsF||_||_||_td|d|d|dt||_dS(sInitializes a urllib3 PoolManager. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param connections: The number of urllib3 connection pools to cache. :param maxsize: The maximum number of connections to save in the pool. :param block: Block when no free connections are available. :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager. t num_poolstmaxsizeR=tstrictN(R9R:R;RR5t poolmanager(R&t connectionsRQR=t pool_kwargs((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyRAs   c Ks||jkr|j|}n|jjdrt|\}}t|d|d|d|jd|jd|j|}|j|`. :param proxy: The proxy to return a urllib3 ProxyManager for. :param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager. :returns: ProxyManager :rtype: urllib3.ProxyManager tsockstusernametpasswordRPRQR=t proxy_headers( R@tlowert startswithRR R9R:R;RYR(R&tproxyt proxy_kwargstmanagerRWRXRY((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytproxy_manager_fors*     cCs|jjdr|rd }|tk r6|}n|sEt}n| s_tjj| rwtdj |nd|_ tjj |s||_ q||_ nd|_ d |_ d |_ |rt|ts|d|_|d|_n||_d |_|jrCtjj|j rCtdj |jn|jrtjj|j rtdj |jqnd S( sAVerify a SSL certificate. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param conn: The urllib3 connection object associated with the cert. :param url: The requested URL. :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: The SSL certificate to verify. thttpssFCould not find a suitable TLS CA certificate bundle, invalid path: {0}t CERT_REQUIREDt CERT_NONEiis:Could not find the TLS certificate file, invalid path: {0}s2Could not find the TLS key file, invalid path: {0}N(RZR[R4R5RtostpathtexiststIOErrortformatt cert_reqstisdirtca_certst ca_cert_dirt isinstanceRt cert_filetkey_file(R&tconnturlR+R,tcert_loc((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt cert_verifys8                cCst}t|dd|_tt|di|_t|j|_||_|jj |_ t |j t r|j j d|_ n |j |_ t|j||||_||_|S(sBuilds a :class:`Response ` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter ` :param req: The :class:`PreparedRequest ` used to generate the response. :param resp: The urllib3 response object. :rtype: requests.Response tstatustheaderssutf-8N(RRER4t status_codeRRtRtencodingtrawtreasonRlRptbytestdecodeRtcookiesR(t connection(R&treqtresptresponse((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytbuild_responses     cCsst||}|rEt|d}|j|}|j|}n*t|}|j}|jj|}|S(sReturns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param url: The URL to connect to. :param proxies: (optional) A Requests-style dictionary of proxies used on this request. :rtype: urllib3.ConnectionPool thttp(RRR_tconnection_from_urlRtgeturlRS(R&RpR-R\R@Rotparsed((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pytget_connection"s   cCs5|jjx!|jjD]}|jqWdS(sDisposes of any internal state. Currently, this closes the PoolManager and any active ProxyManager, which closes any pooled connections. N(RStclearR@tvalues(R&R\((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR/9s c Cst|j|}t|jj}|o3|dk}t}|rit|jj}|jd}n|j}|r| rt|j}n|S(s?Obtain the url to use when making the final request. If the message is being sent through a HTTP proxy, the full URL has to be used. Otherwise, we should only use the path portion of the URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` being sent. :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs. :rtype: str R`RV( RRpRtschemeR3RZR[tpath_urlR( R&R(R-R\Rtis_proxied_http_requesttusing_socks_proxyt proxy_schemeRp((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt request_urlCs  cKsdS(s"Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter `. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` to add headers to. :param kwargs: The keyword arguments from the call to send(). N((R&R(R"((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt add_headers`s cCs8i}t|\}}|r4t|||d`. :param proxies: The url of the proxy being used for this request. :rtype: dict sProxy-Authorization(RR(R&R\RtRWRX((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyRYns cCs}|j|j|}|j||j|||j||}|j||jdkphd|jk } t|t ry%|\} } t d| d| }Wqt k r} dj |} t | qXn't|t rnt d|d|}y| s[|j d|jd|d|jd|jd td td td td |jd| }nft|drv|j}n|jdt}y"|j|j|dtx-|jjD]\}}|j||qW|jx^|jD]S}|jtt|djd|jd|j||jdqW|jdy|jdt}Wntk r|j}nXt j!|d|d|d td t}Wn|j"nXWnt#t$j%fk r} t&| d|n{t'k r} t| j(t)r=t| j(t*s=t+| d|q=nt| j(t,rdt-| d|nt| j(t.rt/| d|nt| j(t0rt1| d|nt&| d|nt2k r} t&| d|nt.k r } t/| ndt0t3fk rl} t| t0rBt1| d|qmt| t4rft5| d|qmnX|j6||S(sSends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response sContent-LengthtconnectR<ssInvalid timeout {0}. Pass a (connect, read) timeout tuple, or a single float to set both timeouts to the same valuetmethodRptbodyRttredirecttassert_same_hosttpreload_contenttdecode_contenttretriesR*t proxy_pooltskip_accept_encodingisutf-8s s0 t bufferingtpoolR|R(N(7RRpRrRRRR4RtRlttuplet TimeoutSaucet ValueErrorRgturlopenRR3R7thasattrRt _get_conntDEFAULT_POOL_TIMEOUTt putrequestR5RKt putheadert endheadersR.thextlentencodet getresponset TypeErrorRt from_httplibR/R tsocketterrorRRRxRR RRRt _ProxyErrorR t _SSLErrorR Rt _HTTPErrorR RR(R&R(R)R*R+R,R-RoRptchunkedRR<teterrR~tlow_conntheaderRNtitr((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR.s            &       N(R0R1R2RItDEFAULT_POOLSIZER>tDEFAULT_POOLBLOCKR%RJRORAR_RrRR4RR/RRRYR3R5R.(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyR6Qs$      % 4 %    (@R2tos.pathRcRtpip._vendor.urllib3.poolmanagerRRtpip._vendor.urllib3.responseRtpip._vendor.urllib3.utilRRtpip._vendor.urllib3.util.retryRtpip._vendor.urllib3.exceptionsRRRRRR R RR R R RRtmodelsRtcompatRRtutilsRRRRRRt structuresRR{Rt exceptionsRRRRRtauthRt!pip._vendor.urllib3.contrib.socksR t ImportErrorR3RRR>R4RtobjectR#R6(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.pyt sB  .4  PK!U  __init__.pycnu[ Rec@sdZddlmZddlmZddlZddlmZdZdZyeej ej Wn9e e fk rej d j ej ej enXydd lmZesed nyddlZWnek rdZnXeed esBdd lmZejddlm ZeenWnek rVnXddlmZejdeddl mZmZmZm Z ddl m Z m!Z!m"Z"m#Z#ddl m$Z$m%Z%ddl&m'Z'ddl&m(Z(ddl)m*Z*m+Z+m,Z,ddl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5ddl6m7Z7m8Z8ddl9m:Z:ddlm;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCddlDZDddlDmEZEeDjFeGjHeEejdeAdeIdS(s Requests HTTP Library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> r.status_code 200 >>> b'Python is a programming language' in r.content True ... or POST: >>> payload = dict(key1='value1', key2='value2') >>> r = requests.post('https://httpbin.org/post', data=payload) >>> print(r.text) { ... "form": { "key1": "value1", "key2": "value2" }, ... } The other HTTP methods are supported - see `requests.api`. Full documentation is at . :copyright: (c) 2017 by Kenneth Reitz. :license: Apache 2.0, see LICENSE for more details. i(turllib3(tchardetNi(tRequestsDependencyWarningcCs-|jd}|dgks$tt|dkrF|jdn|\}}}t|t|t|}}}|dkst|dkst|dkst|jdd \}}}t|t|t|}}}|dkst|dkst|dks)tdS( Nt.tdevit0iiii(tsplittAssertionErrortlentappendtint(turllib3_versiontchardet_versiontmajortminortpatch((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/__init__.pytcheck_compatibility1s&&cCsry"ttt|jd}Wntk r6dSX|dddgkrndj|}tj|tndS(NRiiis4Old version of cryptography ({}) may cause slowdown.( tlisttmapR Rt ValueErrortformattwarningstwarnR(tcryptography_versiontwarning((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/__init__.pyt_check_cryptographyJs" s?urllib3 ({}) or chardet ({}) doesn't match a supported version!(tWINDOWSs3pip internals: don't import cryptography on WindowstHAS_SNI(t pyopenssl(t __version__(tDependencyWarningtignore(t __title__t__description__t__url__R(t __build__t __author__t__author_email__t __license__(t __copyright__t__cake__(tutils(tpackages(tRequesttResponsetPreparedRequest(trequesttgettheadtpostRtputtdeletetoptions(tsessiontSession(tcodes( tRequestExceptiontTimeoutt URLRequiredtTooManyRedirectst HTTPErrortConnectionErrortFileModeWarningtConnectTimeoutt ReadTimeout(t NullHandlertdefaultR (Jt__doc__t pip._vendorRRRt exceptionsRRRRRRRRtpip._internal.utils.compatRt ImportErrortssltNonetgetattrtFalsetpip._vendor.urllib3.contribRtinject_into_urllib3t cryptographyRtpip._vendor.urllib3.exceptionsRt simplefilterR R!R"R#R$R%R&R'R(tR)R*tmodelsR+R,R-tapiR.R/R0R1RR2R3R4tsessionsR5R6t status_codesR7R8R9R:R;R<R=R>R?R@tloggingRAt getLoggert__name__t addHandlertTrue(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/requests/__init__.pyt)sV         "":@ PK!!status_codes.pyonu[ abc@skddlmZiDdd6dd6dd6dd 6dd 6dd6dd6dd6dd6dd6dd 6dd#6dd(6dd*6dd,6dd.6dd26dd46dd76dd96dd;6dd=6ddA6ddE6ddH6ddJ6ddM6ddO6ddR6ddU6ddW6dd[6dd^6dd`6ddb6ddd6ddg6ddi6ddk6ddo6dds6ddu6ddy6dd{6dd~6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6ZeddZxcejD]U\ZZxFeD]>Zeeeeej ds!eeej eq!q!WqWdS(i(t LookupDicttcontinueidtswitching_protocolsiet processingift checkpointigt uri_too_longtrequest_uri_too_longiztoktokaytall_oktall_okaytall_goods\o/s✓itcreateditaccepteditnon_authoritative_infotnon_authoritative_informationit no_contentit reset_contenttresetitpartial_contenttpartialit multi_statustmultiple_statust multi_statitmultiple_statiitalready_reporteditim_useditmultiple_choicesi,tmoved_permanentlytmoveds\o-i-tfoundi.t see_othertotheri/t not_modifiedi0t use_proxyi1t switch_proxyi2ttemporary_redirectttemporary_movedt temporaryi3tpermanent_redirecttresume_incompletetresumei4t bad_requesttbadit unauthorizeditpayment_requiredtpaymentit forbiddenit not_founds-o-itmethod_not_allowedt not_alloweditnot_acceptableitproxy_authentication_requiredt proxy_authtproxy_authenticationitrequest_timeoutttimeoutitconflictitgoneitlength_requireditprecondition_failedt preconditionitrequest_entity_too_largeitrequest_uri_too_largeitunsupported_media_typetunsupported_mediat media_typeitrequested_range_not_satisfiabletrequested_rangetrange_not_satisfiableitexpectation_failedit im_a_teapottteapott i_am_a_teapotitmisdirected_requestitunprocessable_entityt unprocessableitlockeditfailed_dependencyt dependencyitunordered_collectiont unordereditupgrade_requiredtupgradeitprecondition_requiredittoo_many_requeststtoo_manyitheader_fields_too_largetfields_too_largeit no_responsetnoneit retry_withtretryit$blocked_by_windows_parental_controlstparental_controlsitunavailable_for_legal_reasonst legal_reasonsitclient_closed_requestitinternal_server_errort server_errors/o\s✗itnot_implementedit bad_gatewayitservice_unavailablet unavailableitgateway_timeoutithttp_version_not_supportedt http_versionitvariant_also_negotiatesitinsufficient_storageitbandwidth_limit_exceededt bandwidthit not_extendeditnetwork_authentication_requiredt network_authtnetwork_authenticationitnamet status_codess\t/N(R(R(R(R(RR(RRR R R s\o/s✓(R (R (RR(R(RR(RR(RRRR(R(R(R(RRs\o-(R(RR (R!(R"(R#(R$R%R&(R'R(R)(R*R+(R,(R-R.(R/(R0s-o-(R1R2(R3(R4R5R6(R7R8(R9(R:(R;(R<R=(R>(R?(R@RARB(RCRDRE(RF(RGRHRI(RJ(RKRL(RM(RNRO(RPRQ(RRRS(RTR=(RURV(RWRX(RYRZ(R[R\(R]R^(R_R`(Ra(RbRcs/o\s✗(Rd(Re(RfRg(Rh(RiRj(Rk(Rl(RmRn(Ro(RpRqRr(s\Ru( t structuresRt_codestcodestitemstcodettitlesttitletsetattrt startswithtupper(((sE/usr/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.pyts  PK!)jj certs.pyonu[ abc@s1dZddlmZedkr-eGHndS(sF requests.certs ~~~~~~~~~~~~~~ This module returns the preferred default CA certificate bundle. There is only one — the one from the certifi package. If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a separately packaged CA bundle. i(twheret__main__N(t__doc__tpip._vendor.certifiRt__name__(((s>/usr/lib/python2.7/site-packages/pip/_vendor/requests/certs.pyts PK!@api.pyonu[ abc@sqdZddlmZdZd dZdZdZd d dZd dZ d d Z d Z d S( s requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. i(tsessionsc Ks2tj }|jd|d||SWdQXdS(s Constructs and sends a :class:`Request `. :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. :param data: (optional) Dictionary or list of tuples ``[(key, value)]`` (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload. ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')`` or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers to add for the file. :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How many seconds to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``True``. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. :param stream: (optional) if ``False``, the response content will be immediately downloaded. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :return: :class:`Response ` object :rtype: requests.Response Usage:: >>> import requests >>> req = requests.request('GET', 'http://httpbin.org/get') tmethodturlN(RtSessiontrequest(RRtkwargstsession((s</usr/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRs)cKs&|jdttd|d||S(sOSends a GET request. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tallow_redirectstgettparams(t setdefaulttTrueR(RR R((s</usr/lib/python2.7/site-packages/pip/_vendor/requests/api.pyR=s cKs |jdttd||S(sSends an OPTIONS request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response Rtoptions(R R R(RR((s</usr/lib/python2.7/site-packages/pip/_vendor/requests/api.pyR Ks cKs |jdttd||S(sSends a HEAD request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response Rthead(R tFalseR(RR((s</usr/lib/python2.7/site-packages/pip/_vendor/requests/api.pyR Xs cKstd|d|d||S(sSends a POST request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tposttdatatjson(R(RRRR((s</usr/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRes cKstd|d||S(sSends a PUT request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tputR(R(RRR((s</usr/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRss cKstd|d||S(sSends a PATCH request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tpatchR(R(RRR((s</usr/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRs cKstd||S(sSends a DELETE request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response tdelete(R(RR((s</usr/lib/python2.7/site-packages/pip/_vendor/requests/api.pyRs N( t__doc__tRRtNoneRR R RRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/requests/api.pyt s -    PK!}<<$__pycache__/packages.cpython-311.pycnu[ |oi!ddlZddlmZdD]yZdezZeeee<eejD]KZ e ekse edzr+e e ddZ eje ejde z<Lzeuej ZeejD]_Z e ekse edr=eje Zeejde <e ed Z eejde <^dSdS) N)chardet)urllib3idnaz pip._vendor..zpip._vendor.requests.packages.zrequests.packages.r)syscompatrpackagevendored_package __import__localslistmodulesmod startswithlenunprefixed_mod__name__target imported_modreplaceT/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/packages.pyrs  #^^G%/" #344FFHHWtCK  ^^ " " "cnn5E5K&L&L " ^!4!4!5!56NMP[Y\M]CK8>I J^    FtCK  CC &==CNNf<<<88=;s+L6BCK2S22 3++fi00C6BCK2S22 3CCrPK!|?II__pycache__/api.cpython-311.pycnu[ |oi1NdZddlmZdZd dZdZdZd dZd d Zd d Z d Z dS)z requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. )sessionsc |tj5}|jd||d|cdddS#1swxYwYdS)a Constructs and sends a :class:`Request `. :param method: method for the new :class:`Request` object: ``GET``, ``OPTIONS``, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:`Request`. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload. ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')`` or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content_type'`` is a string defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers to add for the file. :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How many seconds to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``True``. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. :param stream: (optional) if ``False``, the response content will be immediately downloaded. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :return: :class:`Response ` object :rtype: requests.Response Usage:: >>> import requests >>> req = requests.request('GET', 'https://httpbin.org/get') >>> req )methodurlN)rSessionrequest)rrkwargssessions O/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/api.pyr r sX    Aww@f#@@@@AAAAAAAAAAAAAAAAAAs 155Nc "td|fd|i|S)adSends a GET request. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response getparamsr )rrr s r rr>s! 5# 7 7f 7 7 77c td|fi|S)zSends an OPTIONS request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response optionsrrr s r rrLs 9c , ,V , ,,rc J|ddtd|fi|S)akSends a HEAD request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. If `allow_redirects` is not provided, it will be set to `False` (as opposed to the default :meth:`request` behavior). :return: :class:`Response ` object :rtype: requests.Response allow_redirectsFhead) setdefaultr rs r rrXs3 '/// 63 ) )& ) ))rc $td|f||d|S)aSends a POST request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response post)datajsonr)rrrr s r rrgs# 63 ?T ? ? ? ??rc "td|fd|i|S)aSends a PUT request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response putrrrrr s r rrvs! 5# 3 3D 3F 3 33rc "td|fd|i|S)aSends a PATCH request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response patchrrrs r r!r!s! 7C 5 5d 5f 5 55rc td|fi|S)zSends a DELETE request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response deleterrs r r#r#s 8S + +F + ++r)N)NN) __doc__rr rrrrrr!r#rrr r&s-A-A-A` 8 8 8 8 - - - * * * @ @ @ @ 4 4 4 4 6 6 6 6 , , , , ,rPK!'V==$__pycache__/__init__.cpython-311.pycnu[ |oi(dZddlZddlmZddlmZdZdZdZdZ eej een8#e e f$r.ej dej eeeYnwxYw dd lmZes ed  ddlZn #e$rdZYnwxYweed d s&dd lmZejddlm Ze en #e$rYnwxYwddlmZejdeddlZddlmZddlmZm Z ddl m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m Z ddl*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2ddlm3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;mZ>m?Z?m@Z@ddlAmBZBmCZCddlDmEZEejFeGHeejde5ddS)a Requests HTTP Library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> r.status_code 200 >>> b'Python is a programming language' in r.content True ... or POST: >>> payload = dict(key1='value1', key2='value2') >>> r = requests.post('https://httpbin.org/post', data=payload) >>> print(r.text) { ... "form": { "key1": "value1", "key2": "value2" }, ... } The other HTTP methods are supported - see `requests.api`. Full documentation is at . :copyright: (c) 2017 by Kenneth Reitz. :license: Apache 2.0, see LICENSE for more details. N)urllib3)RequestsDependencyWarningc|d}|dgksJt|dkr|d|\}}}t|t|t|}}}|dksJ|dkr|dksJ|rd|ddd\}}}t|t|t|}}}d|||fcxkrd ksnJdS|rd|ddd\}}}t|t|t|}}}d |||fcxkrd ksnJdSdS) N.dev0r)r rr )rr)r rr)rr)splitlenappendint)urllib3_versionchardet_versioncharset_normalizer_versionmajorminorpatchs T/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/__init__.pycheck_compatibilityr3s%++C00O ug % % % % ?q  s###*E5%e**c%jj#e**%5E A:::: zz{{{{  -33C88!<ue!%jj#e**c%jjeuUE51====I======== # 8>>sCCBQBGue!%jj#e**c%jjeuUE51====I======== c ttt|jd}n#t$rYdSwxYw|gdkr1d|}t j|tdSdS)Nr)rr rz4Old version of cryptography ({}) may cause slowdown.) listmaprr ValueErrorformatwarningswarnr)cryptography_versionwarnings r_check_cryptographyr%Ss#C-G-A-G-L-L$M$MNN iii''HOO     g899999 ('s03 AAzWurllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported version!)WINDOWSz3pip internals: don't import cryptography on WindowsHAS_SNIF) pyopenssl) __version__)DependencyWarningignore) NullHandler)packagesutils) __author____author_email__ __build____cake__ __copyright____description__ __license__ __title____url__r))deletegetheadoptionsrpostputrequest) ConnectionErrorConnectTimeoutFileModeWarning HTTPErrorJSONDecodeError ReadTimeoutRequestExceptionTimeoutTooManyRedirects URLRequired)PreparedRequestRequestResponse)Sessionsession)codesdefaultT)r)I__doc__r! pip._vendorr exceptionsrrrrr%r)AssertionErrorrr"r pip._internal.utils.compatr& ImportErrorsslgetattrpip._vendor.urllib3.contribr(inject_into_urllib3 cryptographyr#pip._vendor.urllib3.exceptionsr* simplefilterloggingr,r-r.r/r0r1r2r3r4r5r6r7apir8r9r:r;rr<r=r>r?r@rArBrCrDrErFrGrHmodelsrIrJrKsessionsrLrM status_codesrN getLogger__name__ addHandlerrrrgs !!F111111!   @ : : : _.H  #HM 6  2L   "  322222 QkOPPP  73 5 ) )2999999% %''' EDDDDD0111   D =<<<<<h 1222                        GFFFFFFFFFFFFFFFFFFF                        7666666666&&&&&&&&(&&{{}}555i>>>>>>sE12A&%A&*C>BCB  C B  6CC  C PK!5Ρ!__pycache__/certs.cpython-311.pycnu[ |oiLdZddlmZedkreedSdS)uF requests.certs ~~~~~~~~~~~~~~ This module returns the preferred default CA certificate bundle. There is only one — the one from the certifi package. If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a separately packaged CA bundle. )where__main__N)__doc__pip._vendor.certifir__name__printQ/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/certs.pyr sM  &%%%%% z E%%''NNNNNr PK!,(__pycache__/status_codes.cpython-311.pycnu[ |oidaddlmZiddddddd d d d d ddddddddddddddddddd d!d"d#d$id%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFidGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhididjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddZedZdZedS)a The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. Example:: >>> import requests >>> requests.codes['temporary_redirect'] 307 >>> requests.codes.teapot 418 >>> requests.codes['\o/'] 200 Some codes have multiple names, and both upper- and lower-case versions of the names are allowed. For example, ``codes.ok``, ``codes.OK``, and ``codes.okay`` all correspond to the HTTP status code 200. ) LookupDictd)continuee)switching_protocolsf) processingz early-hintsg) checkpointz) uri_too_longrequest_uri_too_long)okokayall_okall_okayall_goodz\o/u✓)created)accepted)non_authoritative_infonon_authoritative_information) no_content) reset_contentreset)partial_contentpartial) multi_statusmultiple_status multi_statimultiple_stati)already_reported)im_usedi,)multiple_choicesi-)moved_permanentlymovedz\o-i.)foundi/) see_otherotheri0) not_modifiedi1) use_proxyi2) switch_proxyi3)temporary_redirecttemporary_moved temporaryi4)permanent_redirectresume_incompleteresumei) bad_requestbadi) unauthorizedi)payment_requiredpaymenti) forbiddeni) not_foundz-o-i)method_not_allowed not_allowedi)not_acceptablei)proxy_authentication_required proxy_authproxy_authenticationi)request_timeouttimeouti)conflicti)gonei)length_requiredi)precondition_failed preconditioni)request_entity_too_largecontent_too_largei)request_uri_too_larger i)unsupported_media_typeunsupported_media media_typei)requested_range_not_satisfiablerequested_rangerange_not_satisfiablei)expectation_failedi) im_a_teapotteapot i_am_a_teapoti)misdirected_requesti)unprocessable_entity unprocessableunprocessable_contenti)lockedi)failed_dependency dependencyi)unordered_collection unordered too_earlyi)upgrade_requiredupgradei)precondition_requiredrOi)too_many_requeststoo_manyi)header_fields_too_largefields_too_largei) no_responsenonei) retry_withretryi)$blocked_by_windows_parental_controlsparental_controlsi)unavailable_for_legal_reasons legal_reasonsi)client_closed_requesti)internal_server_error server_errorz/o\u✗i)not_implementedi) bad_gatewayi)service_unavailable unavailablei)gateway_timeouti)http_version_not_supported http_versioni)variant_also_negotiatesi)insufficient_storagei)bandwidth_limit_exceeded bandwidthi) not_extendedi)network_authentication_required network_authnetwork_authentication status_codes)namectD]]\}}|D]U}tt|||ds(tt||V^dt >t dzdfdttDzndadS)N)\/cdddt|D}d||fzS)Nz, c3"K|] }d|dV dS)z``N).0ns X/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/status_codes.py z%_init..doc..us*;;*q***;;;;;;z* %d: %s)join_codes)codenamess rdocz_init..docts5 ;;fTl;;;;;T5M))r c3.K|]}|VdS)Nr)rrrs rrz_init..zs+"H"H33t99"H"H"H"H"H"Hr) ritemssetattrcodes startswithupper__doc__rsorted)rtitlestitlers @r_initrms 44 f 4 4E E5$ ' ' '##K00 4u{{}}d333 4 ***   $"H"H"H"H"H"H"HHHHH  GGrN)r structuresrrrrrrrrs(#"""""Q Q  !Q  & Q   Q   1 Q  HQ Q Q  DQ Q  #Q  'Q  MQ  Q  !Q $ %Q & /'Q Q ()Q * +Q , -Q ./Q 0 1Q 2 ?3Q 4 5Q @ AQ B CQ D (EQ FGQ H IQ J .KQ L MQ N POQ P 'QQ RSQ Q Q TUQ V WQ X 0YQ Z :[Q \ 2]Q ^ F_Q ` aQ j kQ l 3mQ n !oQ p KqQ rsQ t ,uQ v ;wQ x (yQ z 2{Q | *}Q Q Q ~ 8Q @ AQ B CQ D FEQ F ;GQ H #IQ L AMQ N OQ P QQ R /SQ T UQ V 7WQ X %YQ Z "[Q \ 2]Q ^ _Q ` VaQ Q f  '''&rPK!<м|t|t$__pycache__/sessions.cpython-311.pycnu[ |oi'wdZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z dd lmZmZmZmZdd lmZmZmZmZdd lmZmZmZmZdd lmZmZdd l m!Z!m"Z"m#Z#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3ej4dkrej5Z6nejZ6efdZ7efdZ8GddZ9Gdde9Z:dZ;dS)z requests.sessions ~~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). N) OrderedDict) timedelta)to_native_string) HTTPAdapter)_basic_auth_str)Mapping cookieliburljoinurlparse)RequestsCookieJarcookiejar_from_dictextract_cookies_to_jar merge_cookies)ChunkedEncodingErrorContentDecodingError InvalidSchemaTooManyRedirects) default_hooks dispatch_hook)DEFAULT_REDIRECT_LIMITREDIRECT_STATIPreparedRequestRequest)codes)CaseInsensitiveDict) DEFAULT_PORTSdefault_headersget_auth_from_urlget_environ_proxiesget_netrc_auth requote_uriresolve_proxies rewind_bodyshould_bypass_proxiesto_key_val_listwin32c.||S||St|trt|ts|S|t|}|t|d|D}|D]}||=|S)zDetermines appropriate setting for a given request, taking into account the explicit setting on that request, and the setting in the session. If a setting is a dictionary, they will be merged together using `dict_class` Ncg|] \}}|| SN).0kvs T/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/sessions.py z!merge_setting..TsEEEv119999) isinstancer r&updateitems)request_settingsession_setting dict_classmerged_setting none_keyskeys r/ merge_settingr;=s  ?G,,1;OW1U1UZ @ @AAN//::;;;FE!5!5!7!7EEEI   3   r1c||dgkr|S||dgkr|St|||S)zProperly merges both requests and session hooks. This is necessary because when request_hooks == {'response': []}, the merge breaks Session hooks entirely. Nresponse)getr;) request_hooks session_hooksr7s r/ merge_hooksrA[s^  1 1* = = C C 1 1* = = C C  z B BBr1c@eZdZdZdZ d dZdZdZd ZdS) SessionRedirectMixincx|jr2|jd}|d}t|dSdS)z7Receives a Response. Returns a redirect URI or ``None``locationlatin1utf8N) is_redirectheadersencoder)selfresprEs r/get_redirect_targetz(SessionRedirectMixin.get_redirect_targetksC   6|J/H x00H#Hf55 5tr1cbt|}t|}|j|jkrdS|jdkr|jdvr|jdkr |jdvrdS|j|jk}|j|jk}t j|jddf}|s|j|vr |j|vrdS|p|S)zFDecide whether Authorization header should be removed when redirectingThttp)PNhttps)iNFN)r hostnameschemeportrr>)rKold_urlnew_url old_parsed new_parsed changed_portchanged_scheme default_ports r/should_strip_authz&SessionRedirectMixin.should_strip_authsg&& g&&  *"5 5 54   ' ':--!W,,;..5"*/9 #*j.??%)**;TBBDI  <//<//5-~-r1FNTc +Kg} ||} t|jj} | r'|} | || dd|_ |jn8#tttf$r|j dYnwxYwt|j|jkrtd|jd||| dr=t|j}d t'|j| g} t| }|jd kr| r|| }n|jr|j} |} |js#t1|jt3| } nt3| } t'| | _|| ||jt8jt8jfvr)d }|D]}| j |dd| _!| j}| d dtE| j#||j tI| j#|j%| &| j#|'| |}|(| || j)duod|vpd|v}|rtU| | }|r|VnI|j+|f|||||dd| }tE|j%| |j ||} |V| %dSdS)zBReceives a Response. Returns a generator of Responses or Requests.rNF)decode_contentz Exceeded z redirects.)r=z//:)fragment)Content-Lengthz Content-TypeTransfer-EncodingCookierbrc)streamtimeoutverifycertproxiesallow_redirects),rMr urlracopyappendhistorycontentrr RuntimeErrorrawreadlen max_redirectsrclose startswithjoinrrS_replacegeturlnetlocr r"rebuild_method status_codertemporary_redirectpermanent_redirectrIpopbodyr_cookiesrcookiesprepare_cookiesrebuild_proxies rebuild_auth_body_positionr$send)rKrLreqrerfrgrhriyield_requestsadapter_kwargshistrkprevious_fragmentprepared_request parsed_rurlparsedpurged_headersheaderrI rewindables r/resolve_redirectsz&SessionRedirectMixin.resolve_redirectss&&t,,$SW--6g "xxzz  KK   8DL 4 (*> M 4 4 4 U 33333 44<  D$666&? 2???$ JJLLL~~d## L&tx00 hh 01C D DcJKKc]]F"$$):$2CDD 4$*O!--//C = 'dh C(8(899!#&&#3C#8#8     0$ 7 7 7((( "Y,??F$,00>>>>(, %&.G KK$ ' ' ' ##3##&&&d    ) )( 3 3 3 3 3 r1c6|j}t|jj}t |||j}d|vr|d= t ||\}}n#t$rd\}}YnwxYw|ds|r|rt|||d<|S)aThis method re-evaluates the proxy configuration by considering the environment variables. If we are redirected to a URL covered by NO_PROXY, we strip the proxy configuration. Otherwise, we set missing proxy keys for this URL (in case they were stripped by a previous redirect). This method also replaces the Proxy-Authorization header where necessary. :rtype: dict zProxy-AuthorizationNNrQ) rIr rkrSr#rrKeyErrorrvr)rKrrirIrS new_proxiesusernamepasswords r/rz$SessionRedirectMixin.rebuild_proxies.s#**.//6%&6PP G + +-. ,!2;v3F!G!G Hhh , , ,!+ Hhhh ,   )) Qh Q8 Q-)))))r1rCceZdZdZgdZdZdZdZdZ dd Z d Z d Z d Z dd Z ddZddZdZdZdZdZdZdZdZdZdS)SessionaA Requests session. Provides cookie persistence, connection-pooling, and configuration. Basic Usage:: >>> import requests >>> s = requests.Session() >>> s.get('https://httpbin.org/get') Or as a context manager:: >>> with requests.Session() as s: ... s.get('https://httpbin.org/get') ) rIrauthrihooksparamsrgrhadaptersrerrtct|_d|_i|_t |_i|_d|_d|_d|_ t|_ d|_ ti|_t|_|dt%|dt%dS)NFTzhttps://zhttp://)rrIrrirrrrergrhrrtrrrrrmountrrKs r/__init__zSession.__init__s'((   #__     4 +2.. $   :{}}--- 9kmm,,,,,r1c|Sr*r+rs r/ __enter__zSession.__enter__s r1c.|dSr*)ru)rKargss r/__exit__zSession.__exit__s r1c|jpi}t|tjst |}t t t |j|}|j}|jr|s|jst|j }t}| |j |j |j|j|jt%|j|jt(t%|j|jt%||j|t-|j|j |S)aConstructs a :class:`PreparedRequest ` for transmission and returns it. The :class:`PreparedRequest` has settings merged from the :class:`Request ` instance and those of the :class:`Session`. :param request: :class:`Request` instance to prepare with this session's settings. :rtype: requests.PreparedRequest )r7) rrkfilesdatajsonrIrrrr)rr2r CookieJarrrr rrr!rkrpreparerupperrrrr;rIrrrAr)rKrrmerged_cookiesrps r/prepare_requestzSession.prepare_requests5/'R'9#677 3)'22G' +--t| <  /$ /ty /!'+..D    >'')) -!:M!==tTY//"gmTZ88  r1NTc "t|||||pi||pi|||  }||}| pi} ||j| | ||}| | d}|||j|fi|}|S)a Constructs a :class:`Request `, prepares it and sends it. Returns :class:`Response ` object. :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'filename': file-like-objects`` for multipart encoding upload. :param auth: (optional) Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth. :param timeout: (optional) How many seconds to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param allow_redirects: (optional) Set to True by default. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol or protocol and hostname to the URL of the proxy. :param hooks: (optional) Dictionary mapping hook name to one event or list of events, event must be callable. :param stream: (optional) whether to immediately download the response content. Defaults to ``False``. :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``True``. When set to ``False``, requests will accept any TLS certificate presented by the server, and will ignore hostname mismatches and/or expired certificates, which will make your application vulnerable to man-in-the-middle (MitM) attacks. Setting verify to ``False`` may be useful during local development or testing. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :rtype: requests.Response ) rrkrIrrrrrrr)rfrj)rrrmerge_environment_settingsrkr3r)rKrrkrrrIrrrrfrjrirrergrhrrprepsettings send_kwargsrLs r/rzSession.requests~<<>>z Session.getQs7 +T222t|E311&111r1c L|dd|jd|fi|S)zSends a OPTIONS request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response rjTOPTIONSrrs r/optionszSession.options\s7 +T222t|Is55f555r1c L|dd|jd|fi|S)zSends a HEAD request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response rjFrrrs r/headz Session.headgs7 +U333t|FC226222r1c &|jd|f||d|S)aSends a POST request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response r)rrr)rKrkrrrs r/postz Session.postrs't|FCHdHHHHHr1c $|jd|fd|i|S)auSends a PUT request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response PUTrrrKrkrrs r/putz Session.puts%t|E3<>t>v>>>r1c |jd|fi|S)zSends a DELETE request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response DELETErrs r/deletezSession.deletes t|Hc44V444r1c .|d|j|d|j|d|jd|vrt ||j|j|d<t|trtd| dd}| d}|j }| |j}t}|j|fi|}t|z } t#| |_t'd ||fi|}|jr*|jD]"} t+|j| j| j#t+|j||j|r|j||fi|} d | D} ng} | r1| d || }| |_|s5 t7|j||fd di||_n#t:$rYnwxYw|s|j|S)zISend a given PreparedRequest. :rtype: requests.Response rergrhriz#You can only send PreparedRequests.rjT)rk)secondsr=cg|]}|Sr+r+)r,rLs r/r0z Session.send..s,,,t,,,r1rr)rrergrhr#rirr2r ValueErrorrr>r get_adapterrkpreferred_clockrrelapsedrrnrrrrqrinsertnext_next StopIterationro) rKrrrjreradapterstartrrrLgenrns r/rz Session.sends (DK000(DK000&$),,, F " " /t~ V VF9  gw ' ' DBCC C!**%6==H%% ""w{"33 !! GL + +F + +"##e+g...  *eQ 9 9& 9 9 9 M  M M&t|T\48LLLLt|Wae<<<  ($(G>>v>>C,,,,,GGG  NN1a  AAI  *D*1gUUdUfUU!      IIs#G<< H H c|jr||dnd}t||}|D]\}} ||| |dus|@t jdp t jdp|}t||j}t||j }t||j }t||j }||||dS)z^ Check the environment and merge it with some settings. :rtype: dict Nno_proxy)rTREQUESTS_CA_BUNDLECURL_CA_BUNDLE)rirergrh) rr>r r4rosenvironr;rirergrh) rKrkrirergrhr env_proxiesr-r.s r/rz"Session.merge_environment_settingss > 292Ew{{:...4H-cHEEEK#))++ ) )1""1a((((~~JNN#788z~~&677 66vt{33vt{33T49--"fPTUUUr1c|jD]B\}}||r|cSCt d|)z~ Returns the appropriate connection adapter for the given URL. :rtype: requests.adapters.BaseAdapter z&No connection adapters were found for )rr4lowerrvr)rKrkprefixrs r/rzSession.get_adapter sr $}2244  OFGyy{{%%fllnn55  LSLLMMMr1cf|jD]}|dS)z+Closes all adapters and as such the sessionN)rvaluesru)rKr.s r/ruz Session.closes8%%''  A GGIIII  r1c||j<fd|jD}|D]$}|j||j|<%dS)zwRegisters a connection adapter to a prefix. Adapters are sorted in descending order by prefix length. cTg|]$}t|tk"|%Sr+)rs)r,r-rs r/r0z!Session.mount..%s/IIIaCFFS[[4H4H4H4H4Hr1N)rr)rKrr keys_to_mover:s ` r/rz Session.mountsd !( fIIII4=III  8 8C!%!2!23!7!7DM#   8 8r1c.fdjD}|S)Nc4i|]}|t|dSr*)getattr)r,attrrKs r/ z(Session.__getstate__..+s'LLLTwtT400LLLr1) __attrs__)rKstates` r/ __getstate__zSession.__getstate__*s#LLLLT^LLL r1c\|D]\}}t|||dSr*)r4setattr)rKrrvalues r/ __setstate__zSession.__setstate__.s< ;;== ' 'KD% D$ & & & & ' 'r1)NNNNNNNTNNNNNNrr*)rrr__doc__rrrrrrr>rrrrrrrrrrurrr r+r1r/rrds$   I;-;-;-z)))^    #[[[[z 2 2 2 6 6 6 3 3 3 I I I I = = = = ? ? ? ?555KKKZVVV> N N N 8 8 8'''''r1rctS)aZ Returns a :class:`Session` for context-management. .. deprecated:: 1.0.0 This method has been deprecated since version 1.0.0 and is only kept for backwards compatibility. New code should use :class:`~requests.sessions.Session` to create a session. This may be removed at a future date. :rtype: Session )rr+r1r/sessionr 3s 99r1)rs ######------!!!!!!!!!!!!999999999999  0///////  ++++++                        <7'OOiO@K<:E C C C Cw)w)w)w)w)w)w)w)tL'L'L'L'L'"L'L'L'^     r1PK!}r  "__pycache__/compat.cpython-311.pycnu[ |oidZddlZddlmZ eejdddkZn#ee f$rdZYnwxYwdZ e Z ej Z e ddkZe dd kZddlZdd lmZdd lmZdd lmZmZmZdd lmZddlmZddlmZddlm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)ddl*m+Z+m,Z,m-Z-m.Z.m/Z/e0Z1e0Z0e2Z2e0e2fZ3ee4fZ5efZ6dS)z requests.compat ~~~~~~~~~~~~~~~ This module previously handled import compatibility issues between Python 2 and Python 3. It remains for backwards compatibility until the next major version. N) __version__.Tc d}|S)z-Find supported character detection libraries.N)chardets R/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/compat.py_resolve_char_detectionr s G N)JSONDecodeError) OrderedDict)CallableMappingMutableMapping) cookiejar)Morsel)StringIO) quote quote_plusunquote unquote_plus urldefrag urlencodeurljoinurlparseurlsplit urlunparse) getproxiesgetproxies_environmentparse_http_list proxy_bypassproxy_bypass_environment)7__doc__syspip._vendor.urllib3rurllib3_versionintsplit is_urllib3_1 TypeErrorAttributeErrorr r version_info_veris_py2is_py3jsonr collectionsrcollections.abcrrrhttpr cookielib http.cookiesrior urllib.parserrrrrrrrrrurllib.requestr r!r"r#r$str builtin_strbytes basestringfloat numeric_types integer_typesrr r rBs= ?>>>>>3,,S11!455:LL>"LLL " ! # #  aA aA $#####==========''''''                           5\ e  s #2 >>PK!82\\!__pycache__/utils.cpython-311.pycnu[ |oiɁjdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddlmZmZddlmZddlmZddlmZmZmZmZdd lmZmZmZmZmZmZm Z dd lm!Z"dd lm#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)dd l*m+Z+dd l,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2dZ3ej4Z5dddZ6d7ej8deddZ9ej:dkrdZ;dZ#dZdZ?d Z@ejAd!ZBd"ZCd#ZDd$ZEd%ZFdJd&ZGd'ZHd(ZId)ZJd*ZKd+ZLd,ZMd-ZNd.ZOePd/ZQd0ZRd1ZSd2ZTd3ZUd4ZVd5ZWejAd6ZXd7ZYdKd8ZZd9Z[dLd:Z\dMd<Z]d=Z^d>Z_d?`d@ZaeadAzZbeadBzZcdCZddDZedEZfdFZgdGZhdHZidIZjdS)Nz requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. N) OrderedDict) make_headers parse_url)certs __version__)_HEADER_VALIDATORS_BYTE_HEADER_VALIDATORS_STRHEADER_VALIDATORSto_native_string)Mapping basestringbytes getproxiesgetproxies_environment integer_types is_urllib3_1)parse_http_list) proxy_bypassproxy_bypass_environmentquotestrunquoteurlparse urlunparsecookiejar_from_dict)FileModeWarning InvalidHeader InvalidURLUnrewindableBodyError)CaseInsensitiveDict)z.netrc_netrcPi)httphttpsz, z,\s*T)accept_encodingzaccept-encodingwin32cl ddl}n#t$rYdSwxYw ||jd}t ||dd}||dd}n#t tf$rYdSwxYw|r|sdS|d}td|}|D]t}|dkrd|vrd S| dd }| d d }| d d}tj ||tj rd SudS)NrFz;Software\Microsoft\Windows\CurrentVersion\Internet Settings ProxyEnable ProxyOverride;z.Tz\.*z.*?)winreg ImportErrorOpenKeyHKEY_CURRENT_USERint QueryValueExOSError ValueErrorsplitfilterreplacerematchI)hostr1internetSettings proxyEnable proxyOverridetests Q/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/utils.pyproxy_bypass_registryrEMs  MMMM   55  %~~(N    f112BMRRSTUVVK"//0@/RRSTUMM$   55  - 5 &++C00 t]33 !  Dy  d??44<<U++D<<U++D<<T**DxdBD)) tt us A A::BBcZtrt|St|S)zReturn True, if the host should be bypassed. Checks proxy settings gathered from the environment, if specified, or the registry. )rrrE)r?s rDrrss. " # # /+D11 1(.. .cNt|dr|}|S)z/Returns an internal sequence dictionary update.items)hasattrrI)ds rDdict_to_sequencerLs(q' GGII HrGcHd}d}ts*t|tr|d}t |drt |}nt |dr|j}n~t |drn |}tj|j }d|j vrtj dtn#tjt f$rYnwxYwt |dr |}t |d rW|U |dd |}||pdn'#t&$rd}YnwxYwn#t&$r||}YnwxYw|d}t)d||z S) Nrutf-8__len__lenfilenoba%Requests has determined the content-length for this request using the binary size of the file: however, the file has been opened in text mode (i.e. without the 'b' flag in the mode). This may lead to an incorrect content-length. In Requests 3.0, support will be removed for files in text mode.tellseek)r isinstancerencoderJrPrQosfstatst_sizemodewarningswarnrioUnsupportedOperationAttributeErrorrSrTr7max)o total_lengthcurrent_positionrQs rD super_lenresL Jq#.. HHW  q)1vv E  u H   XXZZF8F++3L!&   2$   '8    D  .q&% % vvxx q&!! %l&: %FF1aLLL#$6688LFF+0q1111%%%#$LLL%% 0 0 0 '#/  0* q,!11 2 22s7?CC)(C)=E9$AE&& E54E59F  F Fc tjd}||f}ndtD} ddlm}m}d}|D]D}tj|}tj|r|}nE|dSt|} | j } || | } | r| drdnd} | | | dfSdS#|tf$r|rYdSwxYw#ttf$rYdSwxYw)z;Returns the Requests tuple auth for a given url from netrc.NETRCNc3 K|] }d|V dS)z~/N).0fs rD z!get_netrc_auth..s(99888999999rGr)NetrcParseErrornetrcrrU)rXenvironget NETRC_FILESrnrmpath expanduserexistsrhostnameauthenticatorsr7r2r`) url raise_errors netrc_filenetrc_locationsrmrn netrc_pathrklocrir?r$login_is rDget_netrc_authrs((J%-99[999  00000000    A'$$Q''Cw~~c""      F c]]{ U:&&55d;;F 4%ay/!!aw33 4 4 )          (     s6AC8 C8$;C""C51C84C55C88D  D ct|dd}|rLt|tr9|ddkr/|ddkr%tj|SdSdSdSdS)z0Tries to guess the filename of the given object.nameNr<>)getattrrVrrXrrbasename)objrs rDguess_filenamersw 3 % %D & 4,,&aCDHPSOOw%%%&&&&OOrGctj|r|Stj|\}}|r|tj|s]tj|\}}|sn8d||g}|rtj|]t j|s|St j|}||vr|Stj }tj||dd}tj|sOt|5}| | |dddn #1swxYwY|S)zReplace nonexistent paths that look like they refer to a member of a zip archive with the location of an extracted copy of the target, or else just return the provided path unchanged. /rN)rXrrrtr9joinzipfile is_zipfileZipFilenamelisttempfile gettempdir atomic_openwriteread)rrarchivememberprefixzip_filetmpextracted_path file_handlers rDextract_zipped_pathsrs  w~~d gmmD))OGV ,"'..11,'--00  66*++ ,"'..11,  g & & w''H X&&((((     CW\\#v||C'8'8'<==N 7>>. ) )6  ( ( 6L   x}}V44 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 s>)F33F7:F7c#HKtjtj|\}} tj|d5}|Vdddn #1swxYwYtj||dS#t$rtj|wxYw)z-Write a file to the disk in an atomic fashion)dirwbN) rmkstemprXrrdirnamefdopenr; BaseExceptionremove)filenametmp_descriptortmp_name tmp_handlers rDrr's (/BGOOH4M4MNNNNH Y~t , ,                     8X&&&&&  ( s/BA BA##B&A#'B B!c|dSt|ttttfrt dt |S)aTake an object and test to see if it can be represented as a dictionary. Unless it can not be represented as such, return an OrderedDict, e.g., :: >>> from_key_val_list([('key', 'val')]) OrderedDict([('key', 'val')]) >>> from_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples >>> from_key_val_list({'key': 'val'}) OrderedDict([('key', 'val')]) :rtype: OrderedDict N+cannot encode objects that are not 2-tuples)rVrrboolr5r8rvalues rDfrom_key_val_listr4sG$ }t%#udC011HFGGG u  rGc|dSt|ttttfrt dt|t r|}t|S)aTake an object and test to see if it can be represented as a dictionary. If it can be, return a list of tuples, e.g., :: >>> to_key_val_list([('key', 'val')]) [('key', 'val')] >>> to_key_val_list({'key': 'val'}) [('key', 'val')] >>> to_key_val_list('string') Traceback (most recent call last): ... ValueError: cannot encode objects that are not 2-tuples :rtype: list Nr) rVrrrr5r8rrIlistrs rDto_key_val_listrOsd" }t%#udC011HFGGG%!!  ;;rGcg}t|D]N}|dd|ddcxkrdkrnnt|dd}||O|S)aParse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing. It basically works like :func:`parse_set_header` just that items may appear multiple times and case sensitivity is preserved. The return value is a standard :class:`list`: >>> parse_list_header('token, "quoted value"') ['token', 'quoted value'] To create a header from the :class:`list` again, use the :func:`dump_header` function. :param value: a string with a list header. :return: :class:`list` :rtype: list Nrr")_parse_list_headerunquote_header_valueappend)rresultitems rDparse_list_headerrms.F"5)) 8tBCCy ' ' ' 'C ' ' ' ' ''QrT 33D d MrGci}t|D]a}d|vrd||< |dd\}}|dd|ddcxkrdkrnnt|dd}|||<b|S)a^Parse lists of key, value pairs as described by RFC 2068 Section 2 and convert them into a python dict: >>> d = parse_dict_header('foo="is a fish", bar="as well"') >>> type(d) is dict True >>> sorted(d.items()) [('bar', 'as well'), ('foo', 'is a fish')] If there is no value for a key it will be `None`: >>> parse_dict_header('key_without_value') {'key_without_value': None} To create a header from the :class:`dict` again, use the :func:`dump_header` function. :param value: a string with a dict header. :return: :class:`dict` :rtype: dict =Nrrr)rr9r)rrrrs rDparse_dict_headerrs,F"5)) d??F4L jja(( e !9bcc ) ) ) )c ) ) ) ) )(qt55Et MrGc|r`|d|dcxkrdkrGnnD|dd}|r|dddkr*|ddd dS|S) zUnquotes a header value. (Reversal of :func:`quote_header_value`). This does not use the real unquoting but what browsers are actually using for quoting. :param value: the header value to unquote. :rtype: str rrrrNrUz\\\z\")r;)r is_filenames rDrrs CqU2Y----#----- ad  CeBQBi611==..66ucBB B LrGcd|D}|S)zReturns a key/value dictionary from a CookieJar. :param cj: CookieJar object to extract cookies from. :rtype: dict c(i|]}|j|jSri)rr)rjcookies rD z'dict_from_cookiejar..s>>>6; >>>rGricj cookie_dicts rDdict_from_cookiejarrs?>2>>>K rGc"t||S)zReturns a CookieJar from a key/value dictionary. :param cj: CookieJar to insert cookies into. :param cookie_dict: Dict of key/values to insert into CookieJar. :rtype: CookieJar rrs rDadd_dict_to_cookiejarrs {B / //rGc`tjdttjdtj}tjdtj}tjd}||||z||zS)zlReturns encodings from given content string. :param content: bytestring to extract encodings from. zIn requests 3.0, get_encodings_from_content will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)z!])flagsz+]z$^<\?xml.*?encoding=["\']*(.+?)["\'>])r\r]DeprecationWarningr<compiler>findall)content charset_re pragma_rexml_res rDget_encodings_from_contentrs  M 1  @MMMJ IQSQUVVVI Z? @ @F 7##   G $ $ % .. ! ! "rGc|d}|d|dd}}i}d}|D]}|}|rs|d}}|d} | dkr=|d| |}|| dzd|}|||<||fS) zReturns content type and parameters from given header :param header: string :return: tuple containing content type and dictionary of parameters r-rrNz"' Trr)r9stripfindlower) headertokens content_typeparams params_dictitems_to_stripparamkeyrindex_of_equalss rD_parse_content_type_headerrs\\#  F!!9??,,fQRRj&LKN--   -C#jjooO"$$,_,-33NCCo1334::>JJ',K $  $$rGc|d}|sdSt|\}}d|vr|ddSd|vrdSd|vrdSdS) z}Returns encodings from given HTTP Header Dict. :param headers: dictionary to extract encoding from. :rtype: str z content-typeNcharsetz'"textz ISO-8859-1zapplication/jsonrN)rprr)headersrrs rDget_encoding_from_headersrs;;~..L t5lCCL&Fi &&u--- |\))w*)rGc#K|j |Ed{VdStj|jd}|D]}||}|r|V|dd}|r|VdSdS)zStream decodes an iterator.Nr;errorsrGT)final)encodingcodecsgetincrementaldecoderdecode)iteratorrdecoderchunkrvs rDstream_decode_response_unicoder*s z6f*1:66iHHHG ^^E " "  HHH 4 ( (B rGc#Kd}||dkrt|}|t|kr)||||zV||z }|t|k'dSdS)z Iterate over slices of a string.rN)rP)string slice_lengthposs rD iter_slicesr;s{ C|q006{{ F  S3--.... | F      rGc:tjdtg}t|j}|r; t |j|S#t$r||YnwxYw t |j|dS#t$r |jcYSwxYw)zReturns the requested content back in unicode. :param r: Response object to get unicode content from. Tried: 1. charset from content-type 2. fall back and replace all unicode characters :rtype: str zIn requests 3.0, get_unicode_from_response will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)r;r) r\r]rrrrr UnicodeErrorr TypeError)rtried_encodingsrs rDget_unicode_from_responserEs M 1  O)33H- -qy(++ + - - -  " "8 , , , , , -19hy9999 ys#A A+*A+/BBBzBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~c|d}tdt|D]}||dd}t|dkr|ro t t |d}n!#t $rtd|dwxYw|tvr|||ddz||<d||||<d||||<d |S) zUn-escape any percent-escape sequences in a URI that are unreserved characters. This leaves all reserved, illegal and non-ASCII bytes encoded. :rtype: str %rrrUz"Invalid percent-escape sequence: ''N) r9rangerPisalnumchrr5r8r!UNRESERVED_SETr)uripartsihcs rDunquote_unreservedr rs IIcNNE 1c%jj ! ! & & !HQqSM q66Q;;199;;; LAr OO L L L !Ja!J!J!JKKK LN""uQx|+a)uQx>>a%58~~E!HH 775>>s -B  B)cd}d} tt||S#t$rt||cYSwxYw)zRe-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. :rtype: str z!#$%&'()*+,/:;=?@[]~z!#$&'()*+,/:;=?@[]~)safe)rr r!)rsafe_with_percentsafe_without_percents rD requote_urirsk/0 5',,3DEEEE 555S3444444 5s$AAc tjdtj|d}|d\}}tjdtjt t |d}tjdtj|d|z}||z||zkS)zThis function allows you to check if an IP belongs to a network subnet Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24 returns False if ip = 192.168.1.1 and net = 192.168.100.0/24 :rtype: bool z=Lrr)structunpacksocket inet_atonr9dotted_netmaskr5)ipnetipaddrnetaddrbitsnetmasknetworks rDaddress_in_networkr s]4!1"!5!5 6 6q 9FIIcNNMGTmD&"2>#d))3L3L"M"MNNqQGmD&"27";";<I)r inet_ntoarpack)maskrs rDrrs8 b4i1, ,D  FKd33 4 44rGcT tj|n#t$rYdSwxYwdS)z :rtype: bool FT)rrr7) string_ips rDis_ipv4_addressr(sB#### uu 4s  %%cN|ddkr t|dd}n#t$rYdSwxYw|dks|dkrdS t j|ddn#t $rYdSwxYwdSdS)zV Very simple check of the cidr format in no_proxy variable. :rtype: bool rrFr"rT)countr5r9r8rrr7)string_networkr%s rD is_valid_cidrr,s C  A%% ~++C00344DD   55  !88tbyy5   ^11#66q9 : : : :   55 u 4s#(A AA$-B B B c#K|du}|r.tj|}|tj|< dV|r"|tj|=dS|tj|<dSdS#|r|tj|=n|tj|<wxYw)zSet the environment variable 'env_name' to 'value' Save previous value, yield, and then restore the previous value stored in the environment variable 'env_name'. If 'value' is None, do nothingN)rXrorp)env_namer value_changed old_values rD set_environr1s%M%JNN8,, $ 81   1 Jx((('0 8$$$  1 1= 1 Jx(('0 8$0000s A""#Bcd}|}| |d}t|}|jdS|rd|dddD}t |jr<|D]8}t |rt |j|rdS*|j|krdS9nR|j}|jr |d |jz }|D]4}|j|s||rdS5td|5 t|j}n#ttj f$rd }YnwxYwdddn #1swxYwY|rdSd S) zL Returns whether we should bypass proxies or not. :rtype: bool ctj|p0tj|SN)rXrorpupper)rs rD get_proxyz(should_bypass_proxies..get_proxys1z~~c""AbjnnSYY[[&A&AArGNno_proxyTc3K|]}||V dSr4ri)rjr?s rDrlz(should_bypass_proxies.. s'RRTTRDRRRRRRrG r,:F)rrur;r9r(r,r portendswithr1rrrgaierror) rwr7r6 no_proxy_argparsedproxy_iphost_with_portr?bypasss rDshould_bypass_proxiesrDs#BBB L9Z(( c]]F t SRX%5%5c2%>%>%D%DS%I%IRRR 6? + + $   ** )&/8DD$#tt$_00 441  $_N{ 4"3fk"3"33   ?++D11 ^5L5LT5R5R  44 Z . . !&/22FF6?+   FFF  t 5s6ED)(E)EEEEEEcDt||riStS)zA Return a dict of environment proxies. :rtype: dict r7)rDr)rwr7s rDget_environ_proxiesrG0s( S8444 ||rGc|pi}t|}|j.||j|dS|jdz|jz|jd|jzdg}d}|D]}||vr ||}n|S)zSelect a proxy for the url, if applicable. :param url: The url being for the request :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs Nallz://zall://)rrurpscheme)rwproxiesurlparts proxy_keysproxy proxy_keys rD select_proxyrP<s mG}}H {{8?GKK,>,>??? %("338$$ J E   I&E E  LrGcd||ni}|j}t|j}|d}|}|rct ||sRt ||}|||d}|r||||S)aThis method takes proxy information from a request and configuration input to resolve a mapping of target proxies. This will consider settings such as NO_PROXY to strip proxy configurations. :param request: Request or PreparedRequest :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs :param trust_env: Boolean declaring whether to trust environment configs :rtype: dict Nr7rFrI)rwrrJrpcopyrDrG setdefault) requestrK trust_envrwrJr7 new_proxiesenviron_proxiesrNs rDresolve_proxiesrXVs!,gg"G +C c]] !F{{:&&H,,..K2.sXFFF2-cHEEE##FO,?,?,F,FGG  2  " "65 1 1 1 rGpython-requestsc|dtS)zO Return a string representing the default user agent. :rtype: str rr)rs rDdefault_user_agentr[qs  " "[ " ""rGcLtttdddS)z9 :rtype: requests.structures.CaseInsensitiveDict z*/*z keep-alive)z User-AgentzAccept-EncodingAccept Connection)r#r[DEFAULT_ACCEPT_ENCODINGrirGrDdefault_headersr`zs2 ,..6&     rGcg}d}||}|s|Stjd|D]} |dd\}}n#t$r|d}}YnwxYwd|di}|dD]X} |d\}}n#t$rYn0wxYw|||||<Y|||S) zReturn a list of parsed link headers proxies. i.e. Link: ; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" :rtype: list z '"z, * '"r)rr<r9r8r) rlinks replace_charsvalrwrlinkrrs rDparse_header_linksrfsA EM KK & &E  x&& "))C++KC " " "rCCC "syy**+\\#&& H HE "[[-- UU    .3[[-G-GD=)) * * T Ls#AA! A!B,, B:9B:asciirUc|dd}|tjtjfvrdS|ddtjkrdS|ddtjtjfvrdS|t}|dkrd S|dkr,|dddtkrd S|d ddtkrd S|dkr*|ddtkrd S|d dtkrdSdS)z :rtype: str Nzutf-32riz utf-8-sigrUzutf-16rrNz utf-16-berz utf-16-lez utf-32-bez utf-32-le) r BOM_UTF32_LE BOM_UTF32_BEBOM_UTF8 BOM_UTF16_LE BOM_UTF16_BEr*_null_null2_null3)datasample nullcounts rDguess_json_utfrws"1"XF &%v':;;;x bqbzV_$${ bqbzf)6+>???x U##IA~~wA~~ ##A#;& ; !$Q$<6 ! !;A~~ "1":  ; !"":  ; 4rGct|}|\}}}}}}} |j} | s|| }} |rd|| g} ||}|d}t|| |d|| fS)zGiven a URL that may or may not have a scheme, prepend the given scheme. Does not replace a present scheme with the one provided as an argument. :rtype: str @Nr)rnetlocrr) rw new_schemer@rJauthr?r<rrqueryfragmentrzs rDprepend_scheme_if_neededrs s^^F6<3FD$dE8 ]F $V *4.)) ~ | vvtRA B BBrGct|} t|jt|jf}n#tt f$rd}YnwxYw|S)z{Given a url with authentication components, extract them into a tuple of username,password. :rtype: (str,str) )rr)rrusernamepasswordr`r)rwr@r|s rDget_auth_from_urlrsd c]]F(('&/*B*BC I & Ks(:AAcT|\}}t||dt||ddS)zVerifies that header parts don't contain leading whitespace reserved characters, or return characters. :param header: tuple, in the format (name, value). rrN)_validate_header_part)rrrs rDcheck_header_validityrs7 KD%&$***&%+++++rGc Dt|trt|}nHt|trt|}n%t d|d|dt |||s|dkrdnd}t d|d|dS) Nz Header part (z) from z# must be of type str or bytes, not rrrzTInvalid leading whitespace, reserved character(s), or return character(s) in header z: )rVrr rr r typer=)r header_partheader_validator_index validator header_kinds rDrr s+s## *+AB K ' ' +,BC  EK E E& E E15k1B1B E E   ??; ' ' 6! ; ;ff  E&1 E E5@ E E     rGct|\}}}}}}|s||}}|ddd}t|||||dfS)zW Given a url remove the fragment and the authentication part. :rtype: str ryrrr)rrsplitr)rwrJrzrrrr}r~s rD urldefragauthrsb 5=SMM1FFD&% $V ]]3 " "2 &F vvtVUB? @ @@rGct|jdd}|Jt|jtr0 ||jdS#t $rt dwxYwt d)zfMove file pointer back to its recorded starting position so it can be read again on redirect. rTNz;An error occurred when rewinding request body for redirect.z+Unable to rewind request body for redirect.)rbodyrV_body_positionrr7r")prepared_request body_seeks rD rewind_bodyr/s(-vt<rs  ######<<<<<<<<$$$$$$ :99999)((((( ,+++++" $c** )) BHWll48889JKLL <7$$$L / / /   D3D3D3N) ) ) ) X&&&"""J    6<@F20002%%%22"$$$PM 0555, 5 5 55550 111*:::z    46####   """L  g  @CCC:    ,,,   &AAA"SSSSSrGPK!>>66666rrceZdZdZdS)rzAn HTTP error occurred.Nrrrrrr7!!!!rrceZdZdZdS)ConnectionErrorzA Connection error occurred.Nrrrrr'r';s&&&&rr'ceZdZdZdS) ProxyErrorzA proxy error occurred.Nrrrrr)r)?r%rr)ceZdZdZdS)SSLErrorzAn SSL error occurred.Nrrrrr+r+Crrr+ceZdZdZdS)TimeoutzThe request timed out. Catching this error will catch both :exc:`~requests.exceptions.ConnectTimeout` and :exc:`~requests.exceptions.ReadTimeout` errors. Nrrrrr-r-Gsrr-ceZdZdZdS)ConnectTimeoutzThe request timed out while trying to connect to the remote server. Requests that produced this error are safe to retry. Nrrrrr/r/Psrr/ceZdZdZdS) ReadTimeoutz@The server did not send any data in the allotted amount of time.Nrrrrr1r1WJJJJrr1ceZdZdZdS) URLRequiredz*A valid URL is required to make a request.Nrrrrr4r4[s4444rr4ceZdZdZdS)TooManyRedirectszToo many redirects.Nrrrrr6r6_srr6ceZdZdZdS) MissingSchemaz/The URL scheme (e.g. http or https) is missing.Nrrrrr8r8cs9999rr8ceZdZdZdS) InvalidSchemaz9The URL scheme provided is either invalid or unsupported.Nrrrrr:r:gsCCCCrr:ceZdZdZdS) InvalidURLz%The URL provided was somehow invalid.Nrrrrr<r<ks////rr<ceZdZdZdS) InvalidHeaderz.The header value provided was somehow invalid.Nrrrrr>r>os8888rr>ceZdZdZdS)InvalidProxyURLz"The proxy URL provided is invalid.Nrrrrr@r@s,,,,rr@ceZdZdZdS)ChunkedEncodingErrorz?The server declared chunked encoding but sent an invalid chunk.NrrrrrCrCwsIIIIrrCceZdZdZdS)ContentDecodingErrorz"Failed to decode response content.NrrrrrErE{rArrEceZdZdZdS)StreamConsumedErrorz3The content for this response was already consumed.NrrrrrGrGs====rrGceZdZdZdS) RetryErrorzCustom retries logic failedNrrrrrIrIs%%%%rrIceZdZdZdS)UnrewindableBodyErrorz;Requests encountered an error when trying to rewind a body.NrrrrrKrKsEEEErrKceZdZdZdS)RequestsWarningzBase warning for Requests.NrrrrrMrMs$$$$rrMceZdZdZdS)FileModeWarningzJA file was opened in text mode, but Requests determined its binary length.NrrrrrOrOsTTTTrrOceZdZdZdS)RequestsDependencyWarningz@An imported dependency doesn't match the expected version range.NrrrrrQrQr2rrQN)#rpip._vendor.urllib3.exceptionsr BaseHTTPErrorcompatrr!IOErrorrrr'r)r+r-r/r1r4r6 ValueErrorr8r:r<r>r@rCrE TypeErrorrGrIrKWarningrMDeprecationWarningrOrQrrrrZs FEEEEE<<<<<< * * * * *w * * *!!!!!'!!!66666&(=6660""""" """'''''&'''""""""""!!!!!!!!_gKKKKK'KKK55555"555':::::$j:::DDDDD$jDDD00000!:00099999$j999-----j---JJJJJ+JJJ-----+]--->>>>>*I>>>&&&&&!&&&FFFFF,FFF%%%%%g%%%UUUUUo'9UUUKKKKKKKKKKrPK!czs!__pycache__/hooks.cpython-311.pycnu[ |oidZdgZdZdZdS)z requests.hooks ~~~~~~~~~~~~~~ This module provides the capabilities for the Requests hooks system. Available hooks: ``response``: The response generated from a Request. responsec$dtDS)Nci|]}|gSr).0events Q/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/hooks.py z!default_hooks..s ) ) )%E2 ) ) ))HOOKSrr r default_hooksr s ) )5 ) ) ))r c |pi}||}|r%t|dr|g}|D]}||fi|}||}|S)z6Dispatches a hook dictionary on a given piece of data.__call__)gethasattr)keyhooks hook_datakwargshook _hook_datas r dispatch_hookrss KRE IIcNNE ' 5* % % GE ' 'Di22622J%& r N)__doc__r r rrr rrs@    ***     r PK!Ft׬``+__pycache__/_internal_utils.cpython-311.pycnu[ |oidZddlZddlmZejdZejdZejdZejdZeefZ eefZ e e e e iZ d d Zd ZdS) z requests._internal_utils ~~~~~~~~~~~~~~ Provides utility functions that are consumed internally by Requests which depend on extremely few external helpers (such as compat) N) builtin_strs^[^:\s][^:\r\n]*$z^[^:\s][^:\r\n]*$s^\S[^\r\n]*$|^$z^\S[^\r\n]*$|^$asciic`t|tr|}n||}|S)zGiven a string object, regardless of type, returns a representation of that string in the native string type, encoding and decoding where necessary. This assumes ASCII unless told otherwise. ) isinstancerdecode)stringencodingouts [/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/_internal_utils.pyto_native_stringr s3 &+&&&mmH%% Jct|tsJ |ddS#t$rYdSwxYw)zDetermine if unicode string only contains ASCII characters. :param str u_string: unicode string to check. Must be unicode and not Python 2 `str`. :rtype: bool rTF)rstrencodeUnicodeEncodeError)u_strings r unicode_is_asciir&sX h $ $$$ $   t uus 0 >>)r)__doc__recompatrcompile_VALID_HEADER_NAME_RE_BYTE_VALID_HEADER_NAME_RE_STR_VALID_HEADER_VALUE_RE_BYTE_VALID_HEADER_VALUE_RE_STR_HEADER_VALIDATORS_STR_HEADER_VALIDATORS_BYTEbytesrHEADER_VALIDATORSr rrr r"s 'RZ(=>>&BJ';<<(bj)<=='RZ(:;;35OP57RS "          rPK!C 9 9 __pycache__/auth.cpython-311.pycnu[ |oi'dZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z m Z mZddlmZddlmZd Zd Zd ZGd d ZGddeZGddeZGddeZdS)z] requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. N) b64encode)to_native_string) basestringstrurlparse)extract_cookies_to_jar)parse_dict_headerz!application/x-www-form-urlencodedzmultipart/form-datac t|ts=tjd|t t |}t|tsJtjdt|t t |}t|t r|d}t|t r|d}dttd ||f z}|S)zReturns a Basic Auth string.zNon-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in ({!r}) to a string or bytes object in the near future to avoid problems.)categoryzNon-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in ({!r}) to a string or bytes object in the near future to avoid problems.latin1zBasic :) isinstancerwarningswarnformatDeprecationWarningrtypeencoderrjoinstrip)usernamepasswordauthstrs P/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/auth.py_basic_auth_strrs6 h + +!  x(('     x== h + +!  tH~~..'     x==(C  -??8,,(C  -??8,,)$))Xx0112288::G NceZdZdZdZdS)AuthBasez4Base class that all auth implementations derive fromc td)NzAuth hooks must be callable.)NotImplementedErrorselfrs r__call__zAuthBase.__call__Hs!"@AAArN__name__ __module__ __qualname____doc__r%rrrrEs.>>BBBBBrrc*eZdZdZdZdZdZdZdS) HTTPBasicAuthz?Attaches HTTP Basic Authentication to the given Request object.c"||_||_dSN)rrr#rrs r__init__zHTTPBasicAuth.__init__Os    rc t|jt|ddk|jt|ddkgSNrrallrgetattrrr#others r__eq__zHTTPBasicAuth.__eq__SE  D!A!AA  D!A!AA    rc||k Sr/r+r7s r__ne__zHTTPBasicAuth.__ne__[5=  rcJt|j|j|jd<|S)N Authorizationrrrheadersr"s rr%zHTTPBasicAuth.__call__^s!%4T]DM%R%R /"rN)r'r(r)r*r1r9r<r%r+rrr-r-LsVII!!!   !!!rr-ceZdZdZdZdS) HTTPProxyAuthz=Attaches HTTP Proxy Authentication to a given Request object.cJt|j|j|jd<|S)NzProxy-Authorizationr@r"s rr%zHTTPProxyAuth.__call__fs"+:4=$-+X+X '(rNr&r+rrrCrCcs)GGrrCcBeZdZdZdZdZdZdZdZdZ dZ d Z d S) HTTPDigestAuthz@Attaches HTTP Digest Authentication to the given Request object.cR||_||_tj|_dSr/)rr threadinglocal _thread_localr0s rr1zHTTPDigestAuth.__init__ns&    &_..rct|jdsJd|j_d|j_d|j_i|j_d|j_d|j_dSdS)NinitTr)hasattrrJrL last_nonce nonce_countchalpos num_401_calls)r#s rinit_per_thread_statez$HTTPDigestAuth.init_per_thread_statetsit)622 4&*D  #,.D  )-.D  *&(D  #%)D  "/3D  , , ,  4 4rc |jjd}|jjd}|jjd}|jjd}|jjd}d|d}n|}|dks|dkrd } | n#|d krd } | n|d krd } | n |dkrd} | fd} dSd}t |}|jpd}|jr |d|jz }|jd|d|j}|d|}|}|}||jj kr|jxj dz c_ n d|j_ |jj d}t|jj  d}|| dz }|tj dz }|tjdz }t#j|dd}|dkr|d|d|}|s| ||d|}n9|dksd|dvr|d|d|d|}| ||}ndS||j_ d|jd|d|d|d |d! }|r |d"|d!z }|r |d#|d!z }|r |d$|d!z }|r |d%|d&|d!z }d'|S)(z :rtype: str realmnonceqop algorithmopaqueNMD5zMD5-SESSct|tr|d}tj|SNutf-8)rrrhashlibmd5 hexdigestxs rmd5_utf8z4HTTPDigestAuth.build_digest_header..md5_utf8s?a%%*))A{1~~//111rSHAct|tr|d}tj|Sr])rrrr_sha1rarbs rsha_utf8z4HTTPDigestAuth.build_digest_header..sha_utf8s?a%%*))A|A00222rzSHA-256ct|tr|d}tj|Sr])rrrr_sha256rarbs r sha256_utf8z7HTTPDigestAuth.build_digest_header..sha256_utf8Aa%%*))A~a((22444rzSHA-512ct|tr|d}tj|Sr])rrrr_sha512rarbs r sha512_utf8z7HTTPDigestAuth.build_digest_header..sha512_utf8rlrc$|d|S)N:r+)sd hash_utf8s rz4HTTPDigestAuth.build_digest_header..s))qJJ1JJ//r/?rqr08xr^auth,z:auth:z username="z ", realm="z ", nonce="z", uri="z ", response=""z , opaque="z , algorithm="z , digest="z, qop="auth", nc=z , cnonce="zDigest )rJrQgetupperrpathqueryrrrOrPrrtimectimeosurandomr_rgrasplit)r#methodurlrVrWrXrYrZ _algorithmrdrhrkroKDentdigp_parsedrA1A2HA1HA2ncvaluerrcnoncerespdignoncebitbaserts @rbuild_digest_headerz"HTTPDigestAuth.build_digest_header~s5 "'0"'0 %))%00&+// << #(,,X66  JJ"**J   * ":": 2 2 2 !II 5  3 3 3 !II 9 $ $ 5 5 5 $II 9 $ $ 5 5 5 $I / / / /  4C==}# > ) ((( (D 7 7 7 7 7 7    immimm D&1 1 1   * *a / * * *-.D  *'399 ". / / 6 6w ? ? U\\' " "" TZ\\  ) )) RZ]]a**,,SbS1  # #)s55U55V5566C b....//GG F]]f #66??'??F??#??Hbh''GG4(-% 2 2 2% 2 25 2 2 2 2'. 2 2 2   + **** *D  1 0I000 0D  + **** *D  E DDD6DDD DDrc 0|jrd|j_dSdS)z)Reset num_401_calls counter on redirects.rN) is_redirectrJrS)r#r$kwargss rhandle_redirectzHTTPDigestAuth.handle_redirects' = 1/0D  , , , 1 1rc d|jcxkrdksnd|j_|S|jj)|jj|jj|jdd}d| vrA|jjdkr0|jxjdz c_tj d tj }t|d|d |j_|j||j}t'|j|j|j||j||j|j|jd <|jj|fi|}|j|||_|Sd|j_|S) zo Takes the given response and tries digest-auth, if needed. :rtype: requests.Response iirNzwww-authenticaterMdigestzdigest )flags)countr?) status_coderJrSrRrequestbodyseekrAr~lowerrecompile IGNORECASEr subrQcontentclosecopyr _cookiesrawprepare_cookiesrrr connectionsendhistoryappend)r#r$rs_authpatprep_rs r handle_401zHTTPDigestAuth.handle_401sam))))c))))/0D  ,H   ! - IN   2 6 7 7 71266 v||~~ % %$*<*JQ*N*N   , , 1 , ,*Zr}===C&7FRS8T8T&U&UD  # II GGIII9>>##D "4=!)QU C C C   / / /,0,D,D TX--DL )#"422622B J  a BJI+,(rc||jjr(||j|j|jd< |j|j_ n#t$rd|j_ YnwxYw| d|j | d|j d|j_|S)Nr?responser)rTrJrOrrrrArtellrRAttributeError register_hookrrrSr"s rr%zHTTPDigestAuth.__call__s ""$$$   ( S)-)A)A!(AE)R)RAIo & *%&V[[]]D  " " * * * &*D  " " "  *  DO444  D$8999+,(s #A..BBc t|jt|ddk|jt|ddkgSr3r4r7s rr9zHTTPDigestAuth.__eq__1r:rc||k Sr/r+r7s rr<zHTTPDigestAuth.__ne__9r=rN) r'r(r)r*r1rTrrrr%r9r<r+rrrFrFksJJ/// 444l l l \111 ***X(   !!!!!rrF)r*r_rrrHrrbase64r_internal_utilsrcompatrrrcookiesr utilsr CONTENT_TYPE_FORM_URLENCODEDCONTENT_TYPE_MULTI_PARTrrr-rCrFr+rrrs  ----------------++++++$$$$$$B/)))XBBBBBBBBH.MO!O!O!O!O!XO!O!O!O!O!rPK!uu$__pycache__/adapters.cpython-311.pycnu[ |oi=gdZddlZddlZddlZddlZddlmZmZddlm Z ddlm Z ddlm Z mZmZmZddlmZddlmZmZdd lmZdd lmZmZdd lmZdd lmZdd lmZddl m!Z!ddl"m#Z#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m Z m*Z*m+Z+m,Z,mZm-Z-m.Z.mZddl/m0Z0ddl1m2Z2ddl3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z: ddl;mrddl/m?Z?dZ@dZAdZBdZC d*d%ZDGd&d'ZEGd(d)eEZFdS)+z requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. N)ClosedPoolErrorConnectTimeoutError) HTTPError) InvalidHeader)LocationValueError MaxRetryErrorNewConnectionError ProtocolError) ProxyError)ReadTimeoutError ResponseError)SSLError) PoolManagerproxy_from_url)Timeout) parse_url)Retry)_basic_auth_str) basestringurlparse)extract_cookies_to_jar) ConnectionErrorConnectTimeoutrInvalidProxyURL InvalidSchema InvalidURLr ReadTimeout RetryErrorr)Response)CaseInsensitiveDict)DEFAULT_CA_BUNDLE_PATHextract_zipped_pathsget_auth_from_urlget_encoding_from_headersprepend_scheme_if_needed select_proxy urldefragauth)SOCKSProxyManagerc td)Nz'Missing dependencies for SOCKS support.)r)argskwargss T/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/adapters.pyr)r)>sEFFF)PreparedRequestF requestr/verifybool | str | None client_cert#typing.Tuple[str, str] | str | None poolmanagerrreturn<(typing.Dict[str, typing.Any], typing.Dict[str, typing.Any])ci}i}t|j}|j}|j}d} |durd} n?t |t r*tj |s||d<n||d<| |d<|Dt |tr*t|dkr|d|d <|d |d <n||d <||j |d }||fS) N CERT_REQUIREDF CERT_NONEca_certs ca_cert_dir cert_reqsr cert_filerkey_file)schemehostport) rurlrBlowerrD isinstancestrospathisdirtuplelenhostname) r1r2r4r6 host_params pool_kwargsparsed_request_urlrBrDr>s r-_urllib3_request_contextrRLs KK!'+..  & , , . .F  "DI  FC 0w}}V$$ 0&,K # #)/K &(K  k5 ) ) 3c+.>.>!.C.C'21~K $&1!nK # #(3K $"+K  ##r.c2eZdZdZfdZ ddZdZxZS) BaseAdapterzThe Base Transport AdaptercHtdSN)super__init__)self __class__s r-rXzBaseAdapter.__init__ts r.FNTct)aCSends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. NotImplementedError)rYr1streamtimeoutr2certproxiess r-sendzBaseAdapter.sendws ""!r.ct)z!Cleans up adapter specific items.r\rYs r-closezBaseAdapter.closes!!r.FNTNN)__name__ __module__ __qualname____doc__rXrbre __classcell__rZs@r-rTrTqsh$$TX""""&"""""""r.rTceZdZdZgdZeeeeffd ZdZ dZ efdZ dZ dZ d Zdd Zdd Zdd ZdZdZdZdZ ddZxZS) HTTPAdapteraThe built-in HTTP Adapter for urllib3. Provides a general-case interface for Requests sessions to contact HTTP and HTTPS urls by implementing the Transport Adapter interface. This class will usually be created by the :class:`Session ` class under the covers. :param pool_connections: The number of urllib3 connection pools to cache. :param pool_maxsize: The maximum number of connections to save in the pool. :param max_retries: The maximum number of retries each connection should attempt. Note, this applies only to failed DNS lookups, socket connections and connection timeouts, never to requests where data has made it to the server. By default, Requests does not retry failed connections. If you need granular control over the conditions under which we retry a request, import urllib3's ``Retry`` class and pass that instead. :param pool_block: Whether the connection pool should block for connections. Usage:: >>> import requests >>> s = requests.Session() >>> a = requests.adapters.HTTPAdapter(max_retries=3) >>> s.mount('http://', a) ) max_retriesconfig_pool_connections _pool_maxsize _pool_blockc4|tkrtdd|_ntj||_i|_i|_t ||_||_ ||_ | |||dS)NrF)readblock) DEFAULT_RETRIESrrofrom_intrp proxy_managerrWrXrqrrrsinit_poolmanager)rYpool_connections pool_maxsizero pool_blockrZs r-rXzHTTPAdapter.__init__s / ) )$QU333D  $~k::D   !1)% . JOOOOOr.c*fdjDS)Nc4i|]}|t|dSrV)getattr).0attrrYs r- z,HTTPAdapter.__getstate__..s'KKKDgdD$//KKKr.) __attrs__rds`r- __getstate__zHTTPAdapter.__getstate__sKKKKDNKKKKr.ci|_i|_|D]\}}t|||||j|j|jdS)Nrv)rzrpitemssetattrr{rqrrrs)rYstatervalues r- __setstate__zHTTPAdapter.__setstate__sz   ;;== ' 'KD% D$ & & & &   "D$6d>N      r.c Z||_||_||_td|||d||_dS)aInitializes a urllib3 PoolManager. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param connections: The number of urllib3 connection pools to cache. :param maxsize: The maximum number of connections to save in the pool. :param block: Block when no free connections are available. :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager. ) num_poolsmaxsizerwN)rqrrrsrr6)rY connectionsrrwrPs r-r{zHTTPAdapter.init_poolmanagersQ"-$ & !     r.c ||jvr|j|}n|dr?t|\}}t |f|||j|j|jd|x}|j|<n@||}t|f||j|j|jd|x}|j|<|S)aReturn urllib3 ProxyManager for the given proxy. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param proxy: The proxy to return a urllib3 ProxyManager for. :param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager. :returns: ProxyManager :rtype: urllib3.ProxyManager socks)usernamepasswordrrrw) proxy_headersrrrw) rzrF startswithr$r)rqrrrsrr)rYproxy proxy_kwargsmanagerrrrs r-proxy_manager_forzHTTPAdapter.proxy_manager_fors D& & &(/GG [[]] % %g . . !25!9!9 Hh2C3!!0*& 3333 Gd(//!..u55M2@3+0*& 33  33 Gd(/r.c |dr|rd}|dur|}|stt}|rtj|std|d|_tj |s||_ n||_ nd|_d|_ d|_ |rt|ts|d|_|d|_n||_d|_|jr;tj|jstd |j|jr=tj|jstd |jdSdSdS) aAVerify a SSL certificate. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param conn: The urllib3 connection object associated with the cert. :param url: The requested URL. :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: The SSL certificate to verify. httpsNTzCCould not find a suitable TLS CA certificate bundle, invalid path: r:r;rrz7Could not find the TLS certificate file, invalid path: z/Could not find the TLS key file, invalid path: )rFrr#r"rIrJexistsOSErrorr>rKr<r=rGrr@rA)rYconnrEr2r`cert_locs r- cert_verifyzHTTPAdapter.cert_verifys 99;; ! !' * * $v $HT!!! H/0FGG 27>>(#;#; 0%-00 -DN7==** , ( #+  (DN DM#D   dJ// %!%a $Q !% $ ~ bgnnT^&D&D 6%)^66} RW^^DM%B%B UdmUU      r.ct}t|dd|_tt|di|_t |j|_||_|jj|_t|j tr |j d|_ n |j |_ t|j||||_||_|S)aBuilds a :class:`Response ` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter ` :param req: The :class:`PreparedRequest ` used to generate the response. :param resp: The urllib3 response object. :rtype: requests.Response statusNheaderszutf-8)r r status_coder!rr%encodingrawreasonrGrEbytesdecodercookiesr1 connection)rYreqrespresponses r-build_responsezHTTPAdapter.build_responsePs:: 'tXt<</wtY/K/KLL6h6FGG ",- cgu % % #7>>'22HLL7HL x/d;;;"r.Nc0t||||jS)a Build the PoolKey attributes used by urllib3 to return a connection. This looks at the PreparedRequest, the user-specified verify value, and the value of the cert parameter to determine what PoolKey values to use to select a connection from a given urllib3 Connection Pool. The SSL related pool key arguments are not consistently set. As of this writing, use the following to determine what keys may be in that dictionary: * If ``verify`` is ``True``, ``"ssl_context"`` will be set and will be the default Requests SSL Context * If ``verify`` is ``False``, ``"ssl_context"`` will not be set but ``"cert_reqs"`` will be set * If ``verify`` is a string, (i.e., it is a user-specified trust bundle) ``"ca_certs"`` will be set if the string is not a directory recognized by :py:func:`os.path.isdir`, otherwise ``"ca_cert_dir"`` will be set. * If ``"cert"`` is specified, ``"cert_file"`` will always be set. If ``"cert"`` is a tuple with a second item, ``"key_file"`` will also be present To override these settings, one may subclass this class, call this method and use the above logic to change parameters as desired. For example, if one wishes to use a custom :py:class:`ssl.SSLContext` one must both set ``"ssl_context"`` and based on what else they require, alter the other keys to ensure the desired behaviour. :param request: The PreparedReqest being sent over the connection. :type request: :class:`~requests.models.PreparedRequest` :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. :param cert: (optional) Any user-provided SSL certificate for client authentication (a.k.a., mTLS). This may be a string (i.e., just the path to a file which holds both certificate and key) or a tuple of length 2 with the certificate file path and key file path. :returns: A tuple of two dictionaries. The first is the "host parameters" portion of the Pool Key including scheme, hostname, and port. The second is a dictionary of SSLContext related parameters. )rRr6)rYr1r2r`s r-$build_connection_pool_key_attributesz0HTTPAdapter.build_connection_pool_key_attributesus`(t?OPPPr.ct|j|} ||||\}}n##t$r}t ||d}~wwxYw|r\t |d}t |} | jstd| |} | j di|d|i} n|j j di|d|i} | S)aqReturns a urllib3 connection for the given request and TLS settings. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` object to be sent over the connection. :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. :param proxies: (optional) The proxies dictionary to apply to the request. :param cert: (optional) Any user-provided SSL certificate to be used for client authentication (a.k.a., mTLS). :rtype: urllib3.ConnectionPool r1NhttpFPlease check proxy URL. It is malformed and could be missing the host.rPr) r'rEr ValueErrorrr&rrCrrconnection_from_hostr6) rYr1r2rar`rrOrPe proxy_urlrzrs r-get_connection_with_tls_contextz+HTTPAdapter.get_connection_with_tls_contextsA(W['22 1'+'P'P(( $K  1 1 1Q000 0 1  ,UF;;E!%((I> %5!22599M5=5+6DD 94#8+6D s2 AA  Actjdtt||}|r`t |d}t |}|jstd||}| |}n=t|}| }|j |}|S)aDEPRECATED: Users should move to `get_connection_with_tls_context` for all subclasses of HTTPAdapter using Requests>=2.32.2. Returns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param url: The URL to connect to. :param proxies: (optional) A Requests-style dictionary of proxies used on this request. :rtype: urllib3.ConnectionPool z`get_connection` has been deprecated in favor of `get_connection_with_tls_context`. Custom HTTPAdapter subclasses will need to migrate for Requests>=2.32.2. Please see https://github.com/psf/requests/pull/6710 for more details.rr) warningswarnDeprecationWarningr'r&rrCrrconnection_from_urlrgeturlr6)rYrErarrrzrparseds r-get_connectionzHTTPAdapter.get_connections  N    S'**  =,UF;;E!%((I> %5!22599M 44S99DDc]]F--//C#77<`. :param request: The :class:`PreparedRequest ` being sent. :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs. :rtype: str rFrz///) r'rErrBrFrpath_urllstripr() rYr1rarrBis_proxied_http_requestusing_socks_proxy proxy_schemerEs r- request_urlzHTTPAdapter.request_url sW['22'+&&-"'"=Fg,=!  A#E??17799L , 7 7 @ @  >>$   ('cjjoo''C " -+< - ,,C r.c dS)a"Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter `. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` to add headers to. :param kwargs: The keyword arguments from the call to send(). Nr)rYr1r,s r- add_headerszHTTPAdapter.add_headers+s  r.cXi}t|\}}|rt|||d<|S)aReturns a dictionary of the headers to add to any request sent through a proxy. This works with urllib3 magic to ensure that they are correctly sent to the proxy, rather than in a tunnelled request if CONNECT is being used. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param proxy: The url of the proxy being used for this request. :rtype: dict zProxy-Authorization)r$r)rYrrrrs r-rzHTTPAdapter.proxy_headers9s>.u55(  Q-f$rx}t|t8rt;||t|t@rtC||t|tDrtG||d}~wwxYw|$|| S) aSends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response )rar`rN)r^r_r2r`razContent-Length)connectruzInvalid timeout za. Pass a (connect, read) timeout tuple, or a single float to set both timeouts to the same value.F) methodrEbodyrredirectassert_same_hostpreload_contentdecode_contentretriesr_chunked)%rrrrrErrrrrGrL TimeoutSaucerurlopenrror rrrrrr rr r _ProxyErrorr _SSLErrorrr _HTTPErrorr r_InvalidHeaderrr)rYr1r^r_r2r`rarrrErrrurerrs r-rbzHTTPAdapter.sendNs& 177t8DD" 1 1 1Q000 0 1 w{FD999w00      |t+R/?7?/RS gu % % B  ' &wTBBB    QwQQQ   . . B "7AAAG3 <<~\!& %$(  DDw' 8 8 8!#w777 7 6 6 6!($788 =!!(,>??=(G<<<<!(M22 5 G4444!(K00 5 G4444!(I.. 3q'2222!!W555 5 6 6 6!!W555 5   Q-- :&   !Y'' q'2222A/00 !!W5555A~.. #Aw7777 ""7D111sf <7<6C C+4E LE.. L;CI LI00 L=J  L A3LLrV)NNrf)rgrhrirjrDEFAULT_POOLSIZErxDEFAULT_POOLBLOCKrXrrr{rrrrrrrerrrrbrkrls@r-rnrnsy4I*%#$ PPPPPP,LLL    +<    4$$$L666p###J0Q0Q0Q0Qd////b''''R@    ,TXj2j2j2j2j2j2j2j2r.rn) r1r/r2r3r4r5r6rr7r8)Grjos.pathrIsockettypingrpip._vendor.urllib3.exceptionsrrrrrrrrr r r rr r rrpip._vendor.urllib3.poolmanagerrrpip._vendor.urllib3.utilrrrpip._vendor.urllib3.util.retryrauthrcompatrrrr exceptionsrrrrrrrmodelsr structuresr!utilsr"r#r$r%r&r'r(!pip._vendor.urllib3.contrib.socksr) ImportError TYPE_CHECKINGr/rrrxDEFAULT_POOL_TIMEOUTrRrTrnrr.r-rs OOOOOOOOBBBBBBJJJJJJ EDDDDDJJJJJJJJ@@@@@@GGGGGGGG<<<<<<......000000!!!!!!((((((((++++++                        ++++++GCCCCCCCGGGGGGGGG  (''''''"$ "$ "$7"$ "$ D "$"$"$"$J""""""""=B>PK!- ~ii#__pycache__/cookies.cpython-311.pycnu[ |oiH dZddlZddlZddlZddlmZddlmZmZm Z m Z m Z  ddl Z n#e $rddlZ YnwxYwGddZGdd Zd Zd Zdd ZGd deZGdde jeZdZdZdZddZdZdS)z requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `http.cookiejar.CookieJar` with requests. requests.utils imports from here, so be careful with imports. N)to_native_string)MorselMutableMapping cookieliburlparse urlunparseceZdZdZdZdZdZdZdZdZ dZ dd Z d Z d Z d ZedZedZedZd S) MockRequestaWraps a `requests.Request` to mimic a `urllib2.Request`. The code in `http.cookiejar.CookieJar` expects this interface in order to correctly manage cookie policies, i.e., determine whether a cookie can be set, given the domains of the request and the cookie. The original request object is read-only. The client is responsible for collecting the new headers via `get_new_headers()` and interpreting them appropriately. You probably want `get_cookie_header`, defined below. ch||_i|_t|jjj|_dSN)_r _new_headersrurlschemetype)selfrequests S/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/cookies.py__init__zMockRequest.__init__#s+TW[))0 c|jSr )rrs rget_typezMockRequest.get_type(s yrc>t|jjjSr )rrrnetlocrs rget_hostzMockRequest.get_host+s $$++rc*|Sr rrs rget_origin_req_hostzMockRequest.get_origin_req_host.s}}rc(|jjds |jjSt |jjdd}t |jj}t |j||j|j |j |j gS)NHostzutf-8)encoding) rheadersgetrrrr rpathparamsqueryfragment)rhostparseds r get_full_urlzMockRequest.get_full_url1sw""6** 7;  7'JJJ$'+&&         rcdSNTrs ris_unverifiablezMockRequest.is_unverifiableEstrc0||jjvp||jvSr )rr$rrnames r has_headerzMockRequest.has_headerHstw&C$$2C*CCrNct|jj||j||Sr )rr$r%r)rr3defaults r get_headerzMockRequest.get_headerKs/w""4):)>)>tW)M)MNNNrc td)zMcookiejar has no legitimate use for this method; add it back if you find one.z=Cookie headers should be added with add_unredirected_header())NotImplementedError)rkeyvals r add_headerzMockRequest.add_headerNs! K   rc||j|<dSr rrr3values radd_unredirected_headerz#MockRequest.add_unredirected_headerTs"'$rc|jSr r>rs rget_new_headerszMockRequest.get_new_headersWs   rc*|Sr )r0rs r unverifiablezMockRequest.unverifiableZs##%%%rc*|Sr )r rs rorigin_req_hostzMockRequest.origin_req_host^s'')))rc*|Sr rrs rr*zMockRequest.hostbs}}rr )__name__ __module__ __qualname____doc__rrrr r,r0r4r7r<rArCpropertyrErGr*r/rrr r s   111 ,,,   (DDDOOOO   (((!!!&&X&**X*Xrr c$eZdZdZdZdZdZdS) MockResponsezWraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. ...what? Basically, expose the parsed HTTP headers from the server response the way `http.cookiejar` expects to see them. c||_dS)zMake a MockResponse for `cookiejar` to read. :param headers: a httplib.HTTPMessage or analogous carrying the headers N_headers)rr$s rrzMockResponse.__init__ns   rc|jSr rQrs rinfozMockResponse.infous }rc:|j|dSr )rR getheadersr2s rrVzMockResponse.getheadersxs   &&&&&rN)rIrJrKrLrrTrVr/rrrOrOgsK    '''''rrOct|dr|jsdSt|}t|jj}|||dS)zExtract the cookies from the response into a CookieJar. :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar) :param request: our own requests.Request object :param response: urllib3.HTTPResponse object _original_responseN)hasattrrXr rOmsgextract_cookies)jarrresponsereqress rextract_cookies_to_jarr`|sb H2 3 38S g  C x26 7 7CS!!!!!rct|}|||dS)zj Produce an appropriate Cookie header string to be sent with `request`, or None. :rtype: str Cookie)r add_cookie_headerrCr%)r\rrs rget_cookie_headerresE GA!     " "8 , ,,rcg}|D]Q}|j|kr| ||jkr| ||jkr*||j|j|jfR|D]\}}}||||dS)zkUnsets a cookie by name, by default over all domains and paths. Wraps CookieJar.clear(), is O(n). N)r3domainr&appendclear) cookiejarr3rgr& clearablescookies rremove_cookie_by_namerms JEE ;$     &FM"9"9    3 3 6=&+v{CDDDD(,,dd++++,,rceZdZdZdS)CookieConflictErrorzThere are two cookies that meet the criteria specified in the cookie jar. Use .get and .set and include domain and path args in order to be more specific. N)rIrJrKrLr/rrrorosrroceZdZdZddZdZdZdZdZdZ d Z d Z d Z d Z d ZddZfdZdZdZdZfdZfdZddZddZdZdZdZdZxZS)RequestsCookieJaraCompatibility class; is a http.cookiejar.CookieJar, but exposes a dict interface. This is the CookieJar we create by default for requests and sessions that don't specify one, since some clients may expect response.cookies and session.cookies to support dict operations. Requests does not use the dict interface internally; it's just for compatibility with external client code. All requests code should work out of the box with externally provided instances of ``CookieJar``, e.g. ``LWPCookieJar`` and ``FileCookieJar``. Unlike a regular CookieJar, this class is pickleable. .. warning:: dictionary operations that are normally O(1) may be O(n). NcV ||||S#t$r|cYSwxYw)zDict-like get() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. .. warning:: operation is O(n), not O(1). )_find_no_duplicatesKeyError)rr3r6rgr&s rr%zRequestsCookieJar.getsC ++D&$?? ?   NNN s  ((c |;t|||d|ddSt|trt |}nt ||fi|}|||S)zDict-like set() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. Nrgr&)rgr&)rmr% isinstancermorsel_to_cookie create_cookie set_cookie)rr3r@kwargscs rsetzRequestsCookieJar.sets = !d6::h#7#7fjj>P>P     F eV $ $ 5 ''AAdE44V44A rc#@Kt|D] }|jV dS)zDict-like iterkeys() that returns an iterator of names of cookies from the jar. .. seealso:: itervalues() and iteritems(). N)iterr3rrls riterkeyszRequestsCookieJar.iterkeyss8 4jj  F+      rcDt|S)zDict-like keys() that returns a list of names of cookies from the jar. .. seealso:: values() and items(). )listrrs rkeyszRequestsCookieJar.keyss DMMOO$$$rc#@Kt|D] }|jV dS)zDict-like itervalues() that returns an iterator of values of cookies from the jar. .. seealso:: iterkeys() and iteritems(). N)r~r@rs r itervalueszRequestsCookieJar.itervaluess8 4jj  F,      rcDt|S)zDict-like values() that returns a list of values of cookies from the jar. .. seealso:: keys() and items(). )rrrs rvalueszRequestsCookieJar.valuess DOO%%&&&rc#NKt|D]}|j|jfVdS)zDict-like iteritems() that returns an iterator of name-value tuples from the jar. .. seealso:: iterkeys() and itervalues(). N)r~r3r@rs r iteritemszRequestsCookieJar.iteritemss? 4jj , ,F+v|+ + + + + , ,rcDt|S)zDict-like items() that returns a list of name-value tuples from the jar. Allows client-code to call ``dict(RequestsCookieJar)`` and get a vanilla python dict of key value pairs. .. seealso:: keys() and values(). )rrrs ritemszRequestsCookieJar.items sDNN$$%%%rctg}t|D]%}|j|vr||j&|S)z2Utility method to list all the domains in the jar.r~rgrhrdomainsrls r list_domainszRequestsCookieJar.list_domainssC4jj . .F}G++v}---rctg}t|D]%}|j|vr||j&|S)z0Utility method to list all the paths in the jar.)r~r&rh)rpathsrls r list_pathszRequestsCookieJar.list_pathssC4jj * *F{%'' V[))) rcg}t|D]/}|j |j|vrdS||j0dS)zvReturns True if there are multiple domains in the jar. Returns False otherwise. :rtype: bool NTFrrs rmultiple_domainsz"RequestsCookieJar.multiple_domains%sU 4jj * *F}(V]g-E-Ett NN6= ) ) ) )urci}t|D]+}| |j|kr| |j|kr|j||j<,|S)zTakes as an argument an optional domain and path and returns a plain old Python dict of name-value pairs of cookies that meet the requirements. :rtype: dict )r~rgr&r@r3)rrgr& dictionaryrls rget_dictzRequestsCookieJar.get_dict2sU 4jj 7 7F&-6"9"9  t 3 3*0, 6;'rcj t|S#t$rYdSwxYwr.)super __contains__ro)rr3 __class__s rrzRequestsCookieJar.__contains__AsB 77''-- -"   44 s $ 22c,||S)zDict-like __getitem__() for compatibility with client code. Throws exception if there are more than one cookie with name. In that case, use the more explicit get() method instead. .. warning:: operation is O(n), not O(1). )rsr2s r __getitem__zRequestsCookieJar.__getitem__Gs''---rc2|||dS)zDict-like __setitem__ for compatibility with client code. Throws exception if there is already a cookie of that name in the jar. In that case, use the more explicit set() method instead. N)r|r?s r __setitem__zRequestsCookieJar.__setitem__Ps urc&t||dS)zqDeletes a cookie given a name. Wraps ``http.cookiejar.CookieJar``'s ``remove_cookie_by_name()``. N)rmr2s r __delitem__zRequestsCookieJar.__delitem__Ws dD)))))rct|jdrT|jdr:|jdr |jdd|_t j|g|Ri|S)N startswith"z\")rYr@rendswithreplacerry)rrlargsrzrs rryzRequestsCookieJar.set_cookie]s FL, / / ; '',, ; %%c** ; "<//r::FL!uww!&:4:::6:::rct|tjr.|D])}|t j|*dSt |dS)zAUpdates this jar with cookies from another CookieJar or dict-likeN)rvr CookieJarrycopyrupdate)rotherrlrs rrzRequestsCookieJar.updatefsn eY0 1 1 " 3 3 & 1 12222 3 3 GGNN5 ! ! ! ! !rct|D]0}|j|kr#| |j|kr| |j|kr |jcS1t d|d|d|)aRequests uses this method internally to get cookie values. If there are conflicting cookies, _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown if there are conflicting cookies. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :return: cookie.value Nname= , domain=, path=)r~r3rgr&r@rt)rr3rgr&rls r_findzRequestsCookieJar._findns~4jj , ,F{d"">V]f%<%<|v{d':':%|+++ItIIIIIIJJJrcd}t|D]B}|j|kr5| |j|kr(| |j|kr|t d||j}C|r|St d|d|d|)aBoth ``__get_item__`` and ``get`` call this function: it's never used elsewhere in Requests. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :raises KeyError: if cookie is not found :raises CookieConflictError: if there are multiple cookies that match name and optionally domain and path :return: cookie.value Nz&There are multiple cookies with name, rrr)r~r3rgr&ror@rt)rr3rgr&toReturnrls rrsz%RequestsCookieJar._find_no_duplicatess4jj 0 0F{d"">V]f%<%<|v{d':':#/"5 Q Q Q##$*<  OItIIIIIIJJJrcb|j}|d|S)4Unlike a normal CookieJar, this class is pickleable. _cookies_lock)__dict__rpoprstates r __getstate__zRequestsCookieJar.__getstate__s, ""$$ /""" rc|j|d|jvrtj|_dSdS)rrN)rr threadingRLockrrs r __setstate__zRequestsCookieJar.__setstate__sC U### $- / /!*!2!2D    0 /rct}|||||S)z(Return a copy of this RequestsCookieJar.)rq set_policy get_policyr)rnew_cjs rrzRequestsCookieJar.copysB"$$$//++,,, d rc|jS)z&Return the CookiePolicy instance used.)_policyrs rrzRequestsCookieJar.get_policys |r)NNNNN)rIrJrKrLr%r|rrrrrrrrrrrrrrryrrrsrrrr __classcell__)rs@rrqrqs"    &%%%''',,,&&&        ...*** ;;;;;"""""KKKK(KKKK:333 rrqc|dSt|dr|Stj|}||D])}|tj|*|S)Nr)rYrriry)r\new_jarrls r_copy_cookie_jarrs{ {tsFxxzzinnG MMOOO..49V,,---- Nrc d||ddddddddddidd }t|t|z }|rtd t|||t |d |d <t |d |d <|d d|d<t |d|d<t jdi|S)zMake a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). rNr/FTHttpOnly) versionr3r@portrgr&secureexpiresdiscardcomment comment_urlrestrfc2109z2create_cookie() got unexpected keyword arguments: rport_specifiedrgdomain_specified.domain_initial_dotr&path_specifiedr/)r| TypeErrorrrboolrrrb)r3r@rzresultbadargss rrxrxsT"F &kkCKK'G  Pg P P    MM&#F6N33F !%fX&6!7!7F #)(#3#>#>s#C#CF  #F6N33F    % %f % %%rcd}|dr_ ttjt|dz}n^#t$rtd|ddwxYw|dr/d}t jtj|d|}t|dt|dd|d ||j |d dd |d idt|d |j |dpd S)zBConvert a Morsel object into a Cookie containing the one k/v pair.Nzmax-agez max-age: z must be integerrz%a, %d-%b-%Y %H:%M:%S GMTrFrgr&rhttponlyrrr) rrrrgrr3r&rrrrr@r) inttime ValueErrorrcalendartimegmstrptimerxrr:r@)morselr time_templates rrwrws3G iS M$)++F9,=(>(>>??GG M M MKy(9KKKLL L M  S3 /$-y0A="Q"QRR y! *++h Z F^ &, -F8$%%ly!&Q   s 6A$A'Tc|t}|@d|D}|D]1}|s||vr)|t|||2|S)aCReturns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. :rtype: CookieJar Ncg|] }|j Sr/)r3).0rls r z'cookiejar_from_dict..s>>>&&+>>>r)rqryrx) cookie_dictrj overwritenames_from_jarr3s rcookiejar_from_dictr s|%'' >>I>>> M MD MT77$$]4T9J%K%KLLL rc^t|tjstdt|trt ||d}n[t|tjrA ||n*#t$r|D]}||YnwxYw|S)zAdd cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. :rtype: CookieJar z!You can only merge into CookieJarF)rjr) rvrrrdictrrAttributeErrorry)rjcookies cookie_in_jars r merge_cookiesrs i!4 5 5><==='4  4'9PUVVV GY0 1 14 4   W % % % % 4 4 4!( 4 4 $$]3333 4 4 4 s-B$B*)B*rr.)rLrrr_internal_utilsrcompatrrrrr r ImportErrordummy_threadingr rOr`rerm RuntimeErrorrorrqrrxrwrrr/rrrs ------KKKKKKKKKKKKKK((((''''''(MMMMMMMM`''''''''* " " " ---,,,,&, EEEEE +^EEEP   "&"&"&J:*s ) 55PK!{ DD'__pycache__/__version__.cpython-311.pycnu[ |oi.dZdZdZdZdZdZdZdZdZd Z d S) requestszPython HTTP for Humans.zhttps://requests.readthedocs.ioz2.32.5i2z Kenneth Reitzzme@kennethreitz.orgz Apache-2.0zCopyright Kenneth Reitzu ✨ 🍰 ✨N) __title____description____url__ __version__ __build__ __author____author_email__ __license__ __copyright____cake__W/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/__version__.pyrs>  + +   ( ) %rPK!q^JHH&__pycache__/structures.cpython-311.pycnu[ |oi` ^dZddlmZddlmZmZGddeZGddeZd S) zO requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. ) OrderedDict)MappingMutableMappingcPeZdZdZd dZdZdZdZdZdZ d Z d Z d Z d Z dS)CaseInsensitiveDictaA case-insensitive ``dict``-like object. Implements all methods and operations of ``MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive:: cid = CaseInsensitiveDict() cid['Accept'] = 'application/json' cid['aCCEPT'] == 'application/json' # True list(cid) == ['Accept'] # True For example, ``headers['content-encoding']`` will return the value of a ``'Content-Encoding'`` response header, regardless of how the header name was originally stored. If the constructor, ``.update``, or equality comparison operations are given keys that have equal ``.lower()``s, the behavior is undefined. Nc Pt|_|i}|j|fi|dSN)r_storeupdate)selfdatakwargss V/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/structures.py__init__zCaseInsensitiveDict.__init__(s7!mm <D D##F#####cB||f|j|<dSr r lower)r keyvalues r __setitem__zCaseInsensitiveDict.__setitem__.s"%(< CIIKK   rcL|j|dS)Nrrr rs r __getitem__zCaseInsensitiveDict.__getitem__3s{399;;'**rc:|j|=dSr rrs r __delitem__zCaseInsensitiveDict.__delitem__6s K $ $ $rcHd|jDS)Nc3 K|] \}}|V dSr ).0casedkey mappedvalues r z/CaseInsensitiveDict.__iter__..:s'KK2X{KKKKKKr)r valuesr s r__iter__zCaseInsensitiveDict.__iter__9s$KKdk6H6H6J6JKKKKrc*t|jSr )lenr r&s r__len__zCaseInsensitiveDict.__len__<s4;rcHd|jDS)z.Like iteritems(), but with all lowercase keys.c30K|]\}}||dfVdS)rNr )r!lowerkeykeyvals rr$z2CaseInsensitiveDict.lower_items..As0TT*<8V6!9%TTTTTTr)r itemsr&s r lower_itemszCaseInsensitiveDict.lower_items?s$TT @Q@Q@S@STTTTrct|trt|}ntSt |t |kSr ) isinstancerrNotImplementeddictr0)r others r__eq__zCaseInsensitiveDict.__eq__Cs\ eW % % "'..EE! !D$$&&''40A0A0C0C+D+DDDrcNt|jSr )rr r%r&s rcopyzCaseInsensitiveDict.copyLs"4;#5#5#7#7888rc^tt|Sr )strr4r/r&s r__repr__zCaseInsensitiveDict.__repr__Os 4 %%&&&rr )__name__ __module__ __qualname____doc__rrrrr'r*r0r6r8r;r rrrr s4$$$$ 000 +++%%%LLL   UUUEEE999'''''rrc8eZdZdZdfd ZdZdZddZxZS) LookupDictzDictionary lookup object.NcV||_tdSr )namesuperr)r rC __class__s rrzLookupDict.__init__Vs&  rcd|jdS)Nz )rCr&s rr;zLookupDict.__repr__Zs(49((((rc8|j|dSr __dict__getrs rrzLookupDict.__getitem__]s}  d+++rc8|j||Sr rH)r rdefaults rrJzLookupDict.getbs}  g...rr ) r<r=r>r?rr;rrJ __classcell__)rEs@rrArASsu##))),,, ////////rrAN) r? collectionsrcompatrrrr4rAr rrrPs$#####++++++++C'C'C'C'C'.C'C'C'L//////////rPK!II __pycache__/help.cpython-311.pycnu[ .|oidZddlZddlZddlZddlZddlmZddlmZddlm Z dZ dZ ddl mZddlZddlZn#e$r dZdZdZYnwxYwdZd Zd Zed kr edSdS) z'Module containing bug report helper(s).N)idna)urllib3) __version__) pyopensslctj}|dkrtj}n|dkrdtjjtjjtjj}tjj dkr&d |tjj g}n6|dkrtj}n|dkrtj}nd}||d S) aReturn a dict with the Python implementation and version. Provide both the name and the version of the Python implementation currently running. For example, on CPython 3.10.3 it will return {'name': 'CPython', 'version': '3.10.3'}. This function works best on CPython and PyPy: in particular, it probably doesn't work for Jython or IronPython. Future investigation should be done to work out the correct shape of the code for those platforms. CPythonPyPyz{}.{}.{}finalJython IronPythonUnknown)nameversion) platformpython_implementationpython_versionformatsyspypy_version_infomajorminormicro releaseleveljoin)implementationimplementation_versions k/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_vendor/requests/help.py_implementationr s355N""!)!8!:!: 6 ! !!+!2!2  ! '  ! '  ! '" "   - 8 8%'WW')>)KL&& " 8 # #!)!8!:!: < ' '!)!8!:!:!*"/E F FFc F tjtjd}n#t$rddd}YnwxYwt }dt ji}ddi}ddi}trdtji}trdtji}ddd}tr tjtj j dd}dttddi}dttddi}tj }d||dndi} ||| t dutdu||||||dt"id S) z&Generate information for a bug report.)systemreleaserrNr )ropenssl_versionxr) rr system_sslusing_pyopensslusing_charset_normalizer pyOpenSSLrchardetcharset_normalizer cryptographyrrequests)rr#r$OSErrorr rrr,r+OpenSSLSSLOPENSSL_VERSION_NUMBERgetattrr-rsslrrequests_version) platform_infoimplementation_info urllib3_infocharset_normalizer_info chardet_infopyopenssl_infocryptography_info idna_infor'system_ssl_infos rinfor?>s  o'''))          *++w23L($/t$LN#,.@.L"M8!7#67 N *")+"DHH   7<;; 7433I+J z7MZ"3"3"3SUVO"-%$D0$+tO#5) '   s '*<<cfttjtdddS)z)Pretty-print the bug information as JSON.T) sort_keysindentN)printjsondumpsr?r!rmainrHys+ $*TVVtA 6 6 677777r!__main__)__doc__rErr4r pip._vendorrrr rr5r,r+pip._vendor.urllib3.contribrr-r0 ImportErrorr r?rH__name__rGr!rrOs&--  ------ 555555 NNNN IGLLL G G GF888v888  zDFFFFFs9 AAPK!9hq"__pycache__/models.cpython-311.pycnu[ |oiRdZddlZddlZddlmZddlmZmZm Z m Z m Z ddl m Z ddlmZddlmZdd lmZmZdd lmZdd lmZmZmZmZmZmZmZdd lmZ dd lm!Z!m"Z"m#Z#ddl$m%Z%m&Z&m'Z'ddl(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.ddl(mZ/ddl(m0Z0ddl(m Z1ddl(m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:m;Z;mZ>m?Z?m@Z@mAZAmBZBmCZCe6jDe6jEe6jFe6jGe6jHfZIdZJdZKdZLGddZMGddZNGdd eNZOGd!d"eMeNZPGd#d$ZQdS)%z` requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. N)UnsupportedOperation) DecodeErrorLocationParseError ProtocolErrorReadTimeoutErrorSSLError) RequestField)encode_multipart_formdata) parse_url)to_native_stringunicode_is_ascii) HTTPBasicAuth)CallableJSONDecodeErrorMapping basestring builtin_strchardet cookielib)json) urlencodeurlsplit urlunparse)_copy_cookie_jarcookiejar_from_dictget_cookie_header)ChunkedEncodingErrorConnectionErrorContentDecodingError HTTPErrorInvalidJSONError InvalidURL)r) MissingSchema)r)StreamConsumedError) default_hooks)codes)CaseInsensitiveDict) check_header_validityget_auth_from_urlguess_filenameguess_json_utf iter_slicesparse_header_links requote_uristream_decode_response_unicode super_lento_key_val_listi(icPeZdZedZedZedZdS)RequestEncodingMixincg}t|j}|j}|sd}|||j}|r*|d||d|S)zBuild the path URL to use./?)rurlpathappendqueryjoin)selfr:pr;r=s R/opt/cloudlinux/venv/lib64/python3.11/site-packages/pip/_vendor/requests/models.pypath_urlzRequestEncodingMixin.path_urlUs~ TX  v D 4   JJsOOO JJu   wws||c  t|ttfr|St|dr|St|drg}t |D]\}}t|t st|ds|g}|D]o}|k|t|tr|dn|t|tr|dn|fpt|dS|S)zEncode parameters in a piece of data. Will successfully encode parameters when passed as a dict or a list of 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary if parameters are supplied as a dict. read__iter__Nutf-8T)doseq) isinstancestrbyteshasattrr2rr<encoder)dataresultkvsvs rA_encode_paramsz#RequestEncodingMixin._encode_paramsjs' dS%L ) ) K T6 " " K T: & & F(..  2b*--WR5L5LBA} 5?35G5G N 1 1 1Q5?35G5G N 1 1 1QV4000 0KrCc v|stdt|trtdg}t|pi}t|pi}|D]\}}t|tst |ds|g}|D]}|t|t st |}|t|t r|dn|t|t r| dn|f|D]\}}d}d} t|ttfr;t|dkr|\} } n5t|dkr|\} } }n|\} } }} nt|p|} |} t| t t tfr| } n*t | dr| } n| | } t!|| | | } | | || t%|\}}||fS) aBuild the body for a multipart/form-data request. Will successfully encode files when passed as a dict or a list of tuples. Order is retained if data is a list of tuples but arbitrary if parameters are supplied as a dict. The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) or 4-tuples (filename, fileobj, contentype, custom_headers). zFiles must be provided.zData must not be a string.rFNrGrE)namerNfilenameheaders) content_type) ValueErrorrIrr2rLrKrJr<decoderMtuplelistlenr+ bytearrayrEr make_multipartr )filesrN new_fieldsfieldsfieldvalrRrPftfhfnfpfdatarfbodyrZs rA _encode_filesz"RequestEncodingMixin._encode_filess ;677 7 j ) ) ;9:: :  ,, ,,   JE3#z** '#z2J2J e  =%a//#FF%% *%77'ELL111!&1;As1C1CJAHHW---   " "DAqBB!eT]++ q66Q;;FBVVq[[!"JBBB%&NBB#A&&+!"sE9566 V$$  152rJJJB   2  . . .   b ! ! ! !6zBBl\!!rCN)__name__ __module__ __qualname__propertyrB staticmethodrSrnrCrAr5r5Tsh X(\:B"B"\B"B"B"rCr5ceZdZdZdZdS)RequestHooksMixinc$||jvrtd|dt|tr"|j||dSt |dr,|j|d|DdSdS)zProperly register a hook.z.Unsupported event specified, with event name ""rFc3DK|]}t|t|VdSN)rIr).0hs rA z2RequestHooksMixin.register_hook..s1$P$P1 1h8O8O$PQ$P$P$P$P$P$PrCN)hooksr[rIrr<rLextendr?eventhooks rA register_hookzRequestHooksMixin.register_hooks  " "VeVVVWW W dH % % Q Ju  $ $T * * * * * T: & & Q Ju  $ $$P$P$P$P$P P P P P P Q QrCcj |j||dS#t$rYdSwxYw)ziDeregister a previously registered hook. Returns True if the hook existed, False if not. TF)r~remover[rs rAderegister_hookz!RequestHooksMixin.deregister_hooksI   Ju  $ $T * * *4   55 s $ 22N)rorprqrrrtrCrArvrvs5 Q Q Q     rCrvc:eZdZdZ ddZdZdZdS)Requesta{A user-created :class:`Request ` object. Used to prepare a :class:`PreparedRequest `, which is sent to the server. :param method: HTTP method to use. :param url: URL to send. :param headers: dictionary of headers to send. :param files: dictionary of {filename: fileobject} files to multipart upload. :param data: the body to attach to the request. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param json: json for the body to attach to the request (if files or data is not specified). :param params: URL parameters to append to the URL. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param auth: Auth handler or (user, pass) tuple. :param cookies: dictionary or CookieJar of cookies to attach to this request. :param hooks: dictionary of callback hooks, for internal usage. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() Nc b|gn|}|gn|}|in|}|in|}| in| } t|_t| D]\} } || | ||_||_||_||_||_ | |_ ||_ ||_ ||_ dS)N)rr)r&r~r^itemsrmethodr:rYrbrNrparamsauthcookies) r?rr:rYrbrNrrrr~rrPrRs rA__init__zRequest.__init__s\rrtm""W~6m"__ '' 0 0DAq   QQ  / / / /        rCcd|jdS)Nz rr?s rA__repr__zRequest.__repr__$s+DK++++rCc t}||j|j|j|j|j|j|j|j |j |j  |S)zXConstructs a :class:`PreparedRequest ` for transmission and returns it.) rr:rYrbrNrrrrr~) PreparedRequestpreparerr:rYrbrNrrrrr~r?r@s rArzRequest.prepare'sa    ;L*;L*  rC NNNNNNNNNN)rorprq__doc__rrrrtrCrArrsq:        D,,,rCrceZdZdZdZ ddZdZdZdZe dZ d Z d Z dd Z d ZddZdZdZdS)ra)The fully mutable :class:`PreparedRequest ` object, containing the exact bytes that will be sent to the server. Instances are generated from a :class:`Request ` object, and should not be instantiated manually; doing so may produce undesirable effects. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> r = req.prepare() >>> r >>> s = requests.Session() >>> s.send(r) cd|_d|_d|_d|_d|_t |_d|_dSrz)rr:rY_cookiesrmr&r~_body_positionrs rArzPreparedRequest.__init__Ns@    "__ "rCNc 4||||||||||||| ||||| dS)z6Prepares the entire request with the given parameters.N)prepare_method prepare_urlprepare_headersprepare_cookies prepare_body prepare_auth prepare_hooks) r?rr:rYrbrNrrrr~rs rArzPreparedRequest.prepare_s F### f%%% W%%% W%%% $t,,, $$$$ 5!!!!!rCcd|jdS)Nz+>??DKKK # "rCcddlm} ||dd}n#|j$rt wxYw|S)Nr)idnaT)uts46rG) pip._vendorrrMr\ IDNAError UnicodeError)hostrs rA_get_idna_encoded_hostz&PreparedRequest._get_idna_encoded_hostsf$$$$$$ ;;t4;0077@@DD~      s *3Ac t|tr|d}nt|}|}d|vr0|ds ||_dS t|\}}}}}}} n #t$r} t| j d} ~ wwxYw|std|d|d|std|dt|s4 ||}nA#t$rtd wxYw|d rtd |pd } | r| d z } | |z } |r| d|z } |sd }t|ttfrt!|}||} | r |r|d| }n| }t%t'|| |d|| g}||_dS)zPrepares the given HTTP URL.utf8:httpNz Invalid URL z0: No scheme supplied. Perhaps you meant https://r8z: No host suppliedzURL has an invalid label.)*.r9@r7&)rIrKr\rJlstriplower startswithr:r rr#argsr$rrrr rSr/r) r?r:rschemerrportr;r=fragmentenetloc enc_paramss rArzPreparedRequest.prepare_urlsw c5 ! ! **V$$CCc((Cjjll #::ciikk44V<<:DH F &>Gnn ;FD$dE88! & & &af% % & 4s44-0444   GECEEEFF F  %% : >22488 > > > !<=== > __Z ( ( :899 9   cMF$  ! j$jj F D fsEl + + .%f--F((00  # # //://"*ffdD%%RSSTTs$B B9&B44B99DD)ct|_|rB|D]/}t||\}}||jt |<.dSdS)z Prepares the given HTTP headers.N)r(rYrr)r )r?rYheaderrWvalues rArzPreparedRequest.prepare_headersss+,,  =!--// = =%f---$ e7< -d3344  = = = =rCc d}d}|si|gd} tj|d}n##t$r}t||d}~wwxYwt |t s|d}tt|dt |ttttf g}|r t|}n#ttt f$rd}YnwxYw|}t#|dd> ||_n##t($rt+|_YnwxYw|rt-d |rt/||jd <nd |jd <n|r|||\}}nA|r?||}t |tst|d rd}nd}|||rd|jvr ||jd<||_dS)z"Prepares the given HTTP body data.Nzapplication/jsonF) allow_nan)requestrGrFtellz1Streamed bodies and files are mutually exclusive.Content-LengthchunkedzTransfer-EncodingrEz!application/x-www-form-urlencodedz content-typez Content-Type) complexjsondumpsr[r"rIrKrMallrLrr^r]rr1 TypeErrorAttributeErrorrgetattrrrOSErrorobjectNotImplementedErrorrrYrnrSprepare_content_lengthrm) r?rNrbrrmrZve is_streamlengths rArzPreparedRequest.prepare_bodys}  ,(.L 9"(??? 9 9 9&r48888 9dE** ,{{7++j))tj$w%GHHH    , < "4~/CD    DtVT**63*.))++D''333+1((D'''3  )G >1A9C C%$C%<DD65D6c|,t|}|rt||jd<dSdS|jdvr&|jdd|jd<dSdSdS)z>Prepare Content-Length header based on request method and bodyNr)GETHEAD0)r1rrYrget)r?rmrs rArz&PreparedRequest.prepare_content_length<s  t__F E2=V1D1D -... E E K . .   !122:.1DL) * * * / .::rCr9cJ|'t|j}t|r|nd}|rwt|trt |dkr t |}||}|j|j| |j dSdS)z"Prepares the given HTTP auth data.NrU) r*r:anyrIr]r_r__dict__updaterrm)r?rr:url_authrs rArzPreparedRequest.prepare_authLs <(22H"8}}688$D  3$&& ,3t99>>$d+T A M  , , ,  ' ' 2 2 2 2 2 3 3rCct|tjr||_nt ||_t |j|}| ||jd<dSdS)aPrepares the given HTTP cookie data. This function eventually generates a ``Cookie`` header from the given cookies using cookielib. Due to cookielib's design, the header will not be regenerated if it already exists, meaning this function can only be called once for the life of the :class:`PreparedRequest ` object. Any subsequent calls to ``prepare_cookies`` will have no actual effect, unless the "Cookie" header is removed beforehand. NCookie)rIr CookieJarrrrrY)r?r cookie_headers rArzPreparedRequest.prepare_cookiesbsb gy2 3 3 9#DMM/88DM)$->>  $%2DL " " " % $rCcP|pg}|D]}||||dS)zPrepares the given hooks.N)r)r?r~rs rArzPreparedRequest.prepare_hooksvsC   4 4E   ueEl 3 3 3 3 4 4rCrrz)r9)rorprqrrrrrrrsrrrrrrrrrtrCrArr9s((###&    """"8444   @@@ \HHHT = = =LLLL\111 3333,333(44444rCrc(eZdZdZgdZdZdZdZdZdZ dZ d Z d Z d Z ed Zed ZedZedZedZddZeddfdZedZedZdZedZdZdZdS)ResponsezhThe :class:`Response ` object, which contains a server's response to an HTTP request. ) _content status_coderYr:historyencodingreasonrelapsedrcd|_d|_d|_d|_t |_d|_d|_d|_g|_ d|_ ti|_ tjd|_d|_dS)NFr)r_content_consumed_nextrr(rYrawr:rrrrrdatetime timedeltarrrs rArzResponse.__init__s !&   +,,    +2..  )!,,  rCc|Srzrtrs rA __enter__zResponse.__enter__s rCc.|dSrz)close)r?rs rA__exit__zResponse.__exit__s rCcFjsjfdjDS)Nc4i|]}|t|dSrz)r)r{attrr?s rA z)Response.__getstate__..s'KKKDgdD$//KKKrC)rcontent __attrs__rs`rA __getstate__zResponse.__getstate__s3%  LLKKKKDNKKKKrCc|D]\}}t|||t|ddt|dddS)NrTr)rsetattr)r?staterWrs rA __setstate__zResponse.__setstate__s_ ;;== ' 'KD% D$ & & & & )4000eT"""""rCcd|jdS)Nz ..PPrCcRd|jvo|jtjtjfvS)z@True if this Response one of the permanent versions of redirect.r)rYrr'moved_permanentlypermanent_redirectrs rAis_permanent_redirectzResponse.is_permanent_redirects4T\) d.>  #  $C /  rCc|jS)zTReturns a PreparedRequest for the next request in a redirect chain, if there is one.)rrs rAnextz Response.nexts zrCcRttj|jdSdS)zOThe apparent encoding, provided by the charset_normalizer or chardet libraries.NrrG)rdetectrrs rAapparent_encodingzResponse.apparent_encodings(  >$,// ; ;7rCr FcZfd}jr(tjtrt 5tt s t dtdtj}|}jr|n|}|rt|}|S)aIterates over the response data. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. The chunk size is the number of bytes it should read into memory. This is not necessarily the length of each item returned as decoding can take place. chunk_size must be of type int or None. A value of None will function differently depending on the value of `stream`. stream=True will read data as it arrives in whatever size the chunks are received. If stream=False, data is returned as a single chunk. If decode_unicode is True, content will be decoded using the best available encoding based on the response. c3Ktjdr jdEd{Vn#t$r}t |d}~wt $r}t |d}~wt$r}t|d}~wt$r}t|d}~wwxYw j }|sn|V"d_ dS)NstreamT)decode_content) rLrr'rrrr rrrRequestsSSLErrorrEr)rchunk chunk_sizer?s rAgeneratez'Response.iter_content..generate0s'tx**  .#xz$OOOOOOOOOO$222.q111"222.q111'---)!,,,...*1---.  HMM*55E KKK  &*D " " "s9"= B/A B/#A22 B/?B B/B**B/Nz+chunk_size must be an int, it is instead a r) rrIrboolr%intrtyper-r0)r?r+decode_unicoder, reused_chunks stream_chunkschunkss`` rArzResponse.iter_contents" * * * * * *.  ! j&E&E %'' '  #Jz3,G,G #Qd:>N>NQQQ $DM:>>   "&"8Km  B3FDAAF rCNc#>Kd}|||D]x}|||z}|r||}n|}|r7|dr/|r-|dd|dkr|}nd}|Ed{Vy||VdSdS)zIterates over the response data, one line at a time. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. .. note:: This method is not reentrant safe. N)r+r0)rsplit splitlinespop)r?r+r0 delimiterpendingr*liness rA iter_lineszResponse.iter_linesYs&&!.'    E"% + I..((** r u r2%)1K1K))++          MMMMM  rCc|jdurd|jrtd|jdks|jd|_n4d|tpd|_d|_|jS)z"Content of the response, in bytes.Fz2The content for this response was already consumedrNrCT)rr RuntimeErrorrrr>rCONTENT_CHUNK_SIZErs rArzResponse.contentzs =E ! !% Y"#WXXX1$$(8 $ #):):;M)N)N O O VSV !%}rCcd}|j}|jsdS|j|j} t|j|d}n-#tt f$rt|jd}YnwxYw|S)aContent of the response, in unicode. If Response.encoding is None, encoding will be guessed using ``charset_normalizer`` or ``chardet``. The encoding of the response content is determined based solely on HTTP headers, following RFC 2616 to the letter. If you can take advantage of non-HTTP knowledge to make a better guess at the encoding, you should set ``r.encoding`` appropriately before accessing this property. Nr9replace)errors)rrr$rJ LookupErrorr)r?rrs rAtextz Response.texts=| 2 = -H :$,CCCGGY' : : :$,y999GGG :s:'A$#A$c |js|jrt|jdkr~t|j}|h t j|j|fi|S#t$rYn1t$r%}t|j |j |j d}~wwxYw t j|j fi|S#t$r%}t|j |j |j d}~wwxYw)aYDecodes the JSON response body (if any) as a Python object. This may return a dictionary, list, etc. depending on what is in the response. :param \*\*kwargs: Optional arguments that ``json.loads`` takes. :raises requests.exceptions.JSONDecodeError: If the response body does not contain valid json. rVN)rrr_r,rloadsr\UnicodeDecodeErrorrRequestsJSONDecodeErrormsgdocposrD)r?kwargsrrs rArz Response.jsons } G G#dl2C2Ca2G2G &dl33H# G&,T\-@-@-J-JUUfUUU) D&GGG1!%FFFG ?$TY99&99 9 ? ? ?*!%>> > ?s5)A(( B"4 B"= BB"&B== C, C''C,c|jd}i}|rCt|}|D]1}|dp|d}|||<2|S)z8Returns the parsed header links of the response, if any.linkrelr:)rYrr.)r?rresolved_linkslinksrNkeys rArQzResponse.linksss!!&))  +&v..E + +hhuoo8%&*s##rCcd}t|jtrF |jd}n1#t$r|jd}Yn wxYw|j}d|jcxkrdkrnn|jd|d|j}n)d|jcxkrdkrnn|jd |d|j}|rt|| d S) z+Raises :class:`HTTPError`, if one occurred.r9rGz iso-8859-1iiz Client Error: z for url: iXz Server Error: )responseN)rIrrKr\rGrr:r!)r?http_error_msgrs rArzResponse.raise_for_statuss1 dk5 ) ) !  :++G44% : : :++L99 :[F $" ( ( ( (S ( ( ( ( (#PPFPPdhPP ND$ * * * *s * * * * *#PPFPPdhPP   ;NT::: : ; ;s9$A A c|js|jt|jdd}| |dSdS)zReleases the connection back to the pool. Once this method has been called the underlying ``raw`` object must not be accessed again. *Note: Should not normally need to be called explicitly.* release_connN)rrrr)r?rWs rArzResponse.closesQ %  HNN   tx>>  # LNNNNN $ #rC)r F)rorprqrrrrrrr rrrrFrrrrrr!r$rITER_CHUNK_SIZEr<rrDrrQrrrtrCrArrs   I---^LLL###222&&&  X QQXQ   X XX8888v)$BX$##X#J!?!?!?FX ;;;:     rCr)Rrrencodings.idna encodingsiorpip._vendor.urllib3.exceptionsrrrrrpip._vendor.urllib3.fieldsr pip._vendor.urllib3.filepostr pip._vendor.urllib3.utilr _internal_utilsr rrrcompatrrrrrrrrrrrrrrrr exceptionsrrr r!r"r#rHr$r)r%r~r& status_codesr' structuresr(utilsr)r*r+r,r-r.r/r0r1r2movedfoundothertemporary_redirectrrDEFAULT_REDIRECT_LIMITr?rXr5rvrrrrtrCrArks  ######433333BBBBBB......????????('''''3333333333MMMMMMMMMMCBBBBB%%%%%%444444++++++ ++++++                          K K K   w"w"w"w"w"w"w"w"t0PPPPPPPPfD4D4D4D4D4*,=D4D4D4N OOOOOOOOOOrCPK!˞''LICENSEnu[ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. PK!8'w'w sessions.pynu[PK!è bwmodels.pynu[PK!~m__version__.pynu[PK!7=g=g adapters.pynu[PK!:Q(k__pycache__/status_codes.cpython-312.pycnu[PK!K!1__pycache__/hooks.cpython-312.pycnu[PK!^*PP__pycache__/api.cpython-312.pycnu[PK!ZИss$4__pycache__/adapters.cpython-312.pycnu[PK!R`~ 22+ __pycache__/_internal_utils.cpython-312.pycnu[PK!{9 ??!&__pycache__/utils.cpython-312.pycnu[PK!m== =__pycache__/auth.cpython-312.pycnu[PK!7K "__pycache__/compat.cpython-312.pycnu[PK!H4" __pycache__/models.cpython-312.pycnu[PK!-s||$__pycache__/sessions.cpython-312.pycnu[PK!+Ann#+__pycache__/cookies.cpython-312.pycnu[PK!qѵ@@$њ__pycache__/packages.cpython-312.pycnu[PK!MzDD"e__pycache__/_types.cpython-312.pycnu[PK!'8WW&__pycache__/structures.cpython-312.pycnu[PK!u]b&__pycache__/exceptions.cpython-312.pycnu[PK!: __pycache__/help.cpython-312.pycnu[PK!1Zww$ __pycache__/__init__.cpython-312.pycnu[PK!D**'__pycache__/__version__.cpython-312.pycnu[PK!4||!L"__pycache__/certs.cpython-312.pycnu[PK!"Ο %compat.pynu[PK!p,py.typednu[PK!(,_internal_utils.pynu[PK!=`: 2exceptions.pynu[PK!s611Capi.pynu[PK!QL` ` ]structures.pynu[PK!hcerts.pynu[PK!\gQɁɁjutils.pynu[PK! # __init__.pynu[PK![ۀ _types.pynu[PK!Iestatus_codes.pynu[PK!V!! (packages.pynu[PK!؞HH $-cookies.pynu[PK!5uhelp.pynu[PK!ލ''auth.pynu[PK!Ghooks.pynu[PK!]< C C .help.pyonu[PK!ϢIt%% models.pycnu[PK!; y @hooks.pycnu[PK!'::'Fapi.pycnu[PK!;̵BB epackages.pyonu[PK!wrr hmodels.pyonu[PK!|LLhstatus_codes.pycnu[PK!u_@gg __init__.pyonu[PK!>l55 compat.pyonu[PK!6 structures.pycnu[PK!2ۄWW %cookies.pyonu[PK!ik{h{h |cookies.pycnu[PK!j5dd|help.pycnu[PK!G_internal_utils.pyonu[PK!*@&__version__.pycnu[PK!f certs.pycnu[PK!դ& packages.pycnu[PK! _internal_utils.pycnu[PK!y  compat.pycnu[PK!E=&& auth.pyonu[PK!6dWdW 8 sessions.pyonu[PK!E~0~0 auth.pycnu[PK! ; U hooks.pyonu[PK!aww a utils.pycnu[PK!jFKKc> __version__.pyonu[PK!$R#R#@ exceptions.pycnu[PK!LĜ\bb }d sessions.pycnu[PK!\++n structures.pyonu[PK!N exceptions.pyonu[PK!-6QQ  adapters.pycnu[PK!wL&d&d RJ utils.pyonu[PK!:<#J#J  adapters.pyonu[PK!U   __init__.pycnu[PK!!T status_codes.pyonu[PK!)jj  certs.pyonu[PK!@P api.pyonu[PK!}<<$< __pycache__/packages.cpython-311.pycnu[PK!|?IIA __pycache__/api.cpython-311.pycnu[PK!'V==$C_ __pycache__/__init__.cpython-311.pycnu[PK!5Ρ!w __pycache__/certs.cpython-311.pycnu[PK!,(z __pycache__/status_codes.cpython-311.pycnu[PK!<м|t|t$ __pycache__/sessions.cpython-311.pycnu[PK!}r  " __pycache__/compat.cpython-311.pycnu[PK!82\\!- __pycache__/utils.cpython-311.pycnu[PK!