Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib/python3.7/site-packages/future/backports/urllib/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/future/backports/urllib/__pycache__/parse.cpython-37.pyc

B

�A�[Ћ�@sdZddlmZmZmZddlmZmZmZm	Z	m
Z
mZddlm
Z
ddlZddlZddlZdddd	d
ddd
dddddddgZdddddddddddd d!d"d#d$d%gZddddd&ddddddd'dd d!d(d"d$d%d#d)d*d+gZdd,dddddd d!d-d.dd"d#d/gZdd,d0d1d&ddd'd-d.g
Zdddddddd d!d-d.d"gZdd,ddd1ddddd'ddd"g
Zd2Zd3ZiZd4d5�Zd6Zd7Zd8d9�Zeefd:d;�Zeefd<d=�Z d>d?�Z!Gd@dA�dAe"�Z#GdBdC�dCe"�Z$GdDdE�dEe"�Z%GdFdG�dGe%e#�Z&GdHdI�dIe%e$�Z'ddJlm(Z(e(dKdL�Z)e(dMdN�Z*e(dOdP�Z+e&Z,GdQdK�dKe)e#�Z-GdRdM�dMe*e&�Z.GdSdO�dOe+e&�Z/GdTdU�dUe)e$�Z0GdVdW�dWe*e'�Z1GdXdY�dYe+e'�Z2dZd[�Z3e3�[3d�d]d�Z4d^d_�Z5d�d`da�Z6d�dbd
�Z7dcd�Z8ddd�Z9d�ded�Z:dfd	�Z;dgZ<edhdi�e<D��Z=djd�Z>e�?dk�Z@d�dnd�ZAd�dpd
�ZBd�dqd�ZCd�drd�ZDeEeds��ZFeeF�ZGiZHGdtdu�duejI�ZJd�dwd�ZKd�dxd�ZLd�dyd�ZMd�dzd�ZNd{d|�ZOd}d~�ZPdaQdd��ZRdaSd�d��ZTdaUd�d��ZVdaWd�d��ZXdaYd�d��ZZda[d�d�d��Z\da]d�d��Z^da_d�d��Z`d�d��Zadabd�d��ZcdS)�a�
Ported using Python-Future from the Python 3.3 standard library.

Parse (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.
�)�absolute_import�division�unicode_literals)�bytes�chr�dict�int�range�str)�raise_with_tracebackN�urlparse�
urlunparse�urljoin�	urldefrag�urlsplit�
urlunsplit�	urlencode�parse_qs�	parse_qsl�quote�
quote_plus�quote_from_bytes�unquote�unquote_plus�unquote_to_bytes�ftp�http�gopher�nntp�imap�wais�file�https�shttp�mms�prospero�rtsp�rtspu��sftp�svnzsvn+ssh�telnet�snews�rsync�nfs�gitzgit+ssh�hdl�sip�sips�tel�mailto�newszAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.�cCst��t��dS)z,Clear the parse cache and the quoters cache.N)�_parse_cache�clear�
_safe_quoters�r:r:�N/opt/alt/python37/lib/python3.7/site-packages/future/backports/urllib/parse.py�clear_cacheNsr<�ascii�strictcCs|S)Nr:)�objr:r:r;�_noop]sr@cCs|�||�S)N)�encode)r?�encoding�errorsr:r:r;�_encode_result`srDcst��fdd�|D��S)Nc3s"|]}|r|����ndVqdS)r(N)�decode)�.0�x)rBrCr:r;�	<genexpr>fsz_decode_args.<locals>.<genexpr>)�tuple)�argsrBrCr:)rBrCr;�_decode_argsdsrKcGsZt|dt�}x.|dd�D]}|rt|t�|krtd��qW|rL|tfSt|�tfS)Nr�z$Cannot mix str and non-str arguments)�
isinstancer
�	TypeErrorr@rKrD)rJ�	str_input�argr:r:r;�_coerce_argshs
rQc@seZdZdZdZddd�ZdS)	�_ResultMixinStrz>Standard approach to encoding parsed results from str to bytesr:r=r>cs|j��fdd�|D��S)Nc3s|]}|����VqdS)N)rA)rFrG)rBrCr:r;rH~sz)_ResultMixinStr.encode.<locals>.<genexpr>)�_encoded_counterpart)�selfrBrCr:)rBrCr;rA}sz_ResultMixinStr.encodeN)r=r>)�__name__�
__module__�__qualname__�__doc__�	__slots__rAr:r:r:r;rRysrRc@seZdZdZdZddd�ZdS)	�_ResultMixinBytesz>Standard approach to decoding parsed results from bytes to strr:r=r>cs|j��fdd�|D��S)Nc3s|]}|����VqdS)N)rE)rFrG)rBrCr:r;rH�sz+_ResultMixinBytes.decode.<locals>.<genexpr>)�_decoded_counterpart)rTrBrCr:)rBrCr;rE�sz_ResultMixinBytes.decodeN)r=r>)rUrVrWrXrYrEr:r:r:r;rZ�srZc@sDeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dS)�_NetlocResultMixinBasezHShared methods for the parsed result objects containing a netloc elementr:cCs
|jdS)Nr)�	_userinfo)rTr:r:r;�username�sz_NetlocResultMixinBase.usernamecCs
|jdS)NrL)r])rTr:r:r;�password�sz_NetlocResultMixinBase.passwordcCs(|jd}|sd}n|dk	r$|��}|S)Nr)�	_hostinfo�lower)rT�hostnamer:r:r;rb�s
z_NetlocResultMixinBase.hostnamecCs:|jd}|dk	r6t|d�}d|kr0dks6ndS|S)NrL�
ri��)r`r)rT�portr:r:r;rd�s

z_NetlocResultMixinBase.portN)
rUrVrWrXrY�propertyr^r_rbrdr:r:r:r;r\�s	r\c@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinStrr:cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:)�netloc�
rpartition�	partition)rTri�userinfo�	have_info�hostinfor^�
have_passwordr_r:r:r;r]�sz_NetlocResultMixinStr._userinfoc	Csl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nrg�[�]rh)rirjrk)	rTri�_rn�have_open_br�	bracketedrbrd�	have_portr:r:r;r`�sz_NetlocResultMixinStr._hostinfoN)rUrVrWrYrer]r`r:r:r:r;rf�srfc@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinBytesr:cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:)rirjrk)rTrirlrmrnr^ror_r:r:r;r]�sz!_NetlocResultMixinBytes._userinfoc	Csl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nrw�[�]rx)rirjrk)	rTrirrrnrsrtrbrdrur:r:r;r`�sz!_NetlocResultMixinBytes._hostinfoN)rUrVrWrYrer]r`r:r:r:r;rv�srv)�
namedtuple�DefragResultzurl fragment�SplitResultz!scheme netloc path query fragment�ParseResultz(scheme netloc path params query fragmentc@seZdZdZdd�ZdS)r|r:cCs |jr|jd|jS|jSdS)N�#)�fragment�url)rTr:r:r;�geturl�szDefragResult.geturlN)rUrVrWrYr�r:r:r:r;r|�sc@seZdZdZdd�ZdS)r}r:cCst|�S)N)r)rTr:r:r;r��szSplitResult.geturlN)rUrVrWrYr�r:r:r:r;r}�sc@seZdZdZdd�ZdS)r~r:cCst|�S)N)r
)rTr:r:r;r�szParseResult.geturlN)rUrVrWrYr�r:r:r:r;r~�sc@seZdZdZdd�ZdS)�DefragResultBytesr:cCs |jr|jd|jS|jSdS)N�#)r�r�)rTr:r:r;r�szDefragResultBytes.geturlN)rUrVrWrYr�r:r:r:r;r�sr�c@seZdZdZdd�ZdS)�SplitResultBytesr:cCst|�S)N)r)rTr:r:r;r�szSplitResultBytes.geturlN)rUrVrWrYr�r:r:r:r;r�sr�c@seZdZdZdd�ZdS)�ParseResultBytesr:cCst|�S)N)r
)rTr:r:r;r�szParseResultBytes.geturlN)rUrVrWrYr�r:r:r:r;r�sr�cCs8ttfttfttff}x|D]\}}||_||_qWdS)N)r|r�r}r�r~r�rSr[)Z
_result_pairsZ_decodedZ_encodedr:r:r;�_fix_result_transcodings
r�Tc
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()rQr�uses_params�_splitparamsr~)
r��scheme�allow_fragments�_coerce_result�splitresultri�queryr��params�resultr:r:r;r$scCsRd|kr,|�d|�d��}|dkr6|dfSn
|�d�}|d|�||dd�fS)N�/r�rr(rL)�find�rfind)r��ir:r:r;r�4s

r�cCsLt|�}x*dD]"}|�||�}|dkrt||�}qW|||�||d�fS)Nz/?#r)�lenr��min)r��start�delim�c�wdelimr:r:r;�_splitnetloc=s
r�c
CsXt||�\}}}t|�}|||t|�t|�f}t�|d�}|rF||�Stt�tkrXt�d}}}|�d�}	|	dk�r�|d|	�dk�rJ|d|	��	�}||	dd�}|dd�dkr�t
|d�\}}d	|kr�d
|ks�d
|kr�d	|kr�td��|�rd|k�r|�dd�\}}d
|k�r*|�d
d�\}}t
|||||�}
|
t|<||
�Sxb|d|	�D]}|tk�rXP�qXW||	dd�}|�r�tdd�|D���r�|d|	��	�|}}|dd�dk�r�t
|d�\}}d	|k�r�d
|k�s�d
|k�r�d	|k�r�td��|�rd|k�r|�dd�\}}d
|k�r8|�d
d�\}}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.Nr(rhrrrL�z//rprqzInvalid IPv6 URLr�?css|]}|dkVqdS)�
0123456789Nr:)rFr�r:r:r;rHlszurlsplit.<locals>.<genexpr>)rQ�bool�typer7�getr��MAX_CACHE_SIZEr<r�rar��
ValueError�splitr}�scheme_chars�any)
r�r�r�r��key�cachedrir�r�r��vr��restr:r:r;rEsX




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)rQr)�
componentsr�rir�r�r�r�r�r: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//rLr�r(rhr�r)rQ�uses_netloc)r�r�rir�r�r�r�r:r:r;r�s cCs�|s|S|s|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|ks`|
tkrh||�S|
tkr�|r�|t|
|||
||f��S|}|dd�dkr�|t|
|||
||f��S|s�|
s�|}|}
|s�|}|t|
|||
||f��S|�d�dd�|�d�}|ddk�rd|d<xd|k�r4|�d��qWxfd}t|�d}xN||k�r�||dk�r�||ddk�r�||d|d�=P|d}�qJWP�q8W|ddgk�r�d|d<n*t|�d	k�r�|ddk�r�dg|d
d�<|t|
|d�|�|
||f��S)zaJoin a base URL and a possibly relative URL to form an absolute
    interpretation of the latter.r(NrLr�����.z..)r(z..r����)	rQr�
uses_relativer�r
r��remover��join)�baser�r�r��bscheme�bnetloc�bpath�bparams�bquery�	bfragmentr�ri�pathr�r�r��segmentsr��nr:r:r;r�sZ



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.
    rr()rQrr
r|)	r�r��sr��p�a�q�frag�defragr:r:r;r�s�0123456789ABCDEFabcdefccs8|]0}tD]&}||��tt||d�g�fVq
qdS)�N)�_hexdigrArr)rFr��br:r:r;rH�srHc	Cs�|s|jtd�St|t�r&|�d�}t|�}|�d�}t|�dkrH|S|dg}|j}xb|dd�D]R}y(|t|dd��||dd��Wqftk
r�|d�||�YqfXqfWtd��	|�S)z,unquote_to_bytes('abc%20def') -> b'abc def'.�zutf-8�%rLrNr�)
r�rrMr
rAr��append�
_hextobyte�KeyErrorr�)�string�bits�resr��itemr:r:r;r�s&



z([-]+)�utf-8�replacecCs�d|kr|j|S|dkrd}|dkr*d}t�|�}|dg}|j}x@tdt|�d�D],}|t||��||��|||d�qVWd�|�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'.
    �%Nzutf-8r�rrLr�r()r��_asciirer�r	r�rrEr�)r�rBrCr�r�r�r�r:r:r;rs


Fc	CsNi}t|||||d�}x2|D]*\}}||kr<||�|�q|g||<qW|S)aOParse 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.
    )rBrC)rr�)	�qs�keep_blank_values�strict_parsingrBrC�
parsed_result�pairs�name�valuer:r:r;rs
cCs�t|�\}}dd�|�d�D�}g}x�|D]�}|s8|s8q*|�dd�}	t|	�dkrt|rbtd|f��|r*|	�d�nq*t|	d�s�|r*|	d	�d
d�}
t|
||d�}
||
�}
|	d�d
d�}t|||d�}||�}|�|
|f�q*W|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.

    Returns a list, as G-d intended.
    cSs g|]}|�d�D]}|�qqS)r�)r�)rF�s1�s2r:r:r;�
<listcomp>Tszparse_qsl.<locals>.<listcomp>�&�=rLr�zbad query field: %rr(r�+� )rBrC)rQr�r�r�r�r�r)r�r�r�rBrCr�r��r�
name_value�nvr�r�r:r:r;r<s,
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�rBrCr:r:r;rls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).
    cCst�t|��|_dS)zsafe: bytes object.N)�_ALWAYS_SAFE�unionr�safe)rTr�r:r:r;�__init__�szQuoter.__init__cCsdt|�S)Nz<Quoter %r>)r)rTr:r:r;�__repr__�szQuoter.__repr__cCs(||jkrt|�nd�|�}|||<|S)Nz%{0:02X})r�r�format)rTr�r�r:r:r;�__missing__�szQuoter.__missing__N)rUrVrWrXr�r�r�r:r:r:r;r�|sr�r�cCsbt|t�r8|s|S|dkrd}|dkr*d}|�||�}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 must
    not be specified if string is a str.

    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)rMr
rArNr)r�r�rBrCr:r:r;r�s
cCslt|t�rd|ks$t|t�r2d|kr2t||||�St|t�rFtd�}ntd�}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�)rMr
rrr�)r�r�rBrC�spacer:r:r;r�s

cs�t|ttf�std��|s"td�St|�}t|t�rFt|��dd�}nt|�}tdd�|D��}|�t|�sv|��Syt	|�Wn&t
k
r�t|�jt	|<�YnXtd��
�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 bytesr(r=�ignorecSsg|]}|dkr|�qS)�r:)rFr�r:r:r;r��sz$quote_from_bytes.<locals>.<listcomp>csg|]}�|��qSr:r:)rF�char)�quoterr:r;r��s)rMr�	bytearrayrNr
rA�rstrip�_ALWAYS_SAFE_BYTESrEr9r�r��__getitem__r�)�bsr�r:)r�r;r�s 
c
	Cst|d�r|��}nPyt|�r0t|dt�s0t�Wn0tk
rbt��\}}}ttd�|�YnXg}|s�xr|D]j\}	}
t|	t	�r�t
|	|�}	nt
t|	�|||�}	t|
t	�r�t
|
|�}
nt
t|
�|||�}
|�|	d|
�qrW�n,�x(|D�]\}	}
t|	t	��rt
|	|�}	nt
t|	�|||�}	t|
t	��rJt
|
|�}
|�|	d|
�q�t|
t��rxt
|
|||�}
|�|	d|
�q�yt|
�}Wn:tk
�r�t
t|
�|||�}
|�|	d|
�Yq�XxJ|
D]B}t|t	��r�t
||�}nt
t|�|||�}|�|	d|��q�Wq�Wtd��
|�S)a#Encode a sequence of two-element tuples or dictionary 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 query arg may be either a string or a bytes type. When query arg is a
    string, the safe, encoding and error parameters are sent the quote_plus for
    encoding.
    �itemsrz1not a valid non-string sequence or mapping objectr�r�)�hasattrr�r�rMrIrN�sys�exc_inforrrr
r�r�)
r��doseqr�rBrC�ty�va�tb�l�kr�rG�eltr:r:r;r�sP





cCsJt|t�rFy|�d���}Wn(tk
rDtdt|�d��YnX|S)zto_bytes(u"URL") --> 'URL'.�ASCIIzURL z contains non-ASCII characters)rMr
rArE�UnicodeError�repr)r�r:r:r;�to_bytesHs
rcCs`t|���}|dd�dkr<|dd�dkr<|dd���}|dd�dkr\|dd���}|S)z8unwrap('<URL:type://host/path>') --> 'type://host/path'.NrL�<r��>�zURL:)r
�strip)r�r:r:r;�unwrapUs rcCsVtdkrddl}|�d�at�|�}|rN|�d�}|��|t|�dd�fSd|fS)z:splittype('type:opaquestring') --> 'type', 'opaquestring'.Nrz
^([^/:]+):rL)�	_typeprog�re�compile�match�grouprar�)r�rrr�r:r:r;�	splittype^s


rcCsbtdkrddl}|�d�at�|�}|rZ|�d�}|�d�}|rR|�d�sRd|}||fSd|fS)z;splithost('//host[:port]/path') --> 'host[:port]', '/path'.Nrz^//([^/?]*)(.*)$rLr�r�)�	_hostprogrrrr�
startswith)r�rr�	host_portr�r:r:r;�	splithostls



rcCs<tdkrddl}|�d�at�|�}|r4|�dd�Sd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz^(.*)@(.*)$rLr�)�	_userprogrrrr)�hostrrr:r:r;�	splituser}s

rcCs@tdkrddl}|�d|j�at�|�}|r8|�dd�S|dfS)z/splitpasswd('user:passwd') -> 'user', 'passwd'.Nrz^([^:]*):(.*)$rLr�)�_passwdprogrr�Srr)�userrrr:r:r;�splitpasswd�s
rcCs<tdkrddl}|�d�at�|�}|r4|�dd�S|dfS)z*splitport('host:port') --> 'host', 'port'.Nrz^(.*):([0-9]+)$rLr�)�	_portprogrrrr)rrrr:r:r;�	splitport�s

rr�cCsztdkrddl}|�d�at�|�}|rr|�dd�\}}y|sFtd��t|�}Wntk
rhd}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.Nrz^(.*):(.*)$rLr�z	no digits)�
_nportprogrrrrr�r)r�defportrrrd�nportr:r:r;�
splitnport�s


r#cCs<tdkrddl}|�d�at�|�}|r4|�dd�S|dfS)z/splitquery('/path?query') --> '/path', 'query'.Nrz^(.*)\?([^?]*)$rLr�)�
_queryprogrrrr)r�rrr:r:r;�
splitquery�s

r%cCs<tdkrddl}|�d�at�|�}|r4|�dd�S|dfS)z)splittag('/path#tag') --> '/path', 'tag'.Nrz^(.*)#([^#]*)$rLr�)�_tagprogrrrr)r�rrr:r:r;�splittag�s

r'cCs|�d�}|d|dd�fS)zksplitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...].r�rrLN)r�)r��wordsr:r:r;�	splitattr�s
r)cCs<tdkrddl}|�d�at�|�}|r4|�dd�S|dfS)z-splitvalue('attr=value') --> 'attr', 'value'.Nrz^([^=]*)=(.*)$rLr�)�
_valueprogrrrr)�attrrrr:r:r;�
splitvalue�s

r,)r(T)r)r(T)T)r�r�)FFr�r�)FFr�r�)r�r�)r�NN)r(NN)r�)Fr(NN)r�)drX�
__future__rrrZfuture.builtinsrrrrr	r
Zfuture.utilsrrr��collections�__all__r�r�r��non_hierarchical�
uses_query�
uses_fragmentr�r�r7r<�_implicit_encoding�_implicit_errorsr@rDrKrQ�objectrRrZr\rfrvr{�_DefragResultBase�_SplitResultBase�_ParseResultBase�
ResultBaser|r}r~r�r�r�r�rr�r�rr
rrrr�r�rrr�rrrr�	frozensetr�r�r9�defaultdictr�rrrrrrr
rrrrrrrrrr r#r$r%r&r'r)r*r,r:r:r:r;�<module>s� 








 




	

8
5




/
	
,


]




Hacked By AnonymousFox1.0, Coded By AnonymousFox