
    ;3hs                     6   U d 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
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mZ ddlmZ ddlmZ dd	lmZmZ dd
lmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 ddl1m2Z2 ddl3m4Z4m5Z5 ddl6Z6ddl7m8Z8m9Z9m:Z: ddl;m<Z= ddl>m?Z? ddl@mAZA ddlBmCZC ej                  dk\  rddlZEnddlEZEdZF ej                         dk(  ZH ej                         dk(  ZIej                  dk\  ZJej                  dk\  ZK e-d      ZL e-d      ZM ej                  dd      ZOeOj                  ZP eQe
j                  j                  d            ZT eUddg eVdd             ZWeAj                  ZYej                  j                  xs: ej                  j                   xr!  eQe
j                  j                  d!            Z] eVdd"      D  ch c]
  }  e^|        c} Z_ eVdd#      D  ch c]
  }  e^|        c}  e^d$      hz  Z`d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6 e^d7      hZae_e`z  eaz  Zb G d8 d9      Zc G d: d; ed;g d<            Zdd=e?d>e+e?e)ed   f   fd?Zed>e)e	j                     fd@Zf e6j                  dAdAdAB       G dC dD             ZhdEe)e	j                     dFeid>edfdGZjd>e"eiehf   fdHZkd=e?d>e+e?e)ed   f   fdIZl e6j                  dAdAdAB       G dJ dK             Zm ej                  dLM      dNeid>emfdO       Zo ej                  dLM      dPeid>e+eieeieif   f   fdQ       ZpddRedSe)ei   d>e)ei   fdTZq ej                  dU      Zs eVd#d$      D  ch c]
  }  e^|        c} dVhz  ZtdWeid>eifdXZu	 ddYeidZeQd[eid\eid>eif
d]ZvdFe)ei   d>eQfd^Zwdaxe)ey   ezd_<   d`a{d>eifdaZ|ddbZ}	 ddce~ddeideedfej                   dged>e)ej                     fdhZ	 ddie g ef   deedfej                   dged>e)ej                     f
djZdkedeedled>efdmZ G dn do      Z G dp dqe!dq         Z G dr dse      Z G dt due      Z	 ddve)e   dwed>eEj                  fdxZ G dy dz      Zd{d|d}eLd>dfd~Z e       Z G d de*      Zefd{ddeded>dfdZej"                   G d de$eL                Z G d de(e.eiee   f   ef         ZdZ ej                  e      Zde dZ ej                  e      Z ej                  d%e d      ZdZ e6j                  dAdAdAB       G d d             Zdeid>dfdZde)ei   d>e)ej
                     fdZej                  deideyd>eQfd       Zdeideyd>eQfdZyc c} w c c} w c c} w )zVarious helper functions    N)
namedtuple)suppress)HeaderParser)	parsedateceil)Path)MappingProxyTypeTracebackType)AnyCallableContextManagerDict	GeneratorGenericIterableIteratorListMappingOptionalProtocolTupleTypeTypeVarUnionget_argsoverload)quote)
getproxiesproxy_bypass)	MultiDictMultiDictProxyMultiMapping)under_cached_property)URL   )hdrs)client_logger      )	BasicAuthChainMapProxyETagreifyDarwinWindows)r*   
   _T_S	_SENTINELsentinelAIOHTTP_NO_EXTENSIONS   i0  d      PYTHONASYNCIODEBUG          ()<>@,;:\"/[]?={} 	   c                       e Zd Zded   fdZy)noopreturn)NNNc              #      K   d  y wN selfs    O/var/www/html/audio-gradio/venv/lib/python3.12/site-packages/aiohttp/helpers.py	__await__znoop.__await__v   s	     s   N)__name__
__module____qualname__r   r[   rW       rZ   rS   rS   u   s    9%56 r_   rS   c            	            e Zd ZdZ	 ddedededd f fdZeddededd fd	       Zedd
dedede	d    fd       Z
defdZ xZS )r,   z!Http basic authentication helper.latin1loginpasswordencodingrT   c                 z    |t        d      |t        d      d|v rt        d      t        | 	  | |||      S )Nz"None is not allowed as login valuez%None is not allowed as password valuerF   z5A ":" is not allowed in login (RFC 1945#section-11.1))
ValueErrorsuper__new__)clsrb   rc   rd   	__class__s       rZ   rh   zBasicAuth.__new__}   sP     =ABBDEE%<TUUwsE8X>>r_   auth_headerc                    	 |j                  dd      \  }}|j                         dk7  rt        d|z        	 t        j                  |j                  d      d      j                  |      }	 |j                  d
d      \  }} | |||      S # t        $ r t        d      w xY w# t        j                  $ r t        d	      w xY w# t        $ r t        d      w xY w)z<Create a BasicAuth object from an Authorization HTTP header.rP   r&   z%Could not parse authorization header.basiczUnknown authorization method %sasciiT)validatezInvalid base64 encoding.rF   zInvalid credentials.rd   )	splitrf   lowerbase64	b64decodeencodedecodebinasciiError)ri   rk   rd   	auth_typeencoded_credentialsdecodedusernamerc   s           rZ   rv   zBasicAuth.decode   s    	F-8->->sA-F*I* ??'>JKK	9&&#**73dfX 	5
 ")sA!6Hh 8X99-  	FDEE	F ~~ 	9788	9  	5344	5s"   B 5B' /C	 B$'C	Crp   urlc                    t        |t              st        d      |j                  |j                  y | |j
                  xs d|j                  xs d|      S )zCreate BasicAuth from url.zurl should be yarl.URL instanceN rp   )
isinstancer%   	TypeErrorraw_userraw_passworduserrc   )ri   r}   rd   s      rZ   from_urlzBasicAuth.from_url   sT     #s#=>> <<C$4$4$<388>r3<<#52IIr_   c                     | j                    d| j                   j                  | j                        }dt	        j
                  |      j                  | j                        z  S )zEncode credentials.rF   zBasic %s)rb   rc   ru   rd   rs   	b64encoderv   )rY   credss     rZ   ru   zBasicAuth.encode   sN    JJ<q088GF,,U3::4==IIIr_   )r   ra   )ra   )r\   r]   r^   __doc__strrh   classmethodrv   r%   r   r   ru   __classcell__)rj   s   @rZ   r,   r,   z   s    + >F??#&?7:?	? : : :; : :8 3; J3 JS J@U J JJ Jr_   r,   )rb   rc   rd   r}   rT   c                     | j                   | j                  | dfS | j                  d      t        | j                  xs d| j
                  xs d      fS )zIRemove user and password from URL if present and return BasicAuth object.Nr   )r   r   	with_userr,   r   rc   )r}   s    rZ   strip_auth_from_urlr      sO     || 0 0 8Dy==	#((.b#,,:L" MMMr_   c                  z   t         j                  j                  d      } | t        |       }n"	 t        j                         }|t        rdndz  }	 t        j                  t        |            S # t
        $ r }t        j                  d|       Y d}~yd}~ww xY w# t        j                  $ r }t        j                  d|       Y d}~yd}~wt        $ re}d}t        j                  t              5  |j!                         }ddd       n# 1 sw Y   nxY w| s|rt        j                  d|       Y d}~yd}~ww xY w)	zLoad netrc from file.

    Attempt to load it from the path specified by the env-var
    NETRC or in the default location in the user's home directory.

    Returns None if it couldn't be found or fails to parse.
    NETRCNzHCould not resolve home directory when trying to look for .netrc file: %s_netrcz.netrczCould not parse .netrc file: %sFzCould not read .netrc file: %s)osenvirongetr	   homeRuntimeErrorr(   debug
IS_WINDOWSnetrcr   NetrcParseErrorwarningOSError
contextlibr   is_file)	netrc_env
netrc_pathhome_direnetrc_existss        rZ   netrc_from_envr      s    

w'I)_
		yy{H ZXF
G{{3z?++  	5
 	    D?CC   G  ) 	0%--/L	0 	0 	0  !!"BAFGsS   A/ B /	B8BBD:.C		D:D50D
	D5
D	!D55D:T)auto_attribsfrozenslotsc                   (    e Zd ZU eed<   ee   ed<   y)	ProxyInfoproxy
proxy_authN)r\   r]   r^   r%   __annotations__r   r,   rW   r_   rZ   r   r      s    J##r_   r   	netrc_objhostc                     | t        d      | j                  |      }|t        d|d      |\  }}}|s||n|}|d}t        ||      S )z
    Return :py:class:`~aiohttp.BasicAuth` credentials for ``host`` from ``netrc_obj``.

    :raises LookupError: if ``netrc_obj`` is :py:data:`None` or if no
            entry is found for the ``host``.
    zNo .netrc file foundzNo entry for z found in the `.netrc` file.r   )LookupErrorauthenticatorsr,   )r   r   auth_from_netrcrb   accountrc   r|   s          rZ   basicauth_from_netrcr      sv     011..t4OM$1MNOO.E7H '/uH Xx((r_   c                  B   t               j                         D  ci c]  \  } }| dv r| t        |       }} }t               }|j                         D  ci c]  \  } }| t	        |       }} }i }|j                         D ]~  \  }}|\  }}	|j
                  dv r0t        j                  d|j
                  j                         |       I|r%|	#|j                  	 t        ||j                        }	t        ||	      ||<    |S c c}} w c c}} w # t        $ r d }	Y ,w xY w)N)httphttpswswss)r   r   z)%s proxies %s are not supported, ignoring)r   itemsr%   r   r   schemer(   r   upperr   r   r   r   )
kv
proxy_urlsr   strippedretprotovalr   auths
             rZ   proxies_from_envr     s3    L&&(Aq.. 	
3q6	J 
  I6@6F6F6HIda&q))IHI
Cnn& ,
st<<++!!;U\\=O=O=QSX zz% /	5::FD ud+E
, J- J #  D s   DD
DDDc                    | j                   .t        | j                         rt        d| j                   d      t               }	 || j                     }|j
                  |j                  fS # t        $ r t        d| d      w xY w)z5Get a permitted proxy for the given URL from the env.zProxying is disallowed for ``zNo proxies found for `z` in the env)r   r    r   r   r   r   r   KeyError)r}   proxies_in_env
proxy_infos      rZ   get_env_proxy_for_urlr   *  s    
xxSXX 68AFGG%'N7#CJJ/
 !6!666  H23'FGGHs   A- -Bc                   6    e Zd ZU eed<   eed<   eed<   ded<   y)MimeTypetypesubtypesuffixzMultiDictProxy[str]
parametersN)r\   r]   r^   r   r   rW   r_   rZ   r   r   8  s    
ILK%%r_   r   8   )maxsizemimetypec           	         | s t        dddt        t                           S | j                  d      }t               }|dd D ]W  }|s|j	                  d      \  }}}|j                  |j                         j                         |j                  d             Y |d   j                         j                         }|d	k(  rd
}|j	                  d      \  }}}	|	j	                  d      \  }	}}
t        ||	|
t        |            S )a  Parses a MIME type into its components.

    mimetype is a MIME type string.

    Returns a MimeType object.

    Example:

    >>> parse_mimetype('text/html; charset=utf-8')
    MimeType(type='text', subtype='html', suffix='',
             parameters={'charset': 'utf-8'})

    r   )r   r   r   r   rE   r&   NrM   z "r   *z*/*rI   +)r   r"   r!   rq   	partitionaddrr   strip)r   partsparamsitemkey_valuefulltypemtypestyper   s              rZ   parse_mimetyper   @  s     R~ik7R
 	
 NN3E&[Fab	 ;s+Q

399;$$&D(9:	; Qx~~%%'H3((-OE1es+E1fE&^F=S r_   rawc                     t               j                  d|        }|j                         }|j                  d      }t	        |dd       }|t        |      fS )zyParse Content-Type header.

    Returns a tuple of the parsed content type and a
    MappingProxyType of parameters.
    zContent-Type: rW   r&   N)r   parsestrget_content_type
get_paramsdictr
   )r   msgcontent_typer   content_dicts        rZ   parse_content_typer   h  sZ     .
!
!N3%"8
9C'')L^^BFqr
#L),777r_   objdefaultc                     t        | dd       }|r5t        |t              r%|d   dk7  r|d   dk7  rt        |      j                  S |S )Nnamer   rA   rB   )getattrr   r   r	   r   )r   r   r   s      rZ   guess_filenamer   v  sC    3%D
4%$q'S.T"X_DzNr_   z[^\041\043-\133\135-\176]	contentc                 p    t         t        |       kD  st        d|       t        j	                  d |       S )a  Return 7-bit content as quoted-string.

    Format content into a quoted-string as defined in RFC5322 for
    Internet Message Format. Notice that this is not the 8-bit HTTP
    format, but the 7-bit email format. Content must be in usascii or
    a ValueError is raised.
    zbad content for quoted-string c                 *    d| j                  d      z   S )NrG   r   )group)xs    rZ   <lambda>zquoted_string.<locals>.<lambda>  s    dQWWQZ&7 r_   )QCONTENTsetrf   not_qtext_resub)r   s    rZ   quoted_stringr    s7     s7|#9'EFF7AAr_   disptypequote_fields_charsetr   c                    | rt         t        |       kD  st        d|       | }|rg }|j                         D ]  \  }}|rt         t        |      kD  st        d|d|      |r[|j	                         dk(  r%t        |d|      }|j                  |d|z  f       e	 t        |      }|j                  |d|z  f       |j                  d
d      j                  dd      }|j                  |d|z  f        dj                  d |D              }	dj                  ||	f      }|S # t        $ r: dj                  |dt        |d|      f      }|j                  |d	z   |f       Y 1w xY w)ak  Sets ``Content-Disposition`` header for MIME.

    This is the MIME payload Content-Disposition header from RFC 2183
    and RFC 7579 section 4.2, not the HTTP Content-Disposition from
    RFC 6266.

    disptype is a disposition type: inline, attachment, form-data.
    Should be valid extension token (see RFC 2183)

    quote_fields performs value quoting to 7-bit MIME headers
    according to RFC 7578. Set to quote_fields to False if recipient
    can take 8-bit file names and field values.

    _charset specifies the charset to use when quote_fields is True.

    params is a dict with disposition params.
    zbad content disposition type z"bad content disposition parameter rM   filenamer   rp   z"%s"z''r   rG   z\\rH   z\"z; c              3   >   K   | ]  }d j                  |        yw)rM   N)join).0pairs     rZ   	<genexpr>z-content_disposition_header.<locals>.<genexpr>  s     ?tCHHTN?s   )
TOKENr   rf   r   rr   r   appendr  r	  replace)
r  r  r  r   r   lparamsr   r   qvalsparamss
             rZ   content_disposition_headerr    su   ( ECM18EFFE 	5HCus3x/ #EcWAcW!UVV99;*, b8<DNNC$#78=,S1  Vd]';<{{4088eDVd]34'	5( ))?w??		5'*+L & :!ww%tU3X-NO   c	4'89	:s   D((?E+*E+c                 T    | syd| v xs  | j                  dd      j                         S )zCheck if host looks like an IP Address.

    This check is only meant as a heuristic to ensure that
    a host is not a domain name.
    FrF   .r   )r  isdigit)r   s    rZ   is_ip_addressr    s/      $;9$,,sB/7799r_   _cached_current_datetimer   c                      t        t        j                               } | t        k7  r5d}d}t        j                  |       ^}}}}}}}	}
d||	   |||   ||||fz  a| at        S )N)MonTueWedThuFriSatSun)r   JanFebMarAprMayJunJulAugSepOctNovDecz#%s, %02d %3s %4d %02d:%02d:%02d GMT)inttimer  gmtime_cached_formatted_datetime)now_weekdayname
_monthnameyearmonthdayhhmmsswdtails              rZ   rfc822_formatted_timer<    s     diik
C
&& I

  37++c2B/eS"b"b4%JuN
 &
" $' %%r_   c                     | \  }} |       }|*t        t              5   t        ||              d d d        y y # 1 sw Y   y xY wrV   )r   	Exceptionr   )inforefr   obs       rZ   _weakref_handlerB    sM    IC	B	~i  	 GB	  	  	  	 s	   :ArA  r   timeoutlooptimeout_ceil_thresholdc                     |T|dkD  rO|j                         |z   }||k\  rt        |      }|j                  |t        t	        j
                  |       |f      S y Nr   )r.  r   call_atrB  weakrefr@  )rA  r   rC  rD  rE  whens         rZ   weakref_handlerK    sU     w{yy{W$,,:D||D/GKKOT3JKKr_   cbc                 p    ||dk  ry |j                         }t        |||      }|j                  ||       S rG  )r.  calculate_timeout_whenrH  )rL  rC  rD  rE  r1  rJ  s         rZ   
call_laterrO    s=     'Q,
))+C!#w0FGD<<b!!r_   	loop_timetimeout_ceiling_thresholdc                 0    | |z   }||kD  rt        |      S |S )z$Calculate when to execute a timeout.r   )rP  rC  rQ  rJ  s       rZ   rN  rN    s&     wD**DzKr_   c            	           e Zd ZdZdZ	 ddej                  dee   deddfdZ	d	e
d
   dededdfdZddZdeej                     fdZddZddZy)TimeoutHandlezTimeout handle_timeout_loop_ceil_threshold
_callbacksrD  rC  ceil_thresholdrT   Nc                 <    || _         || _        || _        g | _        y rV   rU  )rY   rD  rC  rZ  s       rZ   __init__zTimeoutHandle.__init__0  s&      
-  	r_   callback).Nargskwargsc                 @    | j                   j                  |||f       y rV   )rY  r  )rY   r]  r^  r_  s       rZ   registerzTimeoutHandle.register=  s     	$78r_   c                 8    | j                   j                          y rV   )rY  clearrX   s    rZ   closezTimeoutHandle.closeB  s    r_   c                     | j                   }|b|dkD  r]| j                  j                         |z   }|| j                  k\  rt	        |      }| j                  j                  || j                        S y rG  )rV  rW  r.  rX  r   rH  __call__)rY   rC  rJ  s      rZ   startzTimeoutHandle.startE  sa    --7Q;::??$w.D$...Dz::%%dDMM::r_   c                     | j                   A| j                   dkD  r2t        | j                        }| j                  |j                         |S t               S rG  )rV  TimerContextrW  ra  rC  	TimerNoop)rY   timers     rZ   rk  zTimeoutHandle.timerO  sB    ==$): ,EMM%--(L;r_   c                     | j                   D ]&  \  }}}t        t              5   ||i | d d d        ( | j                   j                          y # 1 sw Y   MxY wrV   )rY  r   r>  rc  )rY   rL  r^  r_  s       rZ   rf  zTimeoutHandle.__call__W  s]     $ 	$Bf)$ $D#F#$ $	$ 	$ $s   	AA	   rT   N)rT   BaseTimerContext)r\   r]   r^   r   	__slots__asyncioAbstractEventLoopr   floatr\  r   r   ra  rd  TimerHandlerg  rk  rf  rW   r_   rZ   rT  rT  +  s    FI !"	'' % 	
 
9 +9479CF9	9
 x 3 34  r_   rT  c                       e Zd ZdZddZy)rp  rW   Nc                      y)z0Raise TimeoutError if timeout has been exceeded.NrW   rX   s    rZ   assert_timeoutzBaseTimerContext.assert_timeoutc  s    r_   ro  )r\   r]   r^   rq  rx  rW   r_   rZ   rp  rp  _  s    I?r_   rp  c                   L    e Zd ZdZdefdZdeee      dee   dee	   ddfdZ
y)	rj  rW   rT   c                     | S rV   rW   rX   s    rZ   	__enter__zTimerNoop.__enter__k  s    r_   exc_typeexc_valexc_tbNc                      y rV   rW   )rY   r|  r}  r~  s       rZ   __exit__zTimerNoop.__exit__n  s     	r_   )r\   r]   r^   rq  rp  r{  r   r   BaseExceptionr   r  rW   r_   rZ   rj  rj  g  sS    I+ 4./ -( '	
 
r_   rj  c            	           e Zd ZdZdZdej                  ddfdZddZde	fdZ
d	eee      d
ee   dee   dee   fdZddZy)ri  z&Low resolution timeout context managerrW  _tasks
_cancelled_cancellingrD  rT   Nc                 <    || _         g | _        d| _        d| _        y )NFr   r  )rY   rD  s     rZ   r\  zTimerContext.__init__|  s    
/1r_   c                 >    | j                   rt        j                  dy)z7Raise TimeoutError if timer has already been cancelled.N)r  rr  TimeoutErrorrX   s    rZ   rx  zTimerContext.assert_timeout  s    ??&&D0 r_   c                     t        j                  | j                        }|t        d      t        j
                  dk\  r|j                         | _        | j                  rt         j                  d | j                  j                  |       | S )N)rD  z4Timeout context manager should be used inside a taskr)   )rr  current_taskrW  r   sysversion_info
cancellingr  r  r  r  r  rY   tasks     rZ   r{  zTimerContext.__enter__  sr    ##4<UVVw&  $0D??&&D04 r_   r|  r}  r~  c                    d }| j                   r| j                   j                         }|t        j                  u rR| j                  rF|J t
        j                  dk\  r|j                         | j                  kD  ry t        j                  |y )Nr)   )
r  poprr  CancelledErrorr  r  r  uncancelr  r  )rY   r|  r}  r~  
enter_tasks        rZ   r  zTimerContext.__exit__  s}     37
;;*Jw---$//))) 7* &&(4+;+;;&&G3r_   c                     | j                   s2t        | j                        D ]  }|j                           d| _         y y NT)r  r   r  cancelr  s     rZ   rC  zTimerContext.timeout  s8    DKK(  #DO	 r_   ro  )r\   r]   r^   r   rq  rr  rs  r\  rx  rp  r{  r   r   r  r   boolr  rC  rW   r_   rZ   ri  ri  w  s}    0@IW66 4 1
+ "4./ -( '	
 
$0#r_   ri  delayrZ  c                     | | dk  rt        j                  d       S t        j                         }|j	                         }|| z   }| |kD  rt        |      }t        j                  |      S rG  )async_timeoutrC  rr  get_running_loopr.  r   
timeout_at)r  rZ  rD  r1  rJ  s        rZ   ceil_timeoutr    sd     }
$$T**##%D
))+C;D~Dz##D))r_   c                       e Zd ZU dZ eg d      Zee   ed<   dZ	e
e   ed<   dZe
eeef      ed<   eZeedef   ed<   de
e   d	dfd
Zed	efd       Zed	e
e   fd       Zed	e
e   fd       Zy)HeadersMixinzMixin for handling headers.)_content_type_content_dict_stored_content_type_headersNr  r  r  r   rT   c                     || _         |d| _        i | _        y t        |      \  }}|| _        |j	                         | _        y )Nzapplication/octet-stream)r  r  r  r   copy)rY   r   r   content_mapping_proxys       rZ   _parse_content_typez HeadersMixin._parse_content_type  sH    $'!;!;D!#D2DS2I/L/!-D!6!;!;!=Dr_   c                     | j                   j                  t        j                        }| j                  |k7  r| j                  |       | j                  J | j                  S )z7The value of content part for Content-Type HTTP header.)r  r   r'   CONTENT_TYPEr  r  r  rY   r   s     rZ   r   zHeadersMixin.content_type  sX     mm 1 12$$+$$S)!!---!!!r_   c                     | j                   j                  t        j                        }| j                  |k7  r| j                  |       | j                  J | j                  j                  d      S )z7The value of charset part for Content-Type HTTP header.charset)r  r   r'   r  r  r  r  r  s     rZ   r  zHeadersMixin.charset  sc     mm 1 12$$+$$S)!!---!!%%i00r_   c                 r    | j                   j                  t        j                        }|dS t	        |      S )z(The value of Content-Length HTTP header.N)r  r   r'   CONTENT_LENGTHr-  )rY   content_lengths     rZ   r  zHeadersMixin.content_length  s3     **4+>+>?%-tF3~3FFr_   )r\   r]   r^   r   	frozensetATTRSr#   r   r   r  r   r  r   r6   r  r   r5   r  propertyr   r  r-  r  rW   r_   rZ   r  r    s    %PQE3#'M8C='.2M8DcN+28@%T9 45@
>x} 
> 
> "c " " 1# 1 1 G G Gr_   r  futzasyncio.Future[_T]resultc                 H    | j                         s| j                  |       y y rV   )done
set_result)r  r  s     rZ   r  r    s    88:v r_   c                   $    e Zd Z	 ddededdfdZy)ErrorableProtocolexc	exc_causerT   Nc                      y rV   rW   )rY   r  r  s      rZ   set_exceptionzErrorableProtocol.set_exception  s     r_   .)r\   r]   r^   r  r  rW   r_   rZ   r  r    s(     $' ! 
	r_   r  z&asyncio.Future[_T] | ErrorableProtocolr  r  c                     t        j                  |       r| j                         ry|t        u }||u }|s	|s||_        | j                  |       y)zSet future exception.

    If the future is marked as complete, this function is a no-op.

    :param exc_cause: An exception that is a direct cause of ``exc``.
                      Only set if provided.
    N)rr  isfuturer  _EXC_SENTINEL	__cause__r  )r  r  r  exc_is_sentinelexc_causes_itselfs        rZ   r  r    sM     =0Oy(#4!cr_   c                   `    e Zd ZU dZdZee   ed<   ddede	ee
      fdZded	efd
Zd	efdZy)AppKeyz.Keys for static typing support in Application.)_name_t__orig_class__r  Nr   tc                     t        j                         }|r8|j                  j                  dk(  r|j                  d   }n|j
                  }|r8dz   |z   | _        || _        y )Nz<module>r\   r  )inspectcurrentframef_codeco_name	f_globalsf_backr  r  )rY   r   r  framemodules        rZ   r\  zAppKey.__init__'  s]    $$&||##z1#ooj9LLE	  c\D(
r_   otherrT   c                 V    t        |t              r| j                  |j                  k  S yr  )r   r  r  )rY   r  s     rZ   __lt__zAppKey.__lt__3  s"    eV$::++r_   c                 l   | j                   }|0t        t              5  t        | j                        d   }d d d        |d}nSt        |t              r8|j                  dk(  r|j                  }n'|j                   d|j                   }nt        |      }d| j                   d| dS # 1 sw Y   txY w)Nr   z<<Unknown>>builtinsr  z<AppKey(z, type=z)>)r  r   AttributeErrorr   r  r   r   r]   r^   reprr  )rY   r  t_reprs      rZ   __repr__zAppKey.__repr__8  s    GG9.) 5T001!45 9"F4 ||z)LL>1>>*:;!WF$**WVHB775 5s   B**B3rV   )r\   r]   r^   r   rq  r   objectr   r   r   r3   r\  r  r  r  rW   r_   rZ   r  r    sQ    81I
 L 
S 
Xd2h%7 
F t 
8# 8r_   r  c            	          e Zd ZdZdeeeeee	   f   e	f      ddfdZ
ddZedee   defd       Zedede	fd	       Zdeeee   f   de	fd
Zedee   dedeeef   fd       Zeddee   dddee   fd       Zeddede	de	fd       Zddeeee   f   de	de	fdZdefdZdeeeee	   f      fdZdedefdZdefdZdefdZy)r-   )_mapsmapsrT   Nc                 $    t        |      | _        y rV   )tupler  )rY   r  s     rZ   r\  zChainMapProxy.__init__N  s    4[
r_   c                 J    t        dj                  | j                              )Nz4Inheritance class {} from ChainMapProxy is forbidden)r   formatr\   )ri   s    rZ   __init_subclass__zChainMapProxy.__init_subclass__Q  s"    !6#,,/
 	
r_   r   c                      y rV   rW   rY   r   s     rZ   __getitem__zChainMapProxy.__getitem__W  s    25r_   c                      y rV   rW   r  s     rZ   r  zChainMapProxy.__getitem__Z  s    ,/r_   c                 f    | j                   D ]	  }	 ||   c S  t        |      # t        $ r Y "w xY wrV   )r  r   )rY   r   mappings      rZ   r  zChainMapProxy.__getitem__]  sD    zz 	Gs|#	
 sm  s   $	00r   c                      y rV   rW   rY   r   r   s      rZ   r   zChainMapProxy.gete  s    BEr_   c                      y rV   rW   r  s      rZ   r   zChainMapProxy.geth  s    ILr_   c                      y rV   rW   r  s      rZ   r   zChainMapProxy.getk  s    8;r_   c                 0    	 | |   S # t         $ r |cY S w xY wrV   )r   r  s      rZ   r   zChainMapProxy.getn  s%    	9 	N	s    c                 V    t         t               j                  | j                         S rV   )lenr   unionr  rX   s    rZ   __len__zChainMapProxy.__len__t  s    ;35;;

+,,r_   c                 r    i }t        | j                        D ]  }|j                  |        t        |      S rV   )reversedr  updateiter)rY   dr  s      rZ   __iter__zChainMapProxy.__iter__x  s6    02

+ 	GHHW	 Awr_   c                 @    t        fd| j                  D              S )Nc              3   &   K   | ]  }|v  
 y wrV   rW   )r
  mr   s     rZ   r  z-ChainMapProxy.__contains__.<locals>.<genexpr>  s     03!80s   anyr  r  s    `rZ   __contains__zChainMapProxy.__contains__  s    0TZZ000r_   c                 ,    t        | j                        S rV   r   rX   s    rZ   __bool__zChainMapProxy.__bool__  s    4::r_   c                 `    dj                  t        t        | j                              }d| dS )Nz, zChainMapProxy(r@   )r	  mapr  r  )rY   r   s     rZ   r  zChainMapProxy.__repr__  s*    ))Cdjj12y**r_   ro  r  rV   )r\   r]   r^   rq  r   r   r   r   r  r   r\  r  r   r3   r  r4   r   r   r-  r  r   r  r  r  r  r  r  rW   r_   rZ   r-   r-   K  s}   I!XgeC4D.Es.J&KL !QU !
 5vbz5b5 5/s/s/ /uS&*_5 #  EvbzEBE5R=E ELvbzLDL8B<L L;s;S;3; ;uS&*_-  s - -(5fSk)9#:; 1 14 1$ +# +r_   r-   z[!\x23-\x7E\x80-\xff]+z(W/)?"(z)"z)(?:\s*,\s*|$)|(.)r   c                   &    e Zd ZU eed<   dZeed<   y)r.   r   Fis_weakN)r\   r]   r^   r   r   r  r  rW   r_   rZ   r.   r.     s    JGTr_   r.   r   c                 `    | t         k7  r%t        j                  |       st        d| d      y y )NzValue z, is not a valid etag. Maybe it contains '"'?)ETAG_ANY	_ETAGC_RE	fullmatchrf   )r   s    rZ   validate_etag_valuer    s9    !4!4U!;UIJK
 	
 "<r_   date_strc                     | Vt        |       }|It        t              5  t        j                  |dd dt        j                  j
                  icddd       S y# 1 sw Y   yxY w)z/Process a date string, return a datetime objectN   tzinfo)r   r   rf   datetimetimezoneutc)r  	timetuples     rZ   parse_http_dater    sd    h'	 *% W(()BQ-V@Q@Q@U@UVW WWs   0AA#methodcodec                 r    |t         v xs. | t        v xs$ d|cxk  xr dk  nc xr | t        j                  v S )z-Check if a request must return an empty body.r:   ,  )EMPTY_BODY_STATUS_CODESEMPTY_BODY_METHODSr'   METH_CONNECT_ALLr  r  s     rZ   must_be_empty_bodyr    sD     	'' 	C''	C4#A&D,A,A"Ar_   c                 ^    |t         v xs$ d|cxk  xr dk  nc xr | t        j                  v S )zrCheck if a Content-Length header should be removed.

    This should always be a subset of must_be_empty_body
    r:   r  )r  r'   r  r  s     rZ   should_remove_content_lengthr!    s4     ** tc=f(=(==r_   rV   )Tzutf-8)r?  zTuple[weakref.ref[object], str]rT   Nrm  )r   rr  rs   rw   r   r  enum	functoolsr  r   r   platformrer  r.  rI  collectionsr   r   email.parserr   email.utilsr   mathr   pathlibr	   typesr
   r   typingr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   urllib.parser   urllib.requestr   r    attr	multidictr!   r"   r#   propcache.apir$   r/   yarlr%   r   r'   logr(   r  r  __all__systemIS_MACOSr   PY_310PY_311r3   r4   Enumr5   r6   r  r   r   NO_EXTENSIONSr  ranger  METH_HEAD_ALLr  flagsdev_modeignore_environmentDEBUGchrCHARCTL
SEPARATORSr  rS   r,   r   r   sr   r   r   r   r   r   	lru_cacher   r   r   compiler   r   r  r  r  r  r-  r   r0  r<  rB  r  rt  rs  ru  rK  rO  rN  rT  rp  rj  ri  Timeoutr  r  r  r  r  r  r  total_orderingr  r-   _ETAGCr  _QUOTED_ETAGQUOTED_ETAG_RELIST_QUOTED_ETAG_REr
  r.   r  r  r  r!  )is   0rZ   <module>rO     s{             	  	 
   "  % !   1    (  3  = = 8   w#
98??(X__)+
			W	$			W	$ T]T]DIIk:.	RZZ^^$;<= $S#$@c3$@A  '' 		 			$$$Sbjjnn=Q.R)S 
 a&1A&Q|$!s1v$H(  F'
* 	s
Z 
<J
;(IJ <J~NS NU30C+C%D N(- (V T$d3$ $ 4$
)HU[[$9 ) ) ):$sI~. 47s 7uS(92E-E'F 7 T$d3& & 4& R $S $X $ !$N R 
8C 
8E#/?S/I*I$J 
8 !
8 hsm x}  rzz67!$-.qCF.$7
B3 
B3 
B ?F00!%08;0QT00f
: 
:$ 
: +/ (3- . %&s %&P  %&
  
#
#	
 " g!!"( %&	
"S
"
" 
#
#
" "	
"
 g!!"
"			  %	 		1  1 h?~&89 ?   >## >#D 56*E?*,1**,G ,G^( "  
    -	1	  
	. +8WR[ +8 +8\<+GE#vc{"23S89 <+@ 
#BJJv	&$L) bjjAl^3E!FG  T$d3  4

s 
t 
hsm 9J9J0K  s # $  	 	C 	D 	y '$H	 /s   5VV<V