Your IP : 3.145.88.104


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/yarl/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/yarl/__pycache__/_url.cpython-311.pyc

�

R�Dg/�����ddlZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZmZm
Z
mZmZmZddlZddlmZmZddlmZmZd	d
d	d
d�Ze��Zded
efd�ZGd�d��Zd�ZeGd�d����Zd�ZdZ ej!e ��d���a"ej!e ��d���a#ed���Z$ed���Z%ee e d�d���Z&dS)�N)�Mapping�Sequence)�suppress)�
ip_address)�SplitResult�	parse_qsl�quote�urljoin�urlsplit�
urlunsplit)�	MultiDict�MultiDictProxy�)�_Quoter�	_Unquoter�Pi�)�http�https�ws�wss�obj�returnc��d|_|S)N�yarl)�
__module__)rs �k/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/yarl/_url.py�rewrite_modulers���C�N��J�c�(�eZdZdZd�Zefd�Zd�ZdS)�cached_propertyaRUse as a class method decorator.  It operates almost exactly like
    the Python `@property` decorator, but it puts the result of the
    method it decorates into the instance dict after the first call,
    effectively replacing the function it decorates with an instance
    variable.  It is, in Python parlance, a data descriptor.

    c�v�||_	|j|_n#t$r
d|_YnwxYw|j|_dS)N�)�wrapped�__doc__�AttributeError�__name__�name)�selfr#s  r�__init__zcached_property.__init__!sM�����	�"�?�D�L�L���	�	�	��D�L�L�L�	�����$��	�	�	s��*�*c��|�|S|j�|j|��}||ur|S|�|��}||j|j<|S�N)�_cache�getr'r#)r(�inst�owner�	_sentinel�vals     r�__get__zcached_property.__get__)sW���<��K��k�o�o�d�i��3�3���i����J��l�l�4� � ��!$���D�I���
rc� �td���)Nzcached property is read-only)r%)r(r.�values   r�__set__zcached_property.__set__3s���;�<�<�<rN)r&r�__qualname__r$r)�sentinelr2r5�rrr r sU��������%�%�%�.6�����=�=�=�=�=rr c��g}|D]d}|dkrAtt��5|���ddd��n#1swxYwY�I|dkr|�|���e|r|ddvr|�d��|S)z1Drop '.' and '..' from a sequence of str segments�..N�.����r;r:r")r�
IndexError�pop�append)�segments�
resolved_path�segs   r�_normalize_path_segmentsrD7s����M��&�&���$�;�;��*�%�%�
$�
$��!�!�#�#�#�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$�
$����
$�
$�
$�
$��
�C�Z�Z�� � ��%�%�%���!�H�R�L�K�/�/�	���R� � � ��s�A�A	�	A	c
�n�eZdZdZed���Ze��Zeddd���Zedd���Zedd	d
d���Z	edd	d
���Z
edd
d�
��Zedd���Zed���Z
e��Zed���Zed
���Zdaddd�d�Zedddddddddddd�d���Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!�Zd"�Zd#�Zd$�Z d%e!fd&�Z"d'�Z#d(�Z$d)�Z%d*�Z&d+�Z'd,�Z(e)d-���Z*e)d.���Z+e,d/���Z-e)d0���Z.e,d1���Z/e)d2���Z0e,d3���Z1e)d4���Z2e,d5���Z3e)d6���Z4e)d7���Z5e)d8���Z6e,d9���Z7e,d:���Z8e)d;���Z9e,d<���Z:e,d=���Z;e,d>���Z<e)d?���Z=e,d@���Z>e,dA���Z?e,dB���Z@e,dC���ZAe,dD���ZBe,dE���ZCe,dF���ZDe,dG���ZEe,dH���ZFe,dI���ZGeHdJ���ZIdbdK�ZJedL���ZKedbdM���ZLe	dcdN���ZMdO�ZNdP�ZOdQ�ZPdR�ZQdS�ZRddT�dU�ZSedV���ZTeHdW���ZUdX�ZVdY�ZWdZ�ZXd[�ZYd\�ZZd]�Z[d^�Z\ddT�d_�Z]d`�Z^dS)d�URL)r,�_valF)�requotez@:z/+)�safe�	protectedrH)rIrJz?/:@z=+&;T)rIrJ�qsrH)rIrJrK)rIrKrH)rIrH)rI�+)�unsafe)rKr"N)�encoded�strictc���|�tjd��t|��|ur|St|��turt	|��}nit|��t
ur|st
d���nAt|t��rt	t|����}ntd���|�s
|dsd}d}nh|j	}|�t
d���	|j
}n"#t$r}t
d��|�d}~wwxYw|�|j|j
||dd�	��}|�|d
��}|r|�|��}|�||���|�|d��}	|�|d
��}
t|d|||	|
��}t&�|��}||_i|_|S)Nzstrict parameter is ignoredz$Cannot apply decoding to SplitResultz#Constructor parameter should be strrr"z/Invalid URL: host is required for absolute urlsz/Invalid URL: port can't be converted to integerT)�encoderH���host�path��r)�warnings�warn�type�strrr�
ValueError�
isinstance�	TypeError�hostname�port�_make_netloc�username�password�_PATH_REQUOTER�_normalize_path� _validate_authority_uri_abs_path�_QUERY_REQUOTER�_FRAGMENT_REQUOTER�object�__new__rGr,)�clsr1rNrO�netlocrTr`�erU�query�fragmentr(s            rrjzURL.__new__�s�����M�7�8�8�8���9�9�����J���9�9�����3�-�-�C�C�
�#�Y�Y�+�
%�
%��
I� �!G�H�H�H�
I�
��S�
!�
!�	C��3�s�8�8�$�$�C�C��A�B�B�B��	E��q�6�
�������|���<�$�%V�W�W�W���8�D�D��!����$�I�������������
�)�)��L�#�,��d�4�QU�*�����%�%�c�!�f�-�-�D��
1��*�*�4�0�0���0�0�d��0�F�F�F��'�'��A��/�/�E��-�-�c�!�f�5�5�H��c�!�f�f�d�E�8�D�D�C��~�~�c�"�"����	�����s�"C*�*
D	�4D�D	)�scheme�	authority�userrcrTr`rUrn�query_stringrorNc	���|r|s|s|s|rtd���|r|std���|r|	rtd���|�
|�|�|�|	�|
�td���|rG|r|}njtd|ddd��}
|�|
j|
j|
j|
jd���}n(|s	|s|s|sd}n|�||||||�	��}|sm|�|��}|r|�	|��}|�
||�
��|�|	��}	|�|
��}
|t||||	|
��d���}|r|�
|��S|S)zCreates and returns a new URLz@Can't mix "authority" with "user", "password", "host" or "port".z/Can't build URL with "port" but without "host".z6Only one of "query" or "query_string" should be passedNz}NoneType is illegal for "scheme", "authority", "host", "path", "query_string", and "fragment" args, use empty string instead.r"T)rQ)rQ�encode_hostrS�rN)r\r^rrarbrcr_r`�_PATH_QUOTERrerf�
_QUERY_QUOTER�_FRAGMENT_QUOTER�
with_query)rkrprqrrrcrTr`rUrnrsrorNrl�tmp�urls               r�buildz	URL.build�s*��$�	�$�	�(�	�d�	�d�	��S���
��	Q��	Q��O�P�P�P��	W�\�	W��U�V�V�V��N�� ��|��|��#����Q���
�
�
	��
�"���!�"�i��R��<�<���)�)��L�#�,���c�h�t�*������	�h�	�t�	�D�	��F�F��%�%��h��d�w�;�PW�K�&���F��	6��#�#�D�)�)�D��
1��*�*�4�0�0���0�0�d��0�F�F�F��,�,�\�:�:�L��+�+�H�5�5�H��c�����l�H�E�E�t�
�
�
���	��>�>�%�(�(�(��Jrc�(�td|�d����)NzInheriting a class z from URL is forbidden)r^)rks r�__init_subclass__zURL.__init_subclass__s���K�c�K�K�K�L�L�Lrc��|j}|js8|���r$|js|jr|�d���}t
|��S�N�/�rU)rGrU�is_absoluternro�_replacer�r(r1s  r�__str__zURL.__str__ sW���i���x�	)�D�,�,�.�.�	)�C�I�	)���	)��,�,�C�,�(�(�C��#���rc�@�|jj�dt|���d�S)Nz('z'))�	__class__r&r[�r(s r�__repr__zURL.__repr__&s$���.�)�:�:�S��Y�Y�:�:�:�:rc�F�t|���d��S)N�ascii)r[rQr�s r�	__bytes__z
URL.__bytes__)s���4�y�y����(�(�(rc�(�t|��turtS|j}|js*|���r|�d���}|j}|js*|���r|�d���}||kSr�)rZrF�NotImplementedrGrUr�r�)r(�other�val1�val2s    r�__eq__z
URL.__eq__,s����E�{�{�c�!�!�!�!��y���y�	+�T�-�-�/�/�	+��=�=�c�=�*�*�D��z���y�	+�U�.�.�0�0�	+��=�=�c�=�*�*�D��t�|�rc���|j�d��}|�Q|j}|js*|���r|�d���}t
|��x}|jd<|S)N�hashr�r�)r,r-rGrUr�r�r�)r(�retr1s   r�__hash__zURL.__hash__:sm���k�o�o�f�%�%���;��)�C��8�
-�� 0� 0� 2� 2�
-��l�l��l�,�,��(,�S�	�	�1�C�$�+�f�%��
rc�\�t|��turtS|j|jkSr+�rZrFr�rG�r(r�s  r�__le__z
URL.__le__C�(���E�{�{�c�!�!�!�!��y�E�J�&�&rc�\�t|��turtS|j|jkSr+r�r�s  r�__lt__z
URL.__lt__H�(���E�{�{�c�!�!�!�!��y�5�:�%�%rc�\�t|��turtS|j|jkSr+r�r�s  r�__ge__z
URL.__ge__Mr�rc�\�t|��turtS|j|jkSr+r�r�s  r�__gt__z
URL.__gt__Rr�rc�h�t|��turtS|�|f��Sr+)rZr[r��_make_child�r(r's  r�__truediv__zURL.__truediv__Ws/���D�z�z�S� � �!�!������(�(�(rc�,�|�|��Sr+)�update_query)r(rns  r�__mod__zURL.__mod__\s��� � ��'�'�'rrc�|�t|jjp#|jjp|jjp|jj��Sr+)�boolrGrlrUrnror�s r�__bool__zURL.__bool___s8����I��W��	��W�$�)�/�W�T�Y�EW�
�
�	
rc��|jfSr+)rGr�s r�__getstate__zURL.__getstate__ds���	�|�rc��|d�/t|dt��r|dd|_n	|^|_}i|_dS)NrrrG)r]�dictrGr,)r(�state�unuseds   r�__setstate__zURL.__setstate__gsH����8��
�5��8�T� :� :���a���(�D�I�I�!&��D�I������rc��|jduS)z�A check for absolute URLs.

        Return True for absolute ones (having scheme or starting
        with //), False otherwise.

        N)�raw_hostr�s rr�zURL.is_absoluteos���}�D�(�(rc�p�|j�dSt�|j��}|�dS|j|kS)z�A check for default port.

        Return True if port is default for specified scheme,
        e.g. 'http://python.org' or 'http://python.org:80', False
        otherwise.

        NF)r`�
DEFAULT_PORTSr-rp)r(�defaults  r�is_default_portzURL.is_default_portxs=���9���5��#�#�D�K�0�0���?��5��y�G�#�#rc�$�|���std���|jjstd���|j}|�dd|j|j��}|�|ddd���}t|d���S)z}Return an URL with scheme, host and port parts only.

        user, password, path, query and fragment are removed.

        �URL should be absolutezURL should have schemeNr")rlrUrnroTrv)	r�r\rGrprar_r`r�rF)r(�vrlr1s    r�originz
URL.origin�s������!�!�	7��5�6�6�6��y��	7��5�6�6�6��I���"�"�4��q�z�1�6�B�B���j�j��R�r�B�j�G�G���3��%�%�%�%rc��|���std���|j�dd���}t	|d���S)zhReturn a relative part of the URL.

        scheme, user, password, host and port are removed.

        r�r")rprlTrv)r�r\rGr�rFr�s  r�relativezURL.relative�sT�����!�!�	7��5�6�6�6��i� � ��2� �6�6���3��%�%�%�%rc��|jjS)zdScheme for absolute URLs.

        Empty string for relative URLs or URLs starting with //

        )rGrpr�s rrpz
URL.scheme�����y��rc��|jjS)zQEncoded authority part of URL.

        Empty string for relative URLs.

        )rGrlr�s r�
raw_authorityzURL.raw_authority�r�rc�^�|�|j|j|j|jd���S)zQDecoded authority part of URL.

        Empty string for relative URLs.

        F�ru)rarrrcrTr`r�s rrqz
URL.authority�s4��� � ��I�t�}�d�i����!�
�
�	
rc�&�|jj}|sdS|S)zEEncoded user part of URL.

        None if user is missing.

        N)rGrb�r(r�s  r�raw_userzURL.raw_user�s ���i� ���	��4��
rc�6�|�|j��S)zEDecoded user part of URL.

        None if user is missing.

        )�	_UNQUOTERr�r�s rrrzURL.user�s���~�~�d�m�,�,�,rc��|jjS)zMEncoded password part of URL.

        None if password is missing.

        )rGrcr�s r�raw_passwordzURL.raw_password�����y�!�!rc�6�|�|j��S)zMDecoded password part of URL.

        None if password is missing.

        )r�r�r�s rrczURL.password�����~�~�d�/�0�0�0rc��|jjS)zDEncoded host part of URL.

        None for relative URLs.

        )rGr_r�s rr�zURL.raw_host�s���y�!�!rc�B�|j}|�dSd|vr|St|��S)zDDecoded host part of URL.

        None for relative URLs.

        N�%)r��_idna_decode)r(�raws  rrTzURL.host�s3���m���;��4��#�:�:��J��C� � � rc�b�|jjp#t�|jj��S)z�Port part of URL, with scheme-based fallback.

        None for relative URLs or URLs without explicit port and
        scheme without default port substitution.

        )rGr`r�r-rpr�s rr`zURL.ports&���y�~�D��!2�!2�4�9�3C�!D�!D�Drc��|jjS)zyPort part of URL, without scheme-based fallback.

        None for relative URLs or URLs without explicit port.

        )rGr`r�s r�
explicit_portzURL.explicit_port
s���y�~�rc�N�|jj}|s|���rd}|S)zNEncoded path of URL.

        / for absolute URLs without path part.

        r�)rGrUr�r�s  r�raw_pathzURL.raw_paths2���i�n���	�t�'�'�)�)�	��C��
rc�6�|�|j��S)zNDecoded path of URL.

        / for absolute URLs without path part.

        )�_PATH_UNQUOTERr�r�s rrUzURL.path"s���"�"�4�=�1�1�1rc�f�tt|jd�����}t|��S)z�A MultiDictProxy representing parsed query parameters in decoded
        representation.

        Empty value if URL has no query part.

        T��keep_blank_values)r
r�raw_query_stringrr�s  rrnz	URL.query+s/���	�$�"7�4�P�P�P�Q�Q���c�"�"�"rc��|jjS)zOEncoded query part of URL.

        Empty string if query is missing.

        )rGrnr�s rr�zURL.raw_query_string6s���y��rc�6�|�|j��S)zODecoded query part of URL.

        Empty string if query is missing.

        )�_QS_UNQUOTERr�r�s rrszURL.query_string?s��� � ��!6�7�7�7rc�@�|js|jS|j�d|j��S)zDecoded path of URL with query.�?)rsrUr�s r�path_qszURL.path_qsHs0��� �	��9���)�1�1�d�/�1�1�1rc�@�|js|jS|j�d|j��S)zEncoded path of URL with query.r�)r�r�r�s r�raw_path_qszURL.raw_path_qsOs0���$�	!��=� ��-�9�9�$�"7�9�9�9rc��|jjS)zUEncoded fragment part of URL.

        Empty string if fragment is missing.

        )rGror�s r�raw_fragmentzURL.raw_fragmentVr�rc�6�|�|j��S)zUDecoded fragment part of URL.

        Empty string if fragment is missing.

        )r�r�r�s rrozURL.fragment_r�rc�H�|jj}|���r(|sdg}nndg|dd��d��z}nL|�d��r"dg|dd��d��z}n|�d��}t|��S)zjA tuple containing encoded *path* parts.

        ('/',) for absolute URLs if *path* is missing.

        r�rN)rGrUr��split�
startswith�tuple)r(rU�partss   r�	raw_partsz
URL.raw_partshs����y�~�������		(��
4��������Q�R�R����s� 3� 3�3������s�#�#�
(����Q�R�R����s� 3� 3�3����
�
�3�����U�|�|�rc�D��t�fd��jD����S)zjA tuple containing decoded *path* parts.

        ('/',) for absolute URLs if *path* is missing.

        c3�B�K�|]}��|��V��dSr+�r�)�.0�partr(s  �r�	<genexpr>zURL.parts.<locals>.<genexpr>�s/�����E�E�d�T�^�^�D�)�)�E�E�E�E�E�Er)r�r�r�s`rr�z	URL.parts|s*����E�E�E�E�d�n�E�E�E�E�E�Erc�R�|j}|r|dkr;|js|jr+t|j�dd���d���S|S|�d��}|j�d�|dd���dd���}t|d���S)	z]A new URL with last part of path removed and cleaned up query and
        fragment.

        r�r")rnroTrvNr<�rUrnro)r�r�r�rFrGr�r��join)r(rUr�r1s    r�parentz
URL.parent�s����}���	�t�s�{�{�� �
T�D�$9�
T��4�9�-�-�B��-�D�D�d�S�S�S�S��K��
�
�3�����i� � �c�h�h�u�S�b�S�z�&:�&:�"�r� �R�R���3��%�%�%�%rc�t�|j}|���r|dd�}|sdS|dS|dS)zThe last part of raw_parts.rNr"r<)r�r�)r(r�s  r�raw_namezURL.raw_name�sM����������	��!�"�"�I�E��
!��r��R�y� ���9�rc�6�|�|j��S)zThe last part of parts.)r�r�r�s rr'zURL.name�s���~�~�d�m�,�,�,rc��|j}|�d��}d|cxkrt|��dz
kr
nn
||d�SdS)Nr;rrr")r��rfind�len)r(r'�is   r�
raw_suffixzURL.raw_suffix�sV���}���J�J�s�O�O���q� � � � �3�t�9�9�q�=� � � � � �����8�O��2rc�6�|�|j��Sr+)r�rr�s r�suffixz
URL.suffix�s���~�~�d�o�.�.�.rc���|j}|�d��rdS|�d��}td�|�d��dd�D����S)Nr;r8c3� K�|]	}d|zV��
dS�r;Nr8)r�rs  rr�z#URL.raw_suffixes.<locals>.<genexpr>�s&����D�D�f�S�6�\�D�D�D�D�D�Drr)r��endswith�lstripr�r�r�s  r�raw_suffixeszURL.raw_suffixes�sc���}���=�=����	��2��{�{�3�����D�D��
�
�3������0C�D�D�D�D�D�Drc�D��t�fd��jD����S)Nc3�B�K�|]}��|��V��dSr+r�)r�rr(s  �rr�zURL.suffixes.<locals>.<genexpr>�s/�����L�L��T�^�^�F�+�+�L�L�L�L�L�Lr)r�rr�s`r�suffixeszURL.suffixes�s)����L�L�L�L�$�:K�L�L�L�L�L�Lrc��t|��dkr7t|��dkr&|�d��std���dSdSdS)znEnsure that path in URL with authority starts with a leading slash.

        Raise ValueError if not.
        rr�zCPath in a URL with authority should start with a slash ('/') if setN)rr�r\rSs  rrfz$URL._validate_authority_uri_abs_path�sU���t�9�9�q�=�=�S��Y�Y��]�]�4�?�?�3�3G�3G�]��U���
��=�]�]�]�]rc���g}t|��D]�}|s�|ddkrtd|�d����|r|n|�|��}d|vr0|d�t|�d����D��z
}�q|dkr|�|����|���|jj}|r,g|�d���d���|�}|�	��r"t|��}|r|ddkrdg|�}d�|��}t|j�
|dd���d	�
��S)zIadd segments to self._val.path, accounting for absolute vs relative pathsrr�zAppending path z! starting from slash is forbiddenc3�*K�|]}|r
|dk�
|V��dSr	r8)r��subs  rr�z"URL._make_child.<locals>.<genexpr>�s7�������s��GJ�c�z�z�C�z�z�z�z��rr;r"r�Trv)�reversedr\rwr�r@�reverserGrU�rstripr�rDr�rFr�)r(rArN�parsedrC�old_path�new_paths       rr�zURL._make_child�s������H�%�%�
	#�
	#�C��
���1�v��}�}� �N�c�N�N�N����!�<�#�#�d�&7�&7��&<�&<�C��c�z�z����#+�C�I�I�c�N�N�#;�#;������������
�
�c�"�"�"���������9�>���	A�@�x���s�+�+�1�1�#�6�6�@��@�F������	'�-�f�5�5�F��
'�&��)�r�/�/���v����8�8�F�#�#����I���H�B���D�D�d�
�
�
�	
rc��d}|�d��rd}|dd�}|�d��}|d�t|����zS)Nr"r�r)r�r�r�rD)rkrU�prefixrAs    rrezURL._normalize_path�s`�����?�?�3���	��F�����8�D��:�:�c�?�?������!9�(�!C�!C�D�D�D�Drc�<�	|�d��\}}}t|��}|j}|r|d|zz
}|jdkrd|zdz}nM#t$r@|���}|s|���r|cYSt|��}YnwxYw|S)Nr���[�])�	partitionr�
compressed�versionr\�lower�isascii�_idna_encode)rkrT�human�ip�sep�zones      r�_encode_hostzURL._encode_host�s���	(� �N�N�3�/�/�M�B��T��B���B��=�D��
#���d�
�"���z�Q����T�z�C�'�����	&�	&�	&��:�:�<�<�D�
�
������
�������%�%�D�D�D�	&�����s�(A�6B�B�Bc��|r|jn|j}|r|�|��}	n|}	|�|	dzt|��z}	|�(|sd}n
|r||��}|r||��}|dz|z}n|r
|r||��}|r|dz|	z}	|	S)N�:r"�@)�	_REQUOTER�_QUOTERr*r[)
rkrrrcrTr`rQrurH�quoterr�s
          rrazURL._make_netlocs���#*�:����s�{���	��"�"�4�(�(�C�C��C�����)�c�$�i�i�'�C����
(�����(�!�6�$�<�<�D��
,�!�6�(�+�+���#�:��(�D�D�
�	 �f�	 ��6�$�<�<�D��	#���*�s�"�C��
rc��t|t��std���|���st	d���t|j�|������d���S)z&Return a new URL with scheme replaced.zInvalid scheme typez3scheme replacement is not allowed for relative URLs)rpTrv)	r]r[r^r�r\rFrGr�r#)r(rps  r�with_schemezURL.with_scheme(sw���&�#�&�&�	3��1�2�2�2����!�!�	T��R�S�S�S��4�9�%�%�V�\�\�^�^�%�<�<�d�K�K�K�Krc
�v�|j}|�d}nAt|t��r|�|��}|j}ntd���|���std���t|j�	|�
|||j|j�����d���S)z�Return a new URL with user replaced.

        Autoencode user if needed.

        Clear user/password if user is None.

        NzInvalid user typez1user replacement is not allowed for relative URLs�rlTrv)
rGr]r[r/rcr^r�r\rFr�rar_r`)r(rrr1rcs    r�	with_userz
URL.with_user1s����i���<��H�H�
��c�
"�
"�	1��<�<��%�%�D��|�H�H��/�0�0�0����!�!�	R��P�Q�Q�Q���I����(�(��x���s�x�P�P�
�
�
��	
�
�
�	
rc
�n�|�n:t|t��r|�|��}ntd���|���std���|j}t|j�|�	|j
||j|j�����d���S)z�Return a new URL with password replaced.

        Autoencode password if needed.

        Clear password if argument is None.

        NzInvalid password typez5password replacement is not allowed for relative URLsr4Trv)
r]r[r/r^r�r\rGrFr�rarbr_r`)r(rcr1s   r�
with_passwordzURL.with_passwordKs������
��#�
&�
&�	5��|�|�H�-�-�H�H��3�4�4�4����!�!�	V��T�U�U�U��i����I����(�(���x���s�x�X�X�
�
�
��	
�
�
�	
rc
�^�t|t��std���|���st	d���|st	d���|j}t
|j�|�|j	|j
||j�����d���S)z�Return a new URL with host replaced.

        Autoencode host if needed.

        Changing host for relative URLs is not allowed, use .join()
        instead.

        zInvalid host typez1host replacement is not allowed for relative URLszhost removing is not allowedr4Trv)r]r[r^r�r\rGrFr�rarbrcr`)r(rTr1s   r�	with_hostz
URL.with_hostds����$��$�$�	1��/�0�0�0����!�!�	R��P�Q�Q�Q��	=��;�<�<�<��i����I����(�(���s�|�T�3�8�T�T�
�
�
��	
�
�
�	
rc
���|�gt|t��st|t��stdt	|�������|dks|dkrtd|�����|���std���|j}t|j�	|�
|j|j|j
|�����d�	��S)
z`Return a new URL with port replaced.

        Clear port to default if None is passed.

        Nz port should be int or None, got ri��z&port must be between 0 and 65535, got z1port replacement is not allowed for relative URLsr4Trv)r]r��intr^rZr\r�rGrFr�rarbrcr_)r(r`r1s   r�	with_portz
URL.with_port|s������$��%�%�
Q�Z��c�-B�-B�
Q�� O�4��:�:� O� O�P�P�P��a�x�x�4�%�<�<� �!P�$�!P�!P�Q�Q�Q����!�!�	R��P�Q�Q�Q��i����I����(�(���s�|�S�\�SW�X�X�
�
�
��	
�
�
�	
rrvc�"�|s>|�|��}|���r|�|��}t|��dkr|ddkrd|z}t	|j�|dd���d���S)z$Return a new URL with path replaced.rr�r"r�Trv)rwr�rerrFrGr�)r(rUrNs   r�	with_pathz
URL.with_path�s����	2��$�$�T�*�*�D����!�!�
2��+�+�D�1�1���t�9�9�q�=�=�T�!�W��^�^���:�D��4�9�%�%�4�r�B�%�G�G�QU�V�V�V�Vrc#�K�|D]�\}}t|ttf��r5|D]1}||��dz||�|����zV��2�V||��dz||�|����zV���dS)N�=)r]�listr��
_query_var)rkr0�pairs�keyr1r�s      r�_query_seq_pairszURL._query_seq_pairs�s������	F�	F�H�C���#��e�}�-�-�
F��H�H�A� �&��+�+��+�f�f�S�^�^�A�5F�5F�.G�.G�G�G�G�G�G�H��f�S�k�k�C�'�&�&�����1D�1D�*E�*E�E�E�E�E�E�	F�	Frc��t|��}t|t��r|St|t��rbt	j|��rt
d���t	j|��rt
d���tt|����St|t��r%|turtt|����Std�||�����)Nzfloat('inf') is not supportedzfloat('nan') is not supportedzMInvalid variable type: value should be str, int or float, got {!r} of type {})rZ�
issubclassr[�float�math�isinfr\�isnanr;r�r^�format)r�rks  rrBzURL._query_var�s����1�g�g���c�3���	��H��c�5�!�!�	!��z�!�}�}�
B� �!@�A�A�A��z�!�}�}�
B� �!@�A�A�A��u�Q�x�x�=�=� ��c�3���	�C�t�O�O��s�1�v�v�;�;���
����3���
�
�	
rc����|r%t|��dkrtd���|}n+t|��dkr	|d}ntd���|�d}�nt|t��rC�j�d����|�������}n�t|t��r��	|��}nt|tttf��rtd���t|t��r*�j�d���fd�|D����}ntd���|S)Nrz7Either kwargs or single query parameter must be presentr�&zAInvalid query type: bytes, bytearray and memoryview are forbiddenc3�x�K�|]4\}}�|��dz���|����zV��5dS)r@N)rB)r��kr�r0r(s   ��rr�z%URL._get_str_query.<locals>.<genexpr>�s_�������AE��A���q�	�	�C��&�&�����);�);�"<�"<�<������rzRInvalid query type: only str, mapping or sequence of (key, value) pairs is allowed)rr\r]r�_QUERY_PART_QUOTERr�rE�itemsr[rx�bytes�	bytearray�
memoryviewr^r)r(�args�kwargsrnr0s`   @r�_get_str_queryzURL._get_str_query�s������		X��4�y�y�1�}�}� �M�����E�E�
��Y�Y�!�^�^���G�E�E��V�W�W�W��=��E�E�
��w�
'�
'�	��,�F��H�H�T�2�2�6�5�;�;�=�=�I�I�J�J�E�E�
��s�
#�
#�	��&�&�u�-�-�E�E�
���y�*�=�
>�
>�	��S���
���x�
(�
(�
	��,�F�
�H�H������IN������E�E��<���
�
�rc��|j|i|��pd}t|j�|jj|���d���S)a[Return a new URL with query part replaced.

        Accepts any Mapping (e.g. dict, multidict.MultiDict instances)
        or str, autoencode the argument if needed.

        A sequence of (key, value) pairs is supported as well.

        It also can take an arbitrary number of keyword arguments.

        Clear query if None is passed.

        r")rUrnTrv)rXrFrGr�rU)r(rVrW�	new_querys    rrzzURL.with_query�sU��(�D�'��8��8�8�>�B�	���I���D�I�N�)��D�D�d�
�
�
�	
rc�0�|j|i|��}d}|�Gtt|d�����}t|j��}|�|��t|j�|�|��pd���d���S)z)Return a new URL with query part updated.NTr�r")rnrv)rXr
rrn�updaterFrGr�)r(rVrW�srnrZs      rr�zURL.update_query�s����D���0��0�0�����=�!�)�A��"F�"F�"F�G�G�I��d�j�)�)�E��L�L��#�#�#���I���T�%8�%8��%?�%?�%E�2��F�F�PT�
�
�
�	
rc���|�d}n9t|t��std���|�|��}|j|kr|St|j�|���d���S)z�Return a new URL with fragment replaced.

        Autoencode fragment if needed.

        Clear fragment to default if None is passed.

        Nr"zInvalid fragment type)roTrv)r]r[r^ryr�rFrGr�)r(ror�s   r�
with_fragmentzURL.with_fragments~�����L�L��H�c�*�*�	;��3�4�4�4��0�0��:�:�L����,�,��K��4�9�%�%�|�%�<�<�d�K�K�K�Krc�"�t|t��std���d|vrtd���|�|��}|dvrtd���t|j��}|���r4t|��dkr|�	|��n||d<d|d	<n||d<|d	dkrd|d	<t|j�d�
|��dd�
��d���S)
z�Return a new URL with name (last part of path) replaced.

        Query and fragment parts are cleaned up.

        Name is encoded if needed.

        zInvalid name typer�zSlash in name is not allowedr=z. and .. values are forbiddenrr<r"rr�Trv)r]r[r^r\rwrAr�r�rr@rFrGr�r�)r(r'r�s   r�	with_namez
URL.with_names"���$��$�$�	1��/�0�0�0��$�;�;��;�<�<�<�� � ��&�&���;����<�=�=�=��T�^�$�$�������		��5�z�z�Q������T�"�"�"�"� ��b�	��E�!�H�H��E�"�I��Q�x�3�����a����I���C�H�H�U�O�O�2���K�K��
�
�
�	
rc�\�t|t��std���|r|�d��r|dkrt	d|�����|j}|st	|�d����|j}|s||z}n|dt|���|z}|�|��S)z�Return a new URL with suffix (file extension of name) replaced.

        Query and fragment parts are cleaned up.

        suffix is encoded if needed.
        zInvalid suffix typer;zInvalid suffix z has an empty nameN)	r]r[r^r�r\r�rrra)r(rr'�
old_suffixs    r�with_suffixzURL.with_suffix4s����&�#�&�&�	3��1�2�2�2��	;�&�+�+�C�0�0�	;�F�c�M�M��9�v�9�9�:�:�:��}���	<���:�:�:�;�;�;��_�
��	5��&�=�D�D��*�3�z�?�?�*�*�+�f�4�D��~�~�d�#�#�#rc��t|t��std���ttt	|��t	|����d���S)u_Join URLs

        Construct a full (“absolute”) URL by combining a “base URL”
        (self) with another URL (url).

        Informally, this uses components of the base URL, in
        particular the addressing scheme, the network location and
        (part of) the path, to provide missing components in the
        relative URL.

        zurl should be URLTrv)r]rFr^r
r[)r(r|s  rr�zURL.joinIsN���#�s�#�#�	1��/�0�0�0��7�3�t�9�9�c�#�h�h�/�/��>�>�>�>rc�0�|�||���S)zAReturn a new URL with the elements in other appended to the path.rv)r�)r(rNr�s   r�joinpathzURL.joinpathZs������w��7�7�7rc���t|jd��}t|jd��}|j}|r|�|jd���}t|jd��}d�d�|j���D����}t|j	d��}tt|j|�
||||jjd�	��|||����S)
z<Return decoded human readable string for URL representation.z#/:?@T)r&z#?rNc3�K�|]9\}}d�t|d��t|d����V��:dS)z{}={}z#&+;=N)rL�_human_quote)r�rPr�s   rr�z!URL.human_repr.<locals>.<genexpr>fs\���� 
� 
���1�
�N�N�<��7�3�3�\�!�W�5M�5M�N�N� 
� 
� 
� 
� 
� 
rr"Fr�)rjrrrcrTr*rUr�rnrRrorrrprarGr`)r(rrrcrTrUrsros       r�
human_reprzURL.human_repr^s���D�I�w�/�/����
�w�7�7���y���	<��$�$�T�Y�d�$�;�;�D��D�I�t�,�,���x�x� 
� 
��
�(�(�*�*� 
� 
� 
�
�
�� ��
�r�2�2�������!�!�����I�N� %�"������
�
�
�
�	
r)r")F)FTF)_r&rr6�	__slots__rr/r.rwrdrxrgrQryrhrr�r�r�rj�classmethodr}rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��propertyrpr�r rqr�rrr�rcr�rTr`r�r�rUrnr�rsr�r�r�ror�r�r�r�r'rrrr�staticmethodrfr�rer*rar2r5r7r9r<r>rErBrXrzr�r_rardr�rgrkr8rrrFrFOs�������N#�I��g�e�$�$�$�G���	�	�I��7���e�D�D�D�L��W�$�$�7�7�7�N��G��6�d�E�R�R�R�M��g�6�V��E�E�E�O� ��f��u�E�E�E���w�F�E�:�:�:�� ��f�-�-�-���	���I��Y�c�*�*�*�N��9��%�%�%�L�.��d�.�.�.�.�.�`���
��
�
�
�����D�D�D�D��[�D�LM�M�M����;�;�;�)�)�)�������'�'�'�
&�&�&�
'�'�'�
&�&�&�
)�)�)�
(�(�(�
�$�
�
�
�
�
������)�)�)�
$�
$�
$�&�&�&� 	&�	&�	&�� � ��X� �� � ��X� ��
�
��_�
��
�
��X�
��-�-��_�-��"�"��X�"��1�1��_�1��"�"��X�"��!�!��_�!� �E�E��X�E�����X���	�	��X�	��2�2��_�2��#�#��_�#�����X���8�8��_�8��2�2��_�2��:�:��_�:��"�"��X�"��1�1��_�1�����_��&�F�F��_�F��&�&��_�&��
�
��_�
��-�-��_�-�����_���/�/��_�/��E�E��_�E��M�M��_�M�����\��
�
�
�
�@�E�E��[�E������[��*�QV�����[��2L�L�L�
�
�
�4
�
�
�2
�
�
�0
�
�
�,*/�W�W�W�W�W��F�F��[�F��
�
��\�
�$&�&�&�P
�
�
�(
�
�
�L�L�L�&
�
�
�@$�$�$�*?�?�?�"(-�8�8�8�8�8�
�
�
�
�
rrFc���|s|Sd|zD]-}||vr'|�|dt|��d����}�.|���r|Sd�d�|D����S)Nr��02Xr"c3�`K�|])}|���r|nt|��V��*dSr+)�isprintabler	)r��cs  rr�z_human_quote.<locals>.<genexpr>�s9����A�A�!��
�
���5�1�1�U�1�X�X�A�A�A�A�A�Ar)�replace�ordrsr�)r]rMrts   rrjrj|s�������
�6�\�/�/����6�6��	�	�!�-��Q���-�-�-�.�.�A���}�}������
�7�7�A�A�q�A�A�A�A�A�Ar�c���	tj|�d����S#t$r+|�d���d��cYSwxYw)Nr��idna)ry�decoderQ�UnicodeError)r�s rr�r��sd��2��{�3�:�:�g�.�.�/�/�/���2�2�2��z�z�'�"�"�)�)�&�1�1�1�1�1�2���s�&)�2A�Ac���	tj|d����d��S#t$r+|�d���d��cYSwxYw)NT)�uts46r�ry)ryrQrzr{)rTs rr%r%�sk��3��{�4�t�,�,�,�3�3�G�<�<�<���3�3�3��{�{�6�"�"�)�)�'�2�2�2�2�2�3���s�(+�2A �A c�j�t���t���dSr+)r��cache_clearr%r8rrrr�s,���������������rc�h�t���t���d�S)N)�idna_encode�idna_decode)r%�
cache_infor�r8rrr�r��s1��$�.�.�0�0�#�.�.�0�0���r��idna_encode_size�idna_decode_sizec��tj|��tj��atj|��tj��adSr+)�	functools�	lru_cacher%�__wrapped__r�r�s  r�cache_configurer��sD��9�9�&�'7�8�8��9Q�R�R�L�8�9�&�'7�8�8��9Q�R�R�L�L�Lr)'r�rIrX�collections.abcrr�
contextlibr�	ipaddressr�urllib.parserrr	r
rrry�	multidictr
r�_quotingrrr�rir7rr rDrFrj�	_MAXCACHEr�r�r%rr�r�r8rr�<module>r�sV��������������-�-�-�-�-�-�-�-������� � � � � � �U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�����/�/�/�/�/�/�/�/�(�(�(�(�(�(�(�(��c��C�@�@�
��6�8�8�����6�����
=�=�=�=�=�=�=�=�>���0�i
�i
�i
�i
�i
�i
�i
���i
�X!B�B�B�
�	����Y���2�2� ��2����Y���3�3� ��3�������
�������(1�I�S�S�S�S���S�S�Sr

?>