Hacked By AnonymousFox

Current Path : /proc/thread-self/root/proc/self/root/opt/alt/python39/lib64/python3.9/urllib/__pycache__/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/opt/alt/python39/lib64/python3.9/urllib/__pycache__/parse.cpython-39.pyc

a

R�f8��@s�dZddlZddlZddlZddlZddlZgd�Zgd�Zgd�Zgd�Z	gd�Z
gd�Zgd	�Zd
Z
dZgd�Zd
ZiZdd�ZdZdZdd�Zeefdd�Zeefdd�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!ee�ZGd"d#�d#ee�Zdd$lmZed%d&�Z ed'd(�Z!ed)d*�Z"d+e _d,e j#_d-e j$_d.e!_d/e!j%_d0e!j&_d1e!j'_d2e!j(_d3e!j$_d4e"_e!j%je"j%_e!j&je"j&_e!j'je"j'_d5e"j)_e!j(je"j(_e!j$je"j$_eZ*Gd6d%�d%e e�Z+Gd7d'�d'e!e�Z,Gd8d)�d)e"e�Z-Gd9d:�d:e e�Z.Gd;d<�d<e!e�Z/Gd=d>�d>e"e�Z0d?d@�Z1e1�[1d�dCdD�Z2dEdF�Z3d�dGdH�Z4dIdJ�Z5d�dKdL�Z6dMdN�Z7dOdP�Z8d�dQdR�Z9dSdT�Z:dUZ;da<dVdW�Z=e�>dX�Z?d�d[d\�Z@d�d_d`�ZAd�dadb�ZBd�dcdd�ZCeDde�ZEeFeE�ZGiZHGdfdg�dgejI�ZJd�didj�ZKd�dkdl�ZLd�dmdn�ZMd]dAddeLfdodp�ZNdqdr�ZOdsdt�ZPdudv�ZQdwdx�ZRdaSdydz�ZTd{d|�ZUdaVd}d~�ZWdd��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\da]d�d��Z^d�d�d��Z_d�d�d��Z`d�d��Zad�d��Zbd�d��Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��ZhdS)�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.
�N)�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�rtspu�sftp�svn�svn+ssh�ws�wss)rrrrr�telnetrrrr!rr �snewsr"r#r$Zrsyncr&r'r%ZnfsZgitzgit+sshr(r))rr�hdlr"rrrr r#r$�sip�sipsr!r%Ztel)
rr,Zmailto�newsr*rrr+r-r.)rrrrrr r!rr#r$r-r.)
rrr,rrr/rrrr r+rr"zAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!	

 )�	�
�
�cCst��t��dS)z,Clear the parse cache and the quoters cache.N)�_parse_cache�clear�
_safe_quoters�r7r7�1/opt/alt/python39/lib64/python3.9/urllib/parse.py�clear_cache`sr9�ascii�strictcCs|S�Nr7)�objr7r7r8�_nooposr>cCs|�||�Sr<��encode)r=�encoding�errorsr7r7r8�_encode_resultrsrCcst��fdd�|D��S)Nc3s"|]}|r|����ndVqdS)rN��decode��.0�x�rArBr7r8�	<genexpr>x�z_decode_args.<locals>.<genexpr>)�tuple)�argsrArBr7rIr8�_decode_argsvsrNcGsVt|dt�}|dd�D]}|rt|t�|krtd��q|rH|tfSt|�tfS)Nr�z$Cannot mix str and non-str arguments)�
isinstance�str�	TypeErrorr>rNrC)rMZ	str_input�argr7r7r8�_coerce_argszs

rTc@seZdZdZdZddd�ZdS)	�_ResultMixinStrz>Standard approach to encoding parsed results from str to bytesr7r:r;cs|j��fdd�|D��S)Nc3s|]}|����VqdSr<r?rFrIr7r8rJ�rKz)_ResultMixinStr.encode.<locals>.<genexpr>)�_encoded_counterpart��selfrArBr7rIr8r@�sz_ResultMixinStr.encodeN)r:r;)�__name__�
__module__�__qualname__�__doc__�	__slots__r@r7r7r7r8rU�srUc@seZdZdZdZddd�ZdS)	�_ResultMixinBytesz>Standard approach to decoding parsed results from bytes to strr7r:r;cs|j��fdd�|D��S)Nc3s|]}|����VqdSr<rDrFrIr7r8rJ�rKz+_ResultMixinBytes.decode.<locals>.<genexpr>)�_decoded_counterpartrWr7rIr8rE�sz_ResultMixinBytes.decodeN)r:r;)rYrZr[r\r]rEr7r7r7r8r^�sr^c@sNeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	e
ej�Z
dS)�_NetlocResultMixinBasezHShared methods for the parsed result objects containing a netloc elementr7cCs
|jdS)Nr��	_userinfo�rXr7r7r8�username�sz_NetlocResultMixinBase.usernamecCs
|jdS)NrOrarcr7r7r8�password�sz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|t�r dnd}|�|�\}}}|��||S)Nr�%�%)�	_hostinforPrQ�	partition�lower)rX�hostname�	separatorZpercentZzoner7r7r8rk�s
z_NetlocResultMixinBase.hostnamecCsj|jd}|durfzt|d�}Wn&tyFd|��}t|�d�Yn0d|kr\dksfntd��|S)NrO�
z+Port could not be cast to integer value as ri��zPort out of range 0-65535)rh�int�
ValueError)rX�port�messager7r7r8rp�s

z_NetlocResultMixinBase.portN)rYrZr[r\r]�propertyrdrerkrp�classmethod�types�GenericAlias�__class_getitem__r7r7r7r8r`�s




r`c@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinStrr7cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:��netloc�
rpartitionri�rXr{ZuserinfoZ	have_info�hostinfordZ
have_passwordrer7r7r8rb�sz_NetlocResultMixinStr._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nrx�[�]ryrz�rXr{�_r~Zhave_open_brZ	bracketedrkrpr7r7r8rh�sz_NetlocResultMixinStr._hostinfoN�rYrZr[r]rrrbrhr7r7r7r8rw�s

rwc@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinBytesr7cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:rzr}r7r7r8rb�sz!_NetlocResultMixinBytes._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nr��[�]r�rzr�r7r7r8rh�sz!_NetlocResultMixinBytes._hostinfoNr�r7r7r7r8r��s

r�)�
namedtuplerz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@seZdZdZdd�ZdS)rr7cCs |jr|jd|jS|jSdS)N�#��fragment�urlrcr7r7r8�geturlKszDefragResult.geturlN�rYrZr[r]r�r7r7r7r8rIsc@seZdZdZdd�ZdS)rr7cCst|�Sr<�rrcr7r7r8r�SszSplitResult.geturlNr�r7r7r7r8rQsc@seZdZdZdd�ZdS)rr7cCst|�Sr<�rrcr7r7r8r�XszParseResult.geturlNr�r7r7r7r8rVsc@seZdZdZdd�ZdS)rr7cCs |jr|jd|jS|jSdS)N�#r�rcr7r7r8r�^szDefragResultBytes.geturlNr�r7r7r7r8r\src@seZdZdZdd�ZdS)rr7cCst|�Sr<r�rcr7r7r8r�fszSplitResultBytes.geturlNr�r7r7r7r8rdsrc@seZdZdZdd�ZdS)rr7cCst|�Sr<r�rcr7r7r8r�kszParseResultBytes.geturlNr�r7r7r7r8risrcCs4ttfttfttff}|D]\}}||_||_qdSr<)rrrrrrrVr_)Z
_result_pairsZ_decodedZ_encodedr7r7r8�_fix_result_transcodingos�r�rTc
Csft||�\}}}t|||�}|\}}}}}|tvrHd|vrHt|�\}}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)rTr�uses_params�_splitparamsr)
r��scheme�allow_fragments�_coerce_resultZsplitresultr{�queryr��params�resultr7r7r8r|srcCsRd|vr,|�d|�d��}|dkr6|dfSn
|�d�}|d|�||dd�fS)N�/r�rrrO)�find�rfind)r��ir7r7r8r��s

r�cCsHt|�}dD]"}|�||�}|dkrt||�}q|||�||d�fS)Nz/?#r)�lenr��min)r��start�delim�cZwdelimr7r7r8�_splitnetloc�sr�cCs�|r|��rdSddl}|�dd�}|�dd�}|�dd�}|�dd�}|�d|�}||kr`dSdD] }||vrdtd	|d
d��qddS)Nrrxrryr��?ZNFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)�isascii�unicodedata�replaceZ	normalizero)r{r��nZnetloc2r�r7r7r8�_checknetloc�s�r�c
Cs�t||�\}}}|�t�}|�t�}tD]}|�|d�}|�|d�}q(t|�}|||t|�t|�f}t�	|d�}|r|||�St
t�tkr�t�d}}}	|�
d�}
|
dkr�|d|
�D]}|tvr�q�q�|d|
���||
dd�}}|dd�dk�r<t|d�\}}d|v�r d	|v�s4d	|v�r<d|v�r<td
��|�r\d|v�r\|�dd�\}}	d|v�rv|�dd�\}}t|�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.
    rNryrrO��//rr�zInvalid IPv6 URLr�r�)rT�lstrip�_WHATWG_C0_CONTROL_OR_SPACE�strip�_UNSAFE_URL_BYTES_TO_REMOVEr��bool�typer4�getr��MAX_CACHE_SIZEr9r��scheme_charsrjr�ro�splitr�r)
r�r�r�r��b�key�cachedr{r�r�r�r��vr7r7r8r�sH


"��
rcCs<t|�\}}}}}}}|r&d||f}|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).z%s;%s)rTr)�
componentsr�r{r�r�r�r�r�r7r7r8r�s
�rcCs�t|�\}}}}}}|s4|r$|tvs4|dd�dkr`|rP|dd�dkrPd|}d|pXd|}|rp|d|}|r�|d|}|r�|d	|}||�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).Nr�r�rOr�rryr�r�)rT�uses_netloc)r�r�r{r�r�r�r�r7r7r8rs� rc	Cs�|s|S|s|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|ks`|
tvrh||�S|
tvr�|r�|t|
|||
||f��S|}|s�|
s�|}|}
|s�|}|t|
|||
||f��S|�d�}|ddkr�|d=|dd�dkr�|�d�}n(||�d�}td|dd��|dd�<g}|D]N}|dk�rZz|��Wnt�yVYn0n|dk�rj�q(n
|�	|��q(|ddv�r�|�	d�|t|
|d�
|��p�d|
||f��S)	zaJoin a base URL and a possibly relative URL to form an absolute
    interpretation of the latter.rr����NrO�..�.)r�r�)rTr�
uses_relativer�rr��filter�pop�
IndexError�append�join)�baser�r�r�ZbschemeZbnetlocZbpathZbparamsZbqueryZ	bfragmentr�r{�pathr�r�r�Z
base_partsZsegmentsZ
resolved_pathZsegr7r7r8rsb
�
�
�
�



��rc	CsTt|�\}}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)rTrrr)	r�r��sr��p�a�qZfragZdefragr7r7r8r]srZ0123456789ABCDEFabcdefc	Cs�|s|jdSt|t�r"|�d�}|�d�}t|�dkr<|S|dg}|j}tdurbdd�tD�a|dd�D]P}z(|t|dd	��||d	d��Wqnty�|d�||�Yqn0qnd�	|�S)
z,unquote_to_bytes('abc%20def') -> b'abc def'.rK�utf-8rgrOrNcSs.i|]&}tD]}||��t�||��qqSr7)�_hexdigr@�bytes�fromhex)rGr�r�r7r7r8�
<dictcomp>�s
�z$unquote_to_bytes.<locals>.<dictcomp>r�)
r�rPrQr@r�r��
_hextobyter��KeyErrorr�)�string�bits�resr��itemr7r7r8rps,



�rz([-]+)r�r�cCs�t|t�rt|��||�Sd|vr,|j|S|dur8d}|durDd}t�|�}|dg}|j}tdt|�d�D],}|t||��||��|||d�qnd�	|�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'.
    rfNr�r�rrOr�r)
rPr�rrEr��_asciirer��ranger�r�)r�rArBr�r�r�r�r7r7r8r�s 



rF�&c	CsNi}t|||||||d�}|D]*\}	}
|	|vr>||	�|
�q|
g||	<q|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.
    )rArB�max_num_fieldsrl)r
r�)�qs�keep_blank_values�strict_parsingrArBr�rlZ
parsed_result�pairs�name�valuer7r7r8r	�s�r	cCs.t|�\}}t|�\}}|r*t|ttf�s2td��|durXd|�|�}	||	krXtd��dd�|�|�D�}
g}|
D]�}|s�|s�qt|�dd�}
t|
�dkr�|r�td	|f��|rt|
�d
�nqtt|
d�s�|rt|
d�	dd
�}t
|||d�}||�}|
d�	dd
�}t
|||d�}||�}|�||f�qt|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.NrOzMax number of fields exceededcSsg|]}|�qSr7r7)rG�s1r7r7r8�
<listcomp>rKzparse_qsl.<locals>.<listcomp>�=r�zbad query field: %rrr�+� rI)rTrPrQr�ro�countr�r�r�r�r)r�r�r�rArBr�rlr�r��
num_fieldsr��rZ
name_valueZnvr�r�r7r7r8r
�s:r
cCs|�dd�}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�r�)r�r)r�rArBr7r7r8rsrsBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Quoterz�A mapping from bytes (in range(0,256)) to strings.

    String values are percent-encoded byte values, unless the key < 128, and
    in the "safe" set (either the specified safe set, or default set).
    cCst�|�|_dS)zsafe: bytes object.N)�_ALWAYS_SAFE�union�safe)rXr�r7r7r8�__init__1szQuoter.__init__cCsd|jjt|�fS)Nz<%s %r>)�	__class__rY�dictrcr7r7r8�__repr__5szQuoter.__repr__cCs(||jvrt|�nd�|�}|||<|S)Nz%{:02X})r��chr�format)rXr�r�r7r7r8�__missing__9szQuoter.__missing__N)rYrZr[r\r�r�r�r7r7r7r8r�)sr�r�cCsbt|t�r8|s|S|durd}|dur*d}|�||�}n |durHtd��|durXtd��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).
    Nr�r;z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)rPrQr@rRr
)r�r�rArBr7r7r8r?s'
rcCsdt|t�rd|vs$t|t�r2d|vr2t||||�St|t�rBd}nd}t|||||�}|�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�� r�)rPrQr�rr�)r�r�rArBZspacer7r7r8rus��
rcs�t|ttf�std��|sdSt|t�r6|�dd�}ntdd�|D��}|�t|�s^|��Szt	|�Wn$t
y�t|�jt	|<�Yn0d�
�fdd�|D��S)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 bytesrr:�ignorecSsg|]}|dkr|�qS)�r7)rGr�r7r7r8r��rKz$quote_from_bytes.<locals>.<listcomp>csg|]}�|��qSr7r7)rG�char�Zquoterr7r8r��rK)rPr��	bytearrayrRrQr@�rstrip�_ALWAYS_SAFE_BYTESrEr6r�r��__getitem__r�)Zbsr�r7r�r8r
�s
r
c	Cst|d�r|��}nNzt|�r0t|dt�s0t�Wn.ty`t��\}}}td��|��Yn0g}	|s�|D]j\}
}t|
t	�r�||
|�}
n|t
|
�|||�}
t|t	�r�|||�}n|t
|�|||�}|	�|
d|�qn�n |D�]\}
}t|
t	��r||
|�}
n|t
|
�|||�}
t|t	��r@|||�}|	�|
d|�q�t|t
��rn|||||�}|	�|
d|�q�zt|�}Wn8t�y�|t
|�|||�}|	�|
d|�Yq�0|D]B}
t|
t	��r�||
|�}
n|t
|
�|||�}
|	�|
d|
��q�q�d�|	�S)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 objectr�r�)
�hasattrr�r�rPrLrR�sys�exc_info�with_tracebackr�rQr�r�)r�Zdoseqr�rArBZ	quote_viaZtyZva�tb�l�kr�rH�eltr7r7r8r�sR

�



rcCstjdtdd�t|�S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r���
stacklevel)�warnings�warn�DeprecationWarning�	_to_bytes�r�r7r7r8�to_bytes�s�rcCsHt|t�rDz|�d���}Wn&tyBtdt|�d��Yn0|S)zto_bytes(u"URL") --> 'URL'.�ASCIIzURL z contains non-ASCII characters)rPrQr@rE�UnicodeError�reprrr7r7r8r
�s
�r
cCs`t|���}|dd�dkr<|dd�dkr<|dd���}|dd�dkr\|dd���}|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.
    NrO�<r��>�zURL:)rQr�rr7r7r8�unwraps rcCstjdtdd�t|�S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)r
rr�
_splittyperr7r7r8�	splittypes�rcCsDtdurt�dtj�at�|�}|r<|��\}}|��|fSd|fS)z:splittype('type:opaquestring') --> 'type', 'opaquestring'.Nz
([^/:]+):(.*))�	_typeprog�re�compile�DOTALL�match�groupsrj)r�rr��datar7r7r8rs
rcCstjdtdd�t|�S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)r
rr�
_splithostrr7r7r8�	splithost#s�r!cCsXtdurt�dtj�at�|�}|rP|��\}}|rH|ddkrHd|}||fSd|fS)z;splithost('//host[:port]/path') --> 'host[:port]', '/path'.Nz//([^/#?]*)(.*)rr�)�	_hostprogrrrrr)r�rZ	host_portr�r7r7r8r +s
r cCstjdtdd�t|�S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)r
rr�
_splituser��hostr7r7r8�	splituser:s�r&cCs |�d�\}}}|r|nd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.rxN�r|)r%�userr�r7r7r8r#Asr#cCstjdtdd�t|�S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)r
rr�_splitpasswd)r(r7r7r8�splitpasswdGs�r*cCs |�d�\}}}||r|ndfS)z/splitpasswd('user:passwd') -> 'user', 'passwd'.ryN�ri)r(r�Zpasswdr7r7r8r)Nsr)cCstjdtdd�t|�S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)r
rr�
_splitportr$r7r7r8�	splitportTs�r-cCsDtdurt�dtj�at�|�}|r<|��\}}|r<||fS|dfS)z*splitport('host:port') --> 'host', 'port'.Nz
(.*):([0-9]*))�	_portprogrrr�	fullmatchr)r%rrpr7r7r8r,]s
r,r�cCstjdtdd�t||�S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)r
rr�_splitnport)r%�defportr7r7r8�
splitnportks�r2cCsR|�d�\}}}|s|}n0|rJzt|�}Wnty@d}Yn0||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 are found after ':'.
    Return None if ':' but not a valid number.ryN)r|rnro)r%r1r�rpZnportr7r7r8r0rs
r0cCstjdtdd�t|�S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)r
rr�_splitqueryrr7r7r8�
splitquery�s�r4cCs$|�d�\}}}|r||fS|dfS)z/splitquery('/path?query') --> '/path', 'query'.r�Nr')r�r�r�r�r7r7r8r3�sr3cCstjdtdd�t|�S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)r
rr�	_splittagrr7r7r8�splittag�s�r6cCs$|�d�\}}}|r||fS|dfS)z)splittag('/path#tag') --> '/path', 'tag'.r�Nr')r�r�r��tagr7r7r8r5�sr5cCstjdtdd�t|�S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r)r
rr�
_splitattrrr7r7r8�	splitattr�s�r9cCs|�d�}|d|dd�fS)zksplitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...].r�rrON)r�)r�Zwordsr7r7r8r8�s
r8cCstjdtdd�t|�S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadr�r)r
rr�_splitvalue)�attrr7r7r8�
splitvalue�s�r<cCs |�d�\}}}||r|ndfS)z-splitvalue('attr=value') --> 'attr', 'value'.r�Nr+)r;r�r�r7r7r8r:�sr:)rT)r)rT)T)r�r�)FFr�r�Nr�)FFr�r�Nr�)r�r�)r�NN)rNN)r�)r�)r�)ir\rrrt�collectionsr
�__all__r�r�r�Znon_hierarchicalZ
uses_queryZ
uses_fragmentr�r�r�r�r4r9Z_implicit_encodingZ_implicit_errorsr>rCrNrT�objectrUr^r`rwr�r�Z_DefragResultBaseZ_SplitResultBaseZ_ParseResultBaser�r�r�r{r�r�r�Z
ResultBaserrrrrrr�rr�r�r�rrrrrr�r�rrr�rr	r
r�	frozensetr�r�r�r6�defaultdictr�rrr
rrr
rrrrr!r"r r&r#r*r)r-r.r,r2r0r4r3r6r5r9r8r<r:r7r7r7r8�<module>s�!�
�
'
��

	

=
E

�
*�
C
	
6

�
Q





Hacked By AnonymousFox1.0, Coded By AnonymousFox