KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : andertr9 ( 1047)
PHP Version : 8.2.18
Disable Function : NONE
Directory :  /lib64/python3.6/urllib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python3.6/urllib/__pycache__/parse.cpython-36.pyc
3

0��f��@sddZddlZddlZddlZddddddd	d
ddd
ddddddddddgZddddddddd d!d"d#d$d%d&d'd(d)d*gZdddddd+dddd"d d!d,d#d$d%d-d'd(d&d.d/d0d)d*gZddd1d#ddd d!d$d%d2d3d"d&d4gZdd1d5d6d+ddd,d2d3g
Zddddd d!d"dd$d%d2d3gZ	ddd1ddd6ddd d!d,dd#g
Z
d7Zd8Zd9d:d;gZ
d<ZiZd=d>�Zd?Zd@ZdAdB�ZeefdCdD�ZeefdEdF�ZdGdH�ZGdIdJ�dJe�ZGdKdL�dLe�ZGdMdN�dNe�ZGdOdP�dPee�ZGdQdR�dRee�ZddSlmZeddT�ZeddU�ZeddV�Z dWe_dXej!_dYej"_dZe_d[ej#_d\ej$_d]ej%_d^ej&_d_ej"_d`e _ej#je j#_ej$je j$_ej%je j%_dae j'_ej&je j&_ej"je j"_eZ(Gdbd�dee�Z)Gdcd�dee�Z*Gddd�de e�Z+Gded�dee�Z,Gdfd�dee�Z-Gdgd�de e�Z.dhdi�Z/e/�[/d�dkd�Z0dldm�Z1d�dndo�Z2dpdq�Z3drds�Z4d�dtd�Z5dud�Z6dvd�Z7d�dwd�Z8dxd�Z9dyZ:da;dzd�Z<ej=d{�Z>d�d~d�Z?d�d�d
�Z@d�d�d�ZAd�d�d�ZBeCd��ZDeEeD�ZFiZGGd�d��d�ejH�ZId�d�d�ZJd�d�d
�ZKd�d�d�ZLddddeKfd�d	�ZMd�d��ZNd�d��ZOdaPd�d��ZQdaRd�d��ZSd�d��ZTd�d��ZUdaVd�d��ZWd�d�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\dS)�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�Zftp�httpZgopherZnntpZimapZwais�fileZhttpsZshttpZmmsZprosperoZrtspZrtspuZsftpZsvnzsvn+sshZwsZwssZtelnetZsnewsZrsyncZnfsZgitzgit+sshZhdlZsipZsipsZtelZmailtoZnewszAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!	

 �	�
�
�cCstj�tj�dS)z,Clear the parse cache and the quoters cache.N)�_parse_cache�clear�
_safe_quoters�r!r!�/usr/lib64/python3.6/parse.py�clear_cache^sr#�ascii�strictcCs|S)Nr!)�objr!r!r"�_noopmsr'cCs|j||�S)N)�encode)r&�encoding�errorsr!r!r"�_encode_resultpsr+cst��fdd�|D��S)Nc3s"|]}|r|j���ndVqdS)rN)�decode)�.0�x)r)r*r!r"�	<genexpr>vsz_decode_args.<locals>.<genexpr>)�tuple)�argsr)r*r!)r)r*r"�_decode_argstsr2cGsZt|dt�}x.|dd�D]}|rt|t�|krtd��qW|rL|tfSt|�tfS)Nr�z$Cannot mix str and non-str arguments)�
isinstance�str�	TypeErrorr'r2r+)r1Z	str_input�argr!r!r"�_coerce_argsxs
r8c@seZdZdZfZddd�ZdS)�_ResultMixinStrz>Standard approach to encoding parsed results from str to bytesr$r%cs|j��fdd�|D��S)Nc3s|]}|j���VqdS)N)r()r-r.)r)r*r!r"r/�sz)_ResultMixinStr.encode.<locals>.<genexpr>)�_encoded_counterpart)�selfr)r*r!)r)r*r"r(�sz_ResultMixinStr.encodeN)r$r%)�__name__�
__module__�__qualname__�__doc__�	__slots__r(r!r!r!r"r9�sr9c@seZdZdZfZddd�ZdS)�_ResultMixinBytesz>Standard approach to decoding parsed results from bytes to strr$r%cs|j��fdd�|D��S)Nc3s|]}|j���VqdS)N)r,)r-r.)r)r*r!r"r/�sz+_ResultMixinBytes.decode.<locals>.<genexpr>)�_decoded_counterpart)r;r)r*r!)r)r*r"r,�sz_ResultMixinBytes.decodeN)r$r%)r<r=r>r?r@r,r!r!r!r"rA�srAc@sDeZdZdZfZedd��Zedd��Zedd��Zedd	��Z	d
S)�_NetlocResultMixinBasezHShared methods for the parsed result objects containing a netloc elementcCs
|jdS)Nr)�	_userinfo)r;r!r!r"�username�sz_NetlocResultMixinBase.usernamecCs
|jdS)Nr3)rD)r;r!r!r"�password�sz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|t�r dnd}|j|�\}}}|j�||S)Nr�%�%)�	_hostinfor4r5�	partition�lower)r;�hostnameZ	separatorZpercentZzoner!r!r"rL�s
z_NetlocResultMixinBase.hostnamecCs@|jd}|dk	r<t|d�}d|ko.dkns<td��|S)Nr3�
ri��zPort out of range 0-65535)rI�int�
ValueError)r;�portr!r!r"rP�s

z_NetlocResultMixinBase.portN)
r<r=r>r?r@�propertyrErFrLrPr!r!r!r"rC�srCc@s(eZdZfZedd��Zedd��ZdS)�_NetlocResultMixinStrcCsD|j}|jd�\}}}|r4|jd�\}}}|s<d}nd}}||fS)N�@�:)�netloc�
rpartitionrJ)r;rU�userinfo�	have_info�hostinforE�
have_passwordrFr!r!r"rD�sz_NetlocResultMixinStr._userinfocCsl|j}|jd�\}}}|jd�\}}}|rL|jd�\}}}|jd�\}}}n|jd�\}}}|sdd}||fS)NrS�[�]rT)rUrVrJ)r;rU�_rY�have_open_br�	bracketedrLrPr!r!r"rI�sz_NetlocResultMixinStr._hostinfoN)r<r=r>r@rQrDrIr!r!r!r"rR�srRc@s(eZdZfZedd��Zedd��ZdS)�_NetlocResultMixinBytescCsD|j}|jd�\}}}|r4|jd�\}}}|s<d}nd}}||fS)N�@�:)rUrVrJ)r;rUrWrXrYrErZrFr!r!r"rD�sz!_NetlocResultMixinBytes._userinfocCsl|j}|jd�\}}}|jd�\}}}|rL|jd�\}}}|jd�\}}}n|jd�\}}}|sdd}||fS)Nra�[�]rb)rUrVrJ)r;rUr]rYr^r_rLrPr!r!r"rI�sz!_NetlocResultMixinBytes._hostinfoN)r<r=r>r@rQrDrIr!r!r!r"r`�sr`)�
namedtuplezurl fragmentz!scheme netloc path query fragmentz(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.
zr
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@seZdZfZdd�ZdS)rcCs |jr|jd|jS|jSdS)N�#)�fragment�url)r;r!r!r"�geturlCszDefragResult.geturlN)r<r=r>r@rir!r!r!r"rAsc@seZdZfZdd�ZdS)rcCst|�S)N)r)r;r!r!r"riKszSplitResult.geturlN)r<r=r>r@rir!r!r!r"rIsc@seZdZfZdd�ZdS)rcCst|�S)N)r)r;r!r!r"riPszParseResult.geturlN)r<r=r>r@rir!r!r!r"rNsc@seZdZfZdd�ZdS)rcCs |jr|jd|jS|jSdS)N�#)rgrh)r;r!r!r"riVszDefragResultBytes.geturlN)r<r=r>r@rir!r!r!r"rTsc@seZdZfZdd�ZdS)rcCst|�S)N)r)r;r!r!r"ri^szSplitResultBytes.geturlN)r<r=r>r@rir!r!r!r"r\sc@seZdZfZdd�ZdS)rcCst|�S)N)r)r;r!r!r"ricszParseResultBytes.geturlN)r<r=r>r@rir!r!r!r"rascCs8ttfttfttff}x|D]\}}||_||_qWdS)N)rrrrrrr:rB)Z
_result_pairsZ_decodedZ_encodedr!r!r"�_fix_result_transcodinggs
rkTc
Csft||�\}}}t|||�}|\}}}}}|tkrHd|krHt|�\}}nd}t||||||�}	||	�S)a#Parse a URL into 6 components:
    <scheme>://<netloc>/<path>;<params>?<query>#<fragment>
    Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes.�;r)r8r�uses_params�_splitparamsr)
rh�scheme�allow_fragments�_coerce_resultZsplitresultrU�queryrg�params�resultr!r!r"rtscCsRd|kr,|jd|jd��}|dkr6|dfSn
|jd�}|d|�||dd�fS)N�/rlrrr3)�find�rfind)rh�ir!r!r"rn�s

rncCsLt|�}x*dD]"}|j||�}|dkrt||�}qW|||�||d�fS)Nz/?#r)�lenrv�min)rh�start�delim�cZwdelimr!r!r"�_splitnetloc�s
r~cCs�|stdd�|D��rdSddl}|jdd�}|jdd�}|jdd�}|jdd�}|jd	|�}||krndSx(d
D] }||krttd|dd
��qtWdS)Ncss|]}t|�dkVqdS)�N)�ord)r-r}r!r!r"r/�sz_checknetloc.<locals>.<genexpr>rrSrrTrf�?�NFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)�any�unicodedata�replace�	normalizerO)rUr��nZnetloc2r}r!r!r"�_checknetloc�s
r�cCsxtD]}|j|d�}qW|S)Nr)�_UNSAFE_URL_BYTES_TO_REMOVEr�)rh�br!r!r"�_remove_unsafe_bytes_from_url�s
r�c
Cs�t||�\}}}t|�}t|�}|jt�}|jt�}t|�}|||t|�t|�f}tj|d�}|rj||�St	t�t
kr|t�d}}}|jd�}	|	dk�r�|d|	�dk�r~|d|	�j
�}||	dd�}|dd�dk�rt|d�\}}d	|ko�d
|k�sd
|k�rd	|k�rtd��|�r<d|k�r<|jdd�\}}d
|k�rV|jd
d�\}}t|�t|||||�}
|
t|<||
�Sxd|d|	�D]}|tk�r�P�q�W||	dd�}|�s�tdd�|D���r�|d|	�j
�|}}|dd�dk�r4t|d�\}}d	|k�rd
|k�s,d
|k�r4d	|k�r4td��|�rTd|k�rT|jdd�\}}d
|k�rn|jd
d�\}}t|�t|||||�}
|
t|<||
�S)aParse a URL into 5 components:
    <scheme>://<netloc>/<path>?<query>#<fragment>
    Return a 5-tuple: (scheme, netloc, path, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes.NrrTrrr3�z//r[r\zInvalid IPv6 URLrfr�css|]}|dkVqdS)�
0123456789Nr!)r-r}r!r!r"r/�szurlsplit.<locals>.<genexpr>)r8r��lstrip�_WHATWG_C0_CONTROL_OR_SPACE�strip�bool�typer�getry�MAX_CACHE_SIZEr#rvrKr~rO�splitr�r�scheme_charsr�)
rhrorprq�key�cachedrUrrrgrx�vr}�restr!r!r"r�sd






cCs<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)r8r)�
componentsrorUrhrsrrrgrqr!r!r"r�scCs�t|�\}}}}}}|s4|r`|tkr`|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�z//r3rurrTr�rf)r8�uses_netloc)r�rorUrhrrrgrqr!r!r"r�s cCs�|s|S|s|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|ks`|
tkrh||�S|
tkr�|r�|t|
|||
||f��S|}|r�|
r�|}|}
|s�|}|t|
|||
||f��S|jd�}|ddkr�|d=|dd�dk�r�|jd�}n(||jd�}td|dd	��|dd
�<g}xX|D]P}|dk�rdy|j�Wntk
�r`YnXn|dk�rt�q0n
|j	|��q0W|ddk�r�|j	d�|t|
|dj
|��p�d|
||f��S)
zaJoin a base URL and a possibly relative URL to form an absolute
    interpretation of the latter.rrur3N�..�.���r�r�r�r�)r�r�)r8r�
uses_relativer�rr��filter�pop�
IndexError�append�join)�baserhrprqZbschemeZbnetlocZbpathZbparamsZbqueryZ	bfragmentrorU�pathrsrrrgZ
base_partsZsegmentsZ
resolved_pathZsegr!r!r"r
sT






c	CsTt|�\}}d|kr>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.
    rfr)r8rrr)	rhrq�sr��p�a�qZfragZdefragr!r!r"rOsZ0123456789ABCDEFabcdefcCs�|s|jdSt|t�r"|jd�}|jd�}t|�dkr<|S|dg}|j}tdkrbdd�tD�axb|dd�D]R}y(|t|dd	��||d	d��Wqptk
r�|d�||�YqpXqpWdj	|�S)
z,unquote_to_bytes('abc%20def') -> b'abc def'.�zutf-8rHr3rNcSs4i|],}tD]"}tt||d�g�||j��qqS)�)�_hexdig�bytesrNr()r-r�r�r!r!r"�
<dictcomp>usz$unquote_to_bytes.<locals>.<dictcomp>r�)
r�r4r5r(ryr��
_hextobyter��KeyErrorr�)�string�bits�resr��itemr!r!r"rbs*



z([-]+)�utf-8r�cCs�d|kr|j|S|dkrd}|dkr*d}tj|�}|dg}|j}x@tdt|�d�D],}|t||�j||��|||d�qVWdj|�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'.
    rGNzutf-8r�rr3r�r)r��_asciirer��rangeryrr,r�)r�r)r*r�r�r�rxr!r!r"r�s


Fc
CsPi}t||||||d�}x2|D]*\}}	||kr>||j|	�q|	g||<qW|S)a�Parse 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().

        Returns a dictionary.
    )r)r*�max_num_fields)r
r�)
�qs�keep_blank_values�strict_parsingr)r*r�Z
parsed_result�pairs�name�valuer!r!r"r	�scCst|�\}}|dk	r<d|jd�|jd�}||kr<td��dd�|jd�D�}g}	x�|D]�}
|
rl|rlqZ|
jdd�}t|�d	kr�|r�td
|
f��|rZ|jd�nqZt|d�s�|rZ|djd
d�}t|||d�}||�}|djd
d�}
t|
||d�}
||
�}
|	j||
f�qZW|	S)a�Parse 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().

        Returns a list, as G-d intended.
    Nr3�&rlzMax number of fields exceededcSs g|]}|jd�D]}|�qqS)rl)r�)r-�s1�s2r!r!r"�
<listcomp>�szparse_qsl.<locals>.<listcomp>�=r�zbad query field: %rrr�+� )r)r*)r8�countrOr�ryr�r�r)r�r�r�r)r*r�rq�
num_fieldsr��rZ
name_valueZnvr�r�r!r!r"r
�s4
cCs|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�r�)r�r)r�r)r*r!r!r"r�ssAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-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).
    cCstj|�|_dS)zsafe: bytes object.N)�_ALWAYS_SAFE�union�safe)r;r�r!r!r"�__init__szQuoter.__init__cCsd|jjt|�fS)Nz<%s %r>)�	__class__r<�dict)r;r!r!r"�__repr__szQuoter.__repr__cCs(||jkrt|�ndj|�}|||<|S)Nz%{:02X})r��chr�format)r;r�r�r!r!r"�__missing__szQuoter.__missing__N)r<r=r>r?r�r�r�r!r!r!r"r�sr�rucCsbt|t�r8|s|S|dkrd}|dkr*d}|j||�}n |dk	rHtd��|dk	rXtd��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.

    RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax lists
    the following reserved characters.

    reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
                  "$" | ","

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

    By default, the quote function is intended for quoting the path
    section of a URL.  Thus, it will not encode '/'.  This character
    is reserved, but in typical usage the quote function is being
    called on a path where the existing slash characters are used as
    reserved 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).
    Nzutf-8r%z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r4r5r(r6r
)r�r�r)r*r!r!r"r%s
cCsdt|t�rd|ks$t|t�r2d|kr2t||||�St|t�rBd}nd}t|||||�}|jdd�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�)r4r5r�rr�)r�r�r)r*Zspacer!r!r"rQs
cs�t|ttf�std��|sdSt|t�r6|jdd�}ntdd�|D��}|jt|�s^|j�Syt	|�Wn&t
k
r�t|�jt	|<�YnXdj
�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)�r!)r-r}r!r!r"r�osz$quote_from_bytes.<locals>.<listcomp>csg|]}�|��qSr!r!)r-�char)�quoterr!r"r�vs)r4r��	bytearrayr6r5r(�rstrip�_ALWAYS_SAFE_BYTESr,r r�r��__getitem__r�)Zbsr�r!)r�r"r
bs
cCst|d�r|j�}nRy t|�r2t|dt�r2t�Wn0tk
rdtj�\}}}td�j|��YnXg}	|s�xr|D]j\}
}t|
t	�r�||
|�}
n|t
|
�|||�}
t|t	�r�|||�}n|t
|�|||�}|	j|
d|�qtW�n,�x(|D�]\}
}t|
t	��r||
|�}
n|t
|
�|||�}
t|t	��rL|||�}|	j|
d|�q�t|t
��rz|||||�}|	j|
d|�q�yt|�}Wn:tk
�r�|t
|�|||�}|	j|
d|�Yq�XxJ|D]B}
t|
t	��r�||
|�}
n|t
|
�|||�}
|	j|
d|
��q�Wq�Wdj|	�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�ryr4r0r6�sys�exc_info�with_tracebackr�r5r�r�)rrZdoseqr�r)r*Z	quote_viaZtyZva�tb�l�kr�r.Zeltr!r!r"rxsP





cCsJt|t�rFy|jd�j�}Wn(tk
rDtdt|�d��YnX|S)zto_bytes(u"URL") --> 'URL'.�ASCIIzURL z contains non-ASCII characters)r4r5r(r,�UnicodeError�repr)rhr!r!r"�to_bytes�s
r�cCs`t|�j�}|dd�dkr<|dd�dkr<|dd�j�}|dd�dkr\|dd�j�}|S)	z8unwrap('<URL:type://host/path>') --> 'type://host/path'.Nr3�<�>�zURL:r�r�)r5r�)rhr!r!r"�unwrap�s r�cCsDtdkrtjdtj�atj|�}|r<|j�\}}|j�|fSd|fS)z:splittype('type:opaquestring') --> 'type', 'opaquestring'.Nz
([^/:]+):(.*))�	_typeprog�re�compile�DOTALL�match�groupsrK)rhr�ro�datar!r!r"�	splittype�s
r�cCsXtdkrtjdtj�atj|�}|rP|j�\}}|rH|ddkrHd|}||fSd|fS)z;splithost('//host[:port]/path') --> 'host[:port]', '/path'.Nz//([^/#?]*)(.*)rru)�	_hostprogr�r�r�r�r�)rhr�Z	host_portr�r!r!r"�	splithost�s
r�cCs |jd�\}}}|r|nd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.rSN)rV)�host�userr|r!r!r"�	splituser�sr�cCs |jd�\}}}||r|ndfS)z/splitpasswd('user:passwd') -> 'user', 'passwd'.rTN)rJ)r�r|Zpasswdr!r!r"�splitpasswd�sr�cCsDtdkrtjdtj�atj|�}|r<|j�\}}|r<||fS|dfS)z*splitport('host:port') --> 'host', 'port'.Nz(.*):([0-9]*)$)�	_portprogr�r�r�r�r�)r�r�rPr!r!r"�	splitports
r�r3cCsT|jd�\}}}|s|}n2|rLyt|�}Wntk
rBd}YnX||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.rTN)rVrNrO)r�Zdefportr|rPZnportr!r!r"�
splitnports
r�cCs$|jd�\}}}|r||fS|dfS)z/splitquery('/path?query') --> '/path', 'query'.r�N)rV)rhr�r|rrr!r!r"�
splitquery"srcCs$|jd�\}}}|r||fS|dfS)z)splittag('/path#tag') --> '/path', 'tag'.rfN)rV)rhr�r|�tagr!r!r"�splittag)srcCs|jd�}|d|dd�fS)zksplitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...].rlrr3N)r�)rhZwordsr!r!r"�	splitattr0s
rcCs |jd�\}}}||r|ndfS)z-splitvalue('attr=value') --> 'attr', 'value'.r�N)rJ)�attrr|r�r!r!r"�
splitvalue6sr)rT)r)rT)T)r�r�)FFr�r�N)FFr�r�N)r�r�)ruNN)rNN)rur�)r�)]r?r�r��collections�__all__r�r�rmZnon_hierarchicalZ
uses_queryZ
uses_fragmentr�r�r�r�rr#Z_implicit_encodingZ_implicit_errorsr'r+r2r8�objectr9rArCrRr`reZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBaserhrgrorUr�rrrsZ
ResultBaserrrrrrrkrrnr~r�r�rrrrrr�r�rr�r�rr	r
r�	frozensetr�r�r�r �defaultdictr�rrr
rr�r�r�r�r�r�r�r�r�r�r�rrrrr!r!r!r"�<module> s�





!


	

@
E


&
;
	
,

O



Anon7 - 2021