Your IP : 3.149.24.49


Current Path : /opt/alt/python312/lib64/python3.12/urllib/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/urllib/__pycache__/parse.cpython-312.pyc

�

�Q�f����dZddlmZddlZddlZddlZddlZddlZddlZgd�Z	gd�Z
gd�Zgd�Zgd�Z
gd	�Zgd
�ZdZdZgd
�Zd�ZdZdZd�Zeefd�Zeefd�Zd�ZGd�de�ZGd�de�ZGd�de�ZGd�dee�ZGd�dee�Zedd �Z ed!d"�Z!ed#d$�Z"d%e _d&e jF_d'e jH_d(e!_d)e!jJ_d*e!jL_d+e!jN_d,e!jP_d-e!jH_d.e"_e!jJje"jJ_e!jLje"jL_e!jNje"jN_d/e"jR_e!jPje"jP_e!jHje"jH_eZ*Gd0�de e�Z+Gd1�d!e!e�Z,Gd2�d#e"e�Z-Gd3�d4e e�Z.Gd5�d6e!e�Z/Gd7�d8e"e�Z0d9�Z1e1�[1dsd<�Z2d=�Z3dtd>�Z4d?�Z5d@�Z6ejnd;�A�dsdB��Z8dC�Z9dD�Z:dudE�Z;dF�Z<dGZ=da>dH�Z?dIe@eAzeBzdJe@eAzfdK�ZCej�dL�ZEdM�ZFdvdN�ZG		dwdP�ZH		dwdQ�ZIdvdR�ZJeKdS�ZLe@eL�ZMdT�ZNGdU�dVeO�ZPdxdW�ZQdydX�ZRejndY��ZSdzdZ�ZTdOd:ddeRfd[�ZUd\�ZVd]�ZWd^�ZXd_�ZYdaZd`�Z[da�Z\da]db�Z^dc�Z_dd�Z`de�Zadf�Zbdg�Zcdaddh�Zed{di�Zfd{dj�Zgdk�Zhdl�Zidm�Zjdn�Zkdo�Zldp�Zmdq�Zndr�Zoy)|a3Parse (absolute and relative) URLs.

urlparse module is based upon the following RFC specifications.

RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L.  Masinter, January 2005.

RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, December 1999.

RFC 2396:  "Uniform Resource Identifiers (URI)": Generic Syntax by T.
Berners-Lee, R. Fielding, and L. Masinter, August 1998.

RFC 2368: "The mailto URL scheme", by P.Hoffman , L Masinter, J. Zawinski, July 1998.

RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June
1995.

RFC 1738: "Uniform Resource Locators (URL)" by T. Berners-Lee, L. Masinter, M.
McCahill, December 1994

RFC 3986 is considered the current standard and any future changes to
urlparse module should conform with it.  The urlparse module is
currently not entirely compliant with this RFC due to defacto
scenarios for parsing, and for backward compatibility purposes, some
parsing quirks from older RFCs are retained. The testcases in
test_urlparse.py provides a good indicator of parsing behavior.

The WHATWG URL Parser spec should also be considered.  We are not compliant with
it either due to existing user code API behavior expectations (Hyrum's Law).
It serves as a useful guide when making changes.
�)�
namedtupleN)�urlparse�
urlunparse�urljoin�	urldefrag�urlsplit�
urlunsplit�	urlencode�parse_qs�	parse_qsl�quote�
quote_plus�quote_from_bytes�unquote�unquote_plus�unquote_to_bytes�DefragResult�ParseResult�SplitResult�DefragResultBytes�ParseResultBytes�SplitResultBytes)��ftp�http�gopher�nntp�imap�wais�file�https�shttp�mms�prospero�rtsp�rtsps�rtspu�sftp�svn�svn+ssh�ws�wss)rrrrr�telnetrrr r#r!r"�snewsr$r%r&r'�rsyncr)r*r(�nfs�gitzgit+sshr+r,z
itms-services)rr�hdlr$rrr!r"r%r&r'�sip�sipsr#r(�tel)
rr2�mailto�newsr-rrr.r3r4)
rrrrr!r"r#rr%r&r'r3r4)
rrr2rrr7rrr!r"r.r r$zAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!	

 )�	�
�
c�T�tj�tj�y)zDClear internal performance caches. Undocumented; some tests want it.N)r�cache_clear�_byte_quoter_factory���3/opt/alt/python312/lib64/python3.12/urllib/parse.py�clear_cacherA^s�������$�$�&r?�ascii�strictc��|S�Nr>)�objs r@�_nooprGls���Jr?c�&�|j||�SrE��encode)rF�encoding�errorss   r@�_encode_resultrMos���:�:�h��'�'r?c�0���t��fd�|D��S)Nc3�J�K�|]}|r|j���nd���y�w)rN��decode��.0�xrKrLs  ��r@�	<genexpr>z_decode_args.<locals>.<genexpr>us$�����G�$�Q�q����(�F�+�b�8�$�s� #)�tuple)�argsrKrLs ``r@�_decode_argsrXss����G�$�G�G�Gr?c��t|dt�}|ddD]#}|s�t|t�|k7s�td��|r
|tfzSt	|�t
fzS)Nr�z$Cannot mix str and non-str arguments)�
isinstance�str�	TypeErrorrGrXrM)rW�	str_input�args   r@�_coerce_argsr`wsg���4��7�C�(�I��A�B�x���:�c�3�'�9�4��B�C�C�	�
��u�h������� 1�1�1r?c��eZdZdZdZdd�Zy)�_ResultMixinStrz>Standard approach to encoding parsed results from str to bytesr>c�8���|j��fd�|D��S)Nc3�B�K�|]}|j������y�wrErIrRs  ��r@rUz)_ResultMixinStr.encode.<locals>.<genexpr>�������*T�t�!�1�8�8�H�f�+E�t���)�_encoded_counterpart��selfrKrLs ``r@rJz_ResultMixinStr.encode�����(�t�(�(�*T�t�*T�U�Ur?N�rBrC)�__name__�
__module__�__qualname__�__doc__�	__slots__rJr>r?r@rbrb����H��I�Vr?rbc��eZdZdZdZdd�Zy)�_ResultMixinBytesz>Standard approach to decoding parsed results from bytes to strr>c�8���|j��fd�|D��S)Nc3�B�K�|]}|j������y�wrErPrRs  ��r@rUz+_ResultMixinBytes.decode.<locals>.<genexpr>�rerf)�_decoded_counterpartrhs ``r@rQz_ResultMixinBytes.decode�rjr?Nrk)rlrmrnrorprQr>r?r@rsrs�rqr?rsc�x�eZdZdZdZed��Zed��Zed��Zed��Z	e
ej�Z
y)�_NetlocResultMixinBasezHShared methods for the parsed result objects containing a netloc elementr>c� �|jdS)Nr��	_userinfo�ris r@�usernamez_NetlocResultMixinBase.username�����~�~�a� � r?c� �|jdS)NrZrzr|s r@�passwordz_NetlocResultMixinBase.password�r~r?c��|jd}|syt|t�rdnd}|j|�\}}}|j	�|z|zS)Nr�%�%)�	_hostinfor[r\�	partition�lower)ri�hostname�	separator�percent�zones     r@r�z_NetlocResultMixinBase.hostname�sV���>�>�!�$����&�h��4�C�$�	�"*�"4�"4�Y�"?���'�4��~�~��'�)�D�0�0r?c���|jd}|�\|j�r|j�rt|�}nt	d|����d|cxkrdkst	d��t	d��|S)NrZz+Port could not be cast to integer value as ri��zPort out of range 0-65535)r��isdigit�isascii�int�
ValueError)ri�ports  r@r�z_NetlocResultMixinBase.port�sr���~�~�a� �����|�|�~�$�,�,�.��4�y�� �#N�t�h�!W�X�X���&��&� �!<�=�=�'� �!<�=�=��r?N)rlrmrnrorp�propertyr}r�r�r��classmethod�types�GenericAlias�__class_getitem__r>r?r@rxrx�sk��R��I�
�!��!��!��!��1��1��	��	�$�E�$6�$6�7�r?rxc�0�eZdZdZed��Zed��Zy)�_NetlocResultMixinStrr>c��|j}|jd�\}}}|r|jd�\}}}|sd}||fSdx}}||fS)N�@�:��netloc�
rpartitionr��rir��userinfo�	have_info�hostinfor}�
have_passwordr�s        r@r{z_NetlocResultMixinStr._userinfo�sh������(.�(9�(9�#�(>�%��)�X��08�0B�0B�3�0G�-�H�m�X� �����!�!�#'�&�H�x���!�!r?c��|j}|jd�\}}}|jd�\}}}|r+|jd�\}}}|jd�\}}}n|jd�\}}}|sd}||fS)Nr��[�]r�r��rir��_r��have_open_br�	bracketedr�r�s        r@r�z_NetlocResultMixinStr._hostinfo�s��������*�*�3�/���1�h�%-�%7�%7��%<�"��<��� )� 3� 3�C� 8��H�a������,�J�A�q�$� (� 2� 2�3� 7��H�a����D���~�r?N�rlrmrnrpr�r{r�r>r?r@r�r���-���I�
�	"��	"����r?r�c�0�eZdZdZed��Zed��Zy)�_NetlocResultMixinBytesr>c��|j}|jd�\}}}|r|jd�\}}}|sd}||fSdx}}||fS)N�@�:r�r�s        r@r{z!_NetlocResultMixinBytes._userinfo�sh������(.�(9�(9�$�(?�%��)�X��08�0B�0B�4�0H�-�H�m�X� �����!�!�#'�&�H�x���!�!r?c��|j}|jd�\}}}|jd�\}}}|r+|jd�\}}}|jd�\}}}n|jd�\}}}|sd}||fS)Nr��[�]r�r�r�s        r@r�z!_NetlocResultMixinBytes._hostinfo�s��������*�*�4�0���1�h�%-�%7�%7��%=�"��<��� )� 3� 3�D� 9��H�a������-�J�A�q�$� (� 2� 2�4� 8��H�a����D���~�r?Nr�r>r?r@r�r��r�r?r�rzurl fragmentrz!scheme netloc path query fragmentrz(scheme netloc path params query fragmentz�
DefragResult(url, fragment)

A 2-tuple that contains the url without fragment identifier and the fragment
identifier as a separate argument.
z$The URL with no fragment identifier.z�
Fragment identifier separated from URL, that allows indirect identification of a
secondary resource by reference to a primary resource and additional identifying
information.
z�
SplitResult(scheme, netloc, path, query, fragment)

A 5-tuple that contains the different components of a URL. Similar to
ParseResult, but does not split params.
z%Specifies URL scheme for the request.z0
Network location where the request is made to.
z@
The hierarchical path, such as the path to a file to download.
z�
The query component, that contains non-hierarchical data, that along with data
in path component, identifies a resource in the scope of URI's scheme and
network location.
z�
Fragment identifier, that allows indirect identification of a secondary resource
by reference to a primary resource and additional identifying information.
zq
ParseResult(scheme, netloc, path, params, query, fragment)

A 6-tuple that contains components of a parsed URL.
z�
Parameters for last path element used to dereference the URI in order to provide
access to perform some operation on the resource.
c��eZdZdZd�Zy)rr>c�j�|jr|jdz|jzS|jS)N�#��fragment�urlr|s r@�geturlzDefragResult.geturlEs)���=�=��8�8�c�>�D�M�M�1�1��8�8�Or?N�rlrmrnrpr�r>r?r@rrC����I�r?c��eZdZdZd�Zy)rr>c��t|�SrE�r	r|s r@r�zSplitResult.geturlM�
���$��r?Nr�r>r?r@rrK����I� r?c��eZdZdZd�Zy)rr>c��t|�SrE�rr|s r@r�zParseResult.geturlRr�r?Nr�r>r?r@rrPr�r?c��eZdZdZd�Zy)rr>c�j�|jr|jdz|jzS|jS)N�#r�r|s r@r�zDefragResultBytes.geturlXs)���=�=��8�8�d�?�T�]�]�2�2��8�8�Or?Nr�r>r?r@rrVr�r?rc��eZdZdZd�Zy)rr>c��t|�SrEr�r|s r@r�zSplitResultBytes.geturl`r�r?Nr�r>r?r@rr^r�r?rc��eZdZdZd�Zy)rr>c��t|�SrEr�r|s r@r�zParseResultBytes.geturler�r?Nr�r>r?r@rrcr�r?rc�z�ttfttftt
ff}|D]\}}||_||_�yrE)rrrrrrrgrv)�
_result_pairs�_decoded�_encodeds   r@�_fix_result_transcodingr�isE��	�(�)�	�&�'�	�&�'��M�
,���(�(0��%�(0��%�,r?rTc��t||�\}}}t|||�}|\}}}}}|tvrd|vrt|�\}}nd}t	||||||�}	||	�S)a�Parse a URL into 6 components:
    <scheme>://<netloc>/<path>;<params>?<query>#<fragment>

    The result is a named 6-tuple with fields corresponding to the
    above. It is either a ParseResult or ParseResultBytes object,
    depending on the type of the url parameter.

    The username, password, hostname, and port sub-components of netloc
    can also be accessed as attributes of the returned object.

    The scheme argument provides the default value of the scheme
    component when no scheme is found in url.

    If allow_fragments is False, no attempt is made to separate the
    fragment component from the previous component, which can be either
    path or query.

    Note that % escapes are not expanded.
    �;r)r`r�uses_params�_splitparamsr)
r��scheme�allow_fragments�_coerce_result�splitresultr��queryr��params�results
          r@rrvsu��(#/�s�F�";��C����3���8�K�+6�(�F�F�C���
������"�3�'���V���
����f�e�X�
F�F��&�!�!r?c��d|vr*|jd|jd��}|dkr|dfS|jd�}|d|||dzdfS)N�/r�rrrZ)�find�rfind)r��is  r@r�r��sY��
�s�{��H�H�S�#�)�)�C�.�)���q�5���7�N��H�H�S�M���r��7�C��!���I��r?c��t|�}dD]&}|j||�}|dk\s�t||�}�(|||||dfS)Nz/?#r)�lenr��min)r��start�delim�c�wdelims     r@�_splitnetlocr��sR����H�E�
�����!�U�#���Q�;���v�&�E���u�U��S���[�(�(r?c�0�|r|j�ryddl}|jdd�}|jdd�}|jdd�}|jdd�}|jd|�}||k(rydD]}||vs�t	d	|zd
zdz��y)Nrr�rr�r��?�NFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)r��unicodedata�replace�	normalizer�)r�r��n�netloc2r�s     r@�_checknetlocr��s����V�^�^�%������s�B��A�	�	�	�#�r��A�	�	�	�#�r��A�	�	�	�#�r��A��#�#�F�A�.�G��G�|��
����<��Z�&�0�3H�H�B�C�D�
D�r?c���|jd�r"tjd|�std��yt	j
|�}t
|tj�rtd��y)N�vz\Av[a-fA-F0-9]+\..+\ZzIPvFuture address is invalidz%An IPv4 address cannot be in brackets)�
startswith�re�matchr��	ipaddress�
ip_addressr[�IPv4Address)r��ips  r@�_check_bracketed_hostr��sc�����3���x�x�0�(�;��;�=�=�<��
!�
!�(�
+���b�)�/�/�0��D�F�F�1r?)�typedc�N�t||�\}}}|jt�}|jt�}tD]&}|j|d�}|j|d�}�(t
|�}dx}x}}|jd�}|dkDrU|dj�rB|dj�r/|d|D]}	|	tvs�n|d|j�||dzd}}|dddk(rct|d�\}}d|vrd	|vsd	|vrd|vrtd
��d|vr5d	|vr1|jd�djd	�d}
t|
�|rd|vr|j!dd�\}}d|vr|j!dd�\}}t#|�t%|||||�}||�S)
a�Parse a URL into 5 components:
    <scheme>://<netloc>/<path>?<query>#<fragment>

    The result is a named 5-tuple with fields corresponding to the
    above. It is either a SplitResult or SplitResultBytes object,
    depending on the type of the url parameter.

    The username, password, hostname, and port sub-components of netloc
    can also be accessed as attributes of the returned object.

    The scheme argument provides the default value of the scheme
    component when no scheme is found in url.

    If allow_fragments is False, no attempt is made to separate the
    fragment component from the previous component, which can be either
    path or query.

    Note that % escapes are not expanded.
    rr�rNrZ��//r�r�zInvalid IPv6 URLr�r�)r`�lstrip�_WHATWG_C0_CONTROL_OR_SPACE�strip�_UNSAFE_URL_BYTES_TO_REMOVEr��boolr�r��isalpha�scheme_charsr�r�r�r�r��splitr�r)r�r�r�r��br�r�r�r�r��bracketed_hostr�s            r@rr�s���,#/�s�F�";��C����*�*�0�
1�C�
�\�\�5�
6�F�
(���k�k�!�R� ������2�&��)��?�+�O� "�"�F�"�U�X�����
�A��1�u��Q����!�c�!�f�n�n�&6��R�a��A���$����b�q�'�-�-�/�3�q��s�t�9�C�F�
�2�A�w�$��"�3��*����
�F�]�s�&�0����3�f�#4��/�0�0��&�=�S�F�]�#�-�-�c�2�1�5�?�?��D�Q�G�N�!�.�1��3�#�:��	�	�#�q�)�
��X�
�c�z��Y�Y�s�A�&�
��U�����F�F�C���9�A��!��r?c	�`�t|�\}}}}}}}|r|�d|��}|t|||||f��S)z�Put a parsed URL back together again.  This may result in a
    slightly different, but equivalent URL, if the URL that was parsed
    originally had redundant delimiters, e.g. a ? with an empty query
    (the draft states that these are equivalent).r�)r`r	)�
componentsr�r�r�r�r�r�r�s        r@rr�sH��3?�
�2K�A�F�F�C����.�
��f�%���*�f�f�c�5�(�%K�L�M�Mr?c���t|�\}}}}}}|r|r
|dddk7rd|z}d|z|z}n'|dddk(rd|z}n|r|tvr|r|dddk(rd|z}|r|dz|z}|r|dz|z}|r|dz|z}||�S)	akCombine the elements of a tuple as returned by urlsplit() into a
    complete URL as a string. The data argument can be any five-item iterable.
    This may result in a slightly different, but equivalent URL, if the URL that
    was parsed originally had unnecessary delimiters (for example, a ? with an
    empty query; the RFC states that these are equivalent).NrZr�r�r�r�r�r�)r`�uses_netloc)rr�r�r�r�r�r�s       r@r	r	s���+7�
�*C�9�F�F�C���.�
��3�r��7�c�>��s��3��V�m�c�!��	�R�a��D���S�j��	�F�k�)�3�#�b�q�'�S�.��S�j��
��s�l�S� ����C�i�%�����C�i�(�"���#��r?c
��|s|S|s|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|k7s|
tvr||�S|
tvr|r|t	|
|||
||f��S|}|s!|
s|}|}
|s|}|t	|
|||
||f��S|jd�}|ddk7r|d=|dddk(r|jd�}n&||jd�z}t
d|dd�|ddg}|D]0}|dk(r	|j��|dk(r� |j|��2|ddvr|jd�|t	|
|dj|�xsd|
||f��S#t$rY��wxYw)	zaJoin a base URL and a possibly relative URL to form an absolute
    interpretation of the latter.rr����NrZ�..�.)rr)r`r�
uses_relativer
rr�filter�pop�
IndexError�append�join)�baser�r�r��bscheme�bnetloc�bpath�bparams�bquery�	bfragmentr�r��pathr�r�r��
base_parts�segments�
resolved_path�segs                    r@rrs����
���� ,�T�3� 7��D�#�~��T�2��/�8�G�W�e�W�f�i�
�S�'�?�3�2�F�F�D�&�%�����F�-�7��c�"�"�
����!�*�f�f�d�.4�e�X�.G�#H�I�
I�����������E��j�&�&�$�*0�%��*C�D�E�	E����S�!�J��"�~���
�r�N��B�Q�x�3���:�:�c�?����
�
�3��/�� ��h�q��n�5���2���M����$�;�
��!�!�#�
�C�Z��� � ��%����|�{�"�	���R� ��*�f�f�c�h�h��7�7��v�u�h�&8�9�:�:���
��
�s�E1�1	E=�<E=c��t|�\}}d|vr$t|�\}}}}}}t|||||df�}nd}|}|t||��S)z�Removes any existing fragment from URL.

    Returns a tuple of the defragmented URL and the fragment.  If
    the URL contained no fragments, the second element is the
    empty string.
    r�r)r`rrr)	r�r��sr��p�a�q�frag�defrags	         r@rrdsc��'�s�+��C��
�c�z�&�s�m���1�a��A�t��Q��1�a��B�/�0�������,�v�t�4�5�5r?�0123456789ABCDEFabcdefc�*�tt|��S)z,unquote_to_bytes('abc%20def') -> b'abc def'.)�bytes�
_unquote_impl)�strings r@rrws����v�&�'�'r?r/�returnc
��|s
|jyt|t�r|jd�}|jd�}t	|�dk(r|St|d�}|j}t�ItD��cic]7}tD],}||zj�tj||z���.�9c}}a|ddD] }	|t|dd�||dd��"|Scc}}w#t$r|d�||�Y�FwxYw)Nr?�utf-8r�rZrr�)rr[r\rJr��	bytearray�extend�
_hextobyte�_hexdigr-�fromhex�KeyError)r/�bits�resrr'r�items       r@r.r.{s
��������&�#�����w�'���<�<���D�
�4�y�A�~��
�
�D��G�
�C�
�Z�Z�F���&�9�&�!��1��1�u�n�n�&��
�
�a�!�e�(<�<�07�'�&�9�
��Q�R���	��:�d�2�A�h�'�(��4���8����J��9���	��4�L��4�L�	�s�;<C%�C+�+D�Dz([-]+)c#��K�d}tj|�D]>}|j�\}}|||��t|d�j	||���|}�@||d��y�w)NrrZ)�_asciire�finditer�spanr.rQ)r/rKrL�previous_match_end�ascii_matchr��ends       r@�_generate_unquoted_partsrC�st�������(�(��0�� �%�%�'�
��s��'��.�.��K��N�+�2�2�8�V�D�D� ��1��#�$�
%�%�s�A!A#c���t|t�rt|�j||�Sd|vr|j|S|�d}|�d}djt
|||��S)a�Replace %xx escapes by their single-character equivalent. The optional
    encoding and errors parameters specify how to decode percent-encoded
    sequences into Unicode characters, as accepted by the bytes.decode()
    method.
    By default, percent-encoded sequences are decoded with UTF-8, and invalid
    sequences are replaced by a placeholder character.

    unquote('abc%20def') -> 'abc def'.
    r�r2r�r)r[r-r.rQrrrC�r/rKrLs   r@rr�sh���&�%� ��V�$�+�+�H�f�=�=�
�&������
�����
�~���
�7�7�+�F�H�f�E�F�Fr?Fc	��i}t|||||||��}|D]$\}	}
|	|vr||	j|
��|
g||	<�&|S)aXParse a query given as a string argument.

        Arguments:

        qs: percent-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            percent-encoded queries should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        encoding and errors: specify how to decode percent-encoded sequences
            into Unicode characters, as accepted by the bytes.decode() method.

        max_num_fields: int. If set, then throws a ValueError if there
            are more than n fields read by parse_qsl().

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.

        Returns a dictionary.
    )rKrL�max_num_fieldsr�)rr)�qs�keep_blank_values�strict_parsingrKrLrGr��
parsed_result�pairs�name�values           r@rr�sd��<�M��b�+�^�'��%3�y�
J�E����e��=� ��$��&�&�u�-�#(�'�M�$��	�
�r?c�X���|rt|ttf�std��t|t�r%t|t�st|d�}d}��fd�}n9|sgStt	|��}t|t�rt|d�}d}d�}|sgS|�$d|j|�z}	||	krtd��g}
|j
|�D]V}|s|s�|j|�\}}
}|
s|rtd	|����|s|s�4||�}||�}|
j||f��X|
S)
aXParse a query given as a string argument.

        Arguments:

        qs: percent-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            percent-encoded queries should be treated as blank strings.
            A true value indicates that blanks should be retained as blank
            strings.  The default false value indicates that blank values
            are to be ignored and treated as if they were  not included.

        strict_parsing: flag indicating what to do with parsing errors. If
            false (the default), errors are silently ignored. If true,
            errors raise a ValueError exception.

        encoding and errors: specify how to decode percent-encoded sequences
            into Unicode characters, as accepted by the bytes.decode() method.

        max_num_fields: int. If set, then throws a ValueError
            if there are more than n fields read by parse_qsl().

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.

        Returns a list, as G-d intended.
    z*Separator must be of type string or bytes.rB�=c� ��t|����S)N)rKrL)r)r%rKrLs ��r@�_unquotezparse_qsl.<locals>._unquote	s�����H�V�D�Dr?�=c�8�t|jdd��S)N�+� )rr�)r%s r@rRzparse_qsl.<locals>._unquotes��#�A�I�I�d�D�$9�:�:r?rZzMax number of fields exceededzbad query field: )	r[r\r-r��
memoryview�countrr�r)rHrIrJrKrLrGr��eqrR�
num_fields�r�
name_valuerM�has_eqrNs   ``          r@rr�s5���<�J�y�3��,�?��E�F�F��"�c���)�S�)��I�w�/�I�
��	E���I��:�b�>�
"���i��%��i��1�I�
��	;���	�
�!�����)�,�,�
��J�&��<�=�=�
�A��h�h�y�)�
���",�"6�"6�r�":��D�&�%��n� �*�!F�G�G��)���~�� �������$���'�*�
�Hr?c�@�|jdd�}t|||�S)z�Like unquote(), but also replace plus signs by spaces, as required for
    unquoting HTML form values.

    unquote_plus('%7e/abc+def') -> '~/abc def'
    �+� )r�rrEs   r@rr.s#���^�^�C��
%�F��6�8�V�,�,r?sBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c�z�|dk(r"tjdtd��tSt	dt
�d|����)N�QuoterzoDeprecated in 3.11. urllib.parse.Quoter will be removed in Python 3.14. It was not intended to be a public API.r���
stacklevelzmodule z has no attribute )�warnings�warn�DeprecationWarning�_Quoter�AttributeErrorrl)rMs r@�__getattr__rj=sC���x���
�
�@�)�Q�	8���
�7�8�,�.@���I�
J�Jr?c�"�eZdZdZd�Zd�Zd�Zy)rhz�A mapping from bytes numbers (in range(0,256)) to strings.

    String values are percent-encoded byte values, unless the key < 128, and
    in either of the specified safe set, or the always safe set.
    c�8�tj|�|_y)zsafe: bytes object.N)�_ALWAYS_SAFE�union�safe)riros  r@�__init__z_Quoter.__init__Ns�� �&�&�t�,��	r?c� �dt|��d�S)Nz<Quoter �>)�dictr|s r@�__repr__z_Quoter.__repr__Rs���$�t�*��q�)�)r?c�d�||jvrt|�ndj|�}|||<|S)Nz%{:02X})ro�chr�format)rirr:s   r@�__missing__z_Quoter.__missing__Us0���T�Y�Y��c�!�f�I�,<�,<�Q�,?����Q���
r?N)rlrmrnrorprtrxr>r?r@rhrhFs���-�*�r?rhc��t|t�r|s|S|�d}|�d}|j||�}n|�td��|�td��t	||�S)a�quote('abc def') -> 'abc%20def'

    Each part of a URL, e.g. the path info, the query, etc., has a
    different set of reserved characters that must be quoted. The
    quote function offers a cautious (not minimal) way to quote a
    string for most of these parts.

    RFC 3986 Uniform Resource Identifier (URI): Generic Syntax lists
    the following (un)reserved characters.

    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
    reserved      = gen-delims / sub-delims
    gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"
    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                  / "*" / "+" / "," / ";" / "="

    Each of the reserved characters is reserved in some component of a URL,
    but not necessarily in all of them.

    The quote function %-escapes all characters that are neither in the
    unreserved chars ("always safe") nor the additional chars set via the
    safe arg.

    The default for the safe arg is '/'. The character is reserved, but in
    typical usage the quote function is being called on a path where the
    existing slash characters are to be preserved.

    Python 3.7 updates from using RFC 2396 to RFC 3986 to quote URL strings.
    Now, "~" is included in the set of unreserved characters.

    string and safe may be either str or bytes objects. encoding and errors
    must not be specified if string is a bytes object.

    The optional encoding and errors parameters specify how to deal with
    non-ASCII characters, as accepted by the str.encode method.
    By default, encoding='utf-8' (characters are encoded with UTF-8), and
    errors='strict' (unsupported characters raise a UnicodeEncodeError).
    r2rCz,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r[r\rJr]r)r/rorKrLs    r@r
r
[sm��N�&�#����M����H��>��F����x��0�����J�K�K����H�I�I��F�D�)�)r?c���t|t�rd|vst|t�rd|vrt||||�St|t�rd}nd}t|||z||�}|j	dd�S)z�Like quote(), but also replace ' ' with '+', as required for quoting
    HTML form values. Plus signs in the original string are escaped unless
    they are included in safe. It also does not have safe default to '/'.
    r`rVr_)r[r\r-r
r�)r/rorKrL�spaces     r@rr�sp��
�F�C�	 �S��%6�	�F�E�	"�t�6�'9��V�T�8�V�4�4��$�������
�6�4�%�<��6�
:�F��>�>�#�s�#�#r?c�,�t|�jSrE)rh�__getitem__)ros r@r=r=�s���4�=�$�$�$r?c�\�t|ttf�std��|syt|t�r|jdd�}nt|D�cgc]
}|dks�	|��c}�}|j
t|z�s|j�St|�}t|�x}dkrdjt||��Stj|�}td||�D�cgc]#}djt|||||z����%}}dj|�Scc}wcc}w)z�Like quote(), but accepts a bytes object rather than a str, and does
    not perform string-to-bytes encoding.  It always returns an ASCII string.
    quote_from_bytes(b'abc def?') -> 'abc%20def%3f'
    z!quote_from_bytes() expected bytesrrB�ignore�i@
r)r[r-r3r]r\rJ�rstrip�_ALWAYS_SAFE_BYTESrQr=r�r�map�math�isqrt�range)�bsror��quoter�bs_len�
chunk_sizer��chunkss        r@rr�s��
�b�5�)�,�-��;�<�<�
���$����{�{�7�H�-����1��A��S��a��1�2��
�9�9�'�$�.�/��y�y�{��
!�$�
'�F��b�'���W�$��w�w�s�6�2��'�'��Z�Z��'�
� ��F�J�7�9�7�a��'�'�#�f�b��1�Z�<�&8�9�:�7�	�9��w�w�v����2��9s�
D$�D$�)(D)c�D�t|d�r|j�}n%	t|�rt|dt�st
�g}|s~|D]x\}}	t|t�r
|||�}n|t|�|||�}t|	t�r
||	|�}	n|t|	�|||�}	|j|dz|	z��zn�|D]�\}}	t|t�r
|||�}n|t|�|||�}t|	t�r!||	|�}	|j|dz|	z��et|	t�r#||	|||�}	|j|dz|	z���	t|	�}
|	D]G}t|t�r
|||�}n|t|�|||�}|j|dz|z��I��dj|�S#t
$r}td�|�d}~wwxYw#t
$r/|t|	�|||�}	|j|dz|	z�Y��WwxYw)a^Encode a dict or sequence of two-element tuples into a URL query string.

    If any values in the query arg are sequences and doseq is true, each
    sequence element is converted to a separate parameter.

    If the query arg is a sequence of two-element tuples, the order of the
    parameters in the output will match the order of parameters in the
    input.

    The components of a query arg may each be either a string or a bytes type.

    The safe, encoding, and errors parameters are passed down to the function
    specified by quote_via (encoding and errors only if a component is a str).
    �itemsrz1not a valid non-string sequence or mapping objectNrP�&)
�hasattrr�r�r[rVr]r-r\rr)r��doseqrorKrL�	quote_via�err�l�kr�rT�elts            r@r
r
�s��"�u�g�����
��	:��5�z�*�U�1�X�u�"=���	�A���D�A�q��!�U�#��a��&���c�!�f�d�H�f�=���!�U�#��a��&���c�!�f�d�H�f�=��
�H�H�Q��W�q�[�!���D�A�q��!�U�#��a��&���c�!�f�d�H�f�=���!�U�#��a��&������S��1��%��A�s�#��a��x��8������S��1��%�0��A��A� !��%�c�5�1�"+�C��"6�C�"+�C��H�d�H�f�"M�C�����S��3��/� !�-�8�8�8�A�;���]�	:��0�1�69�
:��	:��D!�*�!�#�a�&�$��&�A�A��H�H�Q��W�q�[�)�*�s)�$G
� G'�
	G$�G�G$�'4H�Hc�P�tjdtd��t|�S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r�rc)rerfrg�	_to_bytes�r�s r@�to_bytesr�s ���M�M�C�$��4��S�>�r?c��t|t�r"	|jd�j�}|S|S#t$rt	dt|�zdz��wxYw)zto_bytes(u"URL") --> 'URL'.�ASCIIzURL z contains non-ASCII characters)r[r\rJrQ�UnicodeError�reprr�s r@r�r�sl��
�#�s��	A��*�*�W�%�,�,�.�C��J�3�J���	A��v��S�	�1�?� @�A�
A�	A�s	�5�$Ac��t|�j�}|dddk(r|dddk(r|ddj�}|dddk(r|ddj�}|S)z�Transform a string like '<URL:scheme://host/path>' into 'scheme://host/path'.

    The string is returned unchanged if it's not a wrapped URL.
    NrZ�<rrr�zURL:)r\rr�s r@�unwrapr�&sc��
�c�(�.�.�
�C�
�2�A�w�#�~�#�b�c�(�c�/��!�B�i�o�o���
�2�A�w�&���!�"�g�m�m�o���Jr?c�P�tjdtd��t|�S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�rc)rerfrg�
_splittyper�s r@�	splittyper�3�$���M�M�8�$��4��c�?�r?c���t�$tjdtj�atj	|�}|r%|j�\}}|j
�|fSd|fS)z:splittype('type:opaquestring') --> 'type', 'opaquestring'.Nz
([^/:]+):(.*))�	_typeprogr��compile�DOTALLr��groupsr�)r�r�r��datas    r@r�r�;sY�����J�J���	�	�:�	��O�O�C� �E���|�|�~�����|�|�~�t�#�#���9�r?c�P�tjdtd��t|�S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�rc)rerfrg�
_splithostr�s r@�	splithostr�Hr�r?c���t�$tjdtj�atj	|�}|r&|j�\}}|r
|ddk7rd|z}||fSd|fS)z;splithost('//host[:port]/path') --> 'host[:port]', '/path'.Nz//([^/#?]*)(.*)rr�)�	_hostprogr�r�r�r�r�)r�r��	host_portrs    r@r�r�Psi�����J�J�0�"�)�)�<�	��O�O�C� �E���,�,�.��	�4��D��G�s�N���:�D��$�����9�r?c�P�tjdtd��t|�S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�rc)rerfrg�
_splituser��hosts r@�	splituserr�_�%���M�M�8�$��4��d��r?c�@�|jd�\}}}|r||fSd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.r�N�r�)r��userr�s   r@r�r�fs.������,��D�%���D�d�*�*�t�d�*�*r?c�P�tjdtd��t|�S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�rc)rerfrg�_splitpasswd)r�s r@�splitpasswdr�ls%���M�M�8�$��4����r?c�>�|jd�\}}}||r|fSdfS)z/splitpasswd('user:passwd') -> 'user', 'passwd'.r�N�r�)r�r��passwds   r@r�r�ss,���.�.��-��D�%���E�&�,�,�t�,�,r?c�P�tjdtd��t|�S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�rc)rerfrg�
_splitportr�s r@�	splitportr�yr�r?c��t�$tjdtj�atj	|�}|r|j�\}}|r||fS|dfS)z*splitport('host:port') --> 'host', 'port'.Nz
(.*):([0-9]*))�	_portprogr�r�r��	fullmatchr�)r�r�r�s   r@r�r��sW�����J�J���	�	�:�	�����%�E���\�\�^�
��d����:����:�r?c�R�tjdtd��t||�S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�rc)rerfrg�_splitnport)r��defports  r@�
splitnportr��s'���M�M�8�$��4��t�W�%�%r?c��|jd�\}}}|s|}||fS|r5|j�r|j�rt|�}||fSd}||fS||fS)z�Split host and port, returning numeric port.
    Return given default port if no ':' found; defaults to -1.
    Return numerical port if a valid number is found after ':'.
    Return None if ':' but not a valid number.r�N)r�r�r�r�)r�r�r�r��nports     r@r�r��ss��
����,��D�%�������=��

��<�<�>�d�l�l�n���I�E��U�{���E��U�{����=�r?c�P�tjdtd��t|�S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�rc)rerfrg�_splitqueryr�s r@�
splitqueryr��s%���M�M�8�$��4��s��r?c�@�|jd�\}}}|r||fS|dfS)z/splitquery('/path?query') --> '/path', 'query'.r�Nr�)r�rr�r�s    r@r�r��s.������,��D�%����U�{����9�r?c�P�tjdtd��t|�S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�rc)rerfrg�	_splittagr�s r@�splittagr��s$���M�M�8�$��4��S�>�r?c�@�|jd�\}}}|r||fS|dfS)z)splittag('/path#tag') --> '/path', 'tag'.r�Nr�)r�rr��tags    r@r�r��s.���~�~�c�*��D�%����S�y����9�r?c�P�tjdtd��t|�S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�rc)rerfrg�
_splitattrr�s r@�	splitattrr��r�r?c�8�|jd�}|d|ddfS)zksplitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...].r�rrZN)r)r��wordss  r@r�r��s&��
�I�I�c�N�E���8�U�1�2�Y��r?c�P�tjdtd��t|�S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadr�rc)rerfrg�_splitvalue)�attrs r@�
splitvaluer��s%���M�M�9�$��4��t��r?c�>�|jd�\}}}||r|fSdfS)z-splitvalue('attr=value') --> 'attr', 'value'.rPNr�)r�r�rNs   r@r�r��s,������,��D�%���5�%�+�+�d�+�+r?)rT)r)T)r2r�)FFr2r�Nr�)r�NN)rNN)r�)r)pro�collectionsr�	functoolsr�r�r�rer��__all__rr
r��non_hierarchical�
uses_query�
uses_fragmentrrrrA�_implicit_encoding�_implicit_errorsrGrMrXr`�objectrbrsrxr�r��_DefragResultBase�_SplitResultBase�_ParseResultBaser�r�r�r�rr�r��
ResultBaserrrrrrr�rr�r�r�r��	lru_cacherrr	rrr6r5rr-r3r\r.r�r=rCrrrr�	frozensetrmr�rjrsrhr
rr=rr
r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r>r?r@�<module>r�s����B#���	����H��0�
�
-��-��F��A�
�%�
�
��\��1��'������"4�/�(�!3�.�H�2�"V�f�V�V��V�#8�V�#8�L�2�O��<�4�6G��<�~�~�>����6�8����=�?�����!K�����&����"����#N�����#�����!�����"�����%����!�
���#3�"9�"9�"A�"A�����"2�"9�"9�"A�"A����� 0� 5� 5� =� =�����#�����
"2�!7�!7�!?�!?�����$4�$=�$=�$E�$E����!�#�
��$�o�� �"�$9� �
 �"�$9� ��)�+<�� �'�)@� �
 �'�)@� �1����"�<�)�D�(G�����4� �6�!�6�p	N��.B:�J6� #��
�
�(��%�)�+�c�1��e�i�6G��:�2�:�:�&�'��&�G�.:?�PS�'�T;@�QT�G
�R-��!�"���<�(��K��d��*4*�l$�$���%��%��6!�r�D��"�M�`��
��
�	�
��
�	���+��-��
�	��&��"�������,r?

?>