Your IP : 3.149.25.26


Current Path : /opt/alt/python38/lib64/python3.8/urllib/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/urllib/__pycache__/parse.cpython-38.opt-2.pyc

U

i�f���@s�ddlZddlZddlZddlZdddddddd	d
ddd
dddddddddgZdddddddddd d!d"d#d$d%d&d'd(d)gZdddddd*dddd!dd d+d"d#d$d,d&d'd%d-d.d/d(d)gZddd0d"dddd d#d$d1d2d!d%d3gZdd0d4d5d*ddd+d1d2g
Zdddddd d!dd#d$d1d2gZ	ddd0ddd5dddd d+dd"g
Z
d6Zd7Zd8d9d:gZ
d;ZiZd<d=�Zd>Zd?Zd@dA�ZeefdBdC�ZeefdDdE�ZdFdG�ZGdHdI�dIe�ZGdJdK�dKe�ZGdLdM�dMe�ZGdNdO�dOee�ZGdPdQ�dQee�ZddRlmZeddS�ZeddT�ZeddU�Z dVe_!dWej"_!dXej#_!dYe_!dZej$_!d[ej%_!d\ej&_!d]ej'_!d^ej#_!d_e _!ej$j!e j$_!ej%j!e j%_!ej&j!e j&_!d`e j(_!ej'j!e j'_!ej#j!e j#_!eZ)Gdad�dee�Z*Gdbd�dee�Z+Gdcd�de e�Z,Gddd�dee�Z-Gded�dee�Z.Gdfd�de e�Z/dgdh�Z0e0�[0d�djd�Z1dkdl�Z2d�dmdn�Z3dodp�Z4dqdr�Z5d�dsd�Z6dtd�Z7dud�Z8d�dvd�Z9dwd�Z:dxZ;da<dyd�Z=e�>dz�Z?d�d}d�Z@d�d�d	�ZAd�d�d
�ZBd�d�d�ZCeDd��ZEeFeE�ZGiZHGd�d��d�ejI�ZJd�d�d�ZKd�d�d�ZLd�d�d
�ZMd~dddeLfd�d�ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRdaSd�d��ZTd�d��ZUdaVd�d��ZWd�d��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)��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!	

 �	�
�
�cCst��t��dS�N)�_parse_cache�clear�
_safe_quoters�r"r"�1/opt/alt/python38/lib64/python3.8/urllib/parse.py�clear_cache_sr$�ascii�strictcCs|Srr")�objr"r"r#�_noopnsr(cCs|�||�Sr��encode)r'�encoding�errorsr"r"r#�_encode_resultqsr-cst��fdd�|D��S)Nc3s"|]}|r|����ndVqdS)rN��decode��.0�x�r+r,r"r#�	<genexpr>wsz_decode_args.<locals>.<genexpr>)�tuple)�argsr+r,r"r3r#�_decode_argsusr7cGsVt|dt�}|dd�D]}|rt|t�|krtd��q|rH|tfSt|�tfS)Nr�z$Cannot mix str and non-str arguments)�
isinstance�str�	TypeErrorr(r7r-)r6Z	str_input�argr"r"r#�_coerce_argsys

r=c@seZdZdZddd�ZdS)�_ResultMixinStrr"r%r&cs|j��fdd�|D��S)Nc3s|]}|����VqdSrr)r0r3r"r#r4�sz)_ResultMixinStr.encode.<locals>.<genexpr>)�_encoded_counterpart��selfr+r,r"r3r#r*�sz_ResultMixinStr.encodeN)r%r&)�__name__�
__module__�__qualname__�	__slots__r*r"r"r"r#r>�sr>c@seZdZdZddd�ZdS)�_ResultMixinBytesr"r%r&cs|j��fdd�|D��S)Nc3s|]}|����VqdSrr.r0r3r"r#r4�sz+_ResultMixinBytes.decode.<locals>.<genexpr>)�_decoded_counterpartr@r"r3r#r/�sz_ResultMixinBytes.decodeN)r%r&)rBrCrDrEr/r"r"r"r#rF�srFc@s@eZdZdZedd��Zedd��Zedd��Zedd	��Zd
S)�_NetlocResultMixinBaser"cCs
|jdS)Nr��	_userinfo�rAr"r"r#�username�sz_NetlocResultMixinBase.usernamecCs
|jdS)Nr8rIrKr"r"r#�password�sz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|t�r dnd}|�|�\}}}|��||S)Nr�%�%)�	_hostinfor9r:�	partition�lower)rA�hostname�	separatorZpercentZzoner"r"r#rS�s
z_NetlocResultMixinBase.hostnamecCsl|jd}|dk	rhzt|d�}Wn(tk
rHd|��}t|�d�YnXd|kr^dkshntd��|S)Nr8�
z+Port could not be cast to integer value as ri��zPort out of range 0-65535)rP�int�
ValueError)rA�port�messager"r"r#rX�s

z_NetlocResultMixinBase.portN)	rBrCrDrE�propertyrLrMrSrXr"r"r"r#rH�s



rHc@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinStrr"cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:��netloc�
rpartitionrQ�rAr_ZuserinfoZ	have_info�hostinforLZ
have_passwordrMr"r"r#rJ�sz_NetlocResultMixinStr._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nr\�[�]r]r^�rAr_�_rbZhave_open_brZ	bracketedrSrXr"r"r#rP�sz_NetlocResultMixinStr._hostinfoN�rBrCrDrErZrJrPr"r"r"r#r[�s

r[c@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinBytesr"cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:r^rar"r"r#rJ�sz!_NetlocResultMixinBytes._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nri�[�]rjr^rer"r"r#rP�sz!_NetlocResultMixinBytes._hostinfoNrgr"r"r"r#rh�s

rh)�
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.
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)rr"cCs |jr|jd|jS|jSdS�N�#��fragment�urlrKr"r"r#�geturlHszDefragResult.geturlN�rBrCrDrErsr"r"r"r#rFsc@seZdZdZdd�ZdS)rr"cCst|�Sr�rrKr"r"r#rsPszSplitResult.geturlNrtr"r"r"r#rNsc@seZdZdZdd�ZdS)rr"cCst|�Sr�rrKr"r"r#rsUszParseResult.geturlNrtr"r"r"r#rSsc@seZdZdZdd�ZdS)rr"cCs |jr|jd|jS|jSdS)N�#rprKr"r"r#rs[szDefragResultBytes.geturlNrtr"r"r"r#rYsc@seZdZdZdd�ZdS)rr"cCst|�SrrurKr"r"r#rscszSplitResultBytes.geturlNrtr"r"r"r#rasc@seZdZdZdd�ZdS)rr"cCst|�SrrvrKr"r"r#rshszParseResultBytes.geturlNrtr"r"r"r#rfscCs4ttfttfttff}|D]\}}||_||_qdSr)rrrrrrr?rG)Z
_result_pairsZ_decodedZ_encodedr"r"r#�_fix_result_transcodingls�rxTc
Csft||�\}}}t|||�}|\}}}}}|tkrHd|krHt|�\}}nd}t||||||�}	||	�S)N�;r)r=r�uses_params�_splitparamsr)
rr�scheme�allow_fragments�_coerce_resultZsplitresultr_�queryrq�params�resultr"r"r#ryscCsRd|kr,|�d|�d��}|dkr6|dfSn
|�d�}|d|�||dd�fS)N�/ryrrr8)�find�rfind)rr�ir"r"r#r{�s

r{cCsHt|�}dD]"}|�||�}|dkrt||�}q|||�||d�fS)Nz/?#r)�lenr��min)rr�start�delim�cZwdelimr"r"r#�_splitnetloc�sr�cCs�|r|��rdSddl}|�dd�}|�dd�}|�dd�}|�dd�}|�d|�}||kr`dSdD] }||krdtd	|d
d��qddS)Nrr\rr]ro�?�NFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)�isascii�unicodedata�replace�	normalizerW)r_r��nZnetloc2r�r"r"r#�_checknetloc�s�r�cCstD]}|�|d�}q|S)Nr)�_UNSAFE_URL_BYTES_TO_REMOVEr�)rr�br"r"r#�_remove_unsafe_bytes_from_url�sr�c
Cs�t||�\}}}t|�}t|�}|�t�}|�t�}t|�}|||t|�t|�f}t�|d�}|rj||�St	t�t
kr|t�d}}}|�d�}	|	dk�r�|d|	�dk�rn||	dd�}|dd�dk�rt
|d�\}}d|kr�d	|k�sd	|k�rd|k�rtd
��|�r,d|k�r,|�dd�\}}d|k�rF|�dd�\}}t|�td||||�}
|
t|<||
�S|d|	�D]}|tk�rz�qҐqz||	dd�}|�r�td
d�|D���r�|d|	���|}}|dd�dk�r"t
|d�\}}d|k�rd	|k�sd	|k�r"d|k�r"td
��|�rBd|k�rB|�dd�\}}d|k�r\|�dd�\}}t|�t|||||�}
|
t|<||
�S)Nrr]rrr8��//rcrdzInvalid IPv6 URLror�css|]}|dkVqdS)�
0123456789Nr"�r1r�r"r"r#r4�szurlsplit.<locals>.<genexpr>)r=r��lstrip�_WHATWG_C0_CONTROL_OR_SPACE�strip�bool�typer�getr��MAX_CACHE_SIZEr$r�r�rW�splitr�r�scheme_chars�anyrR)
rrr|r}r~�key�cachedr_rrqr��vr��restr"r"r#r�sn



��


��
cCs<t|�\}}}}}}}|r&d||f}|t|||||f��S)Nz%s;%s)r=r)�
componentsr|r_rrr�rrqr~r"r"r#r�s
�cCs�t|�\}}}}}}|s4|r$|tks4|dd�dkr`|rP|dd�dkrPd|}d|pXd|}|rp|d|}|r�|d|}|r�|d|}||�S)	Nr�r�r8r�rr]r�ro)r=�uses_netloc)r�r|r_rrrrqr~r"r"r#r�s� c	Cs�|s|S|s|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|ks`|
tkrh||�S|
tkr�|r�|t|
|||
||f��S|}|s�|
s�|}|}
|s�|}|t|
|||
||f��S|�d�}|ddkr�|d=|dd�dkr�|�d�}n(||�d�}td|dd��|dd�<g}|D]P}|dk�r\z|��Wntk
�rXYnXn|dk�rl�q(n
|�	|��q(|ddk�r�|�	d�|t|
|d�
|��p�d|
||f��S)Nrr����r8�..�.)r�r�)r=r�
uses_relativer�rr��filter�pop�
IndexError�append�join)�baserrr}r~ZbschemeZbnetlocZbpathZbparamsZbqueryZ	bfragmentr|r_�pathr�rrqZ
base_partsZsegmentsZ
resolved_pathZsegr"r"r#rsp
�
�
�
�



��c	CsTt|�\}}d|kr>t|�\}}}}}}t|||||df�}nd}|}|t||��S)Nror)r=rrr)	rrr~�sr��p�a�qZfragZdefragr"r"r#rSsZ0123456789ABCDEFabcdefc	Cs�|s|jdSt|t�r"|�d�}|�d�}t|�dkr<|S|dg}|j}tdkrbdd�tD�a|dd�D]R}z(|t|dd��||dd��Wqntk
r�|d�||�YqnXqnd�	|�S)	N��utf-8rOr8rcSs.i|]&}tD]}||��t�||��qqSr")�_hexdigr*�bytes�fromhex)r1r�r�r"r"r#�
<dictcomp>ys
�
z$unquote_to_bytes.<locals>.<dictcomp>r�)
r�r9r:r*r�r��
_hextobyter��KeyErrorr�)�string�bits�resr��itemr"r"r#rfs,



�z([-]+)r�r�cCs�t|t�rtd��d|kr$|j|S|dkr0d}|dkr<d}t�|�}|dg}|j}tdt|�d�D],}|t||��	||��|||d�qfd�
|�S)	NzExpected str, got bytesrNr�r�rr8r�r)r9r�r;r��_asciirer��ranger�rr/r�)r�r+r,r�r�r�r�r"r"r#r�s 



F�&c	CsNi}t|||||||d�}|D]*\}	}
|	|kr>||	�|
�q|
g||	<q|S)N)r+r,�max_num_fieldsrT)r
r�)�qs�keep_blank_values�strict_parsingr+r,r�rTZ
parsed_result�pairs�name�valuer"r"r#r	�s�cCs.t|�\}}t|�\}}|r*t|ttf�s2td��|dk	rXd|�|�}	||	krXtd��dd�|�|�D�}
g}|
D]�}|s�|s�qt|�dd�}
t|
�dkr�|r�td|f��|rt|
�d	�nqtt|
d�s�|rt|
d
�	dd�}t
|||d
�}||�}|
d�	dd�}t
|||d
�}||�}|�||f�qt|S)Nz*Separator must be of type string or bytes.r8zMax number of fields exceededcSsg|]}|�qSr"r")r1�s1r"r"r#�
<listcomp>�szparse_qsl.<locals>.<listcomp>�=r�zbad query field: %rrr�+� r3)r=r9r:r�rW�countr�r�r�r�r)r�r�r�r+r,r�rTr~rf�
num_fieldsr��rZ
name_valueZnvr�r�r"r"r#r
�s:cCs|�dd�}t|||�S)Nr�r�)r�r)r�r+r,r"r"r#rssBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s$eZdZdd�Zdd�Zdd�ZdS)�QuotercCst�|�|_dSr)�_ALWAYS_SAFE�union�safe)rAr�r"r"r#�__init__'szQuoter.__init__cCsd|jjt|�fS)Nz<%s %r>)�	__class__rB�dictrKr"r"r#�__repr__+szQuoter.__repr__cCs(||jkrt|�nd�|�}|||<|S)Nz%{:02X})r��chr�format)rAr�r�r"r"r#�__missing__/szQuoter.__missing__N)rBrCrDr�r�r�r"r"r"r#r�sr�r�cCsbt|t�r8|s|S|dkrd}|dkr*d}|�||�}n |dk	rHtd��|dk	rXtd��t||�S)Nr�r&z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r9r:r*r;r
)r�r�r+r,r"r"r#r5s'
cCsdt|t�rd|ks$t|t�r2d|kr2t||||�St|t�rBd}nd}t|||||�}|�dd�S)Nr�� r�)r9r:r�rr�)r�r�r+r,Zspacer"r"r#rks��
cs�t|ttf�std��|sdSt|t�r6|�dd�}ntdd�|D��}|�t|�s^|��Szt	|�Wn&t
k
r�t|�jt	|<�YnXd�
�fdd�|D��S)Nz!quote_from_bytes() expected bytesrr%�ignorecSsg|]}|dkr|�qS)�r"r�r"r"r#r��sz$quote_from_bytes.<locals>.<listcomp>csg|]}�|��qSr"r")r1�char�Zquoterr"r#r��s)r9r��	bytearrayr;r:r*�rstrip�_ALWAYS_SAFE_BYTESr/r!r�r��__getitem__r�)Zbsr�r"r�r#r
|s
c	Cst|d�r|��}nPzt|�r0t|dt�s0t�Wn0tk
rbt��\}}}td��|��YnXg}	|s�|D]j\}
}t|
t	�r�||
|�}
n|t
|
�|||�}
t|t	�r�|||�}n|t
|�|||�}|	�|
d|�qp�n"|D�]\}
}t|
t	��r||
|�}
n|t
|
�|||�}
t|t	��rB|||�}|	�|
d|�q�t|t
��rp|||||�}|	�|
d|�q�zt|�}Wn:tk
�r�|t
|�|||�}|	�|
d|�Yq�X|D]B}
t|
t	��r�||
|�}
n|t
|
�|||�}
|	�|
d|
��q�q�d�|	�S)N�itemsrz1not a valid non-string sequence or mapping objectr�r�)
�hasattrr�r�r9r5r;�sys�exc_info�with_tracebackr�r:r�r�)rZdoseqr�r+r,Z	quote_viaZtyZva�tb�l�kr�r2Zeltr"r"r#r�sR

�



cCstjdtdd�t|�S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r���
stacklevel)�warnings�warn�DeprecationWarning�	_to_bytes�rrr"r"r#�to_bytes�s
�r�cCsJt|t�rFz|�d���}Wn(tk
rDtdt|�d��YnX|S)N�ASCIIzURL z contains non-ASCII characters)r9r:r*r/�UnicodeError�reprr�r"r"r#r��s
�r�cCs`t|���}|dd�dkr<|dd�dkr<|dd���}|dd�dkr\|dd���}|S)Nr8�<r��>�zURL:)r:r�r�r"r"r#�unwrap�s rcCstjdtdd�t|�S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r��
_splittyper�r"r"r#�	splittypes
�rcCsDtdkrt�dtj�at�|�}|r<|��\}}|��|fSd|fS)Nz
([^/:]+):(.*))�	_typeprog�re�compile�DOTALL�match�groupsrR)rrr	r|�datar"r"r#rs
rcCstjdtdd�t|�S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r��
_splithostr�r"r"r#�	splithosts
�r
cCsXtdkrt�dtj�at�|�}|rP|��\}}|rH|ddkrHd|}||fSd|fS)Nz//([^/#?]*)(.*)rr�)�	_hostprogrrrr	r
)rrr	Z	host_portr�r"r"r#r!s
rcCstjdtdd�t|�S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r��
_splituser��hostr"r"r#�	splituser0s
�rcCs |�d�\}}}|r|nd|fS)Nr\�r`)r�userr�r"r"r#r7srcCstjdtdd�t|�S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r��_splitpasswd)rr"r"r#�splitpasswd=s
�rcCs |�d�\}}}||r|ndfS�Nr]�rQ)rr�Zpasswdr"r"r#rDsrcCstjdtdd�t|�S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r��
_splitportrr"r"r#�	splitportJs
�rcCsDtdkrt�dtj�at�|�}|r<|��\}}|r<||fS|dfS)Nz
(.*):([0-9]*))�	_portprogrrr�	fullmatchr
)rr	rXr"r"r#rSs
rr�cCstjdtdd�t||�S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r��_splitnport)r�defportr"r"r#�
splitnportas
�rcCsT|�d�\}}}|s|}n2|rLzt|�}Wntk
rBd}YnX||fS||fSr)r`rVrW)rrr�rXZnportr"r"r#rhs
rcCstjdtdd�t|�S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r��_splitqueryr�r"r"r#�
splitqueryys
�r!cCs$|�d�\}}}|r||fS|dfS)Nr�r)rrr�r�rr"r"r#r �sr cCstjdtdd�t|�S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r��	_splittagr�r"r"r#�splittag�s
�r#cCs$|�d�\}}}|r||fS|dfSrnr)rrr�r��tagr"r"r#r"�sr"cCstjdtdd�t|�S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r��
_splitattrr�r"r"r#�	splitattr�s
�r&cCs|�d�}|d|dd�fS)Nryrr8)r�)rrZwordsr"r"r#r%�s
r%cCstjdtdd�t|�S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadr�r�)r�r�r��_splitvalue)�attrr"r"r#�
splitvalue�s
�r)cCs |�d�\}}}||r|ndfS)Nr�r)r(r�r�r"r"r#r'�sr')rT)r)rT)T)r�r�)FFr�r�Nr�)FFr�r�Nr�)r�r�)r�NN)rNN)r�)r�)r�)irr��collectionsr��__all__r�r�rzZnon_hierarchicalZ
uses_queryZ
uses_fragmentr�r�r�r�rr$Z_implicit_encodingZ_implicit_errorsr(r-r7r=�objectr>rFrHr[rhrmZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBase�__doc__rrrqr|r_r�rr�Z
ResultBaserrrrrrrxrr{r�r�r�rrrrrr�r�rrr�rr	r
r�	frozensetr�r�r�r!�defaultdictr�rrr
rr�r�rrrrr
rrrrrrrrrrrr!r r#r"r&r%r)r'r"r"r"r#�<module>"s��������
�
�
%
��

	

?
E

�
*�
C
	
6

�
Q





?>