Your IP : 3.137.211.49


Current Path : /proc/self/root/opt/alt/python310/lib64/python3.10/urllib/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python310/lib64/python3.10/urllib/__pycache__/parse.cpython-310.opt-2.pyc

o

�?Og֪�@s	ddlZddlZddlZddlZddlZddlZgd�Zgd�Zgd�Zgd�Z	gd�Z
gd�Zgd�Zd	Z
d
Zgd�ZdZiZd
d�ZdZdZdd�Zeefdd�Zeefdd�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �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&_#d/e!j'_#d0e!j(_#d1e!j)_#d2e!j%_#d3e"_#e!j&j#e"j&_#e!j'j#e"j'_#e!j(j#e"j(_#d4e"j*_#e!j)j#e"j)_#e!j%j#e"j%_#eZ+Gd5d$�d$e e�Z,Gd6d&�d&e!e�Z-Gd7d(�d(e"e�Z.Gd8d9�d9e e�Z/Gd:d;�d;e!e�Z0Gd<d=�d=e"e�Z1d>d?�Z2e2�[2d�dBdC�Z3dDdE�Z4d�dFdG�Z5dHdI�Z6dJdK�Z7d�dLdM�Z8dNdO�Z9dPdQ�Z:d�dRdS�Z;dTdU�Z<dVZ=da>dWdX�Z?e�@dY�ZAd�d\d]�ZB	^	_d�d`da�ZC	^	_d�dbdc�ZDd�ddde�ZEeFdf�ZGeHeG�ZIiZJGdgdh�dhejK�ZLd�djdk�ZMd�dldm�ZNd�dndo�ZOd^d@ddeNfdpdq�ZPdrds�ZQdtdu�ZRdvdw�ZSdxdy�ZTdaUdzd{�ZVd|d}�ZWdaXd~d�ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^da_d�d��Z`d�d�d��Zad�d�d��Zbd�d��Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��ZjdS)��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!	

 )�	�
�
�cCs	t��t��dS�N)�_parse_cache�clear�
_safe_quoters�r8r8�3/opt/alt/python310/lib64/python3.10/urllib/parse.py�clear_cacheasr:�ascii�strictcCs|Sr4r8)�objr8r8r9�_nooppsr>cCs|�||�Sr4��encode)r=�encoding�errorsr8r8r9�_encode_resultssrCcst��fdd�|D��S)Nc3s$�|]
}|r|����ndVqdS)rN��decode��.0�x�rArBr8r9�	<genexpr>ys�"z_decode_args.<locals>.<genexpr>)�tuple)�argsrArBr8rIr9�_decode_argswsrMcGsVt|dt�}|dd�D]}|rt|t�|krtd��q
|r$|tfSt|�tfS)Nr�z$Cannot mix str and non-str arguments)�
isinstance�str�	TypeErrorr>rMrC)rLZ	str_input�argr8r8r9�_coerce_args{s�
rSc@�eZdZ	dZddd�ZdS)�_ResultMixinStrr8r;r<c�|j��fdd�|D��S)Nc3��|]	}|����VqdSr4r?rFrIr8r9rJ���z)_ResultMixinStr.encode.<locals>.<genexpr>)�_encoded_counterpart��selfrArBr8rIr9r@��z_ResultMixinStr.encodeN�r;r<)�__name__�
__module__�__qualname__�	__slots__r@r8r8r8r9rU��rUc@rT)�_ResultMixinBytesr8r;r<crV)Nc3rWr4rDrFrIr8r9rJ�rXz+_ResultMixinBytes.decode.<locals>.<genexpr>)�_decoded_counterpartrZr8rIr9rE�r\z_ResultMixinBytes.decodeNr])r^r_r`rarEr8r8r8r9rc�rbrcc@sLeZdZ	dZedd��Zedd��Zedd��Zedd	��Ze	e
j�Zd
S)�_NetlocResultMixinBaser8cC�
|jdS)Nr��	_userinfo�r[r8r8r9�username��
z_NetlocResultMixinBase.usernamecCrf)NrNrgrir8r8r9�password�rkz_NetlocResultMixinBase.passwordcCsD|jd}|s	dSt|t�rdnd}|�|�\}}}|��||S)Nr�%�%)�	_hostinforOrP�	partition�lower)r[�hostname�	separatorZpercentZzoner8r8r9rr�s
z_NetlocResultMixinBase.hostnamecCsb|jd}|dur/|��r|��rt|�}ntd|����d|kr*dks/td��td��|S)NrNz+Port could not be cast to integer value as ri��zPort out of range 0-65535)ro�isdigit�isascii�int�
ValueError)r[�portr8r8r9rx�s

�z_NetlocResultMixinBase.portN)
r^r_r`ra�propertyrjrlrrrx�classmethod�types�GenericAlias�__class_getitem__r8r8r8r9re�s




rec@�(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinStrr8cC�J|j}|�d�\}}}|r|�d�\}}}|sd}||fSd}}||fS)N�@�:��netloc�
rpartitionrp�r[r�ZuserinfoZ	have_info�hostinforjZ
have_passwordrlr8r8r9rh���z_NetlocResultMixinStr._userinfocC�l|j}|�d�\}}}|�d�\}}}|r&|�d�\}}}|�d�\}}}n|�d�\}}}|s2d}||fS)Nr��[�]r�r��r[r��_r�Zhave_open_brZ	bracketedrrrxr8r8r9ro��z_NetlocResultMixinStr._hostinfoN�r^r_r`raryrhror8r8r8r9r��
rc@r~)�_NetlocResultMixinBytesr8cCr�)N�@�:r�r�r8r8r9rh�r�z!_NetlocResultMixinBytes._userinfocCr�)Nr��[�]r�r�r�r8r8r9ro�r�z!_NetlocResultMixinBytes._hostinfoNr�r8r8r8r9r��r�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@�eZdZdZdd�ZdS)rr8cC�|jr|jd|jS|jS�N�#��fragment�urlrir8r8r9�geturlK�zDefragResult.geturlN�r^r_r`rar�r8r8r8r9rI�c@r�)rr8cC�t|�Sr4�rrir8r8r9r�S�zSplitResult.geturlNr�r8r8r8r9rQr�c@r�)rr8cCr�r4�rrir8r8r9r�Xr�zParseResult.geturlNr�r8r8r8r9rVr�c@r�)rr8cCr�)N�#r�rir8r8r9r�^r�zDefragResultBytes.geturlNr�r8r8r8r9r\r�rc@r�)rr8cCr�r4r�rir8r8r9r�fr�zSplitResultBytes.geturlNr�r8r8r8r9rdr�rc@r�)rr8cCr�r4r�rir8r8r9r�kr�zParseResultBytes.geturlNr�r8r8r8r9rir�rcCs4ttfttfttff}|D]
\}}||_||_q
dSr4)rrrrrrrYrd)Z
_result_pairsZ_decodedZ_encodedr8r8r9�_fix_result_transcodingos��r�rTc
Csh	t||�\}}}t|||�}|\}}}}}|tvr%d|vr%t|�\}}nd}t||||||�}	||	�S)N�;r)rSr�uses_params�_splitparamsr)
r��scheme�allow_fragments�_coerce_resultZsplitresultr��queryr��params�resultr8r8r9r|srcCsRd|vr|�d|�d��}|dkr|dfSn|�d�}|d|�||dd�fS)N�/r�rrrN)�find�rfind)r��ir8r8r9r��s�
r�cCsHt|�}dD]}|�||�}|dkrt||�}q|||�||d�fS)Nz/?#r)�lenr��min)r��start�delim�cZwdelimr8r8r9�_splitnetloc�s
�r�cCs�|r|��rdSddl}|�dd�}|�dd�}|�dd�}|�dd�}|�d|�}||kr0dSdD]}||vrBtd	|d
d��q2dS)Nrr�rr�r��?�NFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)ru�unicodedata�replace�	normalizerw)r�r��nZnetloc2r�r8r8r9�_checknetloc�s"���r�cCsD|�d�rt�d|�std��dSt�|�}t|tj�r td��dS)N�vz\Av[a-fA-F0-9]+\..+\ZzIPvFuture address is invalidz%An IPv4 address cannot be in brackets)�
startswith�re�matchrw�	ipaddressZ
ip_addressrOZIPv4Address)rrZipr8r8r9�_check_bracketed_host�s
�
�r�cCs�	t||�\}}}|�t�}|�t�}tD]}|�|d�}|�|d�}qt|�}|||t|�t|�f}t�	|d�}|r?||�St
t�tkrHt�d}}}	|�
d�}
|
dkrw|d|
�D]}|tvrenq]|d|
���||
dd�}}|dd�dkr�t|d�\}}d|vr�d|vs�d|vr�d|vr�td	��d|vr�d|vr�|�d�d�d�d}t|�|r�d
|vr�|�d
d�\}}	d|vr�|�dd�\}}t|�t|||||	�}
|
t|<||
�S)Nrr�rrN��//r�r�zInvalid IPv6 URLr�r�)rS�lstrip�_WHATWG_C0_CONTROL_OR_SPACE�strip�_UNSAFE_URL_BYTES_TO_REMOVEr��bool�typer5�getr��MAX_CACHE_SIZEr:r��scheme_charsrqr�rwrpr��splitr�r)r�r�r�r��b�key�cachedr�r�r�r�r�Zbracketed_hostr�r8r8r9r�sL


�"rcCs>	t|�\}}}}}}}|rd||f}|t|||||f��S)Nz%s;%s)rSr)�
componentsr�r�r�r�r�r�r�r8r8r9rs�rcCs�	t|�\}}}}}}|s|r|tvs|dd�dkr1|r)|dd�dkr)d|}d|p-d|}|r9|d|}|rA|d|}|rI|d|}||�S)	Nr�r�rNr�rr�r�r�)rS�uses_netloc)r�r�r�r�r�r�r�r8r8r9rs� rc	Cs�	|s|S|s	|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|ks1|
tvr5||�S|
tvrI|rG|t|
|||
||f��S|}|sa|
sa|}|}
|sU|}|t|
|||
||f��S|�d�}|ddkro|d=|dd�dkr}|�d�}n||�d�}td|dd��|dd�<g}|D] }|dkr�z|��Wq�ty�Yq�w|dkr�q�|�	|�q�|ddvr�|�	d�|t|
|d�
|�p�d|
||f��S)Nrr����rN�..�.)r�r�)rSr�
uses_relativer�rr��filter�pop�
IndexError�append�join)�baser�r�r�ZbschemeZbnetlocZbpathZbparamsZbqueryZ	bfragmentr�r��pathr�r�r�Z
base_partsZsegmentsZ
resolved_pathZsegr8r8r9r%sf
�
�
�
�
�
��rc	CsV	t|�\}}d|vr t|�\}}}}}}t|||||df�}nd}|}|t||��S)Nr�r)rSrrr)	r�r��sr��p�a�qZfragZdefragr8r8r9rjsrZ0123456789ABCDEFabcdefc	Cs�	|s|jdSt|t�r|�d�}|�d�}t|�dkr|S|dg}|j}tdur2dd�tD�a|dd�D]'}z|t|dd��||dd��Wq8ty_|d�||�Yq8wd�	|�S)	N��utf-8rnrNrcSs.i|]}tD]}||��t�||��qqSr8)�_hexdigr@�bytes�fromhex)rGr�r�r8r8r9�
<dictcomp>�s
��z$unquote_to_bytes.<locals>.<dictcomp>r�)
r�rOrPr@r�r��
_hextobyter��KeyErrorr�)�string�bits�resr��itemr8r8r9r}s0



��
rz([-]+)r�r�cCs�	t|t�rt|��||�Sd|vr|j|S|durd}|dur#d}t�|�}|dg}|j}tdt|�d�D]}|t||��||��|||d�q8d�	|�S)Nrmr�r�rrNr�r)
rOr�rrEr��_asciirer��ranger�r�)r�rArBr�r�r�r�r8r8r9r�s"
	


rF�&c	CsP	i}t|||||||d�}|D]\}	}
|	|vr ||	�|
�q|
g||	<q|S)N)rArB�max_num_fieldsrs)r
r�)�qs�keep_blank_values�strict_parsingrArBr�rsZ
parsed_resultZpairs�name�valuer8r8r9r	�s�r	cCs"	t|�\}}t|�\}}|rt|ttf�std��|dur-d|�|�}	||	kr-td��g}
|�|�D]Z}|s;|s;q4|�dd�}t|�dkrY|rPtd|f��|rX|�d�nq4t|d�sa|r�|d�	d	d
�}
t
|
||d�}
||
�}
|d�	d	d
�}t
|||d�}||�}|
�|
|f�q4|
S)Nz*Separator must be of type string or bytes.rNzMax number of fields exceeded�=r�zbad query field: %rrr�+� rI)rSrOrPr�rw�countr�r�r�r�r)r�r�r�rArBr�rsr�r��
num_fields�rZ
name_valueZnvr�r�r8r8r9r
�s<�r
cCs	|�dd�}t|||�S)Nr�r�)r�r)r�rArBr8r8r9r%srsBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s&eZdZ	dd�Zdd�Zdd�ZdS)�QuotercCs	t�|�|_dSr4)�_ALWAYS_SAFE�union�safe)r[rr8r8r9�__init__=szQuoter.__init__cCsd|jjt|�fS)Nz<%s %r>)�	__class__r^�dictrir8r8r9�__repr__AszQuoter.__repr__cCs(||jvr	t|�nd�|�}|||<|S)Nz%{:02X})r�chr�format)r[r�r�r8r8r9�__missing__EszQuoter.__missing__N)r^r_r`rr
r
r8r8r8r9r5s
rr�cCsd	t|t�r|s
|S|durd}|durd}|�||�}n|dur%td��|dur-td��t||�S)Nr�r<z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)rOrPr@rQr
)r�rrArBr8r8r9rKs
&
rcCsf	t|t�r
d|vst|t�rd|vrt||||�St|t�r"d}nd}t|||||�}|�dd�S)Nr�� r�)rOrPr�rr�)r�rrArBZspacer8r8r9r�s�
rcs�	t|ttf�std��|sdSt|t�r|�dd�}n	tdd�|D��}|�t|�s0|��Szt	|�Wnt
yHt|�jt	|<�Ynwd�
�fdd�|D��S)Nz!quote_from_bytes() expected bytesrr;�ignorecSsg|]}|dkr|�qS)�r8)rGr�r8r8r9�
<listcomp>�sz$quote_from_bytes.<locals>.<listcomp>csg|]}�|��qSr8r8)rG�char�Zquoterr8r9r�s)rOr��	bytearrayrQrPr@�rstrip�_ALWAYS_SAFE_BYTESrEr7r�r�__getitem__r�)Zbsrr8rr9r
�s 
�r
c	Cs�	t|d�r|��}n%zt|�rt|dt�st�Wnty/t��\}}}td��|��wg}	|sm|D]5\}
}t|
t	�rE||
|�}
n	|t
|
�|||�}
t|t	�rY|||�}n	|t
|�|||�}|	�|
d|�q6n�|D]�\}
}t|
t	�r~||
|�}
n	|t
|
�|||�}
t|t	�r�|||�}|	�|
d|�qot|t
�r�|||||�}|	�|
d|�qozt|�}Wnty�|t
|�|||�}|	�|
d|�Yqow|D]}
t|
t	�r�||
|�}
n	|t
|
�|||�}
|	�|
d|
�q�qod�|	�S)N�itemsrz1not a valid non-string sequence or mapping objectr�r�)
�hasattrrr�rOrKrQ�sys�exc_info�with_tracebackr�rPr�r�)r�ZdoseqrrArBZ	quote_viaZtyZva�tb�l�kr�rH�eltr8r8r9r�s^

���

�



�
�
rcC�tjdtdd�t|�S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r���
stacklevel)�warnings�warn�DeprecationWarning�	_to_bytes�r�r8r8r9�to_bytes�s�r)cCsH	t|t�r"z
|�d���}W|Sty!tdt|�d��w|S)N�ASCIIzURL z contains non-ASCII characters)rOrPr@rE�UnicodeError�reprr(r8r8r9r'�s
���r'cCsb	t|���}|dd�dkr|dd�dkr|dd���}|dd�dkr/|dd���}|S)NrN�<r��>�zURL:)rPr�r(r8r8r9�unwrap
s r0cCr!)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r")r$r%r&�
_splittyper(r8r8r9�	splittype��r2cCsF	tdurt�dtj�at�|�}|r|��\}}|��|fSd|fS)Nz
([^/:]+):(.*))�	_typeprogr��compile�DOTALLr��groupsrq)r�r�r��datar8r8r9r1"s
r1cCr!)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r")r$r%r&�
_splithostr(r8r8r9�	splithost/r3r:cCsZ	tdurt�dtj�at�|�}|r)|��\}}|r%|ddkr%d|}||fSd|fS)Nz//([^/#?]*)(.*)rr�)�	_hostprogr�r5r6r�r7)r�r�Z	host_portr�r8r8r9r97s
r9cCr!)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r")r$r%r&�
_splituser��hostr8r8r9�	splituserFr3r?cCs&	|�d�\}}}|r||fSd|fS)Nr��r�)r>�userr�r8r8r9r<Msr<cCr!)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r")r$r%r&�_splitpasswd)rAr8r8r9�splitpasswdSr3rCcC�$	|�d�\}}}||r|fSdfS�Nr��rp)rAr�Zpasswdr8r8r9rBZ�rBcCr!)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r")r$r%r&�
_splitportr=r8r8r9�	splitport`r3rIcCsF	tdurt�dtj�at�|�}|r|��\}}|r||fS|dfS)Nz
(.*):([0-9]*))�	_portprogr�r5r6�	fullmatchr7)r>r�rxr8r8r9rHis
rHr�cCstjdtdd�t||�S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r")r$r%r&�_splitnport)r>�defportr8r8r9�
splitnportws�
rNcCsZ	|�d�\}}}|s|}||fS|r)|��r#|��r#t|�}||fSd}||fS||fSrE)r�rtrurv)r>rMr�rxZnportr8r8r9rL~s��rLcCr!)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r")r$r%r&�_splitqueryr(r8r8r9�
splitquery�r3rPcC�&	|�d�\}}}|r||fS|dfS)Nr�r@)r�r�r�r�r8r8r9rO��
rOcCr!)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r")r$r%r&�	_splittagr(r8r8r9�splittag�r3rTcCrQr�r@)r�r�r��tagr8r8r9rS�rRrScCr!)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r")r$r%r&�
_splitattrr(r8r8r9�	splitattr�r3rWcCs 	|�d�}|d|dd�fS)Nr�rrN)r�)r�Zwordsr8r8r9rV�s
rVcCr!)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadr�r")r$r%r&�_splitvalue)�attrr8r8r9�
splitvalue�r3rZcCrD)Nr�rF)rYr�r�r8r8r9rX�rGrX)rT)r)T)r�r�)FFr�r�Nr�)r�NN)rNN)r�)r�)kr�rr{�collectionsr$r��__all__r�r�r�Znon_hierarchicalZ
uses_queryZ
uses_fragmentr�r�r�r�r5r:Z_implicit_encodingZ_implicit_errorsr>rCrMrS�objectrUrcrerr�r�Z_DefragResultBaseZ_SplitResultBaseZ_ParseResultBase�__doc__r�r�r�r�r�r�r�Z
ResultBaserrrrrrr�rr�r�r�r�rrrrrr�r�rr5r�rr	r
r�	frozensetrr�rr7�defaultdictrrrr
rr)r'r0r2r4r1r:r;r9r?r<rCrBrIrJrHrNrLrPrOrTrSrWrVrZrXr8r8r8r9�<module>s�!
�
�&
��


	
	?
E


�*
�
B	

6

�Q





?>