
    hcF                    N   S r SSKrSSKrSSKrSSKrSSKJrJr   SSKJr  SSK
JrJrJrJrJrJrJrJrJrJrJrJrJrJrJr  SSKJr  SSKJr   SS	KJr  SS
K!J"r#J$r%  \RL                  S   S:H  r' \(  \+" S5      r,\\\\\   4   S4   r-\\\\\   4   \-\\\\\   4      4   r.\" S5      r/SS jr0\0" S5      =r1r2\3" S5      r4\Rj                  " S5      r6\Rj                  " S5      r7\Rj                  " S5      r8\9" \Rt                   V Vs/ s HJ  n \Rt                    H6  nX-   RE                  S5      \(" \	" X-   S5      5      RE                  S5      4PM8     ML     snn 5      r;\Rj                  " S5      r<\3" S5      r=\3" S5      r>\=\>-  r?\4\>-  \@" S5      -  rA\?\A-
  rB\A\@" S5      -  rC\?\C-
  rD\C\@" S5      -
  rE\?\E-
  rF\4\C-  \@" S5      -  rG\?\G-
  rH\4\G\@" S5      -
  -  rI\?\I-
  rJ\4\I\@" S5      -
  -  rK\?\K-
  rLSS! jrMS" rN\N" \A5      rO\M" \B5      rP\N" \C5      rQ\N" \E5      rR\M" \D5      rS\N" \K5      rT\M" \L5      rU\N" \I5      rV\M" \J5      rW\N" \G5      rX\M" \H5      rY\N" \45      rZ\9" \;R                  5        VVs/ s H   u  p#URI                  SS#5      \4;   d  M  X#4PM"     snn5      r\\3" S$5      r]SS% jr^SS& jr_SS' jr`    SS( jraSS) jrbSS* jrcSS+ jrdSS, jre0 S-S._S/S0_S1S2_S3S4_S5S_S6S7_S8S9_S:S;_S<S=_S>S?_S@SA_SBSC_SDSC_SESF_SGSH_SISJ_SKSL_0 SMSN_SOSP_SQS_SRSS_STSU_SVSW_SXSY_SZS[_S\S]_S^S__S`Sa_SbSc_SdSe_SfSg_ShSi_SjSk_SlSm_ESiSSnSoSpSqSrS=S?SSs.
Erf\@" / StQ5      rg\@" 5       rh SSu jriSSv jrj " Sw Sx\k5      rlSy rmSz rn\3" 5       S 4S{ jroS| rpSS} jrq SS~ jrrSS jrsSS jrt SS jru SS jrvS SS S \;4S jrwS rxS ryS rz " S S\{5      r|\|r}\|" 5       r~S rS r " S S\{5      rSS jrg! \ a    \	r GNf = f! \ a
    SS	K Jr   GNf = f! \) a    \*r( GNf = fs  snn f s  snnf )a  Hyperlink provides Pythonic URL parsing, construction, and rendering.

Usage is straightforward::

   >>> import hyperlink
   >>> url = hyperlink.parse(u'http://github.com/mahmoud/hyperlink?utm_source=docs')
   >>> url.host
   u'github.com'
   >>> secure_url = url.replace(scheme=u'https')
   >>> secure_url.get('utm_source')[0]
   u'docs'

Hyperlink's API centers on the :class:`DecodedURL` type, which wraps
the lower-level :class:`URL`, both of which can be returned by the
:func:`parse()` convenience function.

    N)AF_INETAF_INET6)AddressFamily)AnyCallableDictIterableIteratorListMappingOptionalSequenceTextTupleTypeTypeVarUnioncast)	normalize   )	inet_pton)r   )encodedecode   .Tc                 :   ^ ^  " U U4S jS[         5      nU" 5       $ )a  Creates and returns a new **instance** of a new class, suitable for
usage as a "sentinel", a kind of singleton often used to indicate
a value is missing when ``None`` is a valid input.

Args:
    name: Name of the Sentinel
    var_name: Set this name to the name of the variable in its respective
        module enable pickle-ability.

>>> make_sentinel(var_name='_MISSING')
_MISSING

The most common use cases here in boltons are as default values
for optional function arguments, partly because of its
less-confusing appearance in automatically generated
documentation. Sentinels also function well as placeholders in queues
and linked lists.

.. note::

    By design, additional calls to ``make_sentinel`` with the same
    values will not produce equivalent objects.

    >>> make_sentinel('TEST') == make_sentinel('TEST')
    False
    >>> type(make_sentinel('TEST')) == type(make_sentinel('TEST'))
    False
c                   J   > \ rS rSrU U4S jrS r Y(       a  S rS r\rSr	g)make_sentinel.<locals>.Sentineli   c                 "   > TU l         TU l        g Nnamevar_name)selfr#   r$   s    U/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/hyperlink/_url.py__init__(make_sentinel.<locals>.Sentinel.__init__j   s    DI$DM    c                     U R                   (       a  U R                   $ U R                  R                  < SU R                  < S3$ )N())r$   	__class____name__r#   r%   s    r&   __repr__(make_sentinel.<locals>.Sentinel.__repr__o   s,    }}}}$#~~66		BBr)   c                     U R                   $ r!   )r$   r/   s    r&   
__reduce__*make_sentinel.<locals>.Sentinel.__reduce__x   s    }}$r)   c                     g)NF r/   s    r&   __nonzero__+make_sentinel.<locals>.Sentinel.__nonzero__|   s    r)   r"   N)
r.   
__module____qualname____firstlineno__r'   r0   r3   r7   __bool____static_attributes__r"   s   r&   Sentinelr   i   s$    	%
	C %	 r)   r>   )object)r#   r$   r>   s   `` r&   make_sentinelr@   J   s    > 6 2 :r)   _UNSETzB~-._0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzz^((?P<scheme>[^:/?#]+):)?((?P<_netloc_sep>//)(?P<authority>[^/?#]*))?(?P<path>[^?#]*)(\?(?P<query>[^#]*))?(#(?P<fragment>.*))?$z^[a-zA-Z0-9+-.]*$z^(?:(?P<userinfo>[^@/?#]*)@)?(?P<host>(?:\[(?P<ipv6_host>[^[\]/?#]*)\])|(?P<plain_host>[^:/?#[\]]*)|(?P<bad_host>.*?))?(?::(?P<port>.*))?$ascii   charmapz([ -]+)z:/?#[]@z!$&'()*+,;=%z:@:z/?&=Fc                 8   [        [        5      nU(       d  [        U 5      [        S/5      -  n U  He  nSR                  [	        U5      5      R                  S5      nUR                  5       nUR                  U5        XE:w  d  MT  UR                  U5        Mg     U$ )NrE   z{0:02X}rB   )dict_HEX_CHAR_MAPsetformatordr   lowerpop)delimsallow_percentretdelim_hexord_hexord_lowers         r&   _make_decode_maprW      s|    
}
CVsD6{*""3u:.55g>#GGM"  Jr)   c                     0 n[        [        S5      [        S5      5       H6  u  p#[        U5      nX@;   a
  U=X'   X'   M  SR                  U5      =X'   X'   M8     U$ )N   z%{0:02X})ziprangechrrM   )
safe_charsrS   ivcs        r&   _make_quote_mapra      s`    
C E#Jc
+F?CFSV(//22CFSV , Jr)   replace)r6    c                    U(       aD  [        SU 5      R                  S5      nSR                  U Vs/ s H  n[        U   PM     sn5      $ SR                  U  Vs/ s H  nU[        ;   a	  [        U   OUPM     sn5      $ s  snf s  snf )zA very comprehensive percent encoding for encoding all
delimiters. Used for arguments to DecodedURL, where a % means a
percent sign, and not the character used by URLs for escaping
bytes.
NFCutf8rd   )r   r   join_UNRESERVED_QUOTE_MAP_UNRESERVED_CHARStextmaximalbytestrbts        r&   _encode_reservedrq      s     E4(//7xx7C7a.q17CDD88 	
 )*->(>!!$AE	
  D	
   BBc                    U(       aD  [        SU 5      R                  S5      nSR                  U Vs/ s H  n[        U   PM     sn5      $ SR                  U  Vs/ s H  oD[        ;   a	  [        U   OUPM     sn5      $ s  snf s  snf )z.Percent-encode a single segment of a URL path.rf   rg   rd   )r   r   rh   _PATH_PART_QUOTE_MAP_PATH_DELIMSrk   s        r&   _encode_path_partrv     s~     E4(//7xx'B'Q-a0'BCC88FJKd$5	a	 1	<dK  CK   B Bc                    U(       aD  [        SU 5      R                  S5      nSR                  U Vs/ s H  n[        U   PM     sn5      $ SR                  U  Vs/ s H  nU[        ;   a	  [        U   OUPM     sn5      $ s  snf s  snf )zUPercent-encode the first segment of a URL path for a URL without a
scheme specified.
rf   rg   rd   )r   r   rh   _SCHEMELESS_PATH_PART_QUOTE_MAP_SCHEMELESS_PATH_DELIMSrk   s        r&   _encode_schemeless_path_partr{     s    
 E4(//7xxWMW8;WMNN88
 		
  ++ ,A. 		
  N	
rr   c           
      F   U (       d  gU(       a  S[        U 5      -   n / nU(       a#  U  Vs/ s H  nU(       a	  [        XdS9OUPM     nnOD[        U S   5      /nUR                  U SS  Vs/ s H  nU(       a	  [        XdS9OUPM     sn5        [        U5      $ s  snf s  snf )a  
Percent-encode a tuple of path parts into a complete path.

Setting *maximal* to False percent-encodes only the reserved
characters that are syntactically necessary for serialization,
preserving any IRI-style textual data.

Leaving *maximal* set to its default True percent-encodes
everything required to convert a portion of an IRI to a portion of
a URI.

RFC 3986 3.3:

   If a URI contains an authority component, then the path component
   must either be empty or begin with a slash ("/") character.  If a URI
   does not contain an authority component, then the path cannot begin
   with two slash characters ("//").  In addition, a URI reference
   (Section 4.1) may be a relative-path reference, in which case the
   first path segment cannot contain a colon (":") character.
r6   rc   rm   r   r   N)tuplerv   r{   extend)
text_partsrooted
has_schemehas_authorityrm   encoded_partsparts          r&   _encode_path_partsr   "  s    8 eJ//
 M #
" 9=d4$F" 	 

 6jmDE 'qrN*D =A!$8dJ*	
 
s   B+Bc                    U(       aD  [        SU 5      R                  S5      nSR                  U Vs/ s H  n[        U   PM     sn5      $ SR                  U  Vs/ s H  oD[        ;   a	  [        U   OUPM     sn5      $ s  snf s  snf z4
Percent-encode a single query string key or value.
rf   rg   rd   )r   r   rh   _QUERY_KEY_QUOTE_MAP_QUERY_KEY_DELIMSrk   s        r&   _encode_query_keyr   U  s    
 E4(//7xx'B'Q-a0'BCC88KOP4a):$:	a	 	A4P  CPrw   c                    U(       aD  [        SU 5      R                  S5      nSR                  U Vs/ s H  n[        U   PM     sn5      $ SR                  U  Vs/ s H  nU[        ;   a	  [        U   OUPM     sn5      $ s  snf s  snf r   )r   r   rh   _QUERY_VALUE_QUOTE_MAP_QUERY_VALUE_DELIMSrk   s        r&   _encode_query_valuer   b  s    
 E4(//7xxGDGq/2GDEE88 	
 *+.A)A"1%qH	
  E	
rr   c                    U(       aD  [        SU 5      R                  S5      nSR                  U Vs/ s H  n[        U   PM     sn5      $ SR                  U  Vs/ s H  oD[        ;   a	  [        U   OUPM     sn5      $ s  snf s  snf )zqQuote the fragment part of the URL. Fragments don't have
subdelimiters, so the whole URL fragment can be passed.
rf   rg   rd   )r   r   rh   _FRAGMENT_QUOTE_MAP_FRAGMENT_DELIMSrk   s        r&   _encode_fragment_partr   r  s    
 E4(//7xxAA,Q/ABB88IMNA(8#8	Q	a	?N  BNrw   c                    U(       aD  [        SU 5      R                  S5      nSR                  U Vs/ s H  n[        U   PM     sn5      $ SR                  U  Vs/ s H  nU[        ;   a	  [        U   OUPM     sn5      $ s  snf s  snf )zPQuote special characters in either the username or password
section of the URL.
rf   rg   rd   )r   r   rh   _USERINFO_PART_QUOTE_MAP_USERINFO_DELIMSrk   s        r&   _encode_userinfo_partr     s    
 E4(//7xxgFg1!4gFGG88 	
 ,-0@+@$Q'aG	
  G	
rr   acapi  afpi$  rJ   iD
  dns5   fileftp   giti$  gopherF   httpP   httpsi  imap   ippiw  ippsirc   ircsi)  ldapi  ldapsi|  mmsi  msrpi'  msrpsmtqpi  nfso   nntpw   nntpsi3  rP   n   prosperoi  redisi  rsyncii  rtspi*  rtspsiB  rtspui  sftp   smbi  snmp   ij     i  i     )
sshsteamsvntelnetventrilovncwaiswswssxmpp)urnaboutbitcoinblobdatageomagnetmailtonewspkcs11sipsipstelc                 R   U R                  5       n Ub   [        U5      nUSL a
  U[        U '   O:USL a'  Ub  [        SU-  5      e[
        R                  U 5        O[        SU-  5      eU(       d  [        R                  U 5        g! [        [        4 a    [        SU< 35      ef = f)a@  Registers new scheme information, resulting in correct port and
slash behavior from the URL object. There are dozens of standard
schemes preregistered, so this function is mostly meant for
proprietary internal customizations or stopgaps on missing
standards information. If a scheme seems to be missing, please
`file an issue`_!

Args:
    text: A string representation of the scheme.
        (the 'http' in 'http://hatnote.com')
    uses_netloc: Does the scheme support specifying a
        network host? For instance, "http" does, "mailto" does
        not. Defaults to True.
    default_port: The default port, if any, for
        netloc-using schemes.
    query_plus_is_space: If true, a "+" in the query string should be
        decoded as a space by DecodedURL.

.. _file an issue: https://github.com/mahmoud/hyperlink/issues
Nz+default_port expected integer or None, not TFz>unexpected default port while specifying non-netloc scheme: %rz"uses_netloc expected bool, not: %r)rO   int
ValueError	TypeErrorSCHEME_PORT_MAPNO_NETLOC_SCHEMESaddNO_QUERY_PLUS_SCHEMES)rl   uses_netlocdefault_portquery_plus_is_spaces       r&   register_schemer     s    0 ::<D	|,L d ,		#)+78  	d#=KLL!!$'
+ I& 	" 	s   B  B&c                     U (       d  gU R                  5       n U [        ;   a  gU [        ;   a  gU R                  S5      S   [        ;   a  gU$ )a  Whether or not a URL uses :code:`:` or :code:`://` to separate the
scheme from the rest of the URL depends on the scheme's own
standard definition. There is no way to infer this behavior
from other parts of the URL. A scheme either supports network
locations or it does not.

The URL type's approach to this is to check for explicitly
registered schemes, with common schemes like HTTP
preregistered. This is the same approach taken by
:mod:`urlparse`.

URL adds two additional heuristics if the scheme as a whole is
not registered. First, it attempts to check the subpart of the
scheme after the last ``+`` character. This adds intuitive
behavior for schemes like ``git+ssh``. Second, if a URL with
an unrecognized scheme is loaded, it will maintain the
separator it sees.
FT+)rO   r   r   split)schemedefaults     r&   scheme_uses_netlocr     sJ    ( \\^F ""||C/Nr)   c                       \ rS rSrSrSrg)URLParseErrori-  zException inheriting from :exc:`ValueError`, raised when failing to
parse a URL. Mostly raised on invalid ports and IPv6 addresses.
r6   N)r.   r9   r:   r;   __doc__r=   r6   r)   r&   r   r   -  s     	r)   r   c                     U [         L a  U$ U $ r!   )rA   )argumentr   s     r&   	_optionalr   5  s    6r)   c           	          U(       d  [        S5      e[        X5      (       d@  [        SSR                  U Vs/ s H  o3R                  PM     sn5      < SU < SU< 35      eU$ s  snf )zv
Check that the given *value* is one of the given *types*, or raise an
exception describing the problem using *name*.
z1expected one or more types, maybe use _textcheck?	expected z or  for , got )r   
isinstancer   rh   r.   )r#   valuetypesrp   s       r&   
_typecheckr   =  s^     LMMe##{{61JJ67uF
 	
 L 7s   A%c                 B   [        U[        5      (       d@  U(       a  Uc  U$ [        (       a  SOSnU(       a  US-   OUn[        SU< SU < SU< 35      eU(       aB  [	        U5      [	        U5      -  (       a&  [        SSR                  U5      < S	U < S
U< 35      eU$ )Nunicodestrz or NoneTyper   r   r   z one or more reserved delimiters rd   z present in z: )r   r   PY2r   rL   r   rh   )r#   r   rQ   nullablestr_nameexps         r&   
_textcheckr  M  s    eT""L$'CyUH/7(^+XCCuMNN#e*s6{*wwve-
 	
 Lr)   c                 b    [        U [        5      (       a  U R                  5       n [        U 5      $ )z
Iterate over the (key, value) pairs in ``iterable``.

This handles dictionaries sensibly, and falls back to assuming the
iterable yields (key, value) pairs. This behaviour is similar to
what Python's ``dict()`` constructor does.
)r   
MappingABCitemsiter)iterables    r&   
iter_pairsr
  _  s'     (J''>>#>r)   c                 "    [        U UU[        S9$ Nnormalize_caseencode_stray_percents_decode_map)_percent_decode_UNRESERVED_DECODE_MAPrl   r  r  s      r&   _decode_unreservedr  m  s    %3*	 r)   c                 "    [        U UU[        S9$ r  )r  _USERINFO_DECODE_MAPr  s      r&   _decode_userinfo_partr  w       %3(	 r)   c                 "    [        U UU[        S9$ )zx
>>> _decode_path_part(u'%61%77%2f%7a')
u'aw%2fz'
>>> _decode_path_part(u'%61%77%2f%7a', normalize_case=True)
u'aw%2Fz'
r  )r  _PATH_DECODE_MAPr  s      r&   _decode_path_partr    s     %3$	 r)   c                 "    [        U UU[        S9$ r  )r  _QUERY_KEY_DECODE_MAPr  s      r&   _decode_query_keyr    s    %3)	 r)   c                 "    [        U UU[        S9$ r  )r  _QUERY_VALUE_DECODE_MAPr  s      r&   _decode_query_valuer!    s     %3+	 r)   c                 "    [        U UU[        S9$ r  )r  _FRAGMENT_DECODE_MAPr  s      r&   _decode_fragment_partr$    r  r)   zutf-8c                 \    U R                  U5      nUR                  S5      n[        U5      S:X  a  U $ US   /nUR                  n	USS  H  n
U
SS U
SS p U	" X[   5        U	" U5        M!     SR                  U5      n UR                  U5      $ ! [         a    U s $ f = f! [
         ac    U[        ;   nU(       d  U(       d	  U	" S5        OU	" S5        U(       a(  U(       a!  U	" UR                  5       5        U	" U5         M  U	" U
5         M  f = f! [         a    U(       a  e U s $ f = f)aT  Convert percent-encoded text characters to their normal,
human-readable equivalents.

All characters in the input text must be encodable by
*subencoding*. All special characters underlying the values in the
percent-encoding must be decodable as *subencoding*. If a
non-*subencoding*-valid string is passed, the original text is
returned with no changes applied.

Only called by field-tailored variants, e.g.,
:func:`_decode_path_part`, as every percent-encodable part of the
URL has characters which should not be percent decoded.

>>> _percent_decode(u'abc%20def')
u'abc def'

Args:
    text: Text with percent-encoding present.
    normalize_case: Whether undecoded percent segments, such as encoded
        delimiters, should be uppercased, per RFC 3986 Section 2.1.
        See :func:`_decode_path_part` for an example.
    subencoding: The name of the encoding underlying the percent-encoding.
    raise_subencoding_exc: Whether an error in decoding the bytes
        underlying the percent-decoding should be raised.

Returns:
    Text: The percent-decoded version of *text*, decoded by *subencoding*.
   %r   r   Nr   s   %25r)   )r   UnicodeEncodeErrorr   lenappendKeyErrorrK   upperrh   r   UnicodeDecodeError)rl   r  subencodingraise_subencoding_excr  r  quoted_bytesbitsresr)  itemhexpairrestpair_is_hexunquoted_bytess                  r&   r  r    s.   J{{;/ d#D
4yA~7)CZZFQRRa$qr(	;'(4L	 * XXc]N$$[11E    	!]2K"7t v+w}}'tt	(   s<   B B$D B! B!$ADDDD+*D+c                     U (       d  g U R                  S5      n [        USS9nU$ ! [         a    U n U$ f = f! [         a    U n U$ f = f)u-  Decode a host from ASCII-encodable text to IDNA-decoded text. If
the host text is not ASCII, it is returned unchanged, as it is
presumed that it is already IDNA-decoded.

Some technical details: _decode_host is built on top of the "idna"
package, which has some quirks:

Capital letters are not valid IDNA2008. The idna package will
raise an exception like this on capital letters:

> idna.core.InvalidCodepoint: Codepoint U+004B at position 1 ... not allowed

However, if a segment of a host (i.e., something in
url.host.split('.')) is already ASCII, idna doesn't perform its
usual checks. In fact, for capital letters it automatically
lowercases them.

This check and some other functionality can be bypassed by passing
uts46=True to idna.encode/decode. This allows a more permissive and
convenient interface. So far it seems like the balanced approach.

Example output (from idna==2.6):

>> idna.encode(u'mahmöud.io')
'xn--mahmud-zxa.io'
>> idna.encode(u'Mahmöud.io')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mahmoud/virtualenvs/hyperlink/local/lib/python2.7/site-packages/idna/core.py", line 355, in encode
    result.append(alabel(label))
  File "/home/mahmoud/virtualenvs/hyperlink/local/lib/python2.7/site-packages/idna/core.py", line 276, in alabel
    check_label(label)
  File "/home/mahmoud/virtualenvs/hyperlink/local/lib/python2.7/site-packages/idna/core.py", line 253, in check_label
    raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+004D at position 1 of u'Mahmöud' not allowed
>> idna.encode(u'Mahmoud.io')
'Mahmoud.io'

# Similar behavior for decodes below
>> idna.decode(u'Mahmoud.io')
u'mahmoud.io
>> idna.decode(u'Méhmoud.io', uts46=True)
u'méhmoud.io'
rd   rB   Tuts46)r   idna_decoder   r'  )host
host_bytes	host_texts      r&   _decode_hostr>    sr    \ [[)
	#Jd;I   	
 I	  	 s   ; 
( 88A
Ac                     / nU  H=  nUS:X  a  M  US:X  a  U(       a  UR                  5         M*  M,  UR                  U5        M?     [        U SS 5      S/S/4;   a  UR                  S5        U$ )a  Normalize the URL path by resolving segments of '.' and '..'. For
more details, see `RFC 3986 section 5.2.4, Remove Dot Segments`_.

Args:
   path: sequence of path segments in text form

Returns:
   A new sequence of path segments with the '.' and '..' elements removed
       and resolved.

.. _RFC 3986 section 5.2.4, Remove Dot Segments: https://tools.ietf.org/html/rfc3986#section-5.2.4
.z..r   Nrd   )rP   r)  list)pathsegssegs      r&   _resolve_dot_segmentsrE  E  sq     D$;E\
  KK  DID6E7++CKr)   c                 J   U (       d  gSU ;   a   [        [        U 5        [        nX4$  [        [        U 5        [        nX4$ ! [        R                   a  n[	        SU < SU< S35      eSnAf[
         a     WU 4$ f = f! [        R                  [
        4 a    Sn X4$ f = f)a  Parse the host into a tuple of ``(family, host)``, where family
is the appropriate :mod:`socket` module constant when the host is
an IP address. Family is ``None`` when the host is not an IP.

Will raise :class:`URLParseError` on invalid IPv6 constants.

Returns:
    family (socket constant or None), host (string)

>>> import socket
>>> parse_host('googlewebsite.com') == (None, 'googlewebsite.com')
True
>>> parse_host('::1') == (socket.AF_INET6, '::1')
True
>>> parse_host('192.168.1.1') == (socket.AF_INET, '192.168.1.1')
True
)Nrd   rF   zinvalid IPv6 host: z (r,   N)r   r   socketerrorr   r'  r   )r;  familyses      r&   
parse_hostrK  d  s    & t|	h% F <	gt$ F< || 	Kb IJJ! 	 4<	 01 	F <	s.   A B A>A++A>=A>B"!B"c            	          \ rS rSrSr         S(S jrS)S jr\S 5       r\S 5       r	\S 5       r
\S	 5       r\S
 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       rS)S jrS rS rS r\S 5       r\\\\\\\\\4	S jr\S 5       r       S*S jrS rS rS+S jrS rS r S)S jr!S r"S r#\$(       a  \#r%\!r&O\#r'\!r%\r(\ r)\S  5       r*S)S! jr+S" r,S,S# jr-S,S$ jr.S% r/\S4S& jr0S'r1g)-URLi  a  From blogs to billboards, URLs are so common, that it's easy to
overlook their complexity and power. With hyperlink's
:class:`URL` type, working with URLs doesn't have to be hard.

URLs are made of many parts. Most of these parts are officially
named in `RFC 3986`_ and this diagram may prove handy in identifying
them::

   foo://user:pass@example.com:8042/over/there?name=ferret#nose
   \_/   \_______/ \_________/ \__/\_________/ \_________/ \__/
    |        |          |        |      |           |        |
  scheme  userinfo     host     port   path       query   fragment

While :meth:`~URL.from_text` is used for parsing whole URLs, the
:class:`URL` constructor builds a URL from the individual
components, like so::

    >>> from hyperlink import URL
    >>> url = URL(scheme=u'https', host=u'example.com', path=[u'hello', u'world'])
    >>> print(url.to_text())
    https://example.com/hello/world

The constructor runs basic type checks. All strings are expected
to be text (:class:`str` in Python 3, :class:`unicode` in Python 2). All
arguments are optional, defaulting to appropriately empty values. A full
list of constructor arguments is below.

Args:
    scheme: The text name of the scheme.
    host: The host portion of the network location
    port: The port part of the network location. If ``None`` or no port is
        passed, the port will default to the default port of the scheme, if
        it is known. See the ``SCHEME_PORT_MAP`` and
        :func:`register_default_port` for more info.
    path: A tuple of strings representing the slash-separated parts of the
        path, each percent-encoded.
    query: The query parameters, as a dictionary or as an sequence of
        percent-encoded key-value pairs.
    fragment: The fragment part of the URL.
    rooted: A rooted URL is one which indicates an absolute path.
        This is True on any URL that includes a host, or any relative URL
        that starts with a slash.
    userinfo: The username or colon-separated username:password pair.
    uses_netloc: Indicates whether ``://`` (the "netloc separator") will
        appear to separate the scheme from the *path* in cases where no
        host is present.
        Setting this to ``True`` is a non-spec-compliant affordance for the
        common practice of having URIs that are *not* URLs (cannot have a
        'host' part) but nevertheless use the common ``://`` idiom that
        most people associate with URLs; e.g. ``message:`` URIs like
        ``message://message-id`` being equivalent to ``message:message-id``.
        This may be inferred based on the scheme depending on whether
        :func:`register_scheme` has been used to register the scheme and
        should not be passed directly unless you know the scheme works like
        this and you know it has not been registered.

All of these parts are also exposed as read-only attributes of :class:`URL`
instances, along with several useful methods.

.. _RFC 3986: https://tools.ietf.org/html/rfc3986
.. _RFC 3987: https://tools.ietf.org/html/rfc3987
Nc
                 6   Ub  Uc  SnUc  Ub  [         R                  U5      nU(       a  U(       a	  U(       d  SnUc  SnUc  SnUc  [        U5      n[        SU5      U l        U R                  (       aV  [
        R                  U R                  5      (       d2  [        SU R                  < SU R                  R                  < S35      e[        [        SUS	5      5      u  ol        [        U[        5      (       a  [        S
U< 35      e[        S U 5       5      U l        [        S [#        U5       5       5      U l        [        SU5      U l        [)        SU[*        [,        5      U l        [)        SU[        5      U l        [        SUS	5      U l        U	c  [5        U R                  U	5      n	[)        SU	[        [,        5      U l        U R                  =(       d5    U R.                  =(       a"    U R.                  [         R                  U5      :g  nU(       a  SU l        SU l        U R0                  (       d.  U R8                  S S S:X  a  SU l        U R                   SS  U l        U(       d,  U R                   (       a  U R0                  (       d  SU l        g g g g )Nr   rc   rd   r   zinvalid scheme: zF. Only alphanumeric, "+", "-", and "." allowed. Did you meant to call z.from_text()?r;  z/?#@z)expected iterable of text for path, not: c              3   <   #    U  H  n[        S US5      v   M     g7f)path segmentz/?#Nr  ).0segments     r&   	<genexpr>URL.__init__.<locals>.<genexpr>  s     LtGZ77ts   c           	   3   X   #    U  H   u  p[        S US5      [        SUSSS94v   M"     g7f)zquery parameter namez&=#zquery parameter valuez&#T)r  NrQ  rR  kr_   s      r&   rT  rU     s;      

 * 11e<2AtdK *s   (*fragmentportr   userinfor   Tr   F)r   getboolr  _scheme
_SCHEME_REmatchr   r-   r.   rK  _hostr   r   r   r~   _pathr
  _query	_fragmentr   r   NoneType_port_rooted	_userinfor   _uses_netlocrB  )r%   r   r;  rB  queryrY  rZ  r   r[  r   _will_have_authoritys               r&   r'   URL.__init__  s/    F<F."&&v.DE$ D >F<D>$ZF "(F3<<##DLL11  +/,,8O8OQ  #:fdF#CD:dD!!AEG  LtL

  

 #5)
 
 $J9c8<
!(FD9#J&A,T\\;GK&;h
 #jj 
JJD4::)<)<V)DD 	   DL $D$))BQ-6"9DLABDJ"tzz$,, !&D	 ;Gz"r)   c                 n     U R                   $ ! [         a    [        XS9U l          U R                   $ f = fNlazy)_decoded_urlAttributeError
DecodedURL)r%   rq  s     r&   get_decoded_urlURL.get_decoded_url#  s;    	<$$$ 	< *4 ;D   	<s    44c                     U R                   $ )a%  The scheme is a string, and the first part of an absolute URL, the
part before the first colon, and the part which defines the
semantics of the rest of the URL. Examples include "http",
"https", "ssh", "file", "mailto", and many others. See
:func:`~hyperlink.register_scheme()` for more info.
)r^  r/   s    r&   r   
URL.scheme+  s     ||r)   c                     U R                   $ )zThe host is a string, and the second standard part of an absolute
URL. When present, a valid host must be a domain name, or an
IP (v4 or v6). It occurs before the first slash, or the second
colon, if a :attr:`~hyperlink.URL.port` is provided.
)ra  r/   s    r&   r;  URL.host6       zzr)   c                     U R                   $ )af  The port is an integer that is commonly used in connecting to the
:attr:`host`, and almost never appears without it.

When not present in the original URL, this attribute defaults
to the scheme's default port. If the scheme's default port is
not known, and the port is not provided, this attribute will
be set to None.

>>> URL.from_text(u'http://example.com/pa/th').port
80
>>> URL.from_text(u'foo://example.com/pa/th').port
>>> URL.from_text(u'foo://example.com:8042/pa/th').port
8042

.. note::

   Per the standard, when the port is the same as the schemes
   default port, it will be omitted in the text URL.
)rf  r/   s    r&   rZ  URL.port@  s    , zzr)   c                     U R                   $ )zA tuple of strings, created by splitting the slash-separated
hierarchical path. Started by the first slash after the host,
terminated by a "?", which indicates the start of the
:attr:`~hyperlink.URL.query` string.
)rb  r/   s    r&   rB  URL.pathX  r{  r)   c                     U R                   $ )a  Tuple of pairs, created by splitting the ampersand-separated
mapping of keys and optional values representing
non-hierarchical data used to identify the resource. Keys are
always strings. Values are strings when present, or None when
missing.

For more operations on the mapping, see
:meth:`~hyperlink.URL.get()`, :meth:`~hyperlink.URL.add()`,
:meth:`~hyperlink.URL.set()`, and
:meth:`~hyperlink.URL.delete()`.
)rc  r/   s    r&   rj  	URL.queryb  s     {{r)   c                     U R                   $ )zA string, the last part of the URL, indicated by the first "#"
after the :attr:`~hyperlink.URL.path` or
:attr:`~hyperlink.URL.query`. Enables indirect identification
of a secondary resource, like an anchor within an HTML page.
)rd  r/   s    r&   rY  URL.fragmentr  s     ~~r)   c                     U R                   $ )aG  Whether or not the path starts with a forward slash (``/``).

This is taken from the terminology in the BNF grammar,
specifically the "path-rootless", rule, since "absolute path"
and "absolute URI" are somewhat ambiguous. :attr:`path` does
not contain the implicit prefixed ``"/"`` since that is
somewhat awkward to work with.
)rg  r/   s    r&   r   
URL.rooted|  s     ||r)   c                     U R                   $ )zFThe colon-separated string forming the username-password
combination.
)rh  r/   s    r&   r[  URL.userinfo  s     ~~r)   c                     U R                   $ )z
Indicates whether ``://`` (the "netloc separator") will appear to
separate the scheme from the *path* in cases where no host is present.
)ri  r/   s    r&   r   URL.uses_netloc  s        r)   c                 >    U R                   R                  S5      S   $ )z6
The user portion of :attr:`~hyperlink.URL.userinfo`.
rF   r   )r[  r   r/   s    r&   userURL.user  s     }}""4(++r)   c                 j   UR                  SU5      nU(       a  [        SUR                  5       -  5      eU R                  nSU;   a
  SU-   S-   /nOU R                  /nU R                  [
        R                  U R                  5      :w  a$  UR                  [        U R                  5      5        / nU R                  (       aA  U R                  nU(       d  SU;   a  USUR                  S5      S-    nUR                  U5        UR                  SR                  U5      5        SR                  U5      $ )	a  Compute and return the appropriate host/port/userinfo combination.

>>> url = URL.from_text(u'http://user:pass@localhost:8080/a/b?x=y')
>>> url.authority()
u'user:@localhost:8080'
>>> url.authority(with_password=True)
u'user:pass@localhost:8080'

Args:
    with_password: Whether the return value of this method include the
    password in the URL, if it is set.
    Defaults to False.

Returns:
    Text: The authority (network location and user information) portion
        of the URL.
includeSecretsz$got unexpected keyword arguments: %rrF   []Nr   @)rP   r   keysr;  rZ  r   r\  r   r)  r   r[  indexrh   )r%   with_passwordkwr;  hostport	authorityr[  s          r&   r  URL.authority  s    ( /?BRWWYNOOyy$;d
S()H		{H99++DKK88OODO,	==}}H TX%5#$>hnnT&:Q&>?X&8,-yy##r)   c                    [        XR                  5      (       d  [        $ S H  n[        X5      [        X5      :w  d  M    g   U R                  UR                  :X  d(  U R                  [
        ;   a  UR                  [
        ;   a  gg)N)r   r[  r;  rj  rY  rZ  r   r   FT)r   r-   NotImplementedgetattrrB  _ROOT_PATHS)r%   otherattrs      r&   __eq__
URL.__eq__  si    %00!!	
D t"ge&::	
 99

"II${)Br)   c                 n    [        XR                  5      (       d  [        $ U R                  U5      (       + $ r!   r   r-   r  r  r%   r  s     r&   __ne__
URL.__ne__  )    %00!!;;u%%%r)   c                     [        U R                  U R                  U R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                  4
5      $ r!   hashr-   r   r[  r;  rB  rj  rY  rZ  r   r   r/   s    r&   __hash__URL.__hash__  \    				

		  
 	
r)   c                 R    [        U R                  =(       a    U R                  5      $ )a/  Whether or not the URL is "absolute". Absolute URLs are complete
enough to resolve to a network resource without being relative
to a base URI.

>>> URL.from_text(u'http://wikipedia.org/').absolute
True
>>> URL.from_text(u'?a=b&c=d').absolute
False

Absolute URLs must have both a scheme and a host set.
)r]  r   r;  r/   s    r&   absoluteURL.absolute  s     DKK-DII..r)   c
                    U[         La  XR                  :w  a  Sn	U R                  [        XR                  5      [        X R                  5      [        X0R
                  5      [        X@R                  5      [        XPR                  5      [        X`R                  5      [        XpR                  5      [        XR                  5      [        XR                  5      S9	$ )a  :class:`URL` objects are immutable, which means that attributes
are designed to be set only once, at construction. Instead of
modifying an existing URL, one simply creates a copy with the
desired changes.

If any of the following arguments is omitted, it defaults to
the value on the current URL.

Args:
    scheme: The text name of the scheme.
    host: The host portion of the network location.
    path: A tuple of strings representing the slash-separated parts of
        the path.
    query: The query parameters, as a dictionary or as an sequence of
        key-value pairs.
    fragment: The fragment part of the URL.
    port: The port part of the network location.
    rooted: Whether or not the path begins with a slash.
    userinfo: The username or colon-separated username:password pair.
    uses_netloc: Indicates whether ``://`` (the "netloc separator")
        will appear to separate the scheme from the *path* in cases
        where no host is present.
        Setting this to ``True`` is a non-spec-compliant affordance for
        the common practice of having URIs that are *not* URLs (cannot
        have a 'host' part) but nevertheless use the common ``://``
        idiom that most people associate with URLs; e.g. ``message:``
        URIs like ``message://message-id`` being equivalent to
        ``message:message-id``.
        This may be inferred based on the scheme depending on whether
        :func:`register_scheme` has been used to register the scheme
        and should not be passed directly unless you know the scheme
        works like this and you know it has not been registered.

Returns:
    URL: A copy of the current :class:`URL`, with new values for
        parameters passed.
N	r   r;  rB  rj  rY  rZ  r   r[  r   )rA   r   r-   r   r;  rB  rj  rY  rZ  r   r[  r   )
r%   r   r;  rB  rj  rY  rZ  r   r[  r   s
             r&   rb   URL.replace  s    d Fkk$9 K~~V[[14+4+E::.x74+V[[1x7!+/?/?@  

 
	
r)   c                    [         R                  [        SU5      5      nUc  [        SU-  5      eUR	                  5       nUS   =(       d    Sn[
        R                  U5      nUc  [        SU< SU< 35      eUR	                  5       nUS   (       a  [        S	US   < SU< 35      eUS
   =(       d    SnUS   =(       d    US   nUS   n	U	b   [        U	5      n	US   =(       d    Sn
US   =(       d    Sn[        US   5      nUS   (       a2  [        US   R                  S5      5      nUS   (       d  USS nSnOSnOSn[        U5      nUS   (       a%  [        S US   R                  S5       5       5      nOSnU " U
UUUUU	UUU5	      $ ! [         a$    U	(       d  [        SU-  5      e[        SU	-  5      ef = f)a  Whereas the :class:`URL` constructor is useful for constructing
URLs from parts, :meth:`~URL.from_text` supports parsing whole
URLs from their string form::

    >>> URL.from_text(u'http://example.com')
    URL.from_text(u'http://example.com')
    >>> URL.from_text(u'?a=b&x=y')
    URL.from_text(u'?a=b&x=y')

As you can see above, it's also used as the :func:`repr` of
:class:`URL` objects. The natural counterpart to
:func:`~URL.to_text()`. This method only accepts *text*, so be
sure to decode those bytestrings.

Args:
   text: A valid URL string.

Returns:
   URL: The structured object version of the parsed string.

.. note::

    Somewhat unexpectedly, URLs are a far more permissive
    format than most would assume. Many strings which don't
    look like URLs are still valid URLs. As a result, this
    method only raises :class:`URLParseError` on invalid port
    and IPv6 values in the host portion of the URL.
rl   Nzcould not parse url: %rr  rd   zinvalid authority z	 in url: bad_hostzinvalid host r[  	ipv6_host
plain_hostrZ  zport must not be empty: %rz!expected integer for port, not %rr   rY  _netloc_seprB  /r   r   TFr6   rj  c              3   Z   #    U  H!  nS U;   a  UR                  S S5      OUS4v   M#     g7f)rH   r   N)r   )rR  qes     r&   rT   URL.from_text.<locals>.<genexpr>  s;       2B rz HHT1%d$ 2s   )+rG   )_URL_REr`  r  r   	groupdict_AUTHORITY_REr   r   r]  r~   r   )clsrl   umgsau_textau_mau_gsr[  r;  rZ  r   rY  r   rB  r   rj  s                   r&   	from_textURL.from_textH  s   > ]]:fd34: 9D @AA\\^[/(S""7+<5<dC   05j0A4H  $+[!8U<%8V}P4y H$j>(S2m,-f:F))$/0D7ABxD']Fg;  W+++D1 E E

 
	
=  P'(Dw(NOO#$G$$NOOPs   F .F?c                   ^ 0 nU(       a  U R                   R                  5       US'   U(       a  U R                  R                  5       US'   U4S jn	U(       aE  U R                  (       a/  [	        U R                  5       V
s/ s H
  o" U
5      PM     sn
US'   OSUS'   U(       a;  U R
                   VVs/ s H  u  pU	" U5      U(       a  U	" U5      OU4PM      snnUS'   U(       a  U	" U R                  5      US'   U(       aD  SR                  U R                  R                  SS	5       V
s/ s H
  o" U
5      PM     sn
5      US
'   U R                  " S0 UD6$ s  sn
f s  snnf s  sn
f )a(  Return a new URL object with several standard normalizations
applied:

* Decode unreserved characters (`RFC 3986 2.3`_)
* Uppercase remaining percent-encoded octets (`RFC 3986 2.1`_)
* Convert scheme and host casing to lowercase (`RFC 3986 3.2.2`_)
* Resolve any "." and ".." references in the path (`RFC 3986 6.2.2.3`_)
* Ensure an ending slash on URLs with an empty path (`RFC 3986 6.2.3`_)
* Encode any stray percent signs (`%`) in percent-encoded
  fields (path, query, fragment, userinfo) (`RFC 3986 2.4`_)

All are applied by default, but normalizations can be disabled
per-part by passing `False` for that part's corresponding
name.

Args:
    scheme: Convert the scheme to lowercase
    host: Convert the host to lowercase
    path: Normalize the path (see above for details)
    query: Normalize the query string
    fragment: Normalize the fragment
    userinfo: Normalize the userinfo
    percents: Encode isolated percent signs for any percent-encoded
        fields which are being normalized (defaults to `True`).

>>> url = URL.from_text(u'Http://example.COM/a/../b/./c%2f?%61%')
>>> print(url.normalize().to_text())
http://example.com/b/c%2F?a%25

.. _RFC 3986 3.2.2: https://tools.ietf.org/html/rfc3986#section-3.2.2
.. _RFC 3986 2.3: https://tools.ietf.org/html/rfc3986#section-2.3
.. _RFC 3986 2.1: https://tools.ietf.org/html/rfc3986#section-2.1
.. _RFC 3986 6.2.2.3: https://tools.ietf.org/html/rfc3986#section-6.2.2.3
.. _RFC 3986 6.2.3: https://tools.ietf.org/html/rfc3986#section-6.2.3
.. _RFC 3986 2.4: https://tools.ietf.org/html/rfc3986#section-2.4
r   r;  c                    > [        U STS9$ )NT)r  r  )r  )targetpercentss    r&   
_dec_unres!URL.normalize.<locals>._dec_unres  s    %t8 r)   rB  rc   rj  rY  rF   r   r[  r6   )r   rO   r;  rB  rE  rj  rY  rh   r[  r   rb   )r%   r   r;  rB  rj  rY  r[  r  r  r  prX  r_   s          `     r&   r   URL.normalize  s8   ^ ;;,,.BxL*BvJ	 yy+@+K+KaJqM+K6
 $6
 !JJ&DA A
1:&BwK '6BzN!YY(,(;(;C(CD(C1A(CDBzN ||!b!!# Es   E4%E,E$c                    U(       d  U $ U Vs/ s H  n[        SU5      PM     nn[        U R                  5      nU R                  (       a  U R                  S   S:X  a  USS nU[        [        USS95      -  nU R	                  US9$ s  snf )a=  Make a new :class:`URL` where the given path segments are a child
of this URL, preserving other parts of the URL, including the
query string and fragment.

For example::

    >>> url = URL.from_text(u'http://localhost/a/b?x=y')
    >>> child_url = url.child(u"c", u"d")
    >>> child_url.to_text()
    u'http://localhost/a/b/c/d?x=y'

Args:
    segments: Additional parts to be joined and added to the path, like
    :func:`os.path.join`. Special characters in segments will be
    percent encoded.

Returns:
   URL: A copy of the current URL with the extra path segments.
rP  r   rd   NFr}   rB  )r  r~   rB  r   rb   )r%   segmentssnew_paths       r&   child	URL.child  s    * K 4<
3;aJ~q)8 	 
 #992#-}HE,XuEFF|||**
s   B	c                     [        SU5        [        U R                  5      SS [        U5      4-   nU R	                  US9$ )a-  Make a new :class:`URL` with a single path segment that is a
sibling of this URL path.

Args:
    segment: A single path segment.

Returns:
    URL: A copy of the current URL with the last path segment
        replaced by *segment*. Special characters such as
        ``/?#`` will be percent encoded.
rP  Nr   r  )r  r~   rB  rv   rb   )r%   rS  r  s      r&   siblingURL.sibling  sB     	>7+#CR(,=g,F+HH|||**r)   c           	         U(       aM  [        U[        5      (       a  UnO![        SU5        [        R                  U5      nUR                  (       a  U$ OU nUR
                  nUR                  (       a   UR                  (       d  [        SU< 35      eUR                  (       a  UR                  nO_UR                  (       a/  [        U R                  5      SS [        UR                  5      -   nOU R                  nU(       d  U R
                  nU R                  UR                  =(       d    U R                  UR                  =(       d    U R                  UR                  =(       d    U R                  [        U5      UUR                  S9$ )a  Resolve the given URL relative to this URL.

The resulting URI should match what a web browser would
generate if you visited the current URL and clicked on *href*.

    >>> url = URL.from_text(u'http://blog.hatnote.com/')
    >>> url.click(u'/post/155074058790').to_text()
    u'http://blog.hatnote.com/post/155074058790'
    >>> url = URL.from_text(u'http://localhost/a/b/c/')
    >>> url.click(u'../d/./e').to_text()
    u'http://localhost/a/b/d/e'

Args (Text):
    href: A string representing a clicked URL.

Return:
    A copy of the current URL with navigation logic applied.

For more information, see `RFC 3986 section 5`_.

.. _RFC 3986 section 5: https://tools.ietf.org/html/rfc3986#section-5
zrelative URLz!absolute URI with rootless path: Nr   )r   r;  rZ  rB  rj  rY  )r   rM  r  r  r  rj  r   r   NotImplementedErrorrB  r~   rb   r;  rZ  rE  rY  )r%   hrefclickedrj  rB  s        r&   click	URL.click+  s#   0 $$$
 >40---   G>>'.. &9=?  ~~||TYY',uW\\/BByy JJE||>>0T[[**&t,%%  
 	
r)   c                 <   SR                  U R                  R                  SS5       Vs/ s H  n[        U5      PM     sn5      n[	        U R
                  [        U R                  5      SSS9nU R                  (       d  U R                  O"[        U R                  SS9R                  S5      nU R                  UUU[        U R                   VVs/ s H  u  pV[        USS9Ub
  [        USS9OS	4PM      snn5      [!        U R"                  SS9S
9$ s  snf s  snnf )u  Make a new :class:`URL` instance with all non-ASCII characters
appropriately percent-encoded. This is useful to do in preparation
for sending a :class:`URL` over a network protocol.

For example::

    >>> URL.from_text(u'https://ايران.com/foo⇧bar/').to_uri()
    URL.from_text(u'https://xn--mgba3a4fra.com/foo%E2%87%A7bar/')

Returns:
    URL: A new instance with its path segments, query parameters, and
        hostname encoded, so that they are all in the standard
        US-ASCII range.
rF   r   FT)r   r   rm   r8  rB   r}   Nr[  r;  rB  rj  rY  )rh   r[  r   r   r   rB  r]  r   r;  idna_encoder   rb   r~   rj  r   r   r   rY  )r%   r  new_userinfor  new_hostrX  r_   s          r&   to_uri
URL.to_urik  s     yy/3}}/B/B3/JK/J!"1%/JK
 &II$t{{"3E4

 99 IITYYd3::7C 	
 ||! !%

 !+ *!T:= ,At<!	 !+
 +4==$G  
 	
 Ls   D%Dc           
         SR                  U R                  R                  SS5       Vs/ s H  n[        U5      PM     sn5      n[	        U R
                  5      nU R                  UUU R                   Vs/ s H  n[        U5      PM     sn[        S U R                   5       5      [        U R                  5      S9$ s  snf s  snf )u	  Make a new :class:`URL` instance with all but a few reserved
characters decoded into human-readable format.

Percent-encoded Unicode and IDNA-encoded hostnames are
decoded, like so::

    >>> url = URL.from_text(u'https://xn--mgba3a4fra.example.com/foo%E2%87%A7bar/')
    >>> print(url.to_iri().to_text())
    https://ايران.example.com/foo⇧bar/

.. note::

    As a general Python issue, "narrow" (UCS-2) builds of
    Python may not be able to fully decode certain URLs, and
    the in those cases, this method will return a best-effort,
    partially-decoded, URL which is still valid. This issue
    does not affect any Python builds 3.4+.

Returns:
    URL: A new instance with its path segments, query parameters, and
        hostname decoded for display purposes.
rF   r   c              3   \   #    U  H"  u  p[        U5      Ub  [        U5      OS 4v   M$     g 7fr!   )r  r!  rW  s      r&   rT  URL.to_iri.<locals>.<genexpr>  s6      
 'DA &a(./m'* 's   *,r  )rh   r[  r   r  r>  r;  rb   rB  r  r~   rj  r$  rY  )r%   r  r  r=  rS  s        r&   to_iri
URL.to_iri  s    0 yy/3}}/B/B3/JK/J!"1%/JK
 !+	||!<@IIFI#G,IF 
 !JJ  +4==9  
 	
	 L Gs   B?6Cc                 n   U R                   nU R                  U5      nSR                  [        U R                  U R
                  [        U5      [        U5      SS95      n/ nU R                   HU  u  pgUc  UR                  [        USS95        M#  UR                  SR                  [        USS9[        USS945      5        MW     SR                  U5      nU R                  n	/ n
U
R                  nU(       a  U" U5        U" S5        U(       a  U" S	5        U" U5        O)U(       a"  USS
 S	:w  a  U R                  (       a  U" S	5        U(       a'  U(       a  U(       a  USS S:w  a  U" S5        U" U5        U(       a  U" S5        U" U5        U	(       a  U" S5        U" U	5        SR                  U
5      $ )aM  Render this URL to its textual representation.

By default, the URL text will *not* include a password, if one
is set. RFC 3986 considers using URLs to represent such
sensitive information as deprecated. Quoting from RFC 3986,
`section 3.2.1`:

    "Applications should not render as clear text any data after the
    first colon (":") character found within a userinfo subcomponent
    unless the data after the colon is the empty string (indicating no
    password)."

Args (bool):
    with_password: Whether or not to include the password in the URL
        text. Defaults to False.

Returns:
    Text: The serialized textual representation of this URL, such as
        ``u"http://example.com/some/path?some=query"``.

The natural counterpart to :class:`URL.from_text()`.

.. _section 3.2.1: https://tools.ietf.org/html/rfc3986#section-3.2.1
r  F)r   r   r   rm   Nr}   rH   rG   rF   z//r   r   ?#rd   )r   r  rh   r   rB  r   r]  rj  r)  r   r   rY  r   )r%   r  r   r  rB  query_partsrX  r_   query_stringrY  parts_adds               r&   to_textURL.to_text  sp   4 NN=1	xx		{{<"9o
 JJDAy""#4Q#FG""II-a?/5A	  yy-==||LIJORaD(T-=-=J)RaCS	JIINxxr)   c                 Z    U R                   R                  < SU R                  5       < S3$ )zConvert this URL to an representation that shows all of its
constituent parts, as well as being a valid argument to
:func:`eval`.
z.from_text(r,   )r-   r.   r  r/   s    r&   r0   URL.__repr__  s     &*^^%<%<dllnMMr)   c                 \    U R                  5       R                  5       R                  S5      $ )z
Allows for direct usage of URL objects with libraries like
requests, which automatically stringify URL parameters. See
issue #49.
rB   )r  r  r   r/   s    r&   	_to_bytesURL._to_bytes  s$     {{}$$&--g66r)   c                 $    U R                  U5      $ r!   r  )r  r  s     r&   fromTextURL.fromText+  s     }}Qr)   c                      U R                  US9$ N)r  r  r%   r  s     r&   asText
URL.asText0      ||.|99r)   c                     [         R                  U 5      n[        [        U5      [        / SQ5      -
  5      nU$ ! [         a<    [        U R                  5      [        U R                  R                  5       5      -   n Nif = fN)r  asURIasIRIr  
r?   __dir__rs  dirr-   rA  __dict__r  sortedrL   r%   rS   s     r&   r	  URL.__dir__4  n    	C..&C SX$L MMN
	  	Cdnn%T]]-?-?-A(BBC	C   ; AB Bc                 >    U R                  U R                  X44-   S9$ )a  Make a new :class:`URL` instance with a given query argument,
*name*, added to it with the value *value*, like so::

    >>> URL.from_text(u'https://example.com/?x=y').add(u'x')
    URL.from_text(u'https://example.com/?x=y&x')
    >>> URL.from_text(u'https://example.com/?x=y').add(u'x', u'z')
    URL.from_text(u'https://example.com/?x=y&x=z')

Args:
    name: The name of the query parameter to add.
        The part before the ``=``.
    value: The value of the query parameter to add.
        The part after the ``=``.
        Defaults to ``None``, meaning no value.

Returns:
    URL: A new :class:`URL` instance with the parameter added.
rj  rb   rj  r%   r#   r   s      r&   r   URL.add@  s#    ( ||$**/?"?|@@r)   c                    ^ U R                    VVs/ s H  u  p4UT:w  d  M  X44PM     nnn[        U4S j[        U R                   5       5       S5      nTU4/XVU& U R                  US9$ s  snnf )a  Make a new :class:`URL` instance with the query parameter *name*
set to *value*. All existing occurences, if any are replaced
by the single name-value pair.

    >>> URL.from_text(u'https://example.com/?x=y').set(u'x')
    URL.from_text(u'https://example.com/?x')
    >>> URL.from_text(u'https://example.com/?x=y').set(u'x', u'z')
    URL.from_text(u'https://example.com/?x=z')

Args:
    name: The name of the query parameter to set.
        The part before the ``=``.
    value: The value of the query parameter to set.
        The part after the ``=``.
        Defaults to ``None``, meaning no value.

Returns:
    URL: A new :class:`URL` instance with the parameter set.
c              3   B   >#    U  H  u  nu  p#UT:X  d  M  Uv   M     g 7fr!   r6   rR  r^   rX  r_   r#   s       r&   rT  URL.set.<locals>.<genexpr>n  s!     E"7;Av19QQ"7   	r   r  rj  next	enumeraterb   )r%   r#   r   rX  r_   qidxs    `     r&   rL   URL.setV  sm    , #'**:*T	VaV*:E)DJJ"7Er
 Um_c
||!|$$ ;s
   A*A*c                 ^    U R                    VVs/ s H  u  p#X:X  d  M  UPM     snn$ s  snnf )a  Get a list of values for the given query parameter, *name*::

    >>> url = URL.from_text(u'?x=1&x=2')
    >>> url.get('x')
    [u'1', u'2']
    >>> url.get('y')
    []

If the given *name* is not set, an empty list is returned. A
list is always returned, and this method raises no exceptions.

Args:
    name: The name of the query parameter to get.

Returns:
    List[Optional[Text]]: A list of all the values associated with the
        key, in string form.
r  )r%   r#   keyr   s       r&   r\  URL.gets  s&    ( +/**D*,3*DDD   ))c                    Uc`  U[         L a)  U R                   VVs/ s H  u  pEXA:w  d  M  XE4PM     nnnOwU R                   VVs/ s H  u  pEXA:X  a  XR:X  a  M  XE4PM     nnnOI/ SpvU R                   H6  u  pEXA:X  a  U[         L d  XR:X  a  Xs:  a  US-  nM$  UR                  XE45        M8     U R                  US9$ s  snnf s  snnf )a#  Make a new :class:`URL` instance with occurrences of the query
parameter *name* removed, or, if *value* is set, parameters
matching *name* and *value*. No exception is raised if the
parameter is not already set.

Args:
    name: The name of the query parameter to remove.
    value: Optional value to additionally filter on.
        Setting this removes query parameters which match both name
        and value.
    limit: Optional maximum number of parameters to remove.

Returns:
    URL: A new :class:`URL` instance with the parameter removed.
r   r   r  rA   rj  r)  rb   r%   r#   r   limitrX  r_   nqremoved_counts           r&   remove
URL.remove  s    , =+/::C:!fqf:C #'**",I!* QF",   !#A

I&AJ%-!Q&MIIqf% # ||"|%%) D   B<B<CC)
rr  rd  ra  rb  rf  rc  rg  r^  rh  ri  )	NNr6   r6   rd   NNrd   NFTTTTTTTrc   r!   )2r.   r9   r:   r;   r   r'   ru  propertyr   r;  rZ  rB  rj  rY  r   r[  r   r  r  r  r  r  r  rA   rb   classmethodr  r   r  r  r  r  r  r  r0   r  r   __str____unicode__	__bytes__r  r  r  r  r	  r   rL   r\  r+  r=   r6   r)   r&   rM  rM    s	   =B S&j!      .       
 
   ! ! , ,%$N,&
" / /" @
D ^
 ^
D N"`+B+">
@+
Z)
VJXN7 	 EE   :A,%:E2 	,&r)   rM  c                 &    U R                  SS5      $ )Nr   z%20)rb   rl   s    r&   _replace_plusr7    s    <<U##r)   c                     U $ r!   r6   r6  s    r&   _no_opr9    s    Kr)   c            	          \ rS rSrSr\SS4S jr\S)S j5       r\	S 5       r
S*S jrS	 rS
 rS rS+S jrS rS r       S,S jr\	S 5       r\	S 5       r\	S 5       r\	S 5       r\	S 5       r\	S 5       r\	S 5       r\	S 5       r\	S 5       r\	S 5       r\	S 5       r\\\\\\\\\4	S jrS r S-S jr!S-S jr"\S4S jr#S  r$S! r%S" r&S# r'S$ r(\r)\r*\S*S% j5       r+S*S& jr,S' r-S(r.g).rt  i  a  
:class:`DecodedURL` is a type designed to act as a higher-level
interface to :class:`URL` and the recommended type for most
operations. By analogy, :class:`DecodedURL` is the
:class:`unicode` to URL's :class:`bytes`.

:class:`DecodedURL` automatically handles encoding and decoding
all its components, such that all inputs and outputs are in a
maximally-decoded state.  Note that this means, for some special
cases, a URL may not "roundtrip" character-for-character, but this
is considered a good tradeoff for the safety of automatic
encoding.

Otherwise, :class:`DecodedURL` has almost exactly the same API as
:class:`URL`.

Where applicable, a UTF-8 encoding is presumed. Be advised that
some interactions can raise :exc:`UnicodeEncodeErrors` and
:exc:`UnicodeDecodeErrors`, just like when working with
bytestrings. Examples of such interactions include handling query
strings encoding binary data, and paths containing segments with
special characters encoded with codecs other than UTF-8.

Args:
    url: A :class:`URL` object to wrap.
    lazy: Set to True to avoid pre-decode all parts of the URL to check for
        validity.
        Defaults to False.
    query_plus_is_space: + characters in the query string should be treated
        as spaces when decoding.  If unspecified, the default is taken from
        the scheme.

.. note::

  The :class:`DecodedURL` initializer takes a :class:`URL` object,
  not URL components, like :class:`URL`. To programmatically
  construct a :class:`DecodedURL`, you can use this pattern:

    >>> print(DecodedURL().replace(scheme=u'https',
    ... host=u'pypi.org', path=(u'projects', u'hyperlink')).to_text())
    https://pypi.org/projects/hyperlink

.. versionadded:: 18.0.0
FNc                     Xl         Uc  UR                  [        ;  nX0l        U(       d9  U R                  U R
                  U R                  U R                  U R                  4  g r!   )	_urlr   r   _query_plus_is_spacer;  r[  rB  rj  rY  )r%   urlrq  r   s       r&   r'   DecodedURL.__init__  sM    	&"%**4I"I$7! IIt}}diiT]]Jr)   c                 :    [         R                  U5      nU " XBUS9$ )zMake a `DecodedURL` instance from any text string containing a URL.

Args:
  text: Text containing the URL
  lazy: Whether to pre-decode all parts of the URL to check for
      validity.
      Defaults to True.
)rq  r   )rM  r  )r  rl   rq  r   r<  s        r&   r  DecodedURL.from_text  s      }}T"48KLLr)   c                     U R                   $ )zUAccess the underlying :class:`URL` object, which has any special
characters encoded.
)r<  r/   s    r&   encoded_urlDecodedURL.encoded_url  s     yyr)   c                 8    U R                   R                  U5      $ )z/Passthrough to :meth:`~hyperlink.URL.to_text()`)r<  r  )r%   r  s     r&   r  DecodedURL.to_text  s     yy  //r)   c                 6    U R                   R                  5       $ )z.Passthrough to :meth:`~hyperlink.URL.to_uri()`)r<  r  r/   s    r&   r  DecodedURL.to_uri       yy!!r)   c                 6    U R                   R                  5       $ )z.Passthrough to :meth:`~hyperlink.URL.to_iri()`)r<  r  r/   s    r&   r  DecodedURL.to_iri"  rI  r)   c                 6    U R                  UU R                  S9$ )N)r   )r-   r=  )r%   r>  s     r&   _cloneDecodedURL._clone'  s$    ~~ $ 9 9  
 	
r)   c                     [        U[        5      (       a  UR                  nU R                  U R                  R	                  US95      $ )zNReturn a new DecodedURL wrapping the result of
:meth:`~hyperlink.URL.click()`
)r  )r   rt  r<  rM  r  )r%   r  s     r&   r  DecodedURL.click/  s=    
 dJ''99D{{IIOOO&
 	
r)   c                 h    U R                  U R                  R                  [        U5      5      5      $ )zAutomatically encode any reserved characters in *segment* and
return a new `DecodedURL` wrapping the result of
:meth:`~hyperlink.URL.sibling()`
)rM  r<  r  rq   )r%   rS  s     r&   r  DecodedURL.sibling:  s-     {{II.w78
 	
r)   c                     U(       d  U $ U Vs/ s H  n[        U5      PM     nnU R                  U R                  R                  " U6 5      $ s  snf )zAutomatically encode any reserved characters in *segments* and
return a new `DecodedURL` wrapping the result of
:meth:`~hyperlink.URL.child()`.
)rq   rM  r<  r  )r%   r  r  new_segss       r&   r  DecodedURL.childD  sG     K19:A$Q':{{499??H566 ;s   Ac                 \    U R                  U R                  R                  XX4XVU5      5      $ )zTReturn a new `DecodedURL` wrapping the result of
:meth:`~hyperlink.URL.normalize()`
)rM  r<  r   )r%   r   r;  rB  rj  rY  r[  r  s           r&   r   DecodedURL.normalizeO  s0     {{IId8x
 	
r)   c                 .    U R                   R                  $ r!   )r<  r  r/   s    r&   r  DecodedURL.absolutec  s     yy!!!r)   c                 .    U R                   R                  $ r!   )r<  r   r/   s    r&   r   DecodedURL.schemeh       yyr)   c                 @    [        U R                  R                  5      $ r!   )r>  r<  r;  r/   s    r&   r;  DecodedURL.hostm  s     DIINN++r)   c                 .    U R                   R                  $ r!   )r<  rZ  r/   s    r&   rZ  DecodedURL.portr  s     yy~~r)   c                 .    U R                   R                  $ r!   )r<  r   r/   s    r&   r   DecodedURL.rootedw  r\  r)   c           
          [        U S5      (       d=  [        U R                  R                   Vs/ s H  n[	        USS9PM     sn5      U l        U R
                  $ s  snf )Nrb  Tr.  )hasattrr~   r<  rB  r  rb  )r%   r  s     r&   rB  DecodedURL.path|  sZ     tW%% "YY^^+ $ATB+DJ zzs   Ac                    ^ [        U S5      (       dZ  U R                  (       a  [        mO[        m[	        [
        [        U4S jU R                  R                   5       5      5      U l	        U R                  $ )Nrc  c              3   T   >#    U  H  u  p[        U4S  jX4 5       5      v   M     g7f)c              3   N   >#    U  H  nUb  [        T" U5      SS9OS v   M     g 7f)NTrd  r  )rR  x	predecodes     r&   rT  -DecodedURL.query.<locals>.<genexpr>.<genexpr>  s;       "(A = (%aL "	"
 "(s   "%Nr~   )rR  rX  r_   rl  s      r&   rT  #DecodedURL.query.<locals>.<genexpr>  s9      
 !0   #$   !0s   %()
re  r=  r7  r9  r   
QueryPairsr~   r<  rj  rc  )r%   rl  s    @r&   rj  DecodedURL.query  s_     tX&&(()	"	 
 !%		
 
DK {{r)   c                     [        U S5      (       d%  U R                  R                  n[        USS9U l        U R                  $ )Nrd  Trd  )re  r<  rY  r  rd  )r%   frags     r&   rY  DecodedURL.fragment  s8     t[))99%%D,TNDN~~r)   c                 "   [        U S5      (       ds  [        [        [        [           [        [        [        4   4   [        [        S U R                  R                  R                  SS5       5       5      5      5      U l	        U R                  $ )Nrh  c              3   6   #    U  H  n[        US S9v   M     g7f)Trd  Nrj  rR  r  s     r&   rT  &DecodedURL.userinfo.<locals>.<genexpr>  s      !AA (F!As   rF   r   )
re  r   r   r   r   r~   r<  r[  r   rh  r/   s    r&   r[  DecodedURL.userinfo  sv     t[))!eCj%S/12 !%!3!3!9!9#q!A DN ~~r)   c                      U R                   S   $ )Nr   )r[  r/   s    r&   r  DecodedURL.user  s     }}Qr)   c                 .    U R                   R                  $ r!   )r<  r   r/   s    r&   r   DecodedURL.uses_netloc  s     yy$$$r)   c
                    U[         La  [        S U 5       5      nU[         La)  [        [        [        S [	        U5       5       5      5      nU[         LaJ  [        U5      S:  a  [        SU< 35      eSR                  U V
s/ s H  n
[        U
5      PM     sn
5      nO[         nU R                  R                  UUUUUUUUU	S9	nU R                  US9$ s  sn
f )aa  While the signature is the same, this `replace()` differs a little
from URL.replace. For instance, it accepts userinfo as a
tuple, not as a string, handling the case of having a username
containing a `:`. As with the rest of the methods on
DecodedURL, if you pass a reserved character, it will be
automatically encoded instead of an error being raised.
c              3   8   #    U  H  n[        U5      v   M     g 7fr!   rq   rw  s     r&   rT  %DecodedURL.replace.<locals>.<genexpr>  s     ;d)!,,ds   c              3   L   #    U  H  u  p[        S  X4 5       5      v   M     g7f)c              3   B   #    U  H  nUb  [        U5      OS v   M     g 7fr!   r  )rR  rk  s     r&   rT  /DecodedURL.replace.<locals>.<genexpr>.<genexpr>  s&      !'A 01}(+$F!'s   Nrn  rW  s      r&   rT  r    s6      
 !2	  "#   !2s   "$r   zDuserinfo expected sequence of ["user"] or ["user", "password"], got rF   r  )r>  )rA   r~   r   rp  r
  r(  r   rh   rq   r<  rb   rM  )r%   r   r;  rB  rj  rY  rZ  r   r[  r   r  userinfo_textnew_urls                r&   rb   DecodedURL.replace  s    ( v;d;;D 
 !+5 1 	E 6!8}q  7?B  !IIH&MHq'7':H&MNM"M))##"# $ 

 {{w{'' 'Ns   Cc                 ^    U R                    VVs/ s H  u  p#X:X  d  M  UPM     snn$ s  snnf )z?Get the value of all query parameters whose name matches *name*r  )r%   r#   rX  r_   s       r&   r\  DecodedURL.get  s&     !%

8
fqdi
888r$  c                 >    U R                  U R                  X44-   S9$ )zJReturn a new DecodedURL with the query parameter *name* and *value*
added.r  r  r  s      r&   r   DecodedURL.add  s#     ||$**/?"?|@@r)   c                    ^ U R                   nU VVs/ s H  u  pEUT:w  d  M  XE4PM     nnn[        U4S j[        U5       5       S5      nTU4/XgU& U R                  US9$ s  snnf )zBReturn a new DecodedURL with query parameter *name* set to *value*c              3   B   >#    U  H  u  nu  p#UT:X  d  M  Uv   M     g 7fr!   r6   r  s       r&   rT  !DecodedURL.set.<locals>.<genexpr>		  s!     G)9+1fqQ$YAA)9r  r   r  r  )r%   r#   r   rj  rX  r_   r  r  s    `      r&   rL   DecodedURL.set	  sj     

"'5%19VaV%5G5)9GLUm_c
||!|$$ 6s
   A"A"c                    Uc`  U[         L a)  U R                   VVs/ s H  u  pEXA:w  d  M  XE4PM     nnnOwU R                   VVs/ s H  u  pEXA:X  a  XR:X  a  M  XE4PM     nnnOI/ SpvU R                   H6  u  pEXA:X  a  U[         L d  XR:X  a  Xs:  a  US-  nM$  UR                  XE45        M8     U R                  US9$ s  snnf s  snnf )zReturn a new DecodedURL with query parameter *name* removed.

Optionally also filter for *value*, as well as cap the number
of parameters removed with *limit*.
r   r   r  r&  r'  s           r&   r+  DecodedURL.remove	  s     =+/::C:!fqf:C #'**",I!* QF",   !#A

I&AJ%-!Q&MIIqf% # ||"|%%' Dr-  c                 V    U R                   R                  nU< SU R                  < S3$ )Nz(url=r,   )r-   r.   r<  )r%   cns     r&   r0   DecodedURL.__repr__0	  s     ^^$$!499--r)   c                 ,    [        U R                  5      $ r!   )r   r<  r/   s    r&   r2  DecodedURL.__str__5	  s     499~r)   c                     [        XR                  5      (       d  [        $ U R                  5       R	                  5       UR                  5       R	                  5       :H  $ r!   )r   r-   r  r   r  r  s     r&   r  DecodedURL.__eq__;	  sB    %00!!~~&&(EOO,=,D,D,FFFr)   c                 n    [        XR                  5      (       d  [        $ U R                  U5      (       + $ r!   r  r  s     r&   r  DecodedURL.__ne__A	  r  r)   c                     [        U R                  U R                  U R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                  4
5      $ r!   r  r/   s    r&   r  DecodedURL.__hash__G	  r  r)   c                      U R                  XS9$ ro  r  )r  r  rq  s      r&   r  DecodedURL.fromText\	  s     }}Q}**r)   c                      U R                  US9$ r  r  r   s     r&   r  DecodedURL.asTexta	  r  r)   c                     [         R                  U 5      n[        [        U5      [        / SQ5      -
  5      nU$ ! [         a<    [        U R                  5      [        U R                  R                  5       5      -   n Nif = fr  r  r  s     r&   r	  DecodedURL.__dir__e	  r  r  )rd  rb  rc  r=  r<  rh  )FNr.  rc   r/  r!   )/r.   r9   r:   r;   r   
_EMPTY_URLr'   r1  r  r0  rC  r  r  r  rM  r  r  r  r   r  r   r;  rZ  r   rB  rj  rY  r[  r  r   rA   rb   r\  r   rL   r+  r0   r2  r  r  r  r  r  r  r  r	  r=   r6   r)   r&   rt  rt    s   +Z &Et 
 M M  0
"
"

	

	7 
( " "     , ,       	 	  0         % % 5(n9
A% 	!&F.
G&
$ EE+ +:r)   rt  c                 T    [         R                  U 5      nU(       d  U$ [        X2S9nU$ )a6  
Automatically turn text into a structured URL object.

>>> url = parse(u"https://github.com/python-hyper/hyperlink")
>>> print(url.to_text())
https://github.com/python-hyper/hyperlink

Args:
    url: A text string representation of a URL.

    decoded: Whether or not to return a :class:`DecodedURL`,
        which automatically handles all
        encoding/decoding/quoting/unquoting for all the various
        accessors of parts of the URL, or a :class:`URL`,
        which has the same API, but requires handling of special
        characters for different parts of the URL.

    lazy: In the case of `decoded=True`, this controls
        whether the URL is decoded immediately or as accessed. The
        default, `lazy=False`, checks all encoded parts of the URL
        for decodability.

.. versionadded:: 18.0.0
rp  )
EncodedURLr  rt  )r>  decodedrq  enc_urldec_urls        r&   parser  r	  s+    4 ""3'G,GNr)   )_MISSINGrd   r.  )T)FTTT)TNTr!   )FF)TF)r   resysstringrG  r   r   r   ImportErrorr   typingr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   unicodedatar   _socketr   collections.abcr  collectionsidnar   r  r   r:  version_infor   unichr	NameErrorr\   typere  rp  QueryParametersr   r@   _unspecifiedrA   	frozensetrj   compiler  r_  r  rJ   	hexdigitsrK   	_ASCII_RE_GEN_DELIMS_SUB_DELIMS_ALL_DELIMSrL   _USERINFO_SAFEr   
_PATH_SAFEru   _SCHEMELESS_PATH_SAFErz   _FRAGMENT_SAFEr   _QUERY_VALUE_SAFEr   _QUERY_KEY_SAFEr   rW   ra   r   r  rt   ry   r  r   r  r   r   r   r#  ri   r  r  r  rq   rv   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  r  r  r  r!  r$  r  r>  rE  rK  r?   rM  r  r  r7  r9  rt  r  )aro   rX  r_   s   0000r&   <module>r     s  $ 
 
   $$    " " 25 > 
qQ
 :5x~-.34
D(4. !U4$'()+
 CL8v &h/ /v
 K  ** ZZ,-


  !!!A!!A %	 &QUB"8"?"?	"JK! 	L! JJ'(	 
#'K'"[03t9</ c%j(
Z'"SX- %(== "Z/#e*</ %T(BB !$55 #&7#d)&CC/1  +>: '(89 &z2 "12G"H #L1 &7 ():; ():; *+>? %n5 '(89 '(9:  "''))DA88GY'+<< 	)  %$( 0 f
 
(-
C-	3- D- 
2	-
 D- 
2- 
4- b- B- S- C- 
3- C- 
3- D-  C!-" S#-$ 
4%-& D'-( T)-* D+-, 
3--. C/-0 S1-2 
33-4 5-6 T7-8 S9-: C;-< S=-> T?-@ BA-B 
3C-D CE-F 
Y-`  &   DH1h@	J 	  $-; $ 7<	  7<	 7<	 M`=@>'Tg&& g&T! 
U
$

f fVmJ  M0  2112  FNJsH   O* O9 2P AP
5P!
P!
*O65O69P	P	PP