HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/aiohttp/__pycache__/helpers.cpython-310.pyc
o

���g�q�@s�UdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZmZm 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/ddl0m1Z1ddl2m3Z3m4Z4ddl5Z5dd
l6m7Z7m8Z8m9Z9ddl:m;Z<ddl=m>Z>ddl?m@Z@ddlAmBZBe
jCdkr�ddlZDnddlDZDdZEe�F�dkZGe�F�dkZHe
jCdkZIe
jCdkZJe,d�ZKe,d�ZLe�Mdd�ZNeNjOZOePe
jQ�Rd��ZSeTddgeUdd ��R�ZVe@jWZXe
jYjZ�p%e
jYj[�o%ePe
jQ�Rd!��Z\d"d#�eUdd$�D�Z]d%d#�eUdd&�D�e^d'�hBZ_d(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9e^d:�hZ`e]e_Ae`AZaGd;d<�d<�ZbGd=d>�d>ed>gd?���Zcd@e>dAe*e>e(ecffdBdC�ZddAe(e	j	fdDdE�Zee5jfdFdFdFdG�GdHdI�dI��ZgdJe(e	j	dKehdAecfdLdM�ZidAe!ehegffdNdO�Zjd@e>dAe*e>e(ecffdPdQ�Zke5jfdFdFdFdG�GdRdS�dS��ZlejmdTdU�dVehdAelfdWdX��Znd�dYedZe(ehdAe(ehfd[d\�Zoe�pd]�Zqd^d#�eUd&d'�D�d_hBZrd`ehdAehfdadb�Zs	cd�ddehdeePdfehdgehdAehf
dhdi�ZtdKe(ehdAePfdjdk�Zudave(ewexdl<dmaydAehfdndo�Zzd�drds�Z{	td�due|dvehdwe}dxej~dye}dAe(ejfdzd{�Z�	td�d|egefdwe}dxej~dye}dAe(ejf
d}d~�Z�de}dwe}d�e}dAe}fd�d��Z�Gd�d��d��Z�Gd�d��d�e d��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�	td�d�e(e}d�e}dAeDj�fd�d��Z�Gd�d��d��Z�d�d�d�eKdAdfd�d��Z�e��Z�Gd�d��d�e)�Z�e�fd�d�d�e�d�e�dAdfd�d��Z�ej�Gd�d��d�e#eK��Z�Gd�d��d�e'e-ehe�efef�Z�d�Z�e�pe��Z�d�e��d��Z�e�pe��Z�e�pd(e��d���Z�d�Z�e5jfdFdFdFdG�Gd�d��d���Z�d�ehdAdfd�d��Z�d�e(ehdAe(ejfd�d��Z�ejmd�ehd�ewdAePfd�d���Z�d�ehd�ewdAePfd�d��Z�dS)�zVarious helper functions�N)�
namedtuple)�suppress)�HeaderParser)�	parsedate��ceil)�Path)�
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���PYTHONASYNCIODEBUGcC�h|]}t|��qS���chr��.0�ir<r<�:/usr/local/lib/python3.10/dist-packages/aiohttp/helpers.py�	<setcomp>Y�rC�cCr;r<r=r?r<r<rBrCZrD� ��(�)�<�>�@�,�;�:�\�"�/�[�]�?�=�{�}� �	c@seZdZdedfdd�ZdS)�noop�return)NNNccs�dVdS�Nr<��selfr<r<rB�	__await__vs�
znoop.__await__N)�__name__�
__module__�__qualname__rr`r<r<r<rBr[usr[c	s�eZdZdZ	ddedededdf�fdd	�
Zedd
ededdfdd��Zedd
�dedede	dfdd��Z
defdd�Z�ZS)r+z!Http basic authentication helper.��latin1�login�password�encodingr\csB|durtd��|durtd��d|vrtd��t��||||�S)Nz"None is not allowed as login valuez%None is not allowed as password valuerOz5A ":" is not allowed in login (RFC 1945#section-11.1))�
ValueError�super�__new__)�clsrfrgrh��	__class__r<rBrk}szBasicAuth.__new__�auth_headercCs�z
|�dd�\}}Wntytd��w|��dkr"td|��ztj|�d�dd��|�}Wntjy=td	��wz
|�d
d�\}}WntyStd��w||||d�S)
z<Create a BasicAuth object from an Authorization HTTP header.rYr%z%Could not parse authorization header.�basiczUnknown authorization method %s�asciiT)�validatezInvalid base64 encoding.rOzInvalid credentials.�rh)	�splitri�lower�base64�	b64decode�encode�decode�binascii�Error)rlrorh�	auth_type�encoded_credentials�decoded�usernamergr<r<rBry�s,�
����zBasicAuth.decoders�urlcCsDt|t�s	td��|jdur|jdurdS||jpd|jpd|d�S)zCreate BasicAuth from url.zurl should be yarl.URL instanceNrdrs)�
isinstancer$�	TypeError�raw_user�raw_password�userrg)rlr�rhr<r<rB�from_url�s

zBasicAuth.from_urlcCs0|j�d|j���|j�}dt�|��|j�S)zEncode credentials.rOzBasic %s)rfrgrxrhrv�	b64encodery)r_�credsr<r<rBrx�szBasicAuth.encode)rdre)re)
rarbrc�__doc__�strrk�classmethodryr$rr�rx�
__classcell__r<r<rmrBr+zs"�����"
r+)rfrgrhr�r\cCs<|jdur|jdur|dfS|�d�t|jpd|jpd�fS)zIRemove user and password from URL if present and return BasicAuth object.Nrd)r�r��	with_userr+r�rg)r�r<r<rB�strip_auth_from_url�s r�cCs0tj�d�}|durt|�}n(zt��}Wnty.}z
t�d|�WYd}~dSd}~ww|tr4dnd}zt	�	t
|��WSt	jyY}z
t�d|�WYd}~dSd}~wt
y�}z3d}t�t
��|��}Wd�n1svwY|s|r�t�d|�WYd}~dSWYd}~dSd}~ww)	z�Load 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.netrczCould not parse .netrc file: %sFzCould 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_existsr<r<rB�netrc_from_env�s@
���	��
�
���r�T)�auto_attribs�frozen�slotsc@s"eZdZUeed<eeed<dS)�	ProxyInfo�proxy�
proxy_authN)rarbrcr$�__annotations__rr+r<r<r<rBr���
r��	netrc_obj�hostcCsf|durtd��|�|�}|durtd|�d���|\}}}|s$|dur&|n|}|dur.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``.
    NzNo .netrc file foundz
No entry for z found in the `.netrc` file.rd)�LookupError�authenticatorsr+)r�r��auth_from_netrcrf�accountrgrr<r<rB�basicauth_from_netrc�s


r�c	Cs�dd�t���D�}t�}dd�|��D�}i}|��D]>\}}|\}}|jdvr4t�d|j��|�q|rS|durS|jdurSzt||j�}Wnt	yRd}Ynwt
||�||<q|S)NcSs"i|]
\}}|dvr|t|��qS))�http�https�ws�wssr#�r@�k�vr<r<rB�
<dictcomp>s
�z$proxies_from_env.<locals>.<dictcomp>cSsi|]	\}}|t|��qSr<)r�r�r<r<rBr�s)r�r�z)%s proxies %s are not supported, ignoring)r�itemsr��schemer'r��upperr�r�r�r�)�
proxy_urlsr��stripped�ret�proto�valr��authr<r<rB�proxies_from_envs,�
�
�r�cCsf|jdurt|j�rtd|j�d���t�}z||j}Wnty,td|�d���w|j|jfS)z5Get a permitted proxy for the given URL from the env.NzProxying is disallowed for `�`zNo proxies found for `z` in the env)r�rr�r�r��KeyErrorr�r�)r��proxies_in_env�
proxy_infor<r<rB�get_env_proxy_for_url*s�r�c@s.eZdZUeed<eed<eed<ded<dS)�MimeType�type�subtype�suffixzMultiDictProxy[str]�
parametersN)rarbrcr�r�r<r<r<rBr�8s

r��8)�maxsize�mimetypecCs�|s
tdddtt��d�S|�d�}t�}|dd�D]}|s q|�d�\}}}|�|����|�d��q|d����}|d	krDd
}|�d�\}}}	|	�d�\}	}}
t||	|
t|�d�S)
aParses 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'})

    rd)r�r�r�r�rNr%NrVz "r�*z*/*rR�+)r�r rrt�	partition�addru�strip)r��parts�params�item�key�_�value�fulltype�mtype�styper�r<r<rB�parse_mimetype@s&�
�r��obj�defaultcCs@t|dd�}|rt|t�r|ddkr|ddkrt|�jS|S)N�namerrJ���rK)�getattrr�r�rr�)r�r�r�r<r<rB�guess_filenamehs&
r�z[^\041\043-\133\135-\176]cCr;r<r=r?r<r<rBrCprD�	�contentcCs*tt|�ks
td|����t�dd�|�S)aReturn 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.
    zbad content for quoted-string cSsd|�d�S)NrPr)�group)�xr<r<rB�<lambda>}szquoted_string.<locals>.<lambda>)�QCONTENT�setri�not_qtext_re�sub)r�r<r<rB�
quoted_stringssr��utf-8�disptype�quote_fields�_charsetr�c

Ks>|rtt|�kstd|����|}|r�g}|��D]r\}}|r%tt|�ks/td|�d|����|rx|��dkrHt|d|d�}|�|d|f�qzt|�}Wntymd�|dt|d|d�f�}|�|d	|f�Yqw|�|d|f�q|�	d
d��	dd
�}|�|d|f�qd�dd�|D��}	d�||	f�}|S)akSets ``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.
    zbad content disposition type z"bad content disposition parameter rV�filenamerdrsz"%s"z''r�rPz\\rQz\"z; css�|]}d�|�VqdS)rVN)�join)r@�pairr<r<rB�	<genexpr>�s�z-content_disposition_header.<locals>.<genexpr>)
�TOKENr�rir�rur�appendr�r��replace)
r�r�r�r�r��lparamsr�r��qval�sparamsr<r<rB�content_disposition_header�s4��r�cCs |sdSd|vp|�dd���S)z�Check 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.
    FrO�.rd)r��isdigit)r�r<r<rB�
is_ip_address�sr�_cached_current_datetimerdcCs\tt���}|tkr,d}d}t�|�^}}}}}}}	}
d||	|||||||fa|atS)N)�Mon�Tue�Wed�Thu�Fri�Sat�Sun)
rd�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�tailr<r<rB�rfc822_formatted_time�s �	r&�info�Tuple[weakref.ref[object], str]cCsT|\}}|�}|dur(tt��t||��Wd�dS1s!wYdSdSr])r�	Exceptionr�)r'�refr��obr<r<rB�_weakref_handle�s
"��r,�r+r��timeout�loop�timeout_ceil_thresholdcCsH|dur"|dkr"|��|}||krt|�}|�|tt�|�|f�SdS�Nr)rr�call_atr,�weakrefr*)r+r�r.r/r0�whenr<r<rB�weakref_handle�sr5�cbcCs4|dus|dkr
dS|��}t|||�}|�||�Sr1)r�calculate_timeout_whenr2)r6r.r/r0rr4r<r<rB�
call_laters
r8�	loop_time�timeout_ceiling_thresholdcCs||}||krt|�S|S)z$Calculate when to execute a timeout.r)r9r.r:r4r<r<rBr7sr7c	@s�eZdZdZdZ	ddejdeededdfd	d
�Z	de
dd
ededdfdd�Zddd�Z
deejfdd�Zddd�Zddd�ZdS)�
TimeoutHandlezTimeout handle��_timeout�_loop�_ceil_threshold�
_callbacksr-r/r.�ceil_thresholdr\NcCs||_||_||_g|_dSr]r<)r_r/r.rAr<r<rB�__init__"s
�zTimeoutHandle.__init__�callback).N�args�kwargscOs|j�|||f�dSr])r@r�)r_rCrDrEr<r<rB�register/szTimeoutHandle.registercCs|j��dSr])r@�clearr^r<r<rB�close4�zTimeoutHandle.closecCsJ|j}|dur#|dkr#|j��|}||jkrt|�}|j�||j�SdSr1)r=r>rr?rr2�__call__)r_r.r4r<r<rB�start7s
zTimeoutHandle.start�BaseTimerContextcCs4|jdur|jdkrt|j�}|�|j�|St�Sr1)r=�TimerContextr>rFr.�	TimerNoop)r_�timerr<r<rBrOAs

zTimeoutHandle.timerc	CsV|jD] \}}}tt��||i|��Wd�n1swYq|j��dSr])r@rr)rG)r_r6rDrEr<r<rBrJIs
��zTimeoutHandle.__call__�r-�r\N)r\rL)rarbrcr��	__slots__�asyncio�AbstractEventLoopr�floatrBrr
rFrH�TimerHandlerKrOrJr<r<r<rBr;s4����
�
���
�


r;c@seZdZdZddd�ZdS)rLr<r\NcCsdS)z0Raise TimeoutError if timeout has been exceeded.Nr<r^r<r<rB�assert_timeoutUszBaseTimerContext.assert_timeoutrQ)rarbrcrRrWr<r<r<rBrLQsrLc@sHeZdZdZdefdd�Zdeeedeedee	ddfd	d
�Z
dS)rNr<r\cCs|Sr]r<r^r<r<rB�	__enter__]�zTimerNoop.__enter__�exc_type�exc_val�exc_tbNcC�dSr]r<)r_rZr[r\r<r<rB�__exit__`szTimerNoop.__exit__)rarbrcrRrLrXrr�
BaseExceptionr	r^r<r<r<rBrNYs
����rNc	@sxeZdZdZdZdejddfdd�Zddd	�Zde	fd
d�Z
deee
d
ee
deedeefdd�Zddd�ZdS)rMz&Low resolution timeout context manager�r>�_tasks�
_cancelled�_cancellingr/r\NcCs||_g|_d|_d|_dS)NFrr`)r_r/r<r<rBrBns
zTimerContext.__init__cCs|jrtjd�dS)z7Raise TimeoutError if timer has already been cancelled.N)rbrS�TimeoutErrorr^r<r<rBrWts�zTimerContext.assert_timeoutcCsPtj|jd�}|durtd��tjdkr|��|_|jr tj	d�|j
�|�|S)N)r/z4Timeout context manager should be used inside a taskr()rS�current_taskr>r��sys�version_info�
cancellingrcrbrdrar��r_�taskr<r<rBrXys

zTimerContext.__enter__rZr[r\cCsXd}|jr
|j��}|tjur*|jr*|dusJ�tjdkr&|��|jkr&dStj	|�dS)Nr()
ra�poprS�CancelledErrorrbrfrg�uncancelrcrd)r_rZr[r\�
enter_taskr<r<rBr^�s

zTimerContext.__exit__cCs,|jst|j�D]}|��qd|_dSdS�NT)rbr�ra�cancelrir<r<rBr.�s


�zTimerContext.timeoutrQ)rarbrcr�rRrSrTrBrWrLrXrrr_r	�boolr^r.r<r<r<rBrMis 

���
�rM�delayrAcCsL|dus|dkr
t�d�St��}|��}||}||kr!t|�}t�|�Sr1)�
async_timeoutr.rS�get_running_looprr�
timeout_at)rrrAr/rr4r<r<rB�ceil_timeout�s

rvc@s�eZdZUdZegd��Zeeed<dZ	e
eed<dZe
eeefed<e
Zeedefed<de
ed	dfd
d�Zed	efdd
��Zed	e
efdd��Zed	e
efdd��ZdS)�HeadersMixinzMixin for handling headers.)�
_content_type�
_content_dict�_stored_content_type�_headersNrxryrz�rawr\cCsX||_|durd|_i|_dSt��d|�}|��|_|�d�}t|dd��|_dS)Nzapplication/octet-streamzContent-Type: r<r%)rzrxryr�parsestr�get_content_type�
get_params�dict)r_r|�msgr�r<r<rB�_parse_content_type�s


z HeadersMixin._parse_content_typecCs6|j�tj�}|j|kr|�|�|jdusJ�|jS)z7The value of content part for Content-Type HTTP header.N)r{r�r&�CONTENT_TYPErzr�rx�r_r|r<r<rB�content_type�s


zHeadersMixin.content_typecCs<|j�tj�}|j|kr|�|�|jdusJ�|j�d�S)z7The value of charset part for Content-Type HTTP header.N�charset)r{r�r&r�rzr�ryr�r<r<rBr��s


zHeadersMixin.charsetcCs"|j�tj�}|dur
dSt|�S)z(The value of Content-Length HTTP header.N)r{r�r&�CONTENT_LENGTHr)r_�content_lengthr<r<rBr��szHeadersMixin.content_length)rarbrcr��	frozenset�ATTRSr!r�r�rxrryr
r5rzrr4r��propertyr�r�rr�r<r<r<rBrw�s
rw�futzasyncio.Future[_T]�resultcCs|��s|�|�dSdSr])�done�
set_result)r�r�r<r<rBr��s�r�c@s&eZdZ	ddededdfdd�ZdS)	�ErrorableProtocol.�exc�	exc_causer\NcCr]r]r<)r_r�r�r<r<rB�
set_exception�szErrorableProtocol.set_exception�.)rarbrcr_r�r<r<r<rBr��s����r�z&asyncio.Future[_T] | ErrorableProtocolr�r�cCsBt�|�r|��rdS|tu}||u}|s|s||_|�|�dS)z�Set 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)rS�isfuturer��
_EXC_SENTINEL�	__cause__r�)r�r�r��exc_is_sentinel�exc_causes_itselfr<r<rBr��sr�c@s^eZdZUdZdZeeed<ddede	ee
fdd�Zd	ed
efdd�Z
d
efd
d�ZdS)�AppKeyz.Keys for static typing support in Application.)�_name�_t�__orig_class__r�Nr��tcCsFt��}|r|jjdkr|jd}n|j}|s|d||_||_dS)Nz<module>rar)�inspect�currentframe�f_code�co_name�	f_globals�f_backr�r�)r_r�r��frame�moduler<r<rBrBs
�
zAppKey.__init__�otherr\cCst|t�r|j|jkSdSro)r�r�r�)r_r�r<r<rB�__lt__%s
z
AppKey.__lt__cCs�|j}|dur"tt��t|j�d}Wd�n1swY|dur)d}nt|t�rA|jdkr7|j}n|j�d|j��}nt	|�}d|j
�d|�d�S)Nrz<<Unknown>>�builtinsrz<AppKey(z, type=z)>)r�r�AttributeErrorrr�r�r�rbrc�reprr�)r_r��t_reprr<r<rB�__repr__*s
�

zAppKey.__repr__r])rarbrcr�rRr�objectr�r�rr2rBrqr�r�r<r<r<rBr�s
r�c	@sveZdZdZdeeeeee	fe	fddfdd�Z
ddd�Zed	ee
de
fd
d��Zed	ede	fdd��Zd	eeee
fde	fd
d�Zed	ee
dedee
effdd��Zed d	ee
dddee
fdd��Zed d	ede	de	fdd��Zd!d	eeee
fde	de	fdd�Zdefdd�Zdeeeee	ffdd�Zd	edefdd�Zdefdd�Zdefdd�ZdS)"r,)�_maps�mapsr\NcCst|�|_dSr])�tupler�)r_r�r<r<rBrB@rIzChainMapProxy.__init__cCstd�|j���)Nz4Inheritance class {} from ChainMapProxy is forbidden)r��formatra)rlr<r<rB�__init_subclass__Cs�zChainMapProxy.__init_subclass__r�cCr]r]r<�r_r�r<r<rB�__getitem__IrYzChainMapProxy.__getitem__cCr]r]r<r�r<r<rBr�LrYc	Cs4|jD]}z||WStyYqwt|��r])r�r�)r_r��mappingr<r<rBr�Os
�r�cCr]r]r<�r_r�r�r<r<rBr�WrYzChainMapProxy.get.cCr]r]r<r�r<r<rBr�ZrYcCr]r]r<r�r<r<rBr�]rYcCs"z||WSty|YSwr])r�r�r<r<rBr�`s

�cCstt�j|j��Sr])�lenr��unionr�r^r<r<rB�__len__fszChainMapProxy.__len__cCs&i}t|j�D]}|�|�qt|�Sr])�reversedr��update�iter)r_�dr�r<r<rB�__iter__jszChainMapProxy.__iter__cst�fdd�|jD��S)Nc3s�|]}�|vVqdSr]r<)r@�m�r�r<rBr�rs�z-ChainMapProxy.__contains__.<locals>.<genexpr>��anyr�r�r<r�rB�__contains__qszChainMapProxy.__contains__cCs
t|j�Sr]r�r^r<r<rB�__bool__ts
zChainMapProxy.__bool__cCsd�tt|j��}d|�d�S)Nz, zChainMapProxy(rI)r��mapr�r�)r_r�r<r<rBr�wszChainMapProxy.__repr__rQr�r])rarbrcrRrrrr�r�r
rBr�rr2r�r3r�rrr�rr�r�rqr�r�r�r<r<r<rBr,=s**
$"$r,z[!\x23-\x7E\x80-\xff]+z(W/)?"(z)"z)(?:\s*,\s*|$)|(.)r�c@s"eZdZUeed<dZeed<dS)r-r�F�is_weakN)rarbrcr�r�r�rqr<r<r<rBr-�r�r-r�cCs*|tkrt�|�std|�d���dSdS)NzValue z, is not a valid etag. Maybe it contains '"'?)�ETAG_ANY�	_ETAGC_RE�	fullmatchri)r�r<r<rB�validate_etag_value�s

��r��date_strcCs`|dur.t|�}|dur.tt��tj|dd�dtjji�Wd�S1s)wYdS)z/Process a date string, return a datetime objectN��tzinfo)rrri�datetime�timezone�utc)r��	timetupler<r<rB�parse_http_date�s
 �r��method�codecCs2|tvp|tvpd|kodkno|tjvS)z-Check if a request must return an empty body.r9�,)�EMPTY_BODY_STATUS_CODES�EMPTY_BODY_METHODSr&�METH_CONNECT_ALL�r�r�r<r<rB�must_be_empty_body�s
� �r�cCs*|tvpd|ko
dkno|tjvS)zrCheck if a Content-Length header should be removed.

    This should always be a subset of must_be_empty_body
    r9r�)r�r&r�r�r<r<rB�should_remove_content_length�s �r�r])Tr�)r'r(r\NrP)�r�rSrvrzr�r��enum�	functoolsr�r�r��platform�rerfrr3�collectionsrr�email.parserr�email.utilsr�mathr�pathlibr�typesr	�typingr
rrr
rrrrrrrrrrrrrr�urllib.parser�urllib.requestrr�attr�	multidictrr r!�
propcache.apir"r.�yarlr$rdr&�logr'rgrs�__all__�system�IS_MACOSr��PY_310�PY_311r2r3�Enumr4r5rqr�r��
NO_EXTENSIONSr��ranger��
METH_HEAD_ALLr��flags�dev_mode�ignore_environment�DEBUG�CHARr>�CTL�
SEPARATORSr�r[r+r�r��sr�r�r�r�r�r��	lru_cacher�r��compiler�r�r�r�rrrr�rr&r,r�rUrTrVr5r8r7r;rLrNrM�Timeoutrvrwr�r_r�r�r��total_orderingr�r,�_ETAGCr��_QUOTED_ETAG�QUOTED_ETAG_RE�LIST_QUOTED_ETAG_REr�r-r�r�r�r�r<r<r<rB�<module>stP




���?	+
 '
�����
�3

(
������
��
����
�
���
�4B���
�/����
�$.@