
    nbi                   \   d Z ddlmZ ddlZddlZddlZddlZddlZddl	Z	ddl
mZ ddlmZ ddlmZ ddlZej        dk    rej        Znej        Zdd	lmZ dd
lmZmZmZ ddlmZmZmZmZmZm Z m!Z!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4 ddl5m6Z6m7Z7 ddl8m9Z9m:Z: ddl;m<Z<m=Z=m>Z> ddl?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZO ddl?mPZQ ddlRmSZS ddlTmUZU ddlVmWZW ddlXmWZY ddlZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZb ddlZmcZd ddlZm*Ze ddlZm0Zf ddlZm3Zg ddlhmiZimjZj ddlhmkZl ddlmmnZn ddlompZpmqZqmrZrmsZsmtZtmuZumvZvmwZwmxZxmyZymzZzm{Z{m|Z| 	 dd l}m~Z~mZ n# e$ r d0d&Zd0d'Z~Y nw xY w G d( d)          Z G d* d+          Z G d, d-e          Z G d. d/e          ZdS )1z
requests.adapters
~~~~~~~~~~~~~~~~~

This module contains the transport adapters that Requests uses to define
and maintain connections.
    )annotationsN)	timedelta)	CookieJar)RLockwin32   )urllib3_ensure_type)DEFAULT_POOLBLOCKDEFAULT_POOLSIZEDEFAULT_RETRIES)AsyncResolverTypeCacheLayerAltSvcTypeHookType	ProxyTypeResolverType	RetryTypeTLSClientCertTypeTLSVerifyType)_basic_auth_str)extract_cookies_to_jar)ConnectionErrorConnectTimeoutInvalidHeaderInvalidProxyURLInvalidSchema
InvalidURLMissingSchemaMultiplexingError
ProxyErrorReadTimeout
RetryErrorSSLErrorTooManyRedirects)DEFAULT_STRATEGYRevocationConfiguration)async_dispatch_hookdispatch_hook)AsyncResponsePreparedRequestResponse)AsyncHTTPConnectionPoolAsyncHTTPSConnectionPoolAsyncPoolManagerAsyncProxyManagerAsyncResolverDescriptionBaseHTTPResponseConnectionInfoHTTPConnectionPoolHTTPSConnectionPoolHttpVersionPoolManagerProxyManagerResolverDescriptionResponsePromiseasync_proxy_from_urlproxy_from_url)AsyncHTTPResponse)BaseResolver)AsyncBaseResolver)load_extension)ClosedPoolErrorConnectTimeoutErrorLocationValueErrorMaxRetryErrorNewConnectionErrorProtocolErrorReadTimeoutErrorResponseError)	HTTPError)r   )r   )r"   )Retry	parse_url)Timeout)CaseInsensitiveDict)_deepcopy_ci_swap_contextasync_wrap_extension_for_httpget_auth_from_urlget_encoding_from_headersparse_schemeprepend_scheme_if_neededresolve_socket_familyselect_proxyshould_check_crlshould_check_ocspurldefragauthwrap_extension_for_http)AsyncSOCKSProxyManagerSOCKSProxyManagerargs
typing.AnykwargsreturnNonec                      t          d          Nz'Missing dependencies for SOCKS support.r   r[   r]   s     a/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/niquests/adapters.pyrZ   rZ          EFFF    c                      t          d          ra   rb   rc   s     rd   rY   rY      re   rf   c                  V     e Zd ZdZd# fdZ	 	 	 	 	 	 	 	 	 d$d%dZd#dZddd&d"Z xZS )'BaseAdapterThe Base Transport Adapterr^   r_   c                H    t                                                       d S Nsuper__init__self	__class__s    rd   ro   zBaseAdapter.__init__       rf   FNTrequestr)   streambooltimeoutint | float | Noneverifyr   certTLSClientCertType | NoneproxiesProxyType | Noneon_post_connection*typing.Callable[[typing.Any], None] | Noneon_upload_body;typing.Callable[[int, int | None, bool, bool], None] | Noneon_early_response(typing.Callable[[Response], None] | Nonemultiplexedr*   c                    t           a  Sends PreparedRequest object. Returns Response object.

        :param request: The :class:`PreparedRequest <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) <timeouts>` tuple.
        :param verify: (optional) Either a boolean, in which case it controls whether we verify
            the server's TLS certificate, or a path passed as a string or os.Pathlike object,
            in which case it must be a path to a CA bundle to use.
            It is also possible to put the certificates (directly) in a string or bytes.
        :param cert: (optional) Any user-provided SSL certificate to be trusted.
        :param proxies: (optional) The proxies dictionary to apply to the request.
        :param on_post_connection: (optional) A callable that should be invoked just after the pool mgr picked up a live
            connection. The function is expected to takes one positional argument and return nothing.
        :param multiplexed: Determine if we should leverage multiplexed connection.
        NotImplementedErrorrq   rt   ru   rw   ry   rz   r|   r~   r   r   r   s              rd   sendzBaseAdapter.send   s
    < "!rf   c                    t           z!Cleans up adapter specific items.r   rq   s    rd   closezBaseAdapter.close   s    !!rf   	max_fetch	responsesr   
int | Nonec                   dS aA  
        Load responses that are still 'lazy'. This method is meant for a multiplexed connection.
        Implementation is not mandatory.

        :param max_fetch: Maximal number of response to be fetched before exiting the loop. By default,
            it waits until all pending (lazy) response are resolved.
        N rq   r   r   s      rd   gatherzBaseAdapter.gather   s	     	rf   r^   r_   	FNTNNNNNF)rt   r)   ru   rv   rw   rx   ry   r   rz   r{   r|   r}   r~   r   r   r   r   r   r   rv   r^   r*   r   r*   r   r   r^   r_   	__name__
__module____qualname____doc__ro   r   r   r   __classcell__rr   s   @rd   ri   ri      s        $$      &* $)-$(IMVZFJ!" " " " "@" " " " DH          rf   ri   c                  V     e Zd ZdZd$ fdZ	 	 	 	 	 	 	 	 	 d%d&dZd$dZddd'd#Z xZS )(AsyncBaseAdapterrj   r^   r_   c                H    t                                                       d S rl   rm   rp   s    rd   ro   zAsyncBaseAdapter.__init__   rs   rf   FNTrt   r)   ru   rv   rw   rx   ry   r   rz   r{   r|   r}   r~   <typing.Callable[[typing.Any], typing.Awaitable[None]] | Noner   Mtyping.Callable[[int, int | None, bool, bool], typing.Awaitable[None]] | Noner   :typing.Callable[[Response], typing.Awaitable[None]] | Noner   r(   c                   K   t           r   r   r   s              rd   r   zAsyncBaseAdapter.send   s      < "!rf   c                   K   t           r   r   r   s    rd   r   zAsyncBaseAdapter.close   s      !!rf   r   r   r*   r   r   c               
   K   dS r   r   r   s      rd   r   zAsyncBaseAdapter.gather   s       	rf   r   r   )rt   r)   ru   rv   rw   rx   ry   r   rz   r{   r|   r}   r~   r   r   r   r   r   r   rv   r^   r(   r   r   r   s   @rd   r   r      s        $$      &* $)-$([_hlX\!" " " " "@" " " " JN          rf   r   c                       e Zd ZdZg dZeeeefddddddddddddeddc fd#Z	ddd&Z
ded(Zd) Zedfdfd0Zdgd4Zdhd<ZdidBZdjdkdFZdldGZdmdIZdndJZdodLZ	 	 	 	 	 	 	 	 	 dpdqdYZdrd^Zdd_dsdbZ xZS )tHTTPAdaptera  The built-in HTTP Adapter for urllib3.future.

    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 <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 niquests
      >>> s = niquests.Session()
      >>> a = niquests.adapters.HTTPAdapter(max_retries=3)
      >>> s.mount('http://', a)
    max_retriesconfig_pool_connections_pool_maxsize_pool_block_quic_cache_layer_disable_http1_disable_http2_disable_http3_source_address_disable_ipv4_disable_ipv6_happy_eyeballs_keepalive_delay_keepalive_idle_window_revocation_configurationNF      @      N@quic_cache_layerdisable_http1disable_http2disable_http3max_in_flight_multiplexedresolversource_addressdisable_ipv4disable_ipv6happy_eyeballskeepalive_delaykeepalive_idle_windowrevocation_configurationpool_connectionsintpool_maxsizer   r   
pool_blockrv   r   CacheLayerAltSvcType | Noner   r   r   r   r   r   ResolverType | Noner   tuple[str, int] | Noner   r   r   
bool | intr   float | int | Noner   r   RevocationConfiguration | Nonec                  t          |t                    rd| _        net          |d          rt	          |          | _        n@|dk     rt          d          t          j        |          | _        |dk    rd| j        _        i | _	        i | _
        t                                                       || _        || _        || _        || _        || _        || _        || _        |
| _        || _        || _        || _        || _        || _        || _        i | _        g | _        |	| _        t=                      | _        d | _         d | _!        || _"        tG                      }|r|$                    tJ          j&                   |r|$                    tJ          j'                   |r|$                    tJ          j(                   | )                    ||||||
|tU          ||          |||           d S NFget_backoff_timer   zWconfigured retries count is invalid. you must specify a positive or zero integer value.)	blockr   disabled_svnr   r   socket_familyr   r   r   )+
isinstancerv   r   hasattrr	   
ValueErrorrH   from_intreadr   proxy_managerrn   ro   r   r   r   r   r   r   r   	_resolverr   r   r   r   r   r   	_promises	_orphaned_max_in_flight_multiplexedr   _promise_lock_ocsp_cache
_crl_cacher   setaddr4   h11h2h3init_poolmanagerrS   rq   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rr   s                      rd   ro   zHTTPAdapter.__init__)  s   * k4(( 
	.*/D["455 	.2;??DQ !z{{{$~k::Da(- %>@GI!1)%!1+++!-))- /&;# /113*C'"WW.2-1Ia&uu 	.[_--- 	-[^,,, 	-[^,,,-%)/lKK)+"7 	 	
 	
 	
 	
 	
rf   r^   strc                L    | j         rd| j         d| j          dS d| j         dS )Nz<HTTPAdapter main() proxy()>z<HTTPAdapter >r   poolmanagerr   s    rd   __repr__zHTTPAdapter.__repr__  sA     	YX(8XX$BTXXXX2t/2222rf   dict[str, typing.Any | None]c                *      fd j         D             S )Nc                4    i | ]}|t          |d           S rl   getattr.0attrrq   s     rd   
<dictcomp>z,HTTPAdapter.__getstate__.<locals>.<dictcomp>  '    KKKDgdD$//KKKrf   	__attrs__r   s   `rd   __getstate__zHTTPAdapter.__getstate__      KKKKDNKKKKrf   c                   i | _         i | _        |                                D ]\  }}t          | ||           t	          j        d                                          | _        t                      }| j	        r|
                    t          j                   | j        r|
                    t          j                   | j        r|
                    t          j                   |                     | j        | j        | j        | j        || j        t/          | j        | j                  | j        | j        | j        
  
         d S Nz	system://)r   r   r   r   r   r   r   r   )r   r   itemssetattrr7   from_urlnewr   r   r   r   r4   r   r   r   r   r   r   r   r   r   r   r   rS   r   r   r   r   r   rq   stater  valuer   s        rd   __setstate__zHTTPAdapter.__setstate__  s:      ;;== 	' 	'KD%D$&&&&,5kBBFFHHuu 	.[_--- 	-[^,,, 	-[^,,,""!3%//0BDDVWW/ 1"&"= 	 	
 	
 	
 	
 	
rf   connectionsmaxsizer   pool_kwargsr\   r_   c                j    || _         || _        || _        || _        t	          d||||d|| _        dS )ar  Initializes a urllib3 PoolManager.

        This method should not be called from user code, and is only
        exposed for use when subclassing the
        :class:`HTTPAdapter <requests.adapters.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 quic_cache_layer: Caching mutable mapping to remember QUIC capable endpoint.
        :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager.
        	num_poolsr  r   preemptive_quic_cacheNr   )r   r   r   r   r5   r   rq   r  r  r   r   r  s         rd   r   zHTTPAdapter.init_poolmanager  s\    * "-$ !1& 
!"2	
 

 
 
rf   proxyproxy_kwargsr6   c                F   t                      }| j        r|                    t          j                   | j        rd|vr
| j        |d<   || j        v r| j        |         }n|                                                    d          rLt          |          \  }}t          |f||| j        | j        | j        || j        | j        d|x}| j        |<   nM|                     |          }t#          |f|| j        | j        | j        || j        | j        d|x}| j        |<   |S )a  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 <requests.adapters.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
        r   socksusernamepasswordr  r  r   r   r   r   proxy_headersr  r  r   r   r   r   )r   r   r   r4   r   r   r   lower
startswithrO   rZ   r   r   r   r   r   r"  r:   rq   r  r  r   managerr  r   r"  s           rd   proxy_manager_forzHTTPAdapter.proxy_manager_for  sr    uu 	-[^,,, 	B$4L$H$H-1-AL)*D&&&(/GG[[]]%%g.. 	!25!9!9Hh2C3!!0*&)#33 3 3 3 Gd(// !..u55M2@
3+0*&)#3
3 
3 
3 
3 
Gd(/ rf   connr3   urlry   TLSVerifyType | Nonerz   r{   c                   t          |          dk    sdS d}t          |dt                                |k    }|s!|rd}t          j                    }d}	t          |t                    rdd|v r|}d}n[|                    d          s|                    d          r1t          |          d	v r |	                    d
d          d         }	d}d}t          |t                    r|                    d          }nt          |t                    r|}nMt          |d          r=|                                }t          |t                    r|                                }t          |t                    r1t          j                            |          st#          d|           |	s|j        dk    rd}d|_        n|j        dk    rd}d|_        |r|d|_        d|_        ||_        nb|r/t          j                            |          s||_        n9||_        n1|	|_        n)|j        dk    rd}d|_        d|_        d|_        d|_        t1          |d|           |rt          |t                    sd|d         v r?|j        |d         k    s|j        |d         k    rd}|d         |_        |d         |_        n>|j        |d         k    s|j        |d         k    rd}|d         |_        |d         |_        t          |          dk    r|d         }
|j        |
k    rd}|
|_        n2|j        	d|_        d}n!d|v r||_        n||_        d|_        d|_        |j        r;t          j                            |j                  st#          d|j                   |j        r;t          j                            |j                  st#          d|j                   |rk|j        r?|j        4|j                                         r|j        !                                 dS dS dS tE          j#        d|j$         dtJ                     dS dS )  Verify a SSL certificate. This method should not be called from user
        code, and is only exposed for use when subclassing the
        :class:`HTTPAdapter <requests.adapters.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 path passed as a string or os.Pathlike object,
            in which case it must be a path to a CA bundle to use.
            It is also possible to put the certificates (directly) in a string or bytes.
        :param cert: The SSL certificate to verify.
        httpsNF_niquests_verify-----BEGIN CERTIFICATE-----Tsha256_sha1_G   -   _r   utf-8
__fspath__CCould not find a suitable TLS CA certificate bundle, invalid path: CERT_REQUIRED	CERT_NONEr         7Could not find the TLS certificate file, invalid path: /Could not find the TLS key file, invalid path: !The TLS verification changed for  but the connection isn't idle.)&rQ   r   objectwassimagenerate_ca_bundler   r   r$  lensplitbytesdecoder   r8  ospathexistsOSError	cert_reqsca_certsca_cert_dirca_cert_dataisdirassert_fingerprintr  	cert_datakey_data	cert_filekey_filekey_passwordis_idlepoolqsizeclearwarningswarnhostUserWarningrq   r(  r)  ry   rz   need_reboot_connverify_witness_bitcert_locrS  rR  cert_pwds              rd   cert_verifyzHTTPAdapter.cert_verify  s   & C  G++F!&#*41CVXX#N#NRX#X! @	6 =)'+(/(B(D(D	15"fc** -4>>$*	!%**955 -9J9J79S9S -v;;(2217c11E1Eb1I.%*F(,Ife,, x &g 6 6II "&#.. 9#) 66 9#)#4#4#6#6%h66 9'/'8'8H!(C00 x9Q9Q x%&vlt&v&vwww) 	1~88+/(%4DNN~44+/(%0DN 
A!1$(DM'+D$(1D%% A7==22 4(0+3((.@D++>[00'+$!, $#' $(!D,f555 !	adC(( )0DG;;~a00DMT!W4L4L+/(%)!WDN$(GDMM~a00DMT!W4L4L+/(%)!WDN$(GDMt99>>#AwH(H44+/((0D%%(4,0)+/(0D88%)DNN%)DN $$(!~ jbgnnT^&D&D jhX\Xfhhiii} aRW^^DM%B%B a_PTP]__``` 	| 9(TY__->->(IOO%%%%% )((( b	bbb    	 	rf   reqr)   resp"BaseHTTPResponse | ResponsePromiser*   c                   t                      }t          |t                    du rt          |dd          |_        t          t          |di                     |_        t          |j                  |_        ||_	        |j	        j
        |_
        t          |j        t                    r |j                            d          |_        n|j        |_        t          |j        ||           n.| j        5  || j        |j        <   ddd           n# 1 swxY w Y   ||_        | |_        t          |t                    r||_        |S a  Builds a :class:`Response <requests.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 <requests.adapters.HTTPAdapter>`

        :param req: The :class:`PreparedRequest <PreparedRequest>` used to generate the response.
        :param resp: The urllib3 response or promise object.
        FstatusNheadersr7  )r*   r   r8   r   status_coderK   rl  rP   encodingrawreasonr)  rG  rH  r   cookiesr   r   uidrt   
connection_promiserq   rf  rg  responses       rd   build_responsezHTTPAdapter.build_response  sg    ::dO,,55#*44#@#@H   374B3O3OPPH !:(:J K KHHL&l1HO#'5)) '"w~~g66"w #8#3S$????# 4 4+3tx(4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 "dO,, 	% $Hs   4DDDr|   r}   (HTTPConnectionPool | HTTPSConnectionPoolc                   t          ||          }|r`t          |d          }t          |          }|j        st	          d          |                     |          }|                    |          }n| j                            |          }|S )e  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 <requests.adapters.HTTPAdapter>`.

        :param url: The URL to connect to.
        :param proxies: (optional) A Requests-style dictionary of proxies used on this request.
        httpFPlease check proxy URL. It is malformed and could be missing the host.rT   rR   rI   r^  r   r'  connection_from_urlr   rq   r)  r|   r  	proxy_urlr   r(  s          rd   get_connectionzHTTPAdapter.get_connection  s     S'** 	=,UF;;E!%((I> p%&nooo 22599M 44S99DD#77<<Drf   c                    | j                                          | j                                        D ]}|                                 dS zDisposes of any internal state.

        Currently, this closes the PoolManager and any active ProxyManager,
        which closes any pooled connections.
        Nr   r[  r   valuesrq   r  s     rd   r   zHTTPAdapter.close  sP     	   '..00 	 	EKKMMMM	 	rf   rt   c                @   |j         J t          |j         |          }t          |j                   }|o|dk    }d}|r@	 t          |          }n# t          $ r}t          |d}~ww xY w|                    d          }|j        }	|r|st          |j                   }	|	S a+  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 <requests.adapters.HTTPAdapter>`.

        :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
        :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs.
        Nr-  Fr  r)  rT   rQ   r   r   r$  path_urlrW   
rq   rt   r|   r  schemeis_proxied_http_requestusing_socks_proxyproxy_schemeer)  s
             rd   request_urlzHTTPAdapter.request_url       {&&&W['22gk**"'"=Fg,=! 	A(+E22  ( ( ( a'( , 7 7 @ @" 	-+< 	-,,C
    A 
A'A""A'c                    dS 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 <requests.adapters.HTTPAdapter>`.

        This should not be called from user code, and is only exposed for use
        when subclassing the
        :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.

        :param request: The :class:`PreparedRequest <PreparedRequest>` to add headers to.
        :param kwargs: The keyword arguments from the call to send().
        Nr   rq   rt   r]   s      rd   add_headerszHTTPAdapter.add_headers  	     	rf   dict[str, str]c                X    i }t          |          \  }}|rt          ||          |d<   |S a  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 <requests.adapters.HTTPAdapter>`.

        :param proxy: The url of the proxy being used for this request.
        zProxy-AuthorizationrO   r   rq   r  rl  r  r   s        rd   r"  zHTTPAdapter.proxy_headers  >     .u55( 	Q-<Xx-P-PG)*rf   Tru   rw   !int | float | TimeoutSauce | Noner   r~   r   r   r   r   r   r   c                
   	 j         j        j        
J d            |
rW j        P j        5  t           j                   j        k    r                                  ddd           n# 1 swxY w Y   	                      j         |          }n## t          $ r}t          |          d}~ww xY wt          |t                    r                     |j         ||                                |          }                     |||||           t!          j                  du pdj        v  }t          |t$                    rV	 t          |          dk    r|\  }}}n|\  }}d}t'          |||          }nH# t(          $ r t)          d	| d
          w xY wt          |t&                    rnt'          ||          }t          j        t*          t,          f          rt)          d          t/          j                   }d}|X|dvrTd|v r(t%          |                    dd                    \  }}nd} t3          t5          ||                                }d	 fd}	 |                    j        |j        j        dddd j        ||||	|nd||
          }t;          j         |          }|K j        |         j                             ||            j        |         j        !                                 n> j"        j                             ||            j"        j        !                                 n# tF          tH          f$ rJ}dtK          |          &                                v rtO          |          tQ          |          d}~wtR          $ r}t          |j*        tV                    r+t          |j*        tX                    st[          |          t          |j*        t\                    rt_          |          t          |j*        t`                    rtc          |          t          |j*        td                    rtg          |          tQ          |          d}~wth          $ r}tQ          |          d}~wt`          $ r}tc          |          d}~wtd          tj          f$ rx}t          |td                    rtg          |          t          |tl                    rto          |          t          |tp                    rtO          |           d}~ww xY w 9                    |          S )aN  Sends PreparedRequest object. Returns Response object.

        :param request: The :class:`PreparedRequest <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) <timeouts>` tuple.
        :param verify: (optional) Either a boolean, in which case it controls whether
            we verify the server's TLS certificate, or a path passed as a string or os.Pathlike object,
            in which case it must be a path to a CA bundle to use.
            Defaults to ``True``.
            It is also possible to put the certificates (directly) in a string or bytes.
        :param cert: (optional) Any user-provided SSL certificate to be trusted.
        :param proxies: (optional) The proxies dictionary to apply to the request.
        :param on_post_connection: (optional) A callable that contain a single positional argument for newly acquired
            connection. Useful to check acquired connection information.
        :param multiplexed: Determine if request shall be transmitted by leveraging the multiplexed aspect of the protocol
            if available. Return a lazy instance of Response pending its retrieval.
        N/Tried to send a non-initialized PreparedRequestrt   ru   rw   ry   rz   r|   FContent-Lengthr<  connectr   totalInvalid timeout {. Pass a (connect, read) or (connect, read, total) timeout tuple, or a single float to set both timeouts to the same value.r  r   -Body contains unprepared native list or dict.r{  r-  +r   maxsplitimplementationearly_responser0   r^   r_   c                N    J                       |                      d S rl   rw  r  r   rt   rq   s    rd   early_response_hookz-HTTPAdapter.send.<locals>.early_response_hookq  s6    $000d11'>JJKKKKKrf   methodr)  bodyrl  redirectassert_same_hostpreload_contentdecode_contentretriesrw   chunkedr~   r   r   	extensionr   illegal header)r  r0   r^   r_   ):r)  rl  r  r   r   rE  r   r   r  rA   r   r   r3   re  r  r  rv   r  tupleTimeoutSaucer   listdictrQ   rF  rX   r>   urlopenr   rT   r   poolsmemorizereleaser   rD   rL  r   r#  r   r   rB   rp  r@   rC   r   rF   r!   _ProxyErrorr   	_SSLErrorr"   r?   
_HTTPErrorrE   r    _InvalidHeaderrw  )rq   rt   ru   rw   ry   rz   r|   r~   r   r   r   r(  r  r)  r  r  r   r  r  r  r  r  resp_or_promiser  errs   ``       `               rd   r   zHTTPAdapter.send  ss   B {&7?+F7>KeKe= LfKeKe
  	"4:F# " "t~&&$*IIIKKMMM" " " " " " " " " " " " " " "	1&&w{G<<DD! 	1 	1 	1Q0000	1 d/00 	>T7;===w00 	 	
 	
 	
 GL))U2Y6F'/6YZgu%% 	Bw<<1$$+2(GT55$+MGT E&wTOOO    Qw Q Q Q  
 .. 	B"7AAAGglT4L11 	NLMMMgk**	&0A"A"Af}}).v||C!|/L/L)M)M&!%f/vVd0e0e0effhhI	L 	L 	L 	L 	L 	L 	L 	L
F	"ll~\!& %$(#5-9J9V"5"5\`#'! +  O, !g66E "5)/88$OOO"5)/779999 &//FFF &..000w' 	8 	8 	83s88>>#3#333#C9999!#w7777 	6 	6 	6!($788 =!!(,>?? =(G<<<<!(M22 5 G4444!(K00 5 G4444!(I.. 3q'2222!!W5555 	6 	6 	6!!W5555 	  	  	 Q--:& 		 		 		!Y'' q'2222A/00 !!W5555A~.. #Aw7777		 ""7O<<<s   2A11A58A5=B 
B9#B44B93F	 	F':CM U*AN//U<CRU R11U>SU!A3UUrv  low_respr0   Response | Nonec                d	    |j                             d          }|j                             d          }|j                             d          }|j                             d          }|j                             d          }|j                             d          }|j                             d          }	|j                             d          ||_        |j         }
|` |j        }|J t	                      |z
  }t          |	          |_        t          |d
d           |_        t          t          |di                     |_
        t          |j
                  |_        |j        j        |_        t          |j        t                     r |j                            d          |_        n|j        |_        t%          |j        ||           t%          |||           d |
j                                        D             }|r|                    ||          |	dz  }	|	|dz   k    rt/          d| d          rۉ j        |
j        = d fd}|d<     j        fi }|j        du rt9          d          t;          j                  _        |j        |_        d|vr||d<   |d         j                             |           t	                      |d<   |	|d<   |                                D ] \  }}|j         !                    ||           !|S n|                    ||          |_"        |`d|v r|d         }|j        d         }|j        #                                 d|_$        d|_%        |j        |j        c|_        |_        |j
        |j
        c|_
        |_
        |j        |j        c|_        |_        |j        |j        c|_        |_        |j        |j        c|_        |_        |j        |j        c|_        |_        |j        |j        c|_        |_        |j        |j        c|_        |_        |g|j        z   |_        tM          d||fi }|j        r%|j        D ]}t%          ||j        |j                   |s|j'        |j(          j        |
j        = d S )Nniquests_is_streamniquests_startniquests_hooksniquests_cookiesniquests_allow_redirectniquests_max_redirectsniquests_redirect_countniquests_kwargssecondsrk  rl  r7  c                D    i | ]\  }}|                     d           ||S 	niquests_r$  r   kvs      rd   r  z/HTTPAdapter._future_handler.<locals>.<dictcomp>  3    qqqtq!WXWcWcdoWpWpqaqqqrf   r   	Exceeded 
 redirectsr  	conn_infor1   r^   r_   c           
        J | _         j        rGj                            d          r.d         r't          j                            dd          dk    }|sj        j        j        }t          | j                  r_	 ddl	m
}  |||sdnd	d
         t          j        t                    rj        ndj        j                   n# t           $ r Y nw xY wt#          | j                  rg	 ddlm
}  |||sdnd	d
         t          j        t                    rj        ndj        j                   dS # t           $ r Y dS w xY wdS dS dS dS zVThis function will be called by urllib3.future just after establishing the connection.Nzhttps://ry   NIQUESTS_STRICT_OCSP0r   )ry   g?g      ?r|   )cache)r  r)  r$  rI  environgetr   strict_moderV   extensions.revocation._ocspry   r   r   r<   r   r   ImportErrorrU   extensions.revocation._crlr   )r  strict_ocsp_enabledocsp_verify
crl_verifyr]   next_requestrq   s       rd   r~   z7HTTPAdapter._future_handler.<locals>.on_post_connection  s    (333-6L*#' $"L,<,G,G
,S,S $"X^_gXh $"46JNNCY[^4_4_cf4f+2 ]t7U7a262P2\/,Y8VWW "" ^ ^ ^ ^ ^ ^ !,$0$7/B$KCC$*9$56@Q]6^6^$hDNNdh$($8*.*:!" !" !" !" !" $/ % % % $% ,It7UVV "" \ \ \ \ \ \ !+
$0$7/B$KCC$*9$56@Q]6^6^$hDNNdh$($8*./!" !" !" !" !" !" $/ % % % $%3$" $" $" $" $" $"," "s$   C 
C#"C#<E 
EEr~   FA multiplexed request led to a non-multiplexed response after a redirect. This is currently unsupported. A patch is in the making to support that edge case.niquests_origin_responser6  rv  r  r1   r^   r_   ))rt  get_parameterro  rt   preferred_clockr   elapsedr   rm  rK   rl  rP   rn  rp  r   r)  rG  rH  r   rq  _parametersr
  _resolve_redirectr#   r   rr  r   lazyr   rL   r  historyappendset_parameter_nextpop_content_content_consumedr'   r  contentrq   rv  r  ru   starthookssession_cookiesallow_redirectsmax_redirectredirect_countresponse_promiserf  r  promise_ctx_backupr~   next_promiser  r  origin_responseleaf_responsesub_respr]   r  s   `                    @@rd   _future_handlerzHTTPAdapter._future_handler  st   (667KLL(667GHH"+99:JKK%-%6%D%DEW%X%X ( 1 ? ?%!
 !
 %-;;<TUU&/==>WXX9A9J9X9XYj9k9k  #, "##e+$W555  'x4@@ /wxB/O/OPP 6h6FGG",-cgu%% 	#7>>'22HLL7HL 	x/h???X>>>qq/?/K/Q/Q/S/Sqqq S	G#55hDDLaNq 000&'K<'K'K'KUabbbb J$N#3#78+" +" +" +" +" +" +" +"Z 0B+,(ty@@@@  $--+m  
 *6l6L)M)M&191K.-5GGGEM&'AB"#=>FMMl[[[7F7H7H"#34@N"#<=.4466 > >DAq )771====##UJ$X &77#FFHN& &);;;(:;U(VO&5&=b&AM#'')))',O$05O- )+ CO')B
 %' ;O#]%:
 &( =O$m&<
 !# 3O!2
 $& 9O"M$8
 !# 3O!2
 %' ;O#]%:
 %' ;O#]%:
 (5o8O&OO# !UHGGGG 	X$, X X&8H(,WWWW 	!!)  N+/0trf   r   r   r   c                  | j         5  | j        s	 d d d            d S | j        gd | j                                        D             }|s	 ||dk    r	 d d d            d S d }| j        rS| j        D ]/}	 |j        j        j        | j        v r|} n # t          $ r Y ,w xY w|| j        
                    |           |	 |D ]}|                                }| nn# t          t          f$ r}t          |          d }~wt          $ r}t!          |j        t$                    r)t!          |j        t&                    st)          |          t!          |j        t*                    rt-          |          t!          |j        t.                    rt1          |          t!          |j        t2                    rt5          |          t          |          d }~wt.          $ r}t1          |          d }~wt2          t6          f$ rr}t!          |t2                    rt5          |          t!          |t8                    rt;          |          t!          |t<                    rt?          |           d }~ww xY w|n||dz  }|j        !tA          |j        d          r|j        j        J |j        j        j        | j        v r| j        |j        j        j                 nd }	|	| j        !                    |           | "                    |	|           Ԑntg }
|D ]T}	||dk    r d d d            d S |	j#        }|J tA          |	d          s5	 |D ]5}	 |                    |	j$                  }n# tJ          $ r d }Y nw xY w| n6n# t          t          f$ r}t          |          d }~wt          $ r}t!          |j        t$                    r)t!          |j        t&                    st)          |          t!          |j        t*                    rt-          |          t!          |j        t.                    rt1          |          t!          |j        t2                    rt5          |          t          |          d }~wt.          $ r}t1          |          d }~wt2          t6          f$ rr}t!          |t2                    rt5          |          t!          |t8                    rt;          |          t!          |t<                    rt?          |           d }~ww xY w|tM          d          ||dz  }| "                    |	|          }||
!                    |           V|
r
 | j'        |
  	 d d d            d S | j        s	 d d d            d S | '                                 d d d            d S # 1 swxY w Y   d S )	Nc                    g | ]}|S r   r   r   pms     rd   
<listcomp>z&HTTPAdapter.gather.<locals>.<listcomp>  s    ;;;";;;rf   Tr   r   from_promisert  promisepUnderlying library did not recognize our promise when asked to retrieve it. Did you close the session too early?)(r   r   r   r   r  r   _fpr  rr  AttributeErrorremoveget_responserD   rL  r   rB   r   rp  r@   rC   r   rF   r!   r  r   r  r"   r  rE   r    r  r   r   r  r  rt   rt  r   r   r   rq   r   r   mgrsr  orphansrcr  r  rv  still_redirectsrf  	next_resps                rd   r   zHTTPAdapter.gather  s    m	 m	> m	 m	 m	 m	 m	 m	 m	 m	
  6;;t188::;;;6D  ^P= ,am	 m	 m	 m	 m	 m	 m	 m	  $H~ 	<&*n ) )F)#):#:#>$.#P#P/5H$)E $Q $2 ) ) ) ()#/ N11(;;;'&&'+ * *+.+;+;+=+=#+#7$)E $8 -w7 7 7 7"1#"6"66, 5 5 5)!(4GHH <'1!(<N'O'O !<*8*;*;$;)!(MBB 4&0mm 3)!(K@@ 4&0mm 3)!(I>> 2&.qkk 1"1!"4"44* 0 0 0",Q--/ ):6 	& 	& 	&)!Y77 &&.qkk 1!+A/?!@!@ &&1!nn 4!+A~!>!> &&3A&6&6 6 %	&  ' ,!Q	 !0#HL.AA 1$L5AAA
 $<48DNJJ x|'@'DEE!   '--h777 ((8<<<aP=v . #% !* C: C:H ,aEm	 m	 m	 m	 m	 m	 m	 m	H #*C???"8Z88 ! *"#' & &C0+.+;+;HDU+;+V+V#- 0 0 0+/0  (3 %  4)73 3 3 3-c222( 1 1 1%ah0CDD 8#-ah8J#K#K 8&4Q&7&7 7%ah>> 0",Q--/%ah<< 0",Q--/%ah	:: ."*1++--a000& , , ,(mm+%z2 	" 	" 	"%a33 ""*1++-'+;<< ""-a..0'>:: ""/"2"22!	"  '/C  
 !,!Q	 $ 4 4Xx H HI ,'..y999" 2DK11Qm	 m	 m	 m	 m	 m	 m	 m	T > Wm	 m	 m	 m	 m	 m	 m	 m	Z KKMMM[m	 m	 m	 m	 m	 m	 m	 m	 m	 m	 m	 m	 m	 m	 m	 m	 m	 m	s  	W8W#W6BW
B WB  "WC" W"I>3DI>CGI>)G88I>A-I99I>>B5W WN"M>=N>N	
NN	NWT3(N77T3CRT3R--T3A-T..T33AWW,WWW)"r   r   r   r   r   r   r   rv   r   r   r   rv   r   rv   r   rv   r   r   r   r   r   r   r   rv   r   rv   r   r   r   r   r   r   r   r   r^   r   r^   r   r  r   r  r   r   rv   r   r   r  r\   r^   r_   )r  r   r  r\   r^   r6   )
r(  r3   r)  r   ry   r*  rz   r{   r^   r_   )rf  r)   rg  rh  r^   r*   rl   )r)  r   r|   r}   r^   rx  r   rt   r)   r|   r}   r^   r   rt   r)   r  r   r^   r  r   )rt   r)   ru   rv   rw   r  ry   r   rz   r{   r|   r}   r~   r   r   r   r   r   r   rv   r^   r*   )rv  r*   r  r0   r^   r  r   r   r   r   r   r  r   r   r
   r$   ro   r   r  r  r   r'  re  rw  r  r   r  r  r"  r   r  r   r   r   s   @rd   r   r      s7        4  I* !1,!0,T
 9=###04(,15""%*.448CS'T
 T
 T
 T
 T
 T
 T
 T
l3 3 3 3
L L L L
 
 
J (8< 
  
  
  
  
D1 1 1 1fE E E EN) ) ) )V    ,      B      . 59 $)-$(IMVZFJ!l= l= l= l= l=\@ @ @ @D DH n n n n n n n n n nrf   r   c                       e Zd ZdZg dZeeeefddddddddddddedde fd#Z	dfd&Z
dgd(Zd) Zedfdhd0Zdid4Zdjd<ZdkdBZ	 dldmdFZdndGZdodIZdpdJZdqdLZ	 	 	 	 	 	 	 	 	 drdsdYZdtd_Zdd`duddZ xZS )vAsyncHTTPAdaptera  The built-in HTTP Adapter for urllib3.future asynchronous part.

    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 <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 niquests
      >>> s = niquests.AsyncSession()
      >>> a = niquests.adapters.AsyncHTTPAdapter(max_retries=3)
      >>> s.mount('http://', a)
    r   NFr   r   r   r   r   r   r   r   r   rv   r   r   r   r   r   r   r   r   AsyncResolverType | Noner   r   r   r   r   r   r   r   r   r   r   c                  t          |t                    rd| _        net          |d          rt	          |          | _        n@|dk     rt          d          t          j        |          | _        |dk    rd| j        _        i | _	        i | _
        t                                                       || _        || _        || _        || _        || _        || _        || _        |
| _        || _        || _        || _        || _        || _        || _        i | _        g | _        |	| _        d | _        d | _        || _         tC                      }|r|"                    tF          j$                   |r|"                    tF          j%                   |r|"                    tF          j&                   | '                    ||||||
|tQ          ||          |||           d S r   ))r   rv   r   r   r	   r   rH   r   r   r   r   rn   ro   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r4   r   r   r   r   rS   r   s                      rd   ro   zAsyncHTTPAdapter.__init__a  s   * k4(( 
	.*/D["455 	.2;??DQ !z{{{$~k::Da(- %>@LN!1)%!1+++!-))- /&;# ?A68*C'.2-1Ia&uu 	.[_--- 	-[^,,, 	-[^,,,-%)/lKK)+"7 	 	
 	
 	
 	
 	
rf   r^   r   c                L    | j         rd| j         d| j          dS d| j         dS )Nz<AsyncHTTPAdapter main(r   r   z<AsyncHTTPAdapter r   r   r   s    rd   r   zAsyncHTTPAdapter.__repr__  sA     	^]T-=]]tGY]]]]7D$47777rf   r   c                *      fd j         D             S )Nc                4    i | ]}|t          |d           S rl   r   r   s     rd   r  z1AsyncHTTPAdapter.__getstate__.<locals>.<dictcomp>  r  rf   r  r   s   `rd   r  zAsyncHTTPAdapter.__getstate__  r  rf   c                   i | _         i | _        |                                D ]\  }}t          | ||           t	          j        d                                          | _        t                      }| j	        r|
                    t          j                   | j        r|
                    t          j                   | j        r|
                    t          j                   |                     | j        | j        | j        | j        || j        t/          | j        | j                  | j        | j        | j        
  
         d S r	  )r   r   r
  r  r/   r  r  r   r   r   r   r4   r   r   r   r   r   r   r   r   r   r   r   rS   r   r   r   r   r   r  s        rd   r  zAsyncHTTPAdapter.__setstate__  s:      ;;== 	' 	'KD%D$&&&&1:;GGKKMMuu 	.[_--- 	-[^,,, 	-[^,,,""!3%//0BDDVWW/ 1"&"= 	 	
 	
 	
 	
 	
rf   r  r  r   r  r\   r_   c                j    || _         || _        || _        || _        t	          d||||d|| _        dS )a|  Initializes a urllib3 AsyncPoolManager.

        This method should not be called from user code, and is only
        exposed for use when subclassing the
        :class:`HTTPAdapter <requests.adapters.AsyncHTTPAdapter>`.

        :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 quic_cache_layer: Caching mutable mapping to remember QUIC capable endpoint.
        :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager.
        r  Nr   )r   r   r   r   r-   r   r  s         rd   r   z!AsyncHTTPAdapter.init_poolmanager  s\    * "-$ !1+ 
!"2	
 

 
 
rf   r  r  r.   c                F   t                      }| j        r|                    t          j                   | j        rd|vr
| j        |d<   || j        v r| j        |         }n|                                                    d          rLt          |          \  }}t          |f||| j        | j        | j        || j        | j        d|x}| j        |<   nM|                     |          }t#          |f|| j        | j        | j        || j        | j        d|x}| j        |<   |S )a  Return urllib3 AsyncProxyManager for the given proxy.

        This method should not be called from user code, and is only
        exposed for use when subclassing the
        :class:`HTTPAdapter <requests.adapters.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
        r   r  r  r!  )r   r   r   r4   r   r   r   r#  r$  rO   rY   r   r   r   r   r   r"  r9   r%  s           rd   r'  z"AsyncHTTPAdapter.proxy_manager_for  sr    uu 	-[^,,, 	B$4L$H$H-1-AL)*D&&&(/GG[[]]%%g.. 	!25!9!9Hh2H3!!0*&)#33 3 3 3 Gd(// !..u55M2F
3+0*&)#3
3 
3 
3 
3 
Gd(/ rf   r(  r,   r)  ry   r*  rz   r{   c                   t          |          dk    sdS d}t          |dt                                |k    }|s!|rd}t          j                    }d}	t          |t                    rdd|v r|}d}n[|                    d          s|                    d          r1t          |          d	v r |	                    d
d          d         }	d}d}t          |t                    r|                    d          }nt          |t                    r|}nMt          |d          r=|                                }t          |t                    r|                                }t          |t                    r1t          j                            |          st#          d|           |	s|j        dk    rd}d|_        n|j        dk    rd}d|_        |r|d|_        d|_        ||_        nb|r/t          j                            |          s||_        n9||_        n1|	|_        n)|j        dk    rd}d|_        d|_        d|_        d|_        t1          |d|           |rt          |t                    sd|d         v r?|j        |d         k    s|j        |d         k    rd}|d         |_        |d         |_        n>|j        |d         k    s|j        |d         k    rd}|d         |_        |d         |_        t          |          dk    r|d         }
|j        |
k    rd}|
|_        n2|j        	d|_        d}n!d|v r||_        n||_        d|_        d|_        |j        r;t          j                            |j                  st#          d|j                   |j        r;t          j                            |j                  st#          d|j                   |S )r,  r-  Fr.  Nr/  Tr0  r1  r2  r5  r   r6  r7  r8  r9  r:  r;  r   r<  r=  r>  r?  )rQ   r   rB  rC  rD  r   r   r$  rE  rF  rG  rH  r   r8  rI  rJ  rK  rL  rM  rN  rO  rP  rQ  rR  r  rS  rT  rU  rV  rW  r`  s              rd   re  zAsyncHTTPAdapter.cert_verify5  s?   & C  G++5!&#*41CVXX#N#NRX#X! ?	6 <)'+(/(B(D(D	15"fc** -4>>$*	!%**955 -9J9J79S9S -v;;(2217c11E1Eb1I.%*F(,Ife,, x &g 6 6II "&#.. 9#) 66 9#)#4#4#6#6%h66 9'/'8'8H!(C00 x9Q9Q x%&vlt&v&vwww) 	1~88+/(%4DNN~44+/(%0DN 
A!1$(DM'+D$(1D%% A7==22 4(0+3((.@D++>[00'+$!, $#' $(!D,f555 !	adC(( )0DG;;~a00DMT!W4L4L+/(%)!WDN$(GDMM~a00DMT!W4L4L+/(%)!WDN$(GDMt99>>#AwH(H44+/((0D%%(4,0)+/(0D88%)DNN%)DN $$(!~ jbgnnT^&D&D jhX\Xfhhiii} aRW^^DM%B%B a_PTP]__```rf   rf  r)   rg  'BaseAsyncHTTPResponse | ResponsePromiser(   c                P   t                      }t          |t                    du rt          |dd          |_        t          t          |di                     |_        t          |j                  |_        ||_	        |j	        j
        |_
        t          |j        t                    r |j                            d          |_        n|j        |_        t          |j        ||           n|| j        |j        <   ||_        | |_        t          |t                    r||_        |S rj  )r(   r   r8   r   rm  rK   rl  rP   rn  ro  rp  r)  rG  rH  r   rq  r   rr  rt   rs  rt  ru  s       rd   rw  zAsyncHTTPAdapter.build_response  s	    !??dO,,55#*44#@#@H   374B3O3OPPH !:(:J K KHHL&l1HO#'5)) '"w~~g66"w #8#3S$????'/DN48$ "dO,, 	% $Hrf   r|   r}   2AsyncHTTPConnectionPool | AsyncHTTPSConnectionPoolc                :  K   t          ||          }|rft          |d          }t          |          }|j        st	          d          |                     |          }|                    |           d{V }n | j                            |           d{V }|S )rz  r{  r|  Nr}  r  s          rd   r  zAsyncHTTPAdapter.get_connection  s       S'** 	C,UF;;E!%((I> p%&nooo 22599M&::3????????DD)==cBBBBBBBBDrf   c                   K   | j                                          d{V  | j                                        D ]}|                                 d{V  dS r  r  r  s     rd   r   zAsyncHTTPAdapter.close  sz       $$&&&&&&&&&'..00 	  	 E++--	  	 rf   rt   c                @   |j         J t          |j         |          }t          |j                   }|o|dk    }d}|r@	 t          |          }n# t          $ r}t          |d}~ww xY w|                    d          }|j        }	|r|st          |j                   }	|	S r  r  r  s
             rd   r  zAsyncHTTPAdapter.request_url   r  r  c                    dS r  r   r  s      rd   r  zAsyncHTTPAdapter.add_headers!  r  rf   r  c                X    i }t          |          \  }}|rt          ||          |d<   |S r  r  r  s        rd   r"  zAsyncHTTPAdapter.proxy_headers/  r  rf   Tru   rw   r  r   r~   r   r   r   r   r   r   c                   	K   j         j        j        
J d            |
r> j        7t	           j                   j        k    r                                  d{V  	                      j         |           d{V }n## t          $ r}t          |          d}~ww xY wt          |t                    r                     |j         ||          }|rj|j        r@|j        8|j                                        r|j                                         d{V  n#t#          j        d|j         dt(                                          |          }                     |||||           t/          j                  du pdj        v  }t          |t2                    rV	 t	          |          d	k    r|\  }}}n|\  }}d}t5          |||
          }nH# t6          $ r t7          d| d          w xY wt          |t4                    rnt5          ||          }t          j        t8          t:          f          rt7          d          t=          j                   }d}|X|dvrTd|v r(t3          |                    dd                    \  }}nd} tA          tC          ||                                }d	 fd}	 |"                    j        |j        j        dddd j#        ||||	|nd||
           d{V }tI          j         |          }|K j%        |         j&        '                    ||            j%        |         j&        (                                 n> j)        j&        '                    ||            j)        j&        (                                 n# tT          tV          f$ rJ}dtY          |          -                                v rt]          |          t_          |          d}~wt`          $ r}t          |j1        td                    r+t          |j1        tf                    sti          |          t          |j1        tj                    rtm          |          t          |j1        tn                    rtq          |          t          |j1        tr                    rtu          |          t_          |          d}~wtv          $ r}t_          |          d}~wtn          $ r}tq          |          d}~wtr          tx          f$ rx}t          |tr                    rtu          |          t          |tz                    rt}          |          t          |t~                    rt]          |           d}~ww xY w @                    |          S )a,  Sends PreparedRequest object. Returns Response object.

        :param request: The :class:`PreparedRequest <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) <timeouts>` tuple.
        :param verify: (optional) Either a boolean, in which case it controls whether
            we verify the server's TLS certificate, or a path passed as a string or os.Pathlike object,
            in which case it must be a path to a CA bundle to use.
            It is also possible to put the certificates (directly) in a string or bytes.
        :param cert: (optional) Any user-provided SSL certificate to be trusted.
        :param proxies: (optional) The proxies dictionary to apply to the request.
        :param on_post_connection: (optional) A callable that contain a single positional argument for newly acquired
            connection. Useful to check acquired connection information.
        :param multiplexed: Determine if request shall be transmitted by leveraging the multiplexed aspect of the protocol
            if available. Return a lazy instance of Response pending its retrieval.
        Nr  r  r@  rA  r  Fr  r<  r  r  r  r  r  r  r  r   r  r  r  BaseAsyncHTTPResponser^   r_   c                ^   K   J                       |                      d {V  d S rl   r  r  s    rd   r  z2AsyncHTTPAdapter.send.<locals>.early_response_hook  sL      $000##D$7$7$P$PQQQQQQQQQQQrf   r  r  )r  rD  r^   r_   )Ar)  rl  r  r   rE  r   r   r  rA   r   r   r,   re  rX  rY  rZ  r[  r\  r]  r^  r_  r  r  rv   r  r  r  r   r  r  rQ   rF  rN   async_load_extensionr  r   rT   r   r  r  r  r   rD   rL  r   r#  r   r   rB   rp  r@   rC   r   rF   r!   r  r   r  r"   r?   r  rE   r    r  rw  )rq   rt   ru   rw   ry   rz   r|   r~   r   r   r   r(  r  need_rebootr)  r  r  r   r  r  r  r  r  r  r  r  s   ``       `                rd   r   zAsyncHTTPAdapter.sendC  s     > {&7?+F7>KeKe= LfKeKe
  	$4:F4>""d&EEEkkmm#######	1,,W['BBBBBBBBDD! 	1 	1 	1Q0000	1 d455 	**4fdKKK < y,1B1B,"ioo/////////MfDIfff#  
 w00 	 	
 	
 	
 GL))U2Y6F'/6YZgu%% 	Bw<<1$$+2(GT55$+MGT E&wTOOO    Qw Q Q Q  
 .. 	B"7AAAGglT4L11 	NLMMMgk**	&0A"A"Af}}).v||C!|/L/L)M)M&!%r56J6bp6q6q6qrrttI	R 	R 	R 	R 	R 	R 	R 	R
E	$(LL~\!& %$(#5-9J9V"5"5\`#'! %1 % %      O* !g66E "5)/88$OOO"5)/779999 &//FFF &..000w' 	8 	8 	83s88>>#3#333#C9999!#w7777 	6 	6 	6!($788 =!!(,>?? =(G<<<<!(M22 5 G4444!(K00 5 G4444!(I.. 3q'2222!!W5555 	6 	6 	6!!W5555 	  	  	 Q--:& 		 		 		!Y'' q'2222A/00 !!W5555A~.. #Aw7777		 ""7O<<<sp   &!B 
B(B##B(03G$ $HC#N: :V:APV:CS44V:TV:T..V:A3V55V:rv  AsyncResponse | Responser  rD  AsyncResponse | Nonec                8
   K   t          |t                    st          |           t          |t                    sJ |j                            d          }|j                            d          }|j                            d          }|j                            d          }|j                            d          }|j                            d          }|j                            d          }	|j                            d          ||_        |j        }
|`|j        }|J t                      |z
  }t          |	          |_	        t          |d
d           |_        t          t          |di                     |_        t          |j                  |_        |j        j        |_        t          |j        t$                    r |j                            d          |_        n|j        |_        t)          |j        ||           t)          |||           d |
j                                        D             }|r#|                    ||           d {V |	dz  }	|	|dz   k    rt3          d| d          r j        |
j        = d fd}|d<     j        fi  d {V }|j        du rt=          d          t?          j                   _         |j        |_        d|vr||d<   |d         j!        "                    |           t                      |d<   |	|d<   |                                D ] \  }}|j        #                    ||           !|S n!|                    ||           d {V |_$        |`d|v r|d         }|j!        d         }|j!        %                                 d|_&        d|_'        |j        |j        c|_        |_        |j        |j        c|_        |_        |j        |j        c|_        |_        |j        |j        c|_        |_        |j        |j        c|_        |_        |j        |j        c|_        |_        |j	        |j	        c|_	        |_	        |j        |j        c|_        |_        |g|j!        z   |_!        tQ          d||fi  d {V }|j!        r%|j!        D ]}t)          ||j        |j                   |s#|j)        |j*         d {V  t          |            j        |
j        = d S )Nr  r  r  r  r  r  r  r  r  rk  rl  r7  c                D    i | ]\  }}|                     d           ||S r  r  r  s      rd   r  z4AsyncHTTPAdapter._future_handler.<locals>.<dictcomp>)  r  rf   r   r  r  r  r  r1   r^   r_   c           
       K   J | _         j        rSj                            d          r:d         r3t          j                            dd          dk    }|sj        j        j        }t          | j                  re	 ddl	m
}  |||sdnd	d
         t          j        t                    rj        ndj        j                   d{V  n# t           $ r Y nw xY wt#          | j                  rm	 ddlm
}  |||sdnd	d
         t          j        t                    rj        ndj        j                   d{V  dS # t           $ r Y dS w xY wdS dS dS dS r  )r  r)  r$  rI  r  r  r   r  rV   "extensions.revocation._ocsp._asyncry   r   r   r=   r   r   r  rU   !extensions.revocation._crl._asyncr   )r  r  async_ocsp_verifyasync_crl_verifyr]   r  rq   s       rd   r~   z<AsyncHTTPAdapter._future_handler.<locals>.on_post_connection5  so      (333-6L*#' ("L,<,G,G
,S,S ("X^_gXh ("46JNNCY[^4_4_cf4f+2 ]t7U7a262P2\/,Y8VWW ""!" !" !" !" !" !" '8&7$0$7/B$KCC$*9$56@Qb6c6c$mDNNim$($8*.*:'" '" '" !" !" !" !" !" !" !" !" $/ % % % $% ,It7UVV ""!" !" !" !" !" !" '7&6$0$7/B$KCC$*9$56@Qb6c6c$mDNNim$($8*./'" '" '" !" !" !" !" !" !" !" !" !" $/ % % % $%;(" (" (" (" (" ("0" "s$   
C 
C+*C+E 
E'&E'r~   Fr  r  r6  rv  r  )+r   r(   rM   rt  r  ro  rt   r  r   r  r   rm  rK   rl  rP   rn  rp  r)  rG  rH  r   rq  r  r
  r  r#   r   rr  r   r  r   rL   r  r   r  r  r  r  r  r  r&   r  r  r  s   `                    @@rd   r  z AsyncHTTPAdapter._future_handler  s      (M22 	$(###(M22222(667KLL(667GHH"+99:JKK%-%6%D%DEW%X%X ( 1 ? ?%!
 !
 %-;;<TUU&/==>WXX9A9J9X9XYj9k9k  #, "##e+$W555  'x4@@ /wxB/O/OPP 6h6FGG",-cgu%% 	#7>>'22HLL7HL 	x/h???X>>>qq/?/K/Q/Q/S/Sqqq W	M!)!;!;Hc!J!JJJJJJJLaNq 000&'K<'K'K'KUabbbb N$N#3#78/" /" /" /" /" /" /" /"b 0B+,%.TY|%F%Fv%F%FFFFFFF  $--+m  
 *6l6L)M)M&191K.-5GGGEM&'AB"#=>FMMl[[[7F7H7H"#34@N"#<=.4466 > >DAq )771====##]N$` $,#=#=h#L#LLLLLLLHN& &);;;(:;U(VO&5&=b&AM#'')))',O$05O- )+ CO')B
 %' ;O#]%:
 &( =O$m&<
 !# 3O!2
 $& 9O"M$8
 !# 3O!2
 %' ;O#]%:
 %' ;O#]%:
 (5o8O&OO# -ZSSFSSSSSSSS 	X$, X X&8H(,WWWW 	$!)&&&&&&&&(###N+/0trf   r   r   Response | AsyncResponser   c               J  K   | j         sd S | j        gd | j                                        D             }|s	 ||dk    rd S d }| j        rS| j        D ]/}	 |j        j        j        | j         v r|} n # t          $ r Y ,w xY w|| j        	                    |           |	 |D ] }|
                                 d {V }| n!n# t          t          f$ r}t          |          d }~wt          $ r}t          |j        t"                    r)t          |j        t$                    st'          |          t          |j        t(                    rt+          |          t          |j        t,                    rt/          |          t          |j        t0                    rt3          |          t          |          d }~wt,          $ r}t/          |          d }~wt0          t4          f$ rr}t          |t0                    rt3          |          t          |t6                    rt9          |          t          |t:                    rt=          |           d }~ww xY w|n||dz  }|j        !t?          |j        d          r|j        j        J |j        j        j        | j         v r| j         |j        j        j                 nd }	|	| j                             |           | !                    |	|           d {V  Ԑnog }
|D ]U}	|	|dk    r d S |	j"        }|J t?          |	d          s*	 |D ];}	 |
                    |	j#                   d {V }n# tH          $ r d }Y nw xY w| n<n# t          t          f$ r}t          |          d }~wt          $ r}t          |j        t"                    r)t          |j        t$                    st'          |          t          |j        t(                    rt+          |          t          |j        t,                    rt/          |          t          |j        t0                    rt3          |          t          |          d }~wt,          $ r}t/          |          d }~wt0          t4          f$ rr}t          |t0                    rt3          |          t          |t6                    rt9          |          t          |t:                    rt=          |           d }~ww xY w|tK          d          ||dz  }| !                    |	|           d {V }||
                     |           W|
r | j&        |
  d {V  d S | j         sd S | &                                 d {V  d S )	Nc                    g | ]}|S r   r   r  s     rd   r  z+AsyncHTTPAdapter.gather.<locals>.<listcomp>  s    777Rb777rf   Tr   r   r  rt  r  r  )'r   r   r   r  r   r  r  rr  r   r!  r"  rD   rL  r   rB   r   rp  r@   rC   r   rF   r!   r  r   r  r"   r  rE   r    r  r   r   r  r  rt   rt  r   r   r   r#  s                rd   r   zAsyncHTTPAdapter.gather  s     ~ 	F <
774-4466777<
  Z	L?(Y!^^F> 	8"&. % %%%z6:dnLL+1 %  M  . % % %$H%+--h777#&"#' & &C-0-=-=-?-?'?'?'?'?'?'?H'3 %  4)73 3 3 3-c222( 1 1 1%ah0CDD 8#-ah8J#K#K 8&4Q&7&7 7%ah>> 0",Q--/%ah<< 0",Q--/%ah	:: ."*1++--a000& , , ,(mm+%z2 	" 	" 	"%a33 ""*1++-'+;<< ""-a..0'>:: ""/"2"22!	" #(NI L,~1V1V,[c[g[t  \A  \A  \A FN\E^EbfjftEtEtDN8<#<#@AAz~  #N))(333**8X>>>>>>>>>YL?v & !O & C6 C6(Y!^^FF&x44 *# " ",-0-=-=hFW-=-X-X'X'X'X'X'X'XHH) , , ,'+HHH, $/!E 0%w/ / / /)#...$ - - -!!(,?@@ 4)!(4FGG 4"0"3"33!!(M:: ,(mm+!!(K88 ,(mm+!!(I66 *&qkk))!,,," ( ( ($Q--'!:. 	 	 	!!Y// &qkk)#A'788 )!nn,#A~66 +A...	 #+?  
 (NI"&"6"6x"J"JJJJJJJ	(#**9555 4!dk?33333333F~ 	Fkkmms   A55
BB%#C
 
I&C**I&7CGI&G  I&4A-I!!I& N !M'&N 'M63N 5M66N  TN  T-CQ::TRT*A-TT)"r   r   r   r   r   r   r   rv   r   r   r   rv   r   rv   r   rv   r   r   r   r2  r   r   r   rv   r   rv   r   r   r   r   r   r   r   r   r)  r*  r+  )r  r   r  r\   r^   r.   )
r(  r,   r)  r   ry   r*  rz   r{   r^   rv   )rf  r)   rg  r;  r^   r(   rl   )r)  r   r|   r}   r^   r=  r   r,  r-  r.  r   )rt   r)   ru   rv   rw   r  ry   r   rz   r{   r|   r}   r~   r   r   r   r   r   r   rv   r^   r(   )rv  rH  r  rD  r^   rI  )r   rQ  r   r   r^   r_   r/  r   s   @rd   r1  r1  3  s<        4  I* !1,!0,T
 9=###04-115""%*.448CS'T
 T
 T
 T
 T
 T
 T
 T
l8 8 8 8
L L L L
 
 
J (8< 
  
  
  
  
D1 1 1 1f}  }  }  } ~( ( ( (V 59    0          B      . 59 $)-$([_hlX\!r= r= r= r= r=hK K K KZ Z^ i i i i i i i i i irf   r1  )r[   r\   r]   r\   r^   r_   )r   
__future__r   os.pathrI  socketsystimetypingr\  datetimer   http.cookiejarr   	threadingr   rC  platformperf_counterr  _compatr	   	_constantr
   r   r   _typingr   r   r   r   r   r   r   r   authr   rq  r   
exceptionsr   r   r   r   r   r   r   r   r   r    r!   r"   r#   extensions.revocationr$   r%   r
  r&   r'   modelsr(   r)   r*   packages.urllib3r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   rD  !packages.urllib3.contrib.resolverr<   (packages.urllib3.contrib.resolver._asyncr=   &packages.urllib3.contrib.webextensionsr>   -packages.urllib3.contrib.webextensions._asyncrF  packages.urllib3.exceptionsr?   r@   rA   rB   rC   rD   rE   rF   rG   r  r  r  r  packages.urllib3.utilrH   rI   rJ   r  
structuresrK   utilsrL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   packages.urllib3.contrib.socksrY   rZ   r  ri   r   r   r1  r   rf   rd   <module>rp     s    # " " " " "   



          $ $ $ $ $ $        <7'OOiO ( ( ( ( ( ( K K K K K K K K K K	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 " ! ! ! ! ! + + + + + +                              M L L L L L L L 5 5 5 5 5 5 5 5 < < < < < < < < < <                                   $      < ; ; ; ; ; G G G G G G B B B B B B     	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	                                 , + + + + +                              GYYYYYYYYY G G GG G G GG G G G G GG2 2 2 2 2 2 2 2j2 2 2 2 2 2 2 2ju u u u u+ u u up!z z z z z' z z z z zs   E# #E32E3