AlkantarClanX12

Your IP : 18.190.219.178


Current Path : /proc/thread-self/root/opt/alt/python33/lib64/python3.3/urllib/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python33/lib64/python3.3/urllib/__pycache__/parse.cpython-33.pyc

�
��fS�c@s�dZddlZddlZddlZddddddd	d
ddd
ddddgZddddddddddddddd d!d"gZddddd#ddddddd$dddd%dd!d"d d&d'd(gZdd)dddddddd*d+ddd d,gZdd)d-d.d#ddd$d*d+g
Zdddddddddd*d+dgZ	dd)ddd.ddddd$dddg
Z
d/Zd0ZiZ
d1d2�Zd3Zd4Zd5d6�Zeed7d8�Zeed9d:�Zd;d<�ZGd=d>�d>e�ZGd?d@�d@e�ZGdAdB�dBe�ZGdCdD�dDee�ZGdEdF�dFee�ZddGlmZedHdI�ZedJdK�ZedLdM�ZeZGdNdH�dHee�Z GdOdJ�dJee�Z!GdPdL�dLee�Z"GdQdR�dRee�Z#GdSdT�dTee�Z$GdUdV�dVee�Z%dWdX�Z&e&�[&dd�dYd�Z(dZd[�Z)dd\d]�Z*dd�d^d�Z+d_d�Z,d`d�Z-d�dad�Z.dbd�Z/dcZ0ddde�e0D�Z1dfd�Z2ej3dg�Z4dhdidjd�Z5d�d�dhdidkd
�Z7d�d�dhdidld�Z8dhdidmd�Z9e:dn�Z;e<e;�Z=iZ>Gdodp�dpej?�Z@dqdddrd�ZBddddsd
�ZCdqdtd�ZDd�ddddud	�ZEdvdw�ZFdxdy�ZGdaHdzd{�ZIdaJd|d}�ZKdaLd~d�ZMdaNd�d��ZOdaPd�d��ZQdaRd�d�d��ZSdaTd�d��ZUdaVd�d��ZWd�d��ZXdaYd�d��ZZdS(�ucParse (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.
iNuurlparseu
urlunparseuurljoinu	urldefraguurlsplitu
urlunsplitu	urlencodeuparse_qsu	parse_qsluquoteu
quote_plusuquote_from_bytesuunquoteuunquote_plusuunquote_to_bytesuftpuhttpugopherunntpuimapuwaisufileuhttpsushttpummsuprosperourtspurtspuuusftpusvnusvn+sshutelnetusnewsursyncunfsugitugit+sshuhdlusipusipsutelumailtounewsuAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.icCstj�tj�dS(u,Clear the parse cache and the quoters cache.N(u_parse_cacheuclearu
_safe_quoters(((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuclear_cacheHs
uclear_cacheuasciiustrictcCs|S(N((uobj((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_noopWsu_noopcCs|j||�S(N(uencode(uobjuencodinguerrors((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_encode_resultZsu_encode_resultcs t��fdd�|D��S(Nc3s-|]#}|r!|j���ndVqdS(uN(udecode(u.0ux(uencodinguerrors(u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	<genexpr>`su_decode_args.<locals>.<genexpr>(utuple(uargsuencodinguerrors((uencodinguerrorsu1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_decode_args^su_decode_argscGszt|dt�}xB|dd�D]0}|r$t|t�|kr$td��q$q$W|ri|tfSt|�tfS(Niiu$Cannot mix str and non-str arguments(u
isinstanceustru	TypeErroru_noopu_decode_argsu_encode_result(uargsu	str_inputuarg((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_coerce_argsbsu_coerce_argscBs2|EeZdZdZfZdddd�ZdS(u_ResultMixinStru>Standard approach to encoding parsed results from str to bytesuasciiustrictcs#|j��fdd�|D��S(Nc3s!|]}|j���VqdS(N(uencode(u.0ux(uencodinguerrors(u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	<genexpr>xsu)_ResultMixinStr.encode.<locals>.<genexpr>(u_encoded_counterpart(uselfuencodinguerrors((uencodinguerrorsu1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuencodewsu_ResultMixinStr.encodeN(u__name__u
__module__u__qualname__u__doc__u	__slots__uencode(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_ResultMixinStrssu_ResultMixinStrcBs2|EeZdZdZfZdddd�ZdS(u_ResultMixinBytesu>Standard approach to decoding parsed results from bytes to struasciiustrictcs#|j��fdd�|D��S(Nc3s!|]}|j���VqdS(N(udecode(u.0ux(uencodinguerrors(u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	<genexpr>�su+_ResultMixinBytes.decode.<locals>.<genexpr>(u_decoded_counterpart(uselfuencodinguerrors((uencodinguerrorsu1/opt/alt/python33/lib64/python3.3/urllib/parse.pyudecodesu_ResultMixinBytes.decodeN(u__name__u
__module__u__qualname__u__doc__u	__slots__udecode(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_ResultMixinBytes{su_ResultMixinBytescBsh|EeZdZdZfZedd��Zedd��Zedd��Zedd	��Z	d
S(u_NetlocResultMixinBaseuHShared methods for the parsed result objects containing a netloc elementcCs|jdS(Ni(u	_userinfo(uself((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuusername�su_NetlocResultMixinBase.usernamecCs|jdS(Ni(u	_userinfo(uself((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyupassword�su_NetlocResultMixinBase.passwordcCs;|jd}|sd}n|dk	r7|j�}n|S(Ni(u	_hostinfouNoneulower(uselfuhostname((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuhostname�s
	u_NetlocResultMixinBase.hostnamecCsO|jd}|dk	rKt|d�}d|ko?dknsKdSn|S(Nii
ii��(u	_hostinfouNoneuint(uselfuport((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuport�s
u_NetlocResultMixinBase.portN(
u__name__u
__module__u__qualname__u__doc__u	__slots__upropertyuusernameupassworduhostnameuport(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_NetlocResultMixinBase�s	u_NetlocResultMixinBasecBs>|EeZdZfZedd��Zedd��ZdS(u_NetlocResultMixinStrcCse|j}|jd�\}}}|rQ|jd�\}}}|s[d}q[n
d}}||fS(Nu@u:(unetlocu
rpartitionu	partitionuNone(uselfunetlocuuserinfou	have_infouhostinfouusernameu
have_passwordupassword((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	_userinfo�s	
u_NetlocResultMixinStr._userinfocCs�|j}|jd�\}}}|jd�\}}}|rr|jd�\}}}|jd�\}}}n|jd�\}}}|s�d}n||fS(Nu@u[u]u:(unetlocu
rpartitionu	partitionuNone(uselfunetlocu_uhostinfouhave_open_bru	bracketeduhostnameuport((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	_hostinfo�s		u_NetlocResultMixinStr._hostinfoN(u__name__u
__module__u__qualname__u	__slots__upropertyu	_userinfou	_hostinfo(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_NetlocResultMixinStr�su_NetlocResultMixinStrcBs>|EeZdZfZedd��Zedd��ZdS(u_NetlocResultMixinBytescCse|j}|jd�\}}}|rQ|jd�\}}}|s[d}q[n
d}}||fS(Ns@s:(unetlocu
rpartitionu	partitionuNone(uselfunetlocuuserinfou	have_infouhostinfouusernameu
have_passwordupassword((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	_userinfo�s	
u!_NetlocResultMixinBytes._userinfocCs�|j}|jd�\}}}|jd�\}}}|rr|jd�\}}}|jd�\}}}n|jd�\}}}|s�d}n||fS(Ns@s[s]s:(unetlocu
rpartitionu	partitionuNone(uselfunetlocu_uhostinfouhave_open_bru	bracketeduhostnameuport((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	_hostinfo�s		u!_NetlocResultMixinBytes._hostinfoN(u__name__u
__module__u__qualname__u	__slots__upropertyu	_userinfou	_hostinfo(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_NetlocResultMixinBytes�su_NetlocResultMixinBytes(u
namedtupleuDefragResultuurl fragmentuSplitResultu!scheme netloc path query fragmentuParseResultu(scheme netloc path params query fragmentcBs&|EeZdZfZdd�ZdS(uDefragResultcCs&|jr|jd|jS|jSdS(Nu#(ufragmentuurl(uself((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyugeturl�s	uDefragResult.geturlN(u__name__u
__module__u__qualname__u	__slots__ugeturl(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuDefragResult�scBs&|EeZdZfZdd�ZdS(uSplitResultcCs
t|�S(N(u
urlunsplit(uself((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyugeturl�suSplitResult.geturlN(u__name__u
__module__u__qualname__u	__slots__ugeturl(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuSplitResult�scBs&|EeZdZfZdd�ZdS(uParseResultcCs
t|�S(N(u
urlunparse(uself((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyugeturl�suParseResult.geturlN(u__name__u
__module__u__qualname__u	__slots__ugeturl(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuParseResult�scBs&|EeZdZfZdd�ZdS(uDefragResultBytescCs&|jr|jd|jS|jSdS(Ns#(ufragmentuurl(uself((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyugeturls	uDefragResultBytes.geturlN(u__name__u
__module__u__qualname__u	__slots__ugeturl(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuDefragResultBytes�suDefragResultBytescBs&|EeZdZfZdd�ZdS(uSplitResultBytescCs
t|�S(N(u
urlunsplit(uself((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyugeturlsuSplitResultBytes.geturlN(u__name__u
__module__u__qualname__u	__slots__ugeturl(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuSplitResultBytessuSplitResultBytescBs&|EeZdZfZdd�ZdS(uParseResultBytescCs
t|�S(N(u
urlunparse(uself((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyugeturl
suParseResultBytes.geturlN(u__name__u
__module__u__qualname__u	__slots__ugeturl(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuParseResultBytessuParseResultBytescCsNttfttfttff}x&|D]\}}||_||_q(WdS(N(uDefragResultuDefragResultBytesuSplitResultuSplitResultBytesuParseResultuParseResultBytesu_encoded_counterpartu_decoded_counterpart(u
_result_pairsu_decodedu_encoded((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_fix_result_transcodings			u_fix_result_transcodingc
Cs�t||�\}}}t|||�}|\}}}}}|tkrld|krlt|�\}}nd}t||||||�}	||	�S(u#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.u;u(u_coerce_argsuurlsplituuses_paramsu_splitparamsuParseResult(
uurluschemeuallow_fragmentsu_coerce_resultusplitresultunetlocuqueryufragmentuparamsuresult((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuurlparsescCsqd|kr@|jd|jd��}|dkrO|dfSn|jd�}|d|�||dd�fS(Nu/u;iui(ufindurfind(uurlui((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_splitparams.s
u_splitparamscCskt|�}x>dD]6}|j||�}|dkrt||�}qqW|||�||d�fS(Nu/?#i(ulenufindumin(uurlustartudelimucuwdelim((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu_splitnetloc7s
u_splitnetlocc
CsHt||�\}}}t|�}|||t|�t|�f}tj|d�}|rg||�Stt�tkr�t�nd}}}|j	d�}	|	dkr[|d|	�dkr�|d|	�j
�}||	dd�}|dd�dkrYt|d�\}}d	|kr/d
|ksGd
|krYd	|krYtd��qYn|r�d|kr�|j
dd�\}}nd
|kr�|j
d
d�\}}nt|||||�}
|
t|<||
�Sx|d|	�D]}|tkr�Pq�q�W||	dd�}|s8tdd�|D��r[|d|	�j
�|}}q[n|dd�dkr�t|d�\}}d	|kr�d
|ks�d
|kr�d	|kr�td��q�n|r�d|kr�|j
dd�\}}nd
|kr|j
d
d�\}}nt|||||�}
|
t|<||
�S(uParse 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.uu:iNuhttpiiu//u[u]uInvalid IPv6 URLu#u?css|]}|dkVqdS(u
0123456789N((u.0uc((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	<genexpr>fsuurlsplit.<locals>.<genexpr>(u_coerce_argsuboolutypeu_parse_cacheugetuNoneulenuMAX_CACHE_SIZEuclear_cacheufinduloweru_splitnetlocu
ValueErrorusplituSplitResultuscheme_charsuany(
uurluschemeuallow_fragmentsu_coerce_resultukeyucachedunetlocuqueryufragmentuiuvucurest((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuurlsplit?sX!



 #
cCsYt|�\}}}}}}}|r:d||f}n|t|||||f��S(u�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).u%s;%s(u_coerce_argsu
urlunsplit(u
componentsuschemeunetlocuurluparamsuqueryufragmentu_coerce_result((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
urlunparsews!cCs�t|�\}}}}}}|sL|r�|tkr�|dd�dkr�|ru|dd�dkrud|}nd|p�d|}n|r�|d|}n|r�|d|}n|r�|d	|}n||�S(
ukCombine 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).Niu//iu/uu:u?u#(u_coerce_argsuuses_netloc(u
componentsuschemeunetlocuurluqueryufragmentu_coerce_result((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
urlunsplit�s.
cCs�|s
|S|s|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|ks�|
tkr�||�S|
tkr�|r�|t|
|||
||f��S|}n|dd�dkr|t|
|||
||f��S|rV|
rV|}|}
|s4|}n|t|
|||
||f��S|jd�dd�|jd�}|d	dkr�d|d
<nxd|kr�|jd�q�Wxtd}t|�d}xX||kr+||dkr||ddkr||d|d�=Pn|d}q�WPq�|ddgkrOd|d<n8t|�dkr�|d
dkr�dg|dd�<n|t|
|dj|�|
||f��S(uaJoin a base URL and a possibly relative URL to form an absolute
    interpretation of the latter.uNiu/u.u..ii����i����i����(uu..i����i����i����(	u_coerce_argsuurlparseu
uses_relativeuuses_netlocu
urlunparseusplituremoveulenujoin(ubaseuurluallow_fragmentsu_coerce_resultubschemeubnetlocubpathubparamsubqueryu	bfragmentuschemeunetlocupathuparamsuqueryufragmentusegmentsuiun((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuurljoin�sZ$$
		&

"c	Cs|t|�\}}d|kr]t|�\}}}}}}t|||||df�}nd}|}|t||��S(u�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.
    u#u(u_coerce_argsuurlparseu
urlunparseuDefragResult(	uurlu_coerce_resultusunupuauqufragudefrag((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	urldefrag�s!u0123456789ABCDEFabcdefcCsFi|]<}tD]/}tt||d�g�||j��qqS(i(u_hexdigubytesuintuencode(u.0uaub((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
<dictcomp>�s	u
<dictcomp>cCs�|s|jdSt|t�r2|jd�}n|jd�}t|�dkrW|S|dg}|j}xq|dd�D]_}y0|t|dd��||dd��Wq~tk
r�|d�||�Yq~Xq~Wdj|�S(u,unquote_to_bytes('abc%20def') -> b'abc def'.suutf-8s%iiNi(	usplitu
isinstanceustruencodeulenuappendu
_hextobyteuKeyErrorujoin(ustringubitsuresuappenduitem((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuunquote_to_bytes�s$
	

u([-]+)uutf-8ureplacecCs�d|kr|j|S|dkr,d}n|dkrAd}ntj|�}|dg}|j}xRtdt|�d�D]8}|t||�j||��|||d�qWdj|�S(	u�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'.
    u%uutf-8ureplaceiiiuN(	usplituNoneu_asciireuappendurangeulenuunquote_to_bytesudecodeujoin(ustringuencodinguerrorsubitsuresuappendui((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuunquote�s
		
	 c	Csli}t|||d|d|�}xA|D]9\}}||krW||j|�q+|g||<q+W|S(uOParse 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.
    uencodinguerrors(u	parse_qsluappend(	uqsukeep_blank_valuesustrict_parsinguencodinguerrorsu
parsed_resultupairsunameuvalue((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuparse_qssc	CsYt|�\}}dd�|jd�D�}g}x|D]}|rU|rUq;n|jdd�}	t|	�dkr�|r�td|f��n|r;|	jd�q�q;nt|	d�s�|r;|	d	jd
d�}
t|
d|d
|�}
||
�}
|	djd
d�}t|d|d
|�}||�}|j|
|f�q;q;W|S(u;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|]"}|jd�D]}|�qqS(u;(usplit(u.0us1us2((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
<listcomp>Is	uparse_qsl.<locals>.<listcomp>u&u=iiubad query field: %ruiu+u uencodinguerrors(u_coerce_argsusplitulenu
ValueErroruappendureplaceuunquote(uqsukeep_blank_valuesustrict_parsinguencodinguerrorsu_coerce_resultupairsuru
name_valueunvunameuvalue((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	parse_qsl1s,
cCs"|jdd�}t|||�S(u�Like unquote(), but also replace plus signs by spaces, as required for
    unquoting HTML form values.

    unquote_plus('%7e/abc+def') -> '~/abc def'
    u+u (ureplaceuunquote(ustringuencodinguerrors((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuunquote_plusassAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-cBs>|EeZdZdZdd�Zdd�Zdd�ZdS(	uQuoteru�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(usafe: bytes object.N(u_ALWAYS_SAFEuunionusafe(uselfusafe((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu__init__ysuQuoter.__init__cCsdt|�S(Nu<Quoter %r>(udict(uself((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu__repr__}suQuoter.__repr__cCs8||jkrt|�ndj|�}|||<|S(Nu%{:02X}(usafeuchruformat(uselfubures((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu__missing__�s*
uQuoter.__missing__N(u__name__u
__module__u__qualname__u__doc__u__init__u__repr__u__missing__(u
__locals__((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuQuoterqsuQuoteru/cCs�t|t�rX|s|S|dkr.d}n|dkrCd}n|j||�}n6|dk	rstd��n|dk	r�td��nt||�S(u�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).
    uutf-8ustrictu,quote() doesn't support 'encoding' for bytesu*quote() doesn't support 'errors' for bytesN(u
isinstanceustruNoneuencodeu	TypeErroruquote_from_bytes(ustringusafeuencodinguerrors((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuquote�s		cCs�t|t�rd|ks6t|t�rId|krIt||||�St|t�rad}nd}t|||||�}|jdd�S(u�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 '/'.
    u s u+(u
isinstanceustrubytesuquoteureplace(ustringusafeuencodinguerrorsuspace((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
quote_plus�s	cs�t|ttf�s$td��n|s.dSt|t�rR|jdd�}ntdd�|D��}|jt|�s�|j�Syt	|�Wn)t
k
r�t|�jt	|<�YnXdj
�fdd�|D��S(u�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'
    u!quote_from_bytes() expected bytesuuasciiuignorecSs"g|]}|dkr|�qS(i�((u.0uc((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
<listcomp>�s	u$quote_from_bytes.<locals>.<listcomp>csg|]}�|��qS(((u.0uchar(uquoter(u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
<listcomp>�s	(u
isinstanceubytesu	bytearrayu	TypeErrorustruencodeurstripu_ALWAYS_SAFE_BYTESudecodeu
_safe_quotersuKeyErroruQuoteru__getitem__ujoin(ubsusafe((uquoteru1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuquote_from_bytes�s

c
Cs�t|d�r|j�}nly-t|�rJt|dt�rJt�nWn<tk
r�tj�\}}}td�j|��YnXg}|s=x |D]�\}	}
t|	t	�r�t
|	|�}	nt
t|	�|||�}	t|
t	�rt
|
|�}
nt
t|
�|||�}
|j|	d|
�q�Wn|xy|D]q\}	}
t|	t	�rqt
|	|�}	nt
t|	�|||�}	t|
t	�r�t
|
|�}
|j|	d|
�qDt|
t�r�t
|
|||�}
|j|	d|
�qDyt|
�}WnBtk
rRt
t|
�|||�}
|j|	d|
�YqDXx_|
D]W}t|t	�r�t
||�}nt
t|�|||�}|j|	d|�qZWqDWdj
|�S(u@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.
    When a component is a string, the safe, encoding and error parameters are
    sent to the quote_plus function for encoding.
    uitemsiu1not a valid non-string sequence or mapping objectu=u&(uhasattruitemsulenu
isinstanceutupleu	TypeErrorusysuexc_infouwith_tracebackubytesu
quote_plusustruappendujoin(
uqueryudosequsafeuencodinguerrorsutyuvautbulukuvuxuelt((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	urlencode�sP 



cCs^t|t�rZy|jd�j�}WqZtk
rVtdt|�d��YqZXn|S(uto_bytes(u"URL") --> 'URL'.uASCIIuURL u contains non-ASCII characters(u
isinstanceustruencodeudecodeuUnicodeErrorurepr(uurl((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuto_bytes7s
uto_bytescCs�t|�j�}|dd�dkrW|dd�dkrW|dd�j�}n|dd�dkr�|dd�j�}n|S(	u8unwrap('<URL:type://host/path>') --> 'type://host/path'.Niu<u>iuURL:i����i����(ustrustrip(uurl((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyuunwrapDs,uunwrapcCs|tdkr*ddl}|jd�antj|�}|rr|jd�}|j�|t|�dd�fSd|fS(u:splittype('type:opaquestring') --> 'type', 'opaquestring'.iNu
^([^/:]+):i(u	_typeproguNoneureucompileumatchugroupulowerulen(uurlureumatchuscheme((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	splittypeMs$u	splittypecCs�tdkr$tjdtj�antj|�}|rx|j�\}}|rn|ddkrnd|}n||fSd|fS(u;splithost('//host[:port]/path') --> 'host[:port]', '/path'.u//([^/#?]*)(.*)iu/N(u	_hostproguNoneureucompileuDOTALLumatchugroups(uurlumatchu	host_portupath((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	splithost[s

u	splithostcCsYtdkr*ddl}|jd�antj|�}|rO|jdd�Sd|fS(uJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.iNu^(.*)@(.*)$ii(u	_userproguNoneureucompileumatchugroup(uhostureumatch((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	splituserjsu	splitusercCs_tdkr0ddl}|jd|j�antj|�}|rU|jdd�S|dfS(u/splitpasswd('user:passwd') -> 'user', 'passwd'.iNu^([^:]*):(.*)$ii(u_passwdproguNoneureucompileuSumatchugroup(uuserureumatch((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyusplitpasswdvsusplitpasswdcCsntdkr*ddl}|jd�antj|�}|rd|j�\}}|rd||fSn|dfS(u*splitport('host:port') --> 'host', 'port'.iNu^(.*):([0-9]*)$(u	_portproguNoneureucompileumatchugroups(uhostureumatchuport((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	splitport�s
u	splitporticCs�tdkr*ddl}|jd�antj|�}|r�|jdd�\}}|r�yt|�}Wntk
r�d}YnX||fSn||fS(u�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.iNu^(.*):(.*)$ii(u
_nportproguNoneureucompileumatchugroupuintu
ValueError(uhostudefportureumatchuportunport((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
splitnport�s

u
splitnportcCsYtdkr*ddl}|jd�antj|�}|rO|jdd�S|dfS(u/splitquery('/path?query') --> '/path', 'query'.iNu^(.*)\?([^?]*)$ii(u
_queryproguNoneureucompileumatchugroup(uurlureumatch((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
splitquery�su
splitquerycCsYtdkr*ddl}|jd�antj|�}|rO|jdd�S|dfS(u)splittag('/path#tag') --> '/path', 'tag'.iNu^(.*)#([^#]*)$ii(u_tagproguNoneureucompileumatchugroup(uurlureumatch((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyusplittag�susplittagcCs'|jd�}|d|dd�fS(uksplitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...].u;iiN(usplit(uurluwords((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu	splitattr�su	splitattrcCsYtdkr*ddl}|jd�antj|�}|rO|jdd�S|dfS(u-splitvalue('attr=value') --> 'attr', 'value'.iNu^([^=]*)=(.*)$ii(u
_valueproguNoneureucompileumatchugroup(uattrureumatch((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu
splitvalue�su
splitvalueTFi����([u__doc__ureusysucollectionsu__all__u
uses_relativeuuses_netlocuuses_paramsunon_hierarchicalu
uses_queryu
uses_fragmentuscheme_charsuMAX_CACHE_SIZEu_parse_cacheuclear_cacheu_implicit_encodingu_implicit_errorsu_noopu_encode_resultu_decode_argsu_coerce_argsuobjectu_ResultMixinStru_ResultMixinBytesu_NetlocResultMixinBaseu_NetlocResultMixinStru_NetlocResultMixinBytesu
namedtupleu_DefragResultBaseu_SplitResultBaseu_ParseResultBaseu
ResultBaseuDefragResultuSplitResultuParseResultuDefragResultBytesuSplitResultBytesuParseResultBytesu_fix_result_transcodinguTrueuurlparseu_splitparamsu_splitnetlocuurlsplitu
urlunparseu
urlunsplituurljoinu	urldefragu_hexdigu
_hextobyteuunquote_to_bytesucompileu_asciireuunquoteuFalseuparse_qsu	parse_qsluunquote_plusu	frozensetu_ALWAYS_SAFEubytesu_ALWAYS_SAFE_BYTESu
_safe_quotersudefaultdictuQuoteruNoneuquoteu
quote_plusuquote_from_bytesu	urlencodeuto_bytesuunwrapu	_typeprogu	splittypeu	_hostprogu	splithostu	_userprogu	splituseru_passwdprogusplitpasswdu	_portprogu	splitportu
_nportprogu
splitnportu
_queryprogu
splitqueryu_tagprogusplittagu	splitattru
_valueprogu
splitvalue(((u1/opt/alt/python33/lib64/python3.3/urllib/parse.pyu<module>s� 
	85	
/	,]