
    nbiw                   `   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Zd dl	Z	d dl
Z
d dlmZ d dlmZmZmZ d dlmZ d dlmZ d dl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 d	dlm Z  d	dl!m"Z"m#Z#m$Z$m%Z%m&Z& d	dl'm(Z(m)Z) d	dl*m+Z+ d	dl,m-Z- d	dl.m/Z/ d	dl0m1Z1m2Z2m3Z3 d	dl4mZ d	dl5m6Z6 d	dl7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZH d	dlImJZJmKZK d	dlLmMZM d	dlNmOZO d	dlPmQZQmRZR d	dlSmTZT d	dlUmVZV d	dlWmXZXmYZY d	dlZm[Z[m\Z\ d	dlZm-Z] d	dlZm^Z^ d	dl_m`Z` dd l*maZambZbmcZcmdZd dd!l*meZe dd"lfmgZg e	jh        rd dliZid d#ljmkZk d	d$l5mlZl  ejm        en          Zo e	jp        d%          Zq G d& d'          Zrejs        ejt        hZud(eefd;d2Zv G d3 d*ere           Zw G d4 d5ew          Zxd<d:ZydS )=    )annotationsN)Task)datetime	timedeltatimezone)zip_longest)timeout)TracebackType)proxy   )HTTPHeaderDict)DEFAULT_BACKGROUND_WATCH_WINDOWDEFAULT_KEEPALIVE_DELAYDEFAULT_KEEPALIVE_IDLE_WINDOWMINIMAL_BACKGROUND_WATCH_WINDOWMINIMAL_KEEPALIVE_IDLE_WINDOW)AsyncRequestMethods)_TYPE_ASYNC_BODY
_TYPE_BODY_TYPE_BODY_POSITION_TYPE_TIMEOUTProxyConfig)ConnectionInfoResponsePromise)_wrap_proxy_error)_normalize_host)ProtocolResolver)AsyncBaseResolverAsyncManyResolverAsyncResolverDescription)load_extension)BaseSSLErrorClosedPoolErrorEmptyPoolErrorFullPoolErrorHostChangedErrorInsecureRequestWarningLocationValueErrorMaxRetryErrorMustDowngradeErrorNameResolutionErrorNewConnectionErrorProtocolError
ProxyErrorReadTimeoutErrorRecoverableErrorSSLErrorTimeoutError)AsyncTrafficPoliceUnavailableTraffic)is_connection_dropped)connection_requires_http_tunnel)NOT_FORWARDABLE_HEADERSset_file_position)Retry)CertificateError)_DEFAULT_TIMEOUTTimeout)Url_encode_target)	parse_url)to_str   )AsyncHTTPConnectionAsyncHTTPSConnectionBrokenPipeErrorDummyConnection)port_by_scheme)AsyncHTTPResponse)Literal)AsyncExtensionFromHTTP_SelfTc                  h    e Zd ZU dZdZded<   eZdddZddZ	ddZ
ddZd dZed!d            ZdS )"AsyncConnectionPoola;  
    Base class for all connection pools, such as
    :class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`.

    .. note::
       ConnectionPool.urlopen() does not normalize or percent-encode target URIs
       which is useful if your target server doesn't support percent-encoded
       target URIs.
    N
str | Noneschemehoststrport
int | NonereturnNonec                    |st          d          t          || j                  | _        || _        t          || j                                                  | _        d S )NzNo host specified.rN   )r(   r   rN   rO   rQ   normalize_hostlower_tunnel_host)selfrO   rQ   s      t/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/urllib3_future/_async/connectionpool.py__init__zAsyncConnectionPool.__init__s   sa     	;$%9:::#D===		 +4DDDJJLL    c                P    t          |           j         d| j        d| j        dS )Nz(host=z, port=))type__name__rO   rQ   rZ   s    r[   __str__zAsyncConnectionPool.__str__   s.    t**%OOTYOOOOOOr]   rZ   rJ   c                
   K   | S N rb   s    r[   
__aenter__zAsyncConnectionPool.__aenter__   s      r]   exc_typetype[BaseException] | Noneexc_valBaseException | Noneexc_tbTracebackType | NoneLiteral[False]c                >   K   |                                   d {V  dS )NF)close)rZ   rh   rj   rl   s       r[   	__aexit__zAsyncConnectionPool.__aexit__   s-       jjllur]   c                
   K   dS zD
        Close all pooled connections and disable the pool.
        Nrf   rb   s    r[   rp   zAsyncConnectionPool.close   s
        r]   boolc                    t           re   )NotImplementedErrorrb   s    r[   is_idlezAsyncConnectionPool.is_idle   s    !!r]   re   )rO   rP   rQ   rR   rS   rT   rS   rP   )rZ   rJ   rS   rJ   )rh   ri   rj   rk   rl   rm   rS   rn   rS   rT   rS   rt   )ra   
__module____qualname____doc__rN   __annotations__r3   QueueClsr\   rc   rg   rq   rp   propertyrw   rf   r]   r[   rL   rL   e   s           F!HM M M M MP P P P         
 " " " X" " "r]   rL   g      @poolAsyncHTTPConnectionPoolwaiting_delayfloat | intkeepalive_delayint | float | Nonekeepalive_idle_windowrS   rT   c                  K   	 | j          | xj        dz  c_        t          j        |           d{V  | j         dS 	 | j                                         2 3 d{V }|j        du rt          j                    }|j        }||z
  }|dk     r7|	                                 d{V  |b|`|j
        }|W||z
  }	|	|k    rL||k    rF| xj        dz  c_        |                                 d{V  |	                    d           d{V  6 n# t          $ r Y dS w xY w| j         dS dS # t          t          j        f$ r Y dS w xY w)zeDiscrete background task that monitor incoming data
    and dispatch message to registered callbacks.NrA   Fg      ?T)expect_frame)r   num_background_watch_iterasynciosleep	iter_idleis_connectedtime	monotoniclast_used_atpeek_and_reactconnected_at	num_pingspingAttributeErrorReferenceErrorCancelledError)
r   r   r   r   connnow	last_used
idle_delayr   since_connection_delays
             r[   idle_conn_watch_taskr      s     (i#**a/**-.........y "&)"5"5"7"7 Q Q Q Q Q Q Q$(E11 .**C $ 1I!$yJ "C'' --///////// (31='+'8'358<5G25HH#-1F#F#F$(NNa$7NN*.))++$5$5$5$5$5$5$5*.*=*=4*=*P*P$P$P$P$P$P$P$P7 #8"78 "   I i#####L G23   sB   9D.  D DB1D D. 
DD. DD. .EEc                  L   e Zd ZU dZdZeZded<   deddddddddde	e
efdpd%Zedqd'            Zedqd(            Zdd)drd-Z	 dsdd)dtd/Zdud2Zdud3Zdud4Zdvd7Zdwd<Zdd=dxdAZej        	 	 	 	 	 	 	 	 	 	 	 	 	 dydzdX            Zej        	 	 	 	 	 	 	 	 	 	 	 	 	 dydBdYd{d\            Zdddeddd]d]d]dddddfd|daZd}dbZd~dcZej        	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddBdYddl            Zej        	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dddm            Zdddd]d]eddddd]d]dddddfddnZddoZdS )r   a  
    Task-safe async connection pool for one host.

    :param host:
        Host used for this HTTP Connection (e.g. "localhost"), passed into
        :class:`http.client.HTTPConnection`.

    :param port:
        Port used for this HTTP Connection (None is equivalent to 80), passed
        into :class:`http.client.HTTPConnection`.

    :param timeout:
        Socket timeout in seconds for each individual connection. This can
        be a float or integer, which sets the timeout for the HTTP request,
        or an instance of :class:`urllib3.util.Timeout` which gives you more
        fine-grained control over request timeouts. After the constructor has
        been parsed, this is always a `urllib3.util.Timeout` object.

    :param maxsize:
        Number of connections to save that can be reused. More than 1 is useful
        in multithreaded situations. If ``block`` is set to False, more
        connections will be created but they will not be saved once they've
        been used.

    :param block:
        If set to True, no more than ``maxsize`` connections will be used at
        a time. When no free connections are available, the call will block
        until a connection has been released. This is a useful side effect for
        particular multithreaded situations where one does not want to use more
        than maxsize connections per host to prevent flooding.

    :param headers:
        Headers to include with all requests, unless other headers are given
        explicitly.

    :param retries:
        Retry configuration to use by default with requests in this pool.

    :param _proxy:
        Parsed proxy URL, should not be used directly, instead, see
        :class:`urllib3.ProxyManager`

    :param _proxy_headers:
        A dictionary with proxy headers, should not be used directly,
        instead, see :class:`urllib3.AsyncProxyManager`

    :param resolver:
        A manual configuration to use for DNS resolution.
        Can be a support DSN/str (e.g. "doh+cloudflare://") or a
        :class:`urllib3.AsyncResolverDescription` or a list of DSN/str or
        :class:`urllib3.AsyncResolverDescription`

    :param happy_eyeballs:
        Enable IETF Happy Eyeballs algorithm when trying to
        connect by concurrently try multiple IPv4/IPv6 endpoints.
        By default, tries at most 4 endpoints simultaneously.
        You may specify an int that override this default.
        Default, set to False.

    :param background_watch_delay:
        The window delay used by our discrete scheduler that run in
        dedicated task to collect unsolicited incoming data and react
        if necessary.

    :param keepalive_delay:
        The delay expressed in seconds on how long we should make sure
        the connection is kept alive by sending pings to the remote peer.
        Set it to None to void this feature.

    :param keepalive_idle_window:
        Immediately related to the parameter keepalive_delay.
        This one, expressed in seconds, specify how long after
        a connection is marked as idle we should send out a
        ping to the remote peer.

    :param \**conn_kw:
        Additional parameters are used to create fresh :class:`urllib3._async.connection.AsyncHTTPConnection`,
        :class:`urllib3._async.connection.AsyncHTTPSConnection` instances.
    httpz6type[AsyncHTTPConnection] | type[AsyncHTTPSConnection]ConnectionClsNrA   FrO   rP   rQ   rR   r	   _TYPE_TIMEOUT | Nonemaxsizeintblockrt   headerstyping.Mapping[str, str] | NoneretriesRetry | bool | int | None_proxy
Url | None_proxy_headers_proxy_configProxyConfig | NoneresolverfAsyncResolverDescription | list[AsyncResolverDescription] | str | list[str] | AsyncBaseResolver | Nonehappy_eyeballs
bool | intbackground_watch_delayr   r   r   conn_kw
typing.Anyc                X   t                               | ||           t          j        | |           t          |t                    st	          j        |          }|t          j        }|| _        || _	        || _
        || _        | j        t          ur@t          | j        t                    s&t          j        dt"                     t          | _        |                     |          | _        || _        || _        |	pi | _        |
| _        d| _        d| _        d| _        d| _        || _        | j        r9| j                            dg            | j        | j        d<   | j        | j        d<   t          |t:                     | _        |t?          t@          j!                  g}nCt          |tD                    rt?          j#        |          g}nt          |t>                    r|g}g | _$        t          |t:                    sd}|D ]}t          |tD                    rO| j$        %                    t?          j#        |                     | j$        d         j&        t@          j!        k    rd}f| j$        %                    |           | j$        d         j&        t@          j!        k    rd}|s,| j$        %                    t?          j#        d	                     | j$        D ];}d
|v rd
|vr|d
         |d
<   d|v rd|vr|d         |d<   d|v rd|vr|d         |d<   <t          |t:                    stO          d | j$        D              n|| _(        | j(        | j        d<   || j        d<   || _)        || _*        || _+        | j+        | j+        tX          k     rtX          | _+        d | _-        d S )Na1  ConnectionPool QueueCls no longer support typical queue implementation due to its inability to answer urllib3.future needs to handle concurrent streams in a single connection. You may customize the implementation by passing a subclass of urllib3.util._async.traffic_police.AsyncTrafficPolice if necessary.r   socket_optionsr   proxy_configFTz system://default?hosts=localhostca_cert_dataca_cert_dirca_certsc                6    g | ]}|                                 S rf   )new).0rs     r[   
<listcomp>z4AsyncHTTPConnectionPool.__init__.<locals>.<listcomp>  s     AAAAAAAr]   r   r   ).rL   r\   r   
isinstancer<   
from_floatr9   DEFAULTr	   r   r   _maxsizer   r3   
issubclasswarningswarnDeprecationWarningr   r   r   proxy_headersr   num_connectionsnum_requestsr   r   r   
setdefaultr   _own_resolverr    r   SYSTEMrP   from_url
_resolversappendprotocolr   	_resolver_background_watch_delay_keepalive_delay_keepalive_idle_windowr   _background_monitoring)rZ   rO   rQ   r	   r   r   r   r   r   r   r   r   r   r   r   r   r   can_resolve_localhostresolver_descriptionrds                       r[   r\   z AsyncHTTPConnectionPool.__init__(  s   0 	$$T4666$T7333'7++ 	2(11G?mG,= 222:M-<
 <
2 MV #   /DMDHMME
 E
	 

+1r)  !)*&: 	= L##$4b999$(JDL!+/+<DL(!+H6G!H!HH01A1HIIJHH#&& 	"09(CCDHH":;; 	" zH:<($566 #	=*/!(0 1 1$2C88 O**09:NOO   r*37G7NNN04-&&';<<<?2&/3C3JJJ,0)( &&,5:    o 	= 	=!W,,%R//-4^-D>* G++$B..,3M,B=)((!++)0)<: h(9::AAAAABB 	 $(>Z *9&''=$ /&;#'3+.KKK*GD';?###r]   rS   c                ,    | j         d u p| j         j        S re   )r   bag_only_idlerb   s    r[   rw   zAsyncHTTPConnectionPool.is_idle  s    yD ;DI$;;r]   c                ,    | j         d uo| j         j        S re   )r   bag_only_saturatedrb   s    r[   is_saturatedz$AsyncHTTPConnectionPool.is_saturated  s    y$E)EEr]   heb_timeoutr   Timeout | NonerB   c                 K   | j         t          | d          | j        \| j        U| j        t          k    rEt          j        t          t          |           | j        | j	        | j
                            | _        | xj        dz  c_        t                              d| j        | j        | j        pd           d}| j                                         4 d{V }| j        rt                              d| j        | j        pd           || j        }|j        (t)          |j        t*          t,          f          r|j        nd}t/          j        t2          j                  }|	 t%          |          4 d{V  | j                            | j        | j        d	| j        vrt<          j        n| j        d	         t<          j         d
           d{V }ddd          d{V  n# 1 d{V swxY w Y   n# tB          $ r7 t=          j"        d| j         d| d          }tG          | j        | |          w xY w| j                            | j        | j        d	| j        vrt<          j        n| j        d	         t<          j         d
           d{V }t/          j        t2          j                  |z
  }tI          |          dk    rg }	g }
|D ]C}|d         t<          j%        k    r|	&                    |           .|
&                    |           D|
rs|	rqt                              d| j        | j        pd           g }tO          |	|
          D ]3\  }}|r|&                    |           |r|&                    |           4|}n(t                              d| j        | j        pd           g }t)          | j        tP                    rdn| j        }|d|         D ]}| j        )                                }|d         t<          j%        k    rd|d         d          dn|d         d         }tU          j+        d| j         d|           ,                                |d<   |d         |d	<   d|v r|d         |d         d         df|d<   |&                     | j-        d"| j        | j        |d|           d t]          |          D             }d}g }t_                      }	 t          j0        |s|n|t
          j1        |           d{V \  }}|rV|2                                }|3                                |}|3                                rA|&                    |           |V|s|sn|D ]}|4                                 |K|rd| dnd}tk          |d         d | j         d| j         |           |d         3                                ||6                    |                   }|j7        r||j7        _8        tI          |          r8|D ]5}||6                    |                   9                                 d{V  6n(t                              d!| j        | j        pd           |* | j-        d"| j        | j        | j        j        d| j        } ||           d{V  ddd          d{V  n# 1 d{V swxY w Y   |S )#z9
        Return a fresh :class:`HTTPConnection`.
        NPool is closedrA   z(Starting new HTTP connection (%d): %s:%s80Attempting Happy-Eyeball %s:%s443tzsocket_familyFquic_upgrade_via_dns_rrunable to resolve '	' within sr   Happy-Eyeball Dual-Stack %s:%s Happy-Eyeball Single-Stack %s:%s   [r   ]in-memory://default?hosts=:r   source_address)rO   rQ   r	   c                `    g | ]+\  }}t          j        |                                          ,S rf   r   create_taskconnectr   i
challengers      r[   r   z5AsyncHTTPConnectionPool._new_conn.<locals>.<listcomp>^  C       )Az  +J,>,>,@,@AA  r]   Treturn_whenr	    within  kFailed to establish a new connection: No suitable address to connect to using Happy Eyeballs algorithm for Happy-Eyeball Ineligible %s:%srf   ):r   r#   r   r   r   r   r   r   r   r   r   r   logdebugrO   rQ   locate_or_holdr   r	   connect_timeoutr   floatr   r   r   r   utcr   getaddrinfor   socket	AF_UNSPECSOCK_STREAMr2   gaierrorr+   lenAF_INET6r   r   rt   copyr    r   r   r   	enumeratesetwaitFIRST_COMPLETEDpop	exceptioncancelr,   index	conn_inforesolution_latencyrp   )rZ   r   r   swapperoverride_timeoutdt_pre_resolveip_addressesnew_errdelta_post_resolveipv6_addressesipv4_addresses
ip_addressintermediary_addresses
ipv6_entry
ipv4_entrychallengersmax_taskr   target_solo_addrtaskswinner_taskremnant_taskspendingdonefinished_tasktaskwithin_delay_msgdisposable_remnants                               r[   	_new_connz!AsyncHTTPConnectionPool._new_conn  s
      9!$(8999 '/,8,0OOO*1*=$$KK0)/	 + +D' 	!		6 II		
 	
 	
 9++-- @	  @	  @	  @	  @	  @	  @	  " p		4II&   &"&,K #2>";#>MM ?  // 	 ! "*!>!>!>#/L#*+;#<#< 	 	 	 	 	 	 	 	151K1K $	 $	#2$,#F#F !' 0 0%)\/%B & 28= 2L 2 2 , , , , , ,L	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ( L L L"(/Y$)YYFVYYY# # 2$)T7KKK	L *.)C)C		*$,>> ((!\/:*05 *D * * $ $ $ $ $ $L &.\X\%B%B%B^%S"|$$q((%'N%'N&2 > >
%a=FO;;*11*====*11*====% . 		< I I.   24.6A*N7 7 J J2J
  * J 6 = =j I I I) J 6 = =j I I I'=		> I I.   #%K &d&94@@1!0  '39H9&=  
"&,"3"3"5"5  *!}?? 5
2q 14444!+B!2 )
 /G.OWWWEUWW/ /#%%  
+ 4>a=0 -77 '(8 9 E !((8 9! < !9G$45
 $**.D. %)Y%)Y(8  #*	     -6{-C-C  E
 #'K$&M/2uuG".5l)0=EEg(/(?$4/ / / ) ) ) ) ) )g # 	@,0HHJJM,6688@.;,6688 ) ()00??? # 	@ ' "g "!'"* !( & &"*>NV:'7::::TV ) 1'N t  KO  KT  t  t  W[  W`  t  br  t  t   %Qx11334
 'u{{;'?'?@D ~ O<N9=)) W2? W W."-ekk:L.M.M"N"T"T"V"VVVVVVVVVII8		*U   |)t)  L8  l	  '$--A@	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	  @	 D sR   B[)G<>AG*G<*
G4	4G<7G4	8G<;[<AH==Q?[
[[float | Nonec                 K   d}| j         t          | d          	 | j                             | j        |d           d{V }nG# t          $ r t          | d          dt
          j        $ r | j        rt          | d          dY nw xY w|rIt          |          r:t          
                    d| j                   |                                 d{V  	 |p|                     |           d{V S # t          $ rA |                                  d{V }| j                             |d           d{V  |cY S w xY w)	a  
        Get a connection. Will return a pooled connection if one is available.

        If no connections are available and :prop:`.block` is ``False``, then a
        fresh connection is returned.

        :param timeout:
            Seconds to wait before giving up and raising
            :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and
            :prop:`.block` is ``True``.
        NzPool is closed.T)r   r	   non_saturated_onlyzHPool is empty and a new connection can't be opened due to blocking mode.z Resetting dropped connection: %sr   )immediately_unavailable)r   r#   getr   r   queueEmptyr$   r5   r  r  rO   rp   r7  	TypeErrorput)rZ   r	   r   r   s       r[   	_get_connz!AsyncHTTPConnectionPool._get_conn  s      9!$(9:::	j'd '        DD  	E 	E 	E!$(9::D{ 	 	 	z $^   D	  	)$// 	II8$)DDD**,,		HK!H!HHHHHHHH	 	 	 ))))))))D )--d-CCCCCCCCCKKK	s%   (A AB
	B
C7 7AEEr   rT   c                  K   | j         L	 | j                             |d           d{V  dS # t          $ r Y nt          j        $ r |r!|j        r|                                 d{V  | j        rt          | d          d|r|j        du rvt          
                    d| j        | j                                                    | j         j        | j         xj        dz  c_        |                     |           d{V cY S t          
                    d| j        | j                                                    | xj        dz  c_        Y dS w xY w|r,|                                 d{V  | xj        dz  c_        dS dS )a  
        Put a connection back into the pool.

        :param conn:
            Connection object for the current host and port as returned by
            :meth:`._new_conn` or :meth:`._get_conn`.

        If the pool is already full, the connection is closed and discarded
        because we exceeded maxsize. If connections are discarded frequently,
        then maxsize should be increased.

        If the pool is closed, then the connection will be closed and discarded.
        NFr   z>Pool reached maximum size and no more connections are allowed.zwConnection pool is full, temporary increase, keeping connection, multiplexed and not idle: %s. Connection pool size: %srA   zLConnection pool is full, discarding connection: %s. Connection pool size: %s)r   r@  r   r=  Fullrw   rp   r   r%   r  warningrO   qsizer   	_put_connr   rZ   r   s     r[   rG  z!AsyncHTTPConnectionPool._put_conn  s      9 'immDm666666666!   : ! ! ! +| +"jjll*******: :'X      
: 5 5U I IOO--	    9,8 I--2--%)^^D%9%9999999999bIIOO%%  
 $$)$$C!H  	&**,,  A%    	& 	&s   "0 
EC	EAEEc                P   K   |j         r|                                 d{V  dS dS )U
        Called right before a request is made, after the socket is created.
        N)	is_closedr   rH  s     r[   _validate_connz&AsyncHTTPConnectionPool._validate_conn  sB       > 	!,,..         	! 	!r]   c                
   K   d S re   rf   rH  s     r[   _prepare_proxyz&AsyncHTTPConnectionPool._prepare_proxy  s      r]   r   r<   c                    |t           u r| j                                        S t          |t                    r |j                    S t	          j        |          S )z:Helper that always returns a :class:`urllib3.util.Timeout`)r;   r	   cloner   r<   r   )rZ   r	   s     r[   _get_timeoutz$AsyncHTTPConnectionPool._get_timeout   sU    &&&<%%'''gw'' 	/ 7=??" %g...r]   err&BaseSSLError | OSError | SocketTimeouturltimeout_valuec                    t          |t                    rt          | |d| d          |t          |d          r$|j        t
          v rt          | |d| d          |dS dS )zAIs the error actually a timeout? Will raise a ReadTimeout or passRead timed out. (read timeout=r_   errnoN)r   SocketTimeoutr/   hasattrrX  _blocking_errnos)rZ   rR  rT  rU  s       r[   _raise_timeoutz&AsyncHTTPConnectionPool._raise_timeout,  s     c=)) 	"cLMLLL 
 3   	SY2B%B%B"cLMLLL 	 	%B%Br]   promiser^  ResponsePromise | NoneAsyncHTTPResponse | Nonec                 K   | j         t          | d          |5t          |t                    s t	          dt          |           d          d}	 | j                             |pt          |du|du           4 d{V 	 }	 |                    || j                    d{V }ni# t          t          f$ rU}|.t          j        t          |                    d                    }nd	}|                     |||j        
            d}~ww xY w	 ddd          d{V  n# 1 d{V swxY w Y   n# t           $ r Y dS t"          t          t$          t          t&          t(          t*          t,          f$ r}d}|}t          |t          t(          f          rt'          |          }t          |t          t.          t"          t&          f          r+|r)|j        r"|j        st5          ||j        j                  }n%t          |t                    rt%          d|          }|t          j        t8          |                    d                    }t          j        t          |                    d                    }	t          j        t          |                    d                    }|                    |	||| t=          j                    d                   }|                                  d{V  n||}
Y d}~nd}~ww xY w|s9tB          "                    d||
|           | #                    |           d{V S ||tI          d          |dS d}|r|}n4|j%        r-tM          |j%        d          r|j%        j'        r|j%        j'        }|tI          d          | j         (                    |           t          j        t          |                    d                    }	t          j        tR          |                    d                    }|o|*                                }|r`t          j        t          |                    d                    }t          j        t          j+        tX                   |                    d                    }t          j        tZ          |                    d                    }t          j        tR          |                    d                    }t          j        tR          |                    d                    }t          j        t          j+        t\                   |                    d                    }t          j        tR          |                    d                    }|                    d          }t          j        t          j/        t          t          j0        f         |                    d                    }t          j        tR          |                    d                    }t          j        tb          |                    d                     }t          j        t8          |                    d                    }|j2        d!k    r2d"}	d}t[          |          }tf          D ]}|4                    |           	 |                    |	||| #          }n4# tj          $ r' |j6        r|7                                 d{V   |cY S w xY w|7                                 d{V  |8                    |           d{V  tB          9                    d$||            | j:        |	|||f|||||d||||dd%| d{V }| #                    |r|nd           d{V S tS          |j;        <                    d&                    }t          j        t8          |                    d                    }|=                    |	|j2        |          rt          j        t          |                    d                    }t          j        t          j+        tX                   |                    d                    }t          j        tZ          |                    d                    }t          j        tR          |                    d                    }t          j        tR          |                    d                    }t          j        t          j+        t\                   |                    d                    }t          j        tR          |                    d                    }|                    d          }t          j        t          j/        t          t          j0        f         |                    d                    }t          j        tR          |                    d                    }t          j        tb          |                    d                     }	 |                    |	||| #          }n4# tj          $ r' |j>        r|7                                 d{V   |cY S w xY w|7                                 d{V  |                     |           d{V  tB          9                    d'|            | j:        |	|||f|||||d||||dd%| d{V }| #                    |r|nd           d{V S |                    d(          }|\|j2        d)k    sd*|j2        cxk    rd+k     r?n n<|	d,k    s|4| t          d                      }|@                    |           d{V  |S )-z
        Retrieve the first response available in the pool.
        This method should be called after issuing at least one request with ``multiplexed=True``.
        If none available, return None.
        Nr   z7get_response only support ResponsePromise but received z] instead. This may occur if you expected the remote peer to support multiplexing but did not.T)r   not_idle_only)r^  police_officerrT  r  rR  rT  rU  FConnection aborted.r   methodr   error_pool_stacktrace1Retrying (%r) after connection broken by '%r': %sr]  zJInvoked get_response with promise=... that no connection in pool recognizefrom_promisezPInternal: Unable to identify originating ResponsePromise from a LowLevelResponseredirectbodyr   preload_contentdecode_contentr	   assert_same_hostpool_timeoutresponse_kwchunkedbody_pos/  GETresponseri  Redirecting %s -> %sr   rm  rq  r	   rr  release_connrt  ru  ro  rp  multiplexedRetry-After	Retry: %s	extensione      ,  CONNECT)Ar   r#   r   r   r?  r`   borrowgetresponser"   OSErrortypingcastrP   get_parameterr\  r	   r4   r2   r-   r1   r:   r.   r0   r,   r   has_connected_to_proxyr   rN   r9   	incrementsysexc_infoasync_sleepr  rE  get_response
ValueError_fprZ  rl  forgetrt   get_redirect_locationOptionalr   r   r   MutableMappingAnyr   statusr7   discardr)   raise_on_redirect
drain_connasync_sleep_for_retryr  urlopenr   r<  is_retryraise_on_statusr!   start_extension)rZ   r^  
clean_exitr   ry  erT  new_er   rf  rR  rl  rm  redirect_locationrn  r   ro  rp  r	   rq  rr  rs  rt  ru  should_be_removed_headernew_promisehas_retry_afterr  s                               r[   r  z$AsyncHTTPConnectionPool.get_response?  s      9!$(8999z'?'K'Kg$w-- g g g  
 
>	y''*?T)%o (           
%)%5%5 '	 &6 & &            HH %g.   *$k#w/D/DU/K/KLL ''A3dl'SSS                             " 	 	 	44	
 +	 +	 +	 J E!l,<=>> $ & 	  D D !JD 04/JD *%1BCCE7++ D%&;UCC" +eW-B-B9-M-MNNS'*?*?*I*IJJk#w'<'<U'C'CDD!++CuDclnnUVFW ,   ))++++++++++ CCCCCCW+	Z  	<KKCWcSV   **7*;;;;;;;;;8#3\   4 	9"LL 9HL.999 L-9
  (|8b   		&&& S,"<"<X"F"FGG;t\%?%?
%K%KLL %I)G)G)I)I D	U+c<#=#=e#D#DEEC;
+\-G-G-O-O D k.,2L2LY2W2WXXG$kl001BCC O $[l001ABB N k.0J0J90U0U G  &{l001CDD    (55nEEL +%c6:o6**=99 K k$(B(B9(M(MNNG{#\%?%?
%K%K H k%)C)CI)N)NOOG#%%(110G > >,OO$<==== !++FC(RV+WW       , "--/////////	  %%'''''''''//999999999II,c3DEEE ,!	!
  !!1)!! /- ! !  !! !      K& **'3S;;t*TTTTTTTTT x/33MBBCC+e\%?%?	%J%JKKFHO_EE ;	U+c<#=#=e#D#DEEC;
+\-G-G-O-O D k.,2L2LY2W2WXXG$kl001BCC O $[l001ABB N k.0J0J90U0U G  &{l001CDD    (55nEEL +%c6:o6**=99 K k$(B(B9(M(MNNG{#\%?%?
%K%K H !++FC(RV+WW       * "--/////////	  %%'''''''''%%h/////////IIk3''' ,	!
  !!1)"! /- ! !  !! !      K& **'3S;;t*TTTTTTTTT ..{;;	 #%%x,,,,,,,,,y((I,A$ 4t 4 4 6 6I..y999999999s   .D7 D$"B('D$(D9AD		DD$D7 $
D..D7 1D.2D7 7
L5L9F K>>L/[	 	.[:9[:h0 0.i! i!.rf  rn  $_TYPE_BODY | _TYPE_ASYNC_BODY | NoneRetry | Nonert  response_connAsyncHTTPConnection | Nonero  rp  enforce_content_lengthon_post_connection@typing.Callable[[ConnectionInfo], typing.Awaitable[None]] | Noneon_upload_bodyFtyping.Callable[[int, int | None, bool, bool], typing.Awaitable[None]]on_early_responseCtyping.Callable[[AsyncHTTPResponse], typing.Awaitable[None]] | Noner  AsyncExtensionFromHTTP | Noner}  Literal[True]r   c               
   K   d S re   rf   rZ   r   rf  rT  rn  r   r   r	   rt  r  ro  rp  r  r  r  r  r  r}  s                     r[   _make_requestz%AsyncHTTPConnectionPool._make_requestO  s      2 #r]   )r}  rn   rG   c               
   K   d S re   rf   r  s                     r[   r  z%AsyncHTTPConnectionPool._make_requestj  s      2  Cr]   TMtyping.Callable[[int, int | None, bool, bool], typing.Awaitable[None]] | NoneLiteral[False] | Literal[True]#AsyncHTTPResponse | ResponsePromisec                T  K   | xj         dz  c_         |                     |          }|                                 t          j        |j                  |_        	 	 |                     |           d{V  n7# t          t          f$ r#}| 
                    |||j                    d}~ww xY wn# t          t          t          t          t          t          f$ r}|}t!          |t          t          f          rt          |          }t!          |t          t          t          t          f          r*|r(|j        r!|j        st'          ||j        j                  }|d}~ww xY w||j        t-          |d          r|j        |j        j        rt3                      |j        _        |j        j        rt3                      |j        _        |j        j        rt3                      |j        _        |j        j        rd|j        _         ||j                   d{V  |j        du r|du rd}||j        |j        j        |                    |j        j                  }|r||}nt-          |d          r*|                                 }|!                    |           nstE                      }|#                                D ]\  }}|$                    ||           |#                                D ]\  }}|$                    ||           |}nd}	 |%                    ||||||
|||	  	         d{V }nH# tL          $ r}|j'        }Y d}~n2d}~wt          $ r"}d}|j(        tP          j)        k    r Y d}~nd}~ww xY w|j*        }|rM|t          |+                    d	|           |+                    d
|           |+                    d|           |S |j,        s"|dk    rt[          | |d| d          ||_        |j        du o| j.        duo|du}|r| j.        /                    ||           | 0                    |           d{V  | j.        1                    |          4 d{V }	 |2                    | j.        |           d{V }n2# t          t          f$ r}| 
                    |||            d}~ww xY w	 | j.        3                    |           n# | j.        3                    |           w xY w	 ddd          d{V  n# 1 d{V swxY w Y   nV	 |2                    | j.        |           d{V }n2# t          t          f$ r}| 
                    |||            d}~ww xY w|j4        }||_5        | |_6        |j7        dk    sd|j7        cxk    rdk     r?n n<|dk    s|4| tq          d                      }|9                    |           d{V  tt          ;                    d| j        | j<        | j=        ||||j7        |j>        	  	         |S )a8
  
        Perform a request on a given urllib connection object taken from our
        pool.

        :param conn:
            a connection from one of our connection pools

        :param method:
            HTTP request method (such as GET, POST, PUT, etc.)

        :param url:
            The URL to perform the request on.

        :param body:
            Data to send in the request body, either :class:`str`, :class:`bytes`,
            an iterable of :class:`str`/:class:`bytes`, or a file-like object.

        :param headers:
            Dictionary of custom headers to send, such as User-Agent,
            If-None-Match, etc. If None, pool headers are used. If provided,
            these headers completely replace any pool-specific headers.

        :param retries:
            Configure the number of retries to allow before raising a
            :class:`~urllib3.exceptions.MaxRetryError` exception.

            Pass ``None`` to retry until you receive a response. Pass a
            :class:`~urllib3.util.retry.Retry` object for fine-grained control
            over different types of retries.
            Pass an integer number to retry connection errors that many times,
            but no other types of errors. Pass zero to never retry.

            If ``False``, then retries are disabled and any exception is raised
            immediately. Also, instead of raising a MaxRetryError on redirects,
            the redirect response will be returned.

        :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.

        :param timeout:
            If specified, overrides the default timeout for this one
            request. It may be a float (in seconds) or an instance of
            :class:`urllib3.util.Timeout`.

        :param chunked:
            If True, urllib3 will send the body using chunked transfer
            encoding. Otherwise, urllib3 will send the body using the standard
            content-length form. Defaults to False.

        :param response_conn:
            Set this to ``None`` if you will handle releasing the connection or
            set the connection to have the response release it.

        :param preload_content:
          If True, the response's body will be preloaded during construction.

        :param decode_content:
            If True, will attempt to decode the body based on the
            'content-encoding' header.

        :param enforce_content_length:
            Enforce content length checking. Body returned by server must match
            value of Content-Length header, if present. Otherwise, raise error.
        rA   Nrd  _start_last_requestFTr  )rn  r   rt  ro  rp  r  r  read_timeoutr  r  r   rW  r_   )rc  early_response_callbackr  r  r  r  z%s://%s:%s "%s %s %s" %s %s)?r   rQ  start_connectr<   resolve_default_timeoutr
  r	   rL  rY  r"   r\  r  r,   r2   r:   r1   r   r   r  r   rN   r  rZ  r  tls_handshake_latencyr   established_latencyr  request_sent_latencyis_multiplexedhttp_versionr   r  updater   itemsaddrequestrD   r^  rX  
EPROTOTYPEr  set_parameterrK  r/   r   memorizerG  r  r  r  _http_vsn_strr   ri  r  r!   r  r  r  rO   rQ   length_remaining)rZ   r   rf  rT  rn  r   r   r	   rt  r  ro  rp  r  r  r  r  r  r}  timeout_objr  r  extension_headersmerged_headerskvrpr  can_shelve_connry  http_vsn_strs                                 r[   r  z%AsyncHTTPConnectionPool._make_request  sJ     p 	Q''00!!###6{7RSS	))$//////////!<0   ##s$,#OOO 0 
 	 	 	  !E!l,<=>> $  !3\8L  DD JD/3/JD *%1BCCK#	& )dn.H 344?,8>7 G;D;;DN8>5 E9BDN6>4 D8ADN5>6 ?:>DN7$$T^444444444%''K4,?,?K !*+7 ) 1 1$.2M N N  -?/GGWf-- -%llnnGNN#45555%3%5%5N ' 1 11&**1a0000 1 7 7 9 9 1 11&**1a0000,GI	|| /-'=- $ 
 
 
 
 
 
 
 
BB  	 	 	BBBBBB 	 	 	B w%*** +****	 #/ 	z^\:::02CDDD[)444I~ 
	( q  &#OOOO   (DL 4'TDIT,ATbPTn 	  	Ir4(((..&&&&&&&&& y''++ 
) 
) 
) 
) 
) 
) 
)t	)%)%5%5'+y0A &6 & &            HH %g.   ''A3l'SSS	  I$$R((((DI$$R(((((
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
) 
)!%!1!1#'9FW "2 " "       !'*   ##s,#OOO
  	
 #?c!!8?((((S(((((9$$	(= 0N40022	**9555555555		)KIIO%	
 	
 	
 s   A8 7B0 8B,	B''B,,B0 0)EBEE$L9 9
M>MM>M99M>/T1"RS"S%R>>SS"T"S>>T
T!T'"U
 
U9U44U9c                  K   | j         dS | j         dc}| _         |                                 d{V  | j        Q| j                                         	 | j         d{V  n# t          j        $ r Y nw xY wd| _        n# d| _        w xY w| j        r:| j                                        r#| j        	                                 d{V  dS dS dS rs   )
r   clearr   r  r   r   r   r   is_availablerp   )rZ   old_pools     r[   rp   zAsyncHTTPConnectionPool.close  s2      9F #i$) nn&2'..0003111111111)    /3++d+2222  	)$."="="?"? 	).&&(((((((((((	) 	) 	) 	)s*   A$ #B $A63B 5A66B 	B
c                :   |                     d          rdS t          |          ^}}}}}|pd}|t          ||          }| j        r|st	          j        |          }n!| j        s|t	          j        |          k    rd}|||f| j        | j        | j        fk    S )zj
        Check if the given ``url`` is a member of the same host as this
        connection pool.
        /Tr   NrV   )
startswithr?   r   rQ   rF   r<  rN   rO   )rZ   rT  rN   _rO   rQ   s         r[   is_same_hostz$AsyncHTTPConnectionPool.is_same_host  s    
 >># 	4 %.cNN!4!6"4777D 9 	T 	!%f--DD 	t~'9&'A'AAADd#TY	'JJJr]   rm  rq  rr  r|  bool | Noneru  _TYPE_BODY_POSITION | Noners  c               
   K   d S re   rf   rZ   rf  rT  rn  r   r   rm  rq  r	   rr  r|  rt  ru  ro  rp  r  r  r  r  r}  rs  s                        r[   r  zAsyncHTTPConnectionPool.urlopen  s      8  Cr]   c               
   K   d S re   rf   r  s                        r[   r  zAsyncHTTPConnectionPool.urlopen  s      8 #r]   c                X  K   | j         t          | d          t          |          }|j        }|| j        }t          |t                    st          j        ||| j                  }|
d}
|r&| 	                    |          st          | ||          |                    d          rt          t          |                    }nt          |j                  }d}|
}t          | j        | j        |          }|s.|                                }|                    | j                   d}d}t+          ||          }	 |                     |          }| j                                          d{V  |                     |	|           d{V }|j        |_        | j        m|rk|j        rd	 |                     |           d{V  nG# t:          t<          t>          f$ r-}|                      || j        j        |j                    d}~ww xY w|
s|nd}| !                    |||||||||||d|||||	           d{V }t          |tD                    sd}|r$|#                    |||||||||||	|||d
           d}n# tH          $ r d}d} tJ          t<          tL          t:          tN          tP          tR          tT          f$ rY}d}|} t          |t:          tP          f          rtO          |          } t          | t<          tV          tJ          tN          f          r+|r)|j        r"|j,        st[          | |j        j                  } n%t          | t<                    rtM          d|           } |.                    ||| | t_          j0                    d                   }|1                                 d{V  t          | td                    rF|Dd| j3        vrti                      | j3        d<   | j3        d         5                    |j6                   |}Y d}~nd}~ww xY w|s |r|7                                 d{V  d}d}| j         |du r`|^t          |tD                    du rG| j         8                    ||           | j         j9         | j         j9        8                    ||            |du rZ|9| j         :                    |          du r| ;                    |           d{V  n| j         <                                 d{V  n# |s |r|7                                 d{V  d}d}| j         |du r`|^t          |tD                    du rG| j         8                    ||           | j         j9         | j         j9        8                    ||            |du r\|9| j         :                    |          du r| ;                    |           d{V  w w | j         <                                 d{V  w w w xY w|sCtz          >                    d|||            | j?        |||||||f||	|
||||||||d| d{V S |rt          |tD                    sJ |S t          |t                    sJ |r)|A                                r|A                                }!|jB        dk    r2d}d}t          |          }t          D ]}"|E                    |"           	 |.                    ||||           }n4# t          $ r' |jG        r|H                                 d{V   |cY S w xY w|H                                 d{V  |I                    |           d{V  tz          J                    d||!            | j?        ||!f|||||||	|
||||dd| d{V S t          |j        L                    d                    }#|M                    ||jB        |#          r	 |.                    ||||           }n4# t          $ r' |jN        r|H                                 d{V   |cY S w xY w|H                                 d{V  |1                    |           d{V  tz          J                    d|            | j?        ||||f|||||	|
||||dd| d{V S |S )a  
        Get a connection from the pool and perform an HTTP request. This is the
        lowest level call for making a request, so you'll need to specify all
        the raw details.

        .. note::

           More commonly, it's appropriate to use a convenience method
           such as :meth:`request`.

        .. note::

           `release_conn` will only behave as expected if
           `preload_content=False` because we want to make
           `preload_content=False` the default behaviour someday soon without
           breaking backwards compatibility.

        :param method:
            HTTP request method (such as GET, POST, PUT, etc.)

        :param url:
            The URL to perform the request on.

        :param body:
            Data to send in the request body, either :class:`str`, :class:`bytes`,
            an iterable of :class:`str`/:class:`bytes`, or a file-like object.

        :param headers:
            Dictionary of custom headers to send, such as User-Agent,
            If-None-Match, etc. If None, pool headers are used. If provided,
            these headers completely replace any pool-specific headers.

        :param retries:
            Configure the number of retries to allow before raising a
            :class:`~urllib3.exceptions.MaxRetryError` exception.

            Pass ``None`` to retry until you receive a response. Pass a
            :class:`~urllib3.util.retry.Retry` object for fine-grained control
            over different types of retries.
            Pass an integer number to retry connection errors that many times,
            but no other types of errors. Pass zero to never retry.

            If ``False``, then retries are disabled and any exception is raised
            immediately. Also, instead of raising a MaxRetryError on redirects,
            the redirect response will be returned.

        :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.

        :param redirect:
            If True, automatically handle redirects (status codes 301, 302,
            303, 307, 308). Each redirect counts as a retry. Disabling retries
            will disable redirect, too.

        :param assert_same_host:
            If ``True``, will make sure that the host of the pool requests is
            consistent else will raise HostChangedError. When ``False``, you can
            use the pool on an HTTP proxy and request foreign hosts.

        :param timeout:
            If specified, overrides the default timeout for this one
            request. It may be a float (in seconds) or an instance of
            :class:`urllib3.util.Timeout`.

        :param pool_timeout:
            If set and the pool is set to block=True, then this method will
            block for ``pool_timeout`` seconds and raise EmptyPoolError if no
            connection is available within the time period.

        :param bool preload_content:
            If True, the response's body will be preloaded into memory.

        :param bool decode_content:
            If True, will attempt to decode the body based on the
            'content-encoding' header.

        :param release_conn:
            If False, then the urlopen call will not release the connection
            back into the pool once a response is received (but will release if
            you read the entire contents of the response such as when
            `preload_content=True`). This is useful if you're not preloading
            the response's content immediately. You will need to call
            ``r.release_conn()`` on the response ``r`` to return the connection
            back into the pool. If None, it takes the value of ``preload_content``
            which defaults to ``True``.

        :param bool chunked:
            If True, urllib3 will send the body using chunked transfer
            encoding. Otherwise, urllib3 will send the body using the standard
            content-length form. Defaults to False.

        :param int body_pos:
            Position to seek to in file-like body in the event of a retry or
            redirect. Typically this won't need to be set because urllib3 will
            auto-populate the value when needed.

        :param on_post_connection:
            Callable to be invoked that will inform you of the connection specifications
            for the request to be sent. See ``urllib3.ConnectionInfo`` class for more.

        :param on_upload_body:
            Callable that will be invoked upon body upload in order to be able to track
            the progress. The values are expressed in bytes. It is possible that the total isn't
            available, thus set to None. In order, arguments are:
            (total_sent, total_to_be_sent, completed, any_error)

        :param on_early_response:
            Callable that will be invoked upon early responses, can be invoked one or several times.
            All informational responses except HTTP/102 (Switching Protocol) are concerned here.
            The callback takes only one positional argument, the fully constructed HTTPResponse.
            Those responses never have bodies, only headers.

        :param multiplexed:
            Dispatch the request in a non-blocking way, this means that the
            response will be retrieved in the future with the get_response()
            method.
        Nr   )rm  defaultTr  F)r	   r   rd  )rn  r   r   r	   rt  r  ro  rp  r  r  r  r  r  r}  )rf  rT  rn  r   r   ro  rp  r	   rm  rs  rr  rq  rt  ru  re  r   rg  disabled_svnrk  )r	   rr  r|  rt  ru  ro  rp  r  r  r  r}  rv  rw  rx  rz  )rn  r   r   rm  rq  r	   rr  r|  rt  ru  ro  rp  r}  r~  r  r{  )Or   r#   r?   rN   r   r   r9   from_intr   r  r&   r  r@   r>   rT  r6   r   r   r  r  r   r8   rQ  &wait_for_unallocated_or_available_slotrA  r
  r	   rK  rN  r"   r  rY  r\  r  r   update_parametersr$   r2   r-   r1   r:   r.   r0   r,   r  r   r  r  r  r  r*   r   r  r  _svnrp   r  parentis_heldrG  kill_cursorr  rE  r  rG   r  r  r   r7   r  r)   r  r  r  r  rt   r<  r  r  )$rZ   rf  rT  rn  r   r   rm  rq  r	   rr  r|  rt  ru  ro  rp  r  r  r  r  r}  rs  
parsed_urldestination_schemer   release_this_connhttp_tunnel_requiredrR  r  r  r  r  ry  r  r  r  r  s$                                       r[   r  zAsyncHTTPConnectionPool.urlopen  s     ` 9!$(8999s^^
'.?lG'5)) 	WnWxVVVG  L  	7D$5$5c$:$: 	7"4g666 >># 	),,--CC((C )>J)+= 
  
 $ 	/llnnGNN4-...  
 %T844[	6++G44K)BBDDDDDDDDD+VVVVVVVVD&6DL z%*>%4>%--d3333333333$g}=   ''4:> (    	 )5>DD$M "//#+ /-'+#5-"3#'# 0        H* h88 $# **"(" $#*#*+:*8#*$,'2(4,<#*$,   ( JJ 	 	 	J % 	
 -	 -	 -	 J E!l,<=>> $ & 	  D D !JD 04/JD *%1BCCE7++ D%&;UCC''5#,..QRBS (  G %%''''''''' %!344 <9I!553655DL0^,00;;; CCCCCC[-	`  )
   **,,&&&&&&&D$(!y$$&&("8_==EEI&&x666y'3	(11(DAAA$,,'  9,,T22d::"&.."6"66666666"i33555555555;  )
   **,,&&&&&&&D$(!y$$&&("8_==EEI&&x666y'3	(11(DAAA$,,'  9,,T22d::"&.."6"666666666 ; #i335555555555' % -  	KKCWcSV   &   ))! /-"3-#5'% & '        ,  	h88888O($566666 *	6688 *	 ( > > @ @#%%(110G > >,OO$<==== !++FC(RV+WW       , "--/////////	  %%'''''''''//999999999II,c3DEEE%! !!1))! /-!   !        ( x/33MBBCCFHO_EE 	 !++FC(RV+WW       * "--/////////	  %%'''''''''%%h/////////IIk3'''%	
  !!1))! /-!   !        & s}    A-J .G
 	J 
H!(H		HA4J T AP!EPT P!!T C/W?#[= =.\.-\.)` .`43`4c                @    d| j          d| j        pd d| j        pd dS )Nz<AsyncHTTPConnection r   P    (Closed)>rO   rQ   r   rb   s    r[   __repr__z AsyncHTTPConnectionPool.__repr__  s3    _ty__49?__TYE\R\____r]   ) rO   rP   rQ   rR   r	   r   r   r   r   rt   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rz   )r   r   rS   rB   re   )r	   r8  r   r   rS   rB   r   rB   rS   rT   )r	   r   rS   r<   )rR  rS  rT  rP   rU  r   rS   rT   )r^  r_  rS   r`  ).............)$r   rB   rf  rP   rT  rP   rn  r  r   r   r   r  r	   r   rt  rt   r  r  ro  rt   rp  rt   r  rt   r  r  r  r  r  r  r  r  r}  r  rS   r   )$r   rB   rf  rP   rT  rP   rn  r  r   r   r   r  r	   r   rt  rt   r  r  ro  rt   rp  rt   r  rt   r  r  r  r  r  r  r  r  r}  rn   rS   rG   )$r   rB   rf  rP   rT  rP   rn  r  r   r   r   r  r	   r   rt  rt   r  r  ro  rt   rp  rt   r  rt   r  r  r  r  r  r  r  r  r}  r  rS   r  ry   )rT  rP   rS   rt   )................)*rf  rP   rT  rP   rn  r  r   r   r   r   rm  rt   rq  rt   r	   r   rr  rR   r|  r  rt  rt   ru  r  ro  rt   rp  rt   r  r  r  r  r  r  r  r  r}  rn   rs  r   rS   rG   )*rf  rP   rT  rP   rn  r  r   r   r   r   rm  rt   rq  rt   r	   r   rr  rR   r|  r  rt  rt   ru  r  ro  rt   rp  rt   r  r  r  r  r  r  r  r  r}  r  rs  r   rS   r   )*rf  rP   rT  rP   rn  r  r   r   r   r   rm  rt   rq  rt   r	   r   rr  rR   r|  r  rt  rt   ru  r  ro  rt   rp  rt   r  r  r  r  r  r  r  r  r}  rt   rs  r   rS   r  rx   )ra   r{   r|   r}   rN   rB   r   r~   r;   r   r   r   r\   r   rw   r   r7  rA  rG  rL  rN  rQ  r\  r  r  overloadr  rp   r  r  r  rf   r]   r[   r   r      s#        N N` F       (837-1!:>,0 %*5T.E4Q+N@ N@ N@ N@ N@` < < < X< F F F XF 04c c c c c cL '+0MQ0 0 0 0 0 0d<& <& <& <&|! ! ! !   
/ 
/ 
/ 
/   ( 48N N N N N N` _ 6936 #!$47 #"'* 36+    _4 _ 6936 #!$47 #"'* 36+ . '*/          _ > 6:37 $!148 $#'+ 376;/R R R R Rh) ) ) )4K K K K, _
 6936-0!$!$#&$'/2 #" 36/ 2 '*3          _ : _
 6936-0!$!$#&$'/2 #" 36/    _B 6:37-1!%!1#'$(/3 $# 37!3Z Z Z Z Zx` ` ` ` ` `r]   c                       e Zd ZU dZdZeZded<   dedddddddddddddddddddddfd= fd2Z	d>d5Z
dd6d?d9Zd@ fd;ZdAd<Z xZS )BAsyncHTTPSConnectionPoola  
    Same as :class:`.HTTPConnectionPool`, but HTTPS.

    :class:`.HTTPSConnection` uses one of ``assert_fingerprint``,
    ``assert_hostname`` and ``host`` in this order to verify connections.
    If ``assert_hostname`` is False, no verification is done.

    The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs``,
    ``ca_cert_dir``, ``ssl_version``, ``key_password`` are only used if :mod:`ssl`
    is available and are fed into :meth:`urllib3.util.ssl_wrap_socket` to upgrade
    the connection socket into an SSL socket.
    httpsztype[AsyncHTTPSConnection]r   NrA   FrO   rP   rQ   rR   r	   r   r   r   r   rt   r   r   r   r   r   r   r   key_filerM   	cert_file	cert_reqsint | str | Nonekey_passwordr   ssl_versionssl_minimum_versionssl.TLSVersion | Nonessl_maximum_versionassert_hostnamestr | Literal[False] | Noneassert_fingerprintr   r   None | str | bytes	cert_datastr | bytes | Nonekey_dataciphersr   r   rS   rT   c                    t                      j        |||||||||	f	i | |
| _        || _        || _        || _        || _        || _        || _        || _	        || _
        || _        || _        || _        || _        || _        || _        d S re   )superr\   r   r  r  r  r   r   r   r  r  r  r  r  r	  r  r  )rZ   rO   rQ   r	   r   r   r   r   r   r   r   r  r  r  r   r  r  r  r	  r  r   r   r  r  r  r   	__class__s                             r[   r\   z!AsyncHTTPSConnectionPool.__init__  s    8 		
 	
 	
 	
 	
 !""( &(" &#6 #6 ."4r]   r   rC   c                   K   | j         r| j         j        dk    rd}nd}|                    || j        | j        | j                   |                                 d{V  dS )z5Establishes a tunnel connection through HTTP CONNECT.r  r   )rN   rO   rQ   r   N)r   rN   
set_tunnelrY   rQ   r   r   )rZ   r   tunnel_schemes      r[   rN  z'AsyncHTTPSConnectionPool._prepare_proxy/  s      : 	#$*+w66#MM"M "&	 	 	
 	
 	
 llnnr]   r   r   r   c          
       K   | j         t          | d          | j        O| j        H| j        t          k    r8t          j        t          | | j        | j        | j	                            | _        | xj
        dz  c_
        t                              d| j
        | j        | j        pd           | j        r| j        t           u rt#          d          | j        }| j        }| j        $| j        j        | j        j        }| j        j        }d}| j                             | j                  4 d{V }| j        r8t                              d| j        | j        pd           || j        }|j        (t1          |j        t2          t4          f          r|j        nd}t7          j        t:          j        	          }|	 t-          |          4 d{V  | j                             ||d
| j!        vrtD          j#        n| j!        d
         tD          j$        d           d{V }ddd          d{V  n# 1 d{V swxY w Y   n# tJ          $ r- tE          j&        d| d| d          }	tO          || |	          w xY w| j                             ||d
| j!        vrtD          j#        n| j!        d
         tD          j$        d           d{V }t7          j        t:          j        	          |z
  }
i }d| j!        v r| j!        d         | j!        d         }tQ          d |D                       r-| j        | j        f|vr| j        | j        f|| j        | j        f<   tS          |          dk    rg }g }|D ]C}|d         tD          j*        k    r|+                    |           .|+                    |           D|rs|rqt                              d| j        | j        pd           g }tY          ||          D ]3\  }}|r|+                    |           |r|+                    |           4|}n(t                              d| j        | j        pd           g }t1          | j        tZ                    rdn| j        }|d|         D ]7}| j!        .                                }|d         tD          j*        k    rd|d         d          dn|d         d         }t_          j0        d| j         d|           1                                |d<   |d         |d
<   ||d<   |+                     | j        d4i d|d|d|d| j2        d | j3        d!| j4        d"| j5        d#| j6        d$| j7        d%| j8        d&| j9        d'| j:        d(| j;        d)| j<        d*| j=        d+| j>        d,| j?        d-| j@        |           9d. t          |          D             }d}g }t                      }	 t          jC        |s|n|t
          jD        |/           d{V \  }}|rV|E                                }|F                                |}|F                                rA|+                    |           |V|s|sn|D ]}|G                                 |A|rd0| dnd1}t          |d         d2| d| |           |d         F                                ||I                    |                   }|jJ        r|
|jJ        _K        tS          |          r8|D ]5}||I                    |                   L                                 d{V  6n(t                              d3| j        | j        pd           | | j        d4i d|d|d| j        j        d| j2        d | j3        d!| j4        d"| j5        d#| j6        d$| j7        d%| j8        d&| j9        d'| j:        d(| j;        d)| j<        d*| j=        d+| j>        d,| j?        d-| j@        | j!        } ||           d{V  ddd          d{V  n# 1 d{V swxY w Y   |S )5zL
        Return a fresh :class:`urllib3.connection.HTTPConnection`.
        Nr   rA   z)Starting new HTTPS connection (%d): %s:%sr   zCCan't connect to HTTPS URL because the SSL module is not available.rC  r   r   r   Tr   r   r   r   preemptive_quic_cachec              3  B   K   | ]}|d          t           j        k    V  dS )rA   N)r  
SOCK_DGRAM)r   r  s     r[   	<genexpr>z5AsyncHTTPSConnectionPool._new_conn.<locals>.<genexpr>  s.      GGQqtv00GGGGGGr]   r   r   r   r   r   r   r   r   r   r   rO   rQ   r	   r  r   r  r  r   r   r   r	  r  r  r  r  r  r  r  c                `    g | ]+\  }}t          j        |                                          ,S rf   r   r   s      r[   r   z6AsyncHTTPSConnectionPool._new_conn.<locals>.<listcomp>  r   r]   r  r  r  r  r  rf   )Mr   r#   r   r   r   r   r   r   r   r   r   r  r  rO   rQ   r   rE   ImportErrorr   r	  r   r   r	   r
  r   r  r   r   r   r   r  r   r  r   r  r  r  r2   r  r+   anyr  r  r   r   rt   r  r    r   r   r  r   r  r  r   r   r   r	  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r,   r  r  r  rp   )rZ   r   actual_hostactual_portr   r  r   r!  r"  r#  r$  
target_pqcr%  r&  r'  r(  r)  r*  r+  r,  r   r-  r.  r/  r0  r1  r2  r3  r4  r5  r6  s                                  r[   r7  z"AsyncHTTPSConnectionPool._new_conn>  s~      9!$(8999'/,8,0OOO*1*=$0)/	 + +D' 	!		7 II		
 	
 	
 ! 	T%7?%J%JU    9i:!djo&A*/K*/K9++$*+== m	  m	  m	  m	  m	  m	  m	 " S 		4II&   &"&,K #2>";#>MM ?  // 	 ! "*!>!>!>#/N#*+;#<#<        151K1K + +#2$,#F#F !' 0 0%)\/%B & 28< 2L 
2 
2 
, 
, 
, 
, 
, 
,L                           ( N N N"(/[+[[HX[[[# # 2+tWMMM	N *.)C)C##*$,>> ((!\/:*04 *D 
* 
* 
$ 
$ 
$ 
$ 
$ 
$L &.\X\%B%B%B^%S"
 ,t|;;%<=I!%.E!FJ GG,GGGGG T	49-Z??>Bi=S
DIty#9: |$$q((%'N%'N&2 > >
%a=FO;;*11*====*11*==== & . 		< I I.  
 24.6A*N7 7 J J2J
  * J 6 = =j I I I) J 6 = =j I I I'=		> I I.   #%K &d&94@@1!0  '39H9&= # #
"&,"3"3"5"5  *!}?? 5
2q 14444!+B!2 )
 /G.OWWWEUWW/ /#%%  
+ 4>a=0;E 78#**.D.   %0[%0[ )9(8 +/..	
 *. .2->-> +/.. *. -1,<,< .2->-> 150D0D 483J3J -1,<,< 594L4L 594L4L  +/..!" *.#$ )-")'    0 -6{-C-C  E
 #'K$&M/2uuG".5l)0=EEg(/(?$4/ / / ) ) ) ) ) )g # 	@,0HHJJM,6688@.;,6688 ) ()00??? # 	@ ' "g "!'", !( & &"*>NV:'7::::TV ) 1' ! x  KV  x  x  Yd  x  fv  x  x	 
  %Qx11334 'u{{;'?'?@D ~ O<N9=)) W2? W W."-ekk:L.M.M"N"T"T"V"VVVVVVVVVII8		*U   |)t)   $$ !L88 #nn	
 "]] "&!2!2 #nn "]] !% 0 0 "&!2!2 %)$8$8 (,'>'> !% 0 0 )-(@(@ )-(@(@  #nn!" "]]#$ !LLl' , '$--[m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	  m	 ^ sQ   3B`6 I	AH7%I	7
I	I	I	I	`6	7J  V$`66
a a rB   c                   K   t                                          |           d{V  |j        s,|j        s't	          j        d|j         dt                     dS dS dS )rJ  Nz0Unverified HTTPS request is being made to host 'z'. Adding certificate verification is strongly advised. See: https://urllib3future.readthedocs.io/en/latest/advanced-usage.html#tls-warnings)r  rL  is_verifiedproxy_is_verifiedr   r   rO   r'   )rZ   r   r  s     r[   rL  z'AsyncHTTPSConnectionPool._validate_connY	  s       gg$$T********* 		(> 		M$ty $ $ $
 '    		 		 		 		r]   c                @    d| j          d| j        pd d| j        pd dS )Nz<AsyncHTTPSConnection r   i  r  r  r  r  rb   s    r[   r  z!AsyncHTTPSConnectionPool.__repr__j	  s4    a	aaDI4DaatyG^T^aaaar]   )4rO   rP   rQ   rR   r	   r   r   r   r   rt   r   r   r   r   r   r   r   r   r   rM   r  rM   r  r  r  rM   r   rM   r  r  r  r  r  r  r	  r
  r  rM   r   rM   r   r  r  r  r  r  r  rM   r   r   rS   rT   )r   rC   rS   rT   )r   r   rS   rC   r  rx   )ra   r{   r|   r}   rN   rC   r   r~   r;   r\   rN  r7  rL  r  __classcell__)r  s   @r[   r  r    s&          F0DMDDDD
  (837-1!:># $&*#'#(,59597;)-"&+/(,'+"37 7 7 7 7 7 7r     04Y Y Y Y Y Yv     "b b b b b b b br]   r  rT  rP   kwr   c                    t          |           ^}}}}}|pd}|pt          j        |d          }|dk    rt          |fd|i|S t	          |fd|i|S )a}  
    Given a url, return an :class:`.ConnectionPool` instance of its host.

    This is a shortcut for not having to parse out the scheme, host, and port
    of the url before creating an :class:`.ConnectionPool` instance.

    :param url:
        Absolute URL string that must include the scheme. Port is optional.

    :param kw:
        Passes additional parameters to the constructor of the appropriate
        :class:`.ConnectionPool`. Useful for specifying things like
        timeout, maxsize, headers, etc.

    Example::

        >>> conn = connection_from_url('http://google.com/')
        >>> r = conn.request('GET', '/')
    r   r  r  rQ   )r?   rF   r<  r  r   )rT  r'  rN   r  rO   rQ   s         r[   connection_from_urlr)  n	  s|    ( !*#FAtTAvF1>%fb11D'>>4>2>>>&t==$="===r]   )
r   r   r   r   r   r   r   r   rS   rT   )rT  rP   r'  r   rS   r   )z
__future__r   r   rX  loggingr=  r  r  r   r  r   r   r   r   r   	itertoolsr   r	   rY  typesr
   weakrefr   _collectionsr   	_constantr   r   r   r   r   _request_methodsr   _typingr   r   r   r   r   backendr   r   
connectionr   connectionpoolr   contrib.resolverr   contrib.resolver._asyncr   r   r    contrib.ssa._timeoutcontrib.webextensions._asyncr!   
exceptionsr"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   util._async.traffic_policer3   r4   util.connectionr5   
util.proxyr6   util.requestr7   r8   
util.retryr9   util.ssl_match_hostnamer:   util.timeoutr;   r<   util.urlr=   r>   rW   r?   	util.utilr@   rB   rC   rD   rE   rF   ry  rG   TYPE_CHECKINGssltyping_extensionsrH   rI   	getLoggerra   r  TypeVarrJ   rL   EAGAINEWOULDBLOCKr[  r   r   r  r)  rf   r]   r[   <module>rK     s   " " " " " "      



          2 2 2 2 2 2 2 2 2 2 ! ! ! ! ! ! + + + + + +             ) ) ) ) ) )              3 2 2 2 2 2              6 5 5 5 5 5 5 5 * * * * * * , , , , , , / / / / / /         
 + * * * * * 9 9 9 9 9 9                                     &        4 3 3 3 3 3 8 8 8 8 8 8 E E E E E E E E       6 6 6 6 6 6 4 4 4 4 4 4 4 4 * * * * * * * * 8 8 8 8 8 8                              9 8 8 8 8 8 ' ' ' ' ' '	 FJJJ))))))EEEEEEg!!		!	!2" 2" 2" 2" 2" 2" 2" 2"l L%"34 
 "%*A0M	1 1 1 1 1hP` P` P` P` P`13F P` P` P`f8Fb Fb Fb Fb Fb6 Fb Fb FbR> > > > > >r]   