HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/aiohttp/__pycache__/helpers.cpython-310.pyc
o

;j���@sxUdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZddlmZmZmZmZmZddlmZddlmZddlmZddlmZdd	l m!Z!dd
l"m#Z#ddl$m%Z%ddl&m'Z'm(Z(dd
l)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1ddl2m3Z3ddl4m5Z5m6Z6ddl7Z7ddl8m9Z9m:Z:m;Z;ddl<m=Z>ddl?m@Z@ddlAmBZBddlCmDZDe
jEdkr�ddlZFnddlFZFdZGe�H�dkZIe�H�dkZJe
jEdkZKdZLe/d�ZMe/d�ZNe�Odd�ZPePjQZQeRe
jS�Td��ZUeVd d!geWd"d#��R�ZXeBjYZZe
j[j\�p.e
j[j]�o.eRe
jS�Td$��Z^d%d&�eWdd'�D�Z_d(d&�eWdd)�D�e`d*�hBZad+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<e`d=�hZbe_eaAebAZcGd>d?�d?�Zdd�dBeedCeedDeedEeefdFdG�ZfGdHdI�dIedIgdJ���Zg	Kd�dBeedCeedDeedEegfdLdM�ZhdNe@dEeie@egdBffdOdP�ZjdEe	j	dBfdQdR�Zke7jldSdSdSdT�GdUdV�dV��ZmdWe	j	dBdXeedEegfdYdZ�ZndEeoeeemffd[d\�ZpdNe@dEeie@egdBffd]d^�Zqe7jldSdSdSdT�Gd_d`�d`��Zrejsdadb�dceedEerfddde��ZtGdfdg�dge�Zuejsdadb�dheedEeieee'eeeefffdidj��Zvd�dke*dleedBdEeedBfdmdn�Zwe�xdo�Zydpd&�eWd)d*�D�dqhBZzdreedEeefdsdt�Z{	Ad�dueedveRdweedxeedEeef
dydz�Z|dXeedBdEeRfd{d|�Z}dXeedEeRfd}d~�Z~dae�dBe�d<d@a�dEeefd�d��Z�d�d�d��Z�	�d�d�e�d�eed�e�d�ej�d�e�dEej�dBfd�d��Z�	�d�d�ege*fd�e�d�ej�d�e�dEej�dBf
d�d��Z�d�e�d�e�d�e�dEe�fd�d��Z�Gd�d��d��Z�Gd�d��d�e+d��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�	�d�d�e�dBd�e�dEeFj�fd�d��Z�Gd�d��d��Z�d�d�d�eMdEdfd�d��Z�e��Z�Gd�d��d�e.�Z�e�fd�d�d�e�d�e�dEdfd�d��Z�ej�Gd�d��d�e,eM��Z�Gd�d��d�e�eM�Z�Gd�d��d�e�eM�Z�Gd�d��d�e�eM�Z�Gd�d��d�eeee�e*Be*f�Z�d�Z�e�xe��Z�d�e��d��Z�e�xe��Z�e�xd+e��d���Z�d�Z�e7jldSdSdSdT�Gd�d��d���Z�d�eedEdfd�d„Z�d�eedBdEejdBfd�dńZ�ejsd�eed�e�dEeRfd�dɄ�Z�d�eed�e�dEeRfd�d˄Z�dS)�zVarious helper functions�N)�
namedtuple)�Callable�	Generator�Iterable�Iterator�Mapping)�suppress)�EmailMessage)�HeaderParser)�HTTP)�	parsedate��ceil)�Path)�MappingProxyType�
TracebackType)�Any�ContextManager�Generic�Optional�Protocol�TypeVar�get_args�overload)�quote)�
getproxies�proxy_bypass)�	MultiDict�MultiDictProxy�MultiMapping)�under_cached_property��URL�)�hdrs)�
client_logger���)�	BasicAuth�
ChainMapProxy�ETag�reify�Darwin�Windowsi�_T�_S�	_SENTINEL�sentinelZAIOHTTP_NO_EXTENSIONS��i0�d��ZPYTHONASYNCIODEBUGcC�h|]}t|��qS���chr��.0�ir7r7�C/opt/saltstack/salt/lib/python3.10/site-packages/aiohttp/helpers.py�	<setcomp>V�r>�cCr6r7r8r:r7r7r=r>Wr?� ��(�)�<�>�@�,�;�:�\�"�/�[�]�?�=�{�}� �	c@seZdZdedfdd�ZdS)�noop�return)NNNccs�dVdS�Nr7��selfr7r7r=�	__await__ss�
znoop.__await__N)�__name__�
__module__�__qualname__rr[r7r7r7r=rVrsrV��utf-8�login�password�encodingrWcCs8d|vrtd��|�d|���|�}dt�|��|�S)z�Encode HTTP Basic Authentication credentials as an Authorization header value.

    Returns a string of the form ``"Basic <base64>"`` suitable for use as the
    value of the ``Authorization`` (or ``Proxy-Authorization``) header.
    rJz2A ":" is not allowed in login (RFC 7617#section-2)zBasic )�
ValueError�encode�base64�	b64encode�decode)rarbrcZcredsr7r7r=�encode_basic_authwsric	s�eZdZdZ	ddedededdf�fdd	�
Zedd
ededdfdd��Zedd
�dedede	dfdd��Z
defdd�Z�ZS)r)z!Http basic authentication helper.r_�latin1rarbrcrWcsR|durtd��|durtd��d|vrtd��tjdtdd�t��||||�S)Nz"None is not allowed as login valuez%None is not allowed as password valuerJz5A ":" is not allowed in login (RFC 1945#section-11.1)z�BasicAuth is deprecated and will be removed in aiohttp 4.0; use aiohttp.encode_basic_auth() with headers={'Authorization': ...} instead�)�
stacklevel)rd�warnings�warn�DeprecationWarning�super�__new__)�clsrarbrc��	__class__r7r=rq�s�zBasicAuth.__new__�auth_headercCs�z
|�dd�\}}Wntytd��w|��dkr"td|��ztj|�d�dd��|�}Wntjy=td	��wz
|�d
d�\}}WntyStd��wt	|||�S)z<Create a BasicAuth object from an Authorization HTTP header.rTr#z%Could not parse authorization header.ZbasiczUnknown authorization method %s�asciiT)�validatezInvalid base64 encoding.rJzInvalid credentials.)
�splitrd�lowerrf�	b64decodererh�binascii�Error�_basic_auth_no_warn)rrrurcZ	auth_typeZencoded_credentials�decoded�usernamerbr7r7r=rh�s,�
����zBasicAuth.decode�rc�urlcCsBt|t�s	td��|jdur|jdurdSt|jpd|jpd|�S)zCreate BasicAuth from url.zurl should be yarl.URL instanceNr_)�
isinstancer"�	TypeError�raw_user�raw_passwordr}�userrb)rrr�rcr7r7r=�from_url�s

zBasicAuth.from_urlcCst|j|j|j�S)zEncode credentials.)rirarbrcrYr7r7r=re��zBasicAuth.encode�r_rj)rj)
r\r]r^�__doc__�strrq�classmethodrhr"rr�re�
__classcell__r7r7rsr=r)�s"�����"
r)�rarbrcrjcCst�t|||f�S)z�Construct a BasicAuth without emitting the deprecation warning.

    For internal use only. Bypasses BasicAuth.__new__ so that aiohttp's own
    machinery doesn't trigger deprecation warnings in user code.
    )�tuplerqr)r�r7r7r=r}�sr}r�cCs<|jdur|jdur|dfS|�d�t|jpd|jpd�fS)zIRemove user and password from URL if present and return BasicAuth object.Nr_)r�r�Z	with_userr}r�rb)r�r7r7r=�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.
    ZNETRCNzHCould not resolve home directory when trying to look for .netrc file: %sZ_netrcz.netrczCould not parse .netrc file: %sFzCould not read .netrc file: %s)�os�environ�getr�home�RuntimeErrorr%�debug�
IS_WINDOWS�netrcr�ZNetrcParseError�warning�OSError�
contextlibr�is_file)Z	netrc_envZ
netrc_pathZhome_dir�eZnetrc_existsr7r7r=�netrc_from_env�s@
���	��
�
���r�T)Zauto_attribs�frozen�slotsc@s"eZdZUeed<edBed<dS)�	ProxyInfo�proxyN�
proxy_auth)r\r]r^r"�__annotations__r)r7r7r7r=r��
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.r_)�LookupErrorZauthenticatorsr})r�r�Zauth_from_netrcraZaccountrbrr7r7r=�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�vr7r7r=�
<dictcomp>+s
�z$proxies_from_env.<locals>.<dictcomp>cSsi|]	\}}|t|��qSr7)r�r�r7r7r=r�1s)r�r�z)%s proxies %s are not supported, ignoring)r�itemsr��schemer%r��upperr�r�r�r�)Z
proxy_urlsr��stripped�ret�proto�valr�Zauthr7r7r=�proxies_from_env*s,�
�
�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�Zproxies_in_envZ
proxy_infor7r7r=�get_env_proxy_for_urlDs�r�c@s.eZdZUeed<eed<eed<ded<dS)�MimeType�type�subtype�suffixzMultiDictProxy[str]�
parametersN)r\r]r^r�r�r7r7r7r=r�Rs

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'})

    r_)r�r�r�r�rIr#NrQz "r�*z*/*rM�+)r�rrrx�	partition�addry�strip)r��parts�params�item�key�_�valueZfulltypeZmtype�styper�r7r7r=�parse_mimetypeZs&�
�r�cs,eZdZd�fdd�Zdefdd�Z�ZS)�EnsureOctetStreamrWNcst���|�d�dS�Nzapplication/octet-stream)rp�__init__�set_default_typerYrsr7r=r��s
zEnsureOctetStream.__init__cCsB|�dd���}|�d�\}}}|��}|�d�dkr|��S|S)aRe-implementation from Message

        Returns application/octet-stream in place of plain/text when
        value is wrong.

        The way this class is used guarantees that content-type will
        be present so simplify the checks wrt to the base implementation.
        zcontent-typer_rIrMr#)r�ryr�r��count�get_default_type)rZr��ctyper�r7r7r=�get_content_type�s	z"EnsureOctetStream.get_content_type�rWN)r\r]r^r�r�r�r�r7r7rsr=r��sr��rawcCsFtttd��d|���}|��}|�d�}t|dd��}|t|�fS)z�Parse Content-Type header.

    Returns a tuple of the parsed content type and a
    MappingProxyType of parameters. The default returned value
    is `application/octet-stream`
    )�policyzContent-Type: r7r#N)r
r�r�parsestrr��
get_params�dictr)r��msg�content_typer�Zcontent_dictr7r7r=�parse_content_type�s

r��obj�defaultcCs@t|dd�}|rt|t�r|ddkr|ddkrt|�jS|S)N�namerrE���rF)�getattrr�r�rr�)r�r�r�r7r7r=�guess_filename�s&
r�z[^\041\043-\133\135-\176]cCr6r7r8r:r7r7r=r>�r?�	�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)NrKr)�group)�xr7r7r=�<lambda>�szquoted_string.<locals>.<lambda>)�QCONTENT�setrd�not_qtext_re�sub)r�r7r7r=�
quoted_string�sr��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 rQ�filenamer_r�z"%s"z''r�rKz\\rLz\"z; css�|]}d�|�VqdS)rQN)�join)r;�pairr7r7r=�	<genexpr>�s�z-content_disposition_header.<locals>.<genexpr>)
�TOKENr�rdr�ryr�appendr�r��replace)
r�r�r�r�r�Zlparamsr�r�ZqvalZsparamsr7r7r=�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.
    FrJ�.r_)r��isdigit)r�r7r7r=�
is_ip_address�srcCs�|�d�}t|�dkr
dS|D]5}dt|�krdkr)ndS|��r)|��s,dS|ddkr;t|�dkr;dSt|�dkrDdSqd	S)
z�Check if host is a canonical dotted-quad IPv4 address.

    Rejects the legacy numeric forms that ``socket`` still accepts and
    maps onto an address, e.g. ``2130706433``, ``017700000001``, ``127.1``.
    r��Fr#r'r�0�T)rx�len�isasciir��int)r�r��partr7r7r=�is_canonical_ipv4_addresss
��r�_cached_current_datetimecCs\tt���}|tkr,d}d}t�|�^}}}}}}}	}
d||	|||||||fa|atS)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)r�timer	�gmtime�_cached_formatted_datetime)�nowZ_weekdaynameZ
_monthname�year�month�dayZhh�mm�ss�wd�tailr7r7r=�rfc822_formatted_times �	r(�info�tuple[weakref.ref[object], str]cCsT|\}}|�}|dur(tt��t||��Wd�dS1s!wYdSdSrX)r�	Exceptionr�)r)�refr��obr7r7r=�_weakref_handleDs
"��r.�r-r��timeout�loop�timeout_ceil_thresholdcCsH|dur"|dkr"|��|}||krt|�}|�|tt�|�|f�SdS�Nr)rr�call_atr.�weakrefr,)r-r�r0r1r2�whenr7r7r=�weakref_handleLsr7�cbcCs4|dus|dkr
dS|��}t|||�}|�||�Sr3)r�calculate_timeout_whenr4)r8r0r1r2r r6r7r7r=�
call_later\s
r:�	loop_time�timeout_ceiling_thresholdcCs||}||krt|�S|S)z$Calculate when to execute a timeout.r
)r;r0r<r6r7r7r=r9isr9c	@s�eZdZdZdZ	ddejdedBdeddfd	d
�Zde	dd
e
de
ddfdd�Zddd�Zdej
dBfdd�Zddd�Zddd�ZdS)�
TimeoutHandlezTimeout handle��_timeout�_loop�_ceil_threshold�
_callbacksr/r1r0N�ceil_thresholdrWcCs||_||_||_g|_dSrXr>)rZr1r0rCr7r7r=r�zs
�zTimeoutHandle.__init__�callback).N�args�kwargscOs|j�|||f�dSrX)rBr�)rZrDrErFr7r7r=�register�szTimeoutHandle.registercCs|j��dSrX)rB�clearrYr7r7r=�close��zTimeoutHandle.closecCsJ|j}|dur#|dkr#|j��|}||jkrt|�}|j�||j�SdSr3)r?r@rrArr4�__call__)rZr0r6r7r7r=�start�s
zTimeoutHandle.start�BaseTimerContextcCs4|jdur|jdkrt|j�}|�|j�|St�Sr3)r?�TimerContextr@rGr0�	TimerNoop)rZ�timerr7r7r=rP�s

zTimeoutHandle.timerc	CsV|jD] \}}}tt��||i|��Wd�n1swYq|j��dSrX)rBrr+rH)rZr8rErFr7r7r=rK�s
��zTimeoutHandle.__call__�r/r�)rWrM)r\r]r^r��	__slots__�asyncio�AbstractEventLoop�floatr�rrrGrI�TimerHandlerLrPrKr7r7r7r=r=us4����
�
���
�


r=c@seZdZdZddd�ZdS)rMr7rWNcCsdS)z0Raise TimeoutError if timeout has been exceeded.Nr7rYr7r7r=�assert_timeout�szBaseTimerContext.assert_timeoutr�)r\r]r^rRrWr7r7r7r=rM�srMc@sHeZdZdZdefdd�ZdeedBdedBdedBddfd	d
�Z	dS)rOr7rWcCs|SrXr7rYr7r7r=�	__enter__��zTimerNoop.__enter__�exc_typeN�exc_val�exc_tbcC�dSrXr7)rZrZr[r\r7r7r=�__exit__�szTimerNoop.__exit__)
r\r]r^rRrMrXr��
BaseExceptionrr^r7r7r7r=rO�s
����rOc	@sxeZdZdZdZdejddfdd�Zddd	�Zde	fd
d�Z
deedBd
edBde
dBdedBfdd�Zddd�ZdS)rNz&Low resolution timeout context manager�r@�_tasks�
_cancelled�_cancellingr1rWNcCs||_g|_d|_d|_dS)NFrr`)rZr1r7r7r=r��s
zTimerContext.__init__cCs|jrtjd�dS)z7Raise TimeoutError if timer has already been cancelled.N)rbrS�TimeoutErrorrYr7r7r=rW�s�zTimerContext.assert_timeoutcCsPtj|jd�}|durtd��tjdkr|��|_|jr tj	d�|j
�|�|S)N)r1z4Timeout context manager should be used inside a taskr&)rSZcurrent_taskr@r��sys�version_infoZ
cancellingrcrbrdrar��rZZtaskr7r7r=rX�s

zTimerContext.__enter__rZr[r\cCsXd}|jr
|j��}|tjur*|jr*|dusJ�tjdkr&|��|jkr&dStj	|�dS)Nr&)
ra�poprSZCancelledErrorrbrerfZuncancelrcrd)rZrZr[r\Z
enter_taskr7r7r=r^�s

zTimerContext.__exit__cCs,|jst|j�D]}|��qd|_dSdS�NT)rbr�ra�cancelrgr7r7r=r0�s


�zTimerContext.timeoutr�)r\r]r^r�rRrSrTr�rWrMrXr�r_r�boolr^r0r7r7r7r=rN�s 

���
�rN�delayrCcCsL|dus|dkr
t�d�St��}|��}||}||kr!t|�}t�|�Sr3)�
async_timeoutr0rSZget_running_looprrZ
timeout_at)rlrCr1r r6r7r7r=�ceil_timeouts

rnc@s�eZdZUdZegd��Zeeed<dZ	edBed<dZ
eeefdBed<eZ
edBeBed<dedBd	dfd
d�Zed	efdd
��Zed	edBfdd��Zed	edBfdd��ZdS)�HeadersMixinzMixin for handling headers.)�
_content_type�
_content_dict�_stored_content_type�_headersNrprqrrr�rWcCs>||_|durd|_i|_dSt|�\}}||_|��|_dSr�)rrrprqr��copy)rZr�r�Zcontent_mapping_proxyr7r7r=�_parse_content_types
z HeadersMixin._parse_content_typecCs6|j�tj�}|j|kr|�|�|jdusJ�|jS)z7The value of content part for Content-Type HTTP header.N)rsr�r$�CONTENT_TYPErrrurp�rZr�r7r7r=r�&s


zHeadersMixin.content_typecCs<|j�tj�}|j|kr|�|�|jdusJ�|j�d�S)z7The value of charset part for Content-Type HTTP header.N�charset)rsr�r$rvrrrurqrwr7r7r=rx/s


zHeadersMixin.charsetcCs"|j�tj�}|dur
dSt|�S)z(The value of Content-Length HTTP header.N)rsr�r$ZCONTENT_LENGTHr)rZ�content_lengthr7r7r=ry8szHeadersMixin.content_length)r\r]r^r��	frozensetZATTRSrr�r�rprqr�r2rrr1ru�propertyr�rxrryr7r7r7r=ros
ro�futzasyncio.Future[_T]�resultcCs|��s|�|�dSdSrX)�done�
set_result)r|r}r7r7r=r?s�rc@s&eZdZ	ddededdfdd�ZdS)	�ErrorableProtocol.�exc�	exc_causerWNcCr]rXr7)rZr�r�r7r7r=�
set_exceptionHszErrorableProtocol.set_exception�.)r\r]r^r_r�r7r7r7r=r�Gs����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)rSZisfuturer~�
_EXC_SENTINEL�	__cause__r�)r|r�r�Zexc_is_sentinelZexc_causes_itselfr7r7r=r�Osr�c@s^eZdZUdZdZeeed<ddedee	dBfdd�Z
d	ed
efdd�Zd
efd
d�Z
dS)�BaseKeyz�Base for concrete context storage key classes.

    Each storage is provided with its own sub-class for the sake of some additional type safety.
    )�_name�_t�__orig_class__r�Nr��tcCsFt��}|r|jjdkr|jd}n|j}|s|d||_||_dS)Nz<module>r\r�)�inspect�currentframe�f_code�co_name�	f_globals�f_backr�r�)rZr�r��frame�moduler7r7r=r�ts
�
zBaseKey.__init__�otherrWcCst|t�r|j|jkSdSri)r�r�r�)rZr�r7r7r=�__lt__�s
zBaseKey.__lt__cCs�|j}|dur"tt��t|j�d}Wd�n1swY|dur)d}nt|t�rA|jdkr7|j}n|j�d|j��}nt	|�}d|j
j�d|j�d|�d�S)	Nrz<<Unknown>>�builtinsr�rErCz, type=z)>)
r�r�AttributeErrorrr�r�r�r]r^�reprrtr\r�)rZr�Zt_reprr7r7r=�__repr__�s
�

zBaseKey.__repr__rX)r\r]r^r�rRr��objectr�r�r/r�rkr�r�r7r7r7r=r�fs
r�c@�eZdZdZdS)�AppKeyz.Keys for static typing support in Application.N�r\r]r^r�r7r7r7r=r���r�c@r�)�
RequestKeyz*Keys for static typing support in Request.Nr�r7r7r7r=r��r�r�c@r�)�ResponseKeyz+Keys for static typing support in Response.Nr�r7r7r7r=r��r�r�c	@sbeZdZdZdeeeeeBefddfdd�Z	ddd�Z
ed	eedefd
d��Z
ed	edefdd��Z
d	eeeBdefd
d�Z
ed	eededeeBfdd��Zed d	eedddedBfdd��Zed d	ededefdd��Zd!d	eeeBdedefdd�Zdefdd�ZdeeeeBfdd�Zd	edefdd�Zdefdd�Zdefdd�ZdS)"r*)�_maps�mapsrWNcCst|�|_dSrX)r�r�)rZr�r7r7r=r��rJzChainMapProxy.__init__cCstd|j�d���)NzInheritance class z  from ChainMapProxy is forbidden)r�r\)rrr7r7r=�__init_subclass__�s�zChainMapProxy.__init_subclass__r�cCr]rXr7�rZr�r7r7r=�__getitem__�rYzChainMapProxy.__getitem__cCr]rXr7r�r7r7r=r��rYc	Cs4|jD]}z||WStyYqwt|��rX)r�r�)rZr��mappingr7r7r=r��s
�r�cCr]rXr7�rZr�r�r7r7r=r��rYzChainMapProxy.get.cCr]rXr7r�r7r7r=r��rYcCr]rXr7r�r7r7r=r��rYcCs"z||WSty|YSwrX)r�r�r7r7r=r��s

�cCstt�j|j��SrX)rr��unionr�rYr7r7r=�__len__�r�zChainMapProxy.__len__cCs&i}t|j�D]}|�|�qt|�SrX)�reversedr��update�iter)rZ�dr�r7r7r=�__iter__�szChainMapProxy.__iter__cst�fdd�|jD��S)Nc3s�|]}�|vVqdSrXr7)r;�m�r�r7r=r��s�z-ChainMapProxy.__contains__.<locals>.<genexpr>��anyr�r�r7r�r=�__contains__�szChainMapProxy.__contains__cCs
t|j�SrXr�rYr7r7r=�__bool__�s
zChainMapProxy.__bool__cCsd�tt|j��}d|�d�S)Nz, zChainMapProxy(rD)r��mapr�r�)rZr�r7r7r=r��szChainMapProxy.__repr__r�r�rX)r\r]r^rRrrr�r�rr�r�rr/r�r0r�rr�rr�r�rkr�r�r�r7r7r7r=r*�s*&
 " r*z[!\x23-\x7E\x80-\xff]+z(W/)?"(z)"z)(?:\s*,\s*|$)|(.)r�c@s"eZdZUeed<dZeed<dS)r+r�F�is_weakN)r\r]r^r�r�r�rkr7r7r7r=r+�r�r+r�cCs*|tkrt�|�std|�d���dSdS)NzValue z, is not a valid etag. Maybe it contains '"'?)�ETAG_ANY�	_ETAGC_RE�	fullmatchrd)r�r7r7r=�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)rrrd�datetime�timezone�utc)r��	timetupler7r7r=�parse_http_date�s
 �r��method�codecCs2|tvp|tvpd|kodkno|tjvS)z-Check if a request must return an empty body.r5�,)�EMPTY_BODY_STATUS_CODES�EMPTY_BODY_METHODSr$�METH_CONNECT_ALL�r�r�r7r7r=�must_be_empty_bodys
� �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
    r5r�)r�r$r�r�r7r7r=�should_remove_content_length
s �r�)r_r`r�rX)Tr`)r)r*rWNrQ)�r�rSrfr{r�r��enum�	functoolsr�r�r��platform�rererrmr5�collectionsr�collections.abcrrrrrr�
email.messager	�email.parserr
�email.policyr�email.utilsr�mathr�pathlibr�typesrr�typingrrrrrrrr�urllib.parser�urllib.requestrr�attrZ	multidictrrrZ
propcache.apir r,Zyarlr"r_r$�logr%rfrm�__all__�systemZIS_MACOSr�ZPY_311ZDEFAULT_CHUNK_SIZEr/r0�Enumr1r2rkr�r�Z
NO_EXTENSIONSrz�ranger�Z
METH_HEAD_ALLr��flags�dev_mode�ignore_environment�DEBUGZCHARr9ZCTLZ
SEPARATORSr�rVr�rir)r}r�r�r��sr�r�r�r�r�r��	lru_cacher�r�r�r��compiler�r�r�r�rrr	rr�rr(r.r�rUrTrVr7r:r9r=rMrOrNZTimeoutrnrorr_r�r�r��total_orderingr�r�r�r�r*Z_ETAGCr�Z_QUOTED_ETAGZQUOTED_ETAG_REZLIST_QUOTED_ETAG_REr�r+r�r�r�r�r7r7r7r=�<module>s�(




���F����
�	+
'
$ 
�����
�3

(
������
��
����
�
���
�4B���
�/����
�1 ?