\d,dZddlmZddlZddlZddlZddlZddlZddlZgdZ gdZ gdZ gdZ gdZ gd Zgd Zd Zd Zgd ZdZdZdZdZeefdZeefdZdZGddeZGddeZGddeZGddeeZGddeeZedd Z ed!d"Z!ed#d$Z"d%e _d&e j#_d'e j$_d(e!_d)e!j%_d*e!j&_d+e!j'_d,e!j(_d-e!j$_d.e"_e!j%je"j%_e!j&je"j&_e!j'je"j'_d/e"j)_e!j(je"j(_e!j$je"j$_eZ*Gd0de eZ+Gd1d!e!eZ,Gd2d#e"eZ-Gd3d4e eZ.Gd5d6e!eZ/Gd7d8e"eZ0d9Z1e1[1dtd<Z2d=Z3dud>Z4d?Z5d@Z6ej7d;AdtdBZ8dCZ9dDZ:dvdEZ;dFZdHZ?ej@dIZAdwdLZB dxdOZC dxdPZDdwdQZEeFdRZGeHeGZIdSZJGdTdUeKZLdydWZMdzdXZNej7dYZOd{dZZPdMd:ddeNfd[ZQd\ZRd]ZSd^ZTd_ZUdaVd`ZWdaZXdaYdbZZdcZ[ddZ\deZ]dfZ^dgZ_da`dhZad|djZbd|dkZcdlZddmZednZfdoZgdpZhdqZidrZjdsZkdS)}a3Parse (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. The WHATWG URL Parser spec should also be considered. We are not compliant with it either due to existing user code API behavior expectations (Hyrum's Law). It serves as a useful guide when making changes. ) namedtupleN)urlparse urlunparseurljoin urldefragurlsplit urlunsplit urlencodeparse_qs parse_qslquote quote_plusquote_from_bytesunquote unquote_plusunquote_to_bytes DefragResult ParseResult SplitResultDefragResultBytesParseResultBytesSplitResultBytes)ftphttpgophernntpimapwaisfilehttpsshttpmmsprosperortsprtspusftpsvnsvn+sshwswss)rrrrrtelnetrrr r#r!r"snewsr$r%r&rsyncr(r)r'nfsgitzgit+sshr*r+)rrhdlr$rrr!r"r%r&sipsipsr#r'tel) rr1mailtonewsr,rrr-r2r3) rrrrr!r"r#rr%r&r2r3) rrr1rrr6rrr!r"r-r r$zAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!  )   cjttdS)zDClear internal performance caches. Undocumented; some tests want it.N)r cache_clear_byte_quoter_factory:J:\tools\MySQL Workbench 8.0 CE\python\Lib\urllib\parse.py clear_cacher@^s, $$&&&&&r>asciistrictc|SNr=)objs r?_nooprFls Jr>c.|||SrDencode)rEencodingerrorss r?_encode_resultrLos ::h ' ''r>c>tfd|DS)Nc3LK|]}|r|ndVdS)rNdecode.0xrJrKs r? z_decode_args..us;GGQq8(F+++bGGGGGGr>)tuple)argsrJrKs ``r? _decode_argsrWss* GGGGG$GGG G GGr>ct|dt}|ddD],}|r(t|t|krtd-|r |tfzSt |t fzS)Nrz$Cannot mix str and non-str arguments) isinstancestr TypeErrorrFrWrL)rV str_inputargs r? _coerce_argsr_ws 47C((IABBxDD  D:c3''944BCC Cuh    1 11r>ceZdZdZdZddZdS)_ResultMixinStrz>Standard approach to encoding parsed results from str to bytesr=rArBc4|jfd|DS)Nc3DK|]}|VdSrDrHrQs r?rTz)_ResultMixinStr.encode..1*T*T!188Hf+E+E*T*T*T*T*T*Tr>)_encoded_counterpartselfrJrKs ``r?rIz_ResultMixinStr.encode,(t(*T*T*T*T*Tt*T*T*TUUr>NrArB)__name__ __module__ __qualname____doc__ __slots__rIr=r>r?rara9HHIVVVVVVr>raceZdZdZdZddZdS)_ResultMixinBytesz>Standard approach to decoding parsed results from bytes to strr=rArBc4|jfd|DS)Nc3DK|]}|VdSrDrOrQs r?rTz+_ResultMixinBytes.decode..rdr>)_decoded_counterpartrfs ``r?rPz_ResultMixinBytes.decoderhr>Nri)rjrkrlrmrnrPr=r>r?rqrqror>rqceZdZdZdZedZedZedZedZ e e j Z dS)_NetlocResultMixinBasezHShared methods for the parsed result objects containing a netloc elementr=c|jdS)Nr _userinforgs r?usernamez_NetlocResultMixinBase.username~a  r>c|jdS)NrYrxrzs r?passwordz_NetlocResultMixinBase.passwordr|r>c|jd}|sdSt|trdnd}||\}}}||z|zS)Nr%%) _hostinforZr[ partitionlower)rghostname separatorpercentzones r?rz_NetlocResultMixinBase.hostnamesi>!$ 4&h44>CC$ "*"4"4Y"?"?'4~~')D00r>c|jd}|h|r$|rt|}nt d|d|cxkrdksnt d|S)NrYz+Port could not be cast to integer value as rizPort out of range 0-65535)risdigitisasciiint ValueError)rgports r?rz_NetlocResultMixinBase.ports~a   ||~~ Y$,,.. Y4yy !Wt!W!WXXX&&&&&&&& !<=== r>N)rjrkrlrmrnpropertyr{r~rr classmethodtypes GenericAlias__class_getitem__r=r>r?rvrvsRRI !!X!!!X!11X1  X $ E$677r>rvc>eZdZdZedZedZdS)_NetlocResultMixinStrr=c|j}|d\}}}|r|d\}}}|sd}ndx}}||fS)N@:netloc rpartitionrrgruserinfo have_infohostinfor{ have_passwordr~s r?ryz_NetlocResultMixinStr._userinfosh(.(9(9#(>(>%)X  '080B0B30G0G -HmX  "& &Hx!!r>c |j}|d\}}}|d\}}}|r3|d\}}}|d\}}}n|d\}}}|sd}||fS)Nr[]rrrgr_r have_open_br bracketedrrs r?rz_NetlocResultMixinStr._hostinfos**3//1h%-%7%7%<%<"<  8 ) 3 3C 8 8 Ha,,JAq$$ ( 2 23 7 7 Ha D~r>Nrjrkrlrnrryrr=r>r?rrMI  " "X "  X   r>rc>eZdZdZedZedZdS)_NetlocResultMixinBytesr=c|j}|d\}}}|r|d\}}}|sd}ndx}}||fS)N@:rrs r?ryz!_NetlocResultMixinBytes._userinfosh(.(9(9$(?(?%)X  '080B0B40H0H -HmX  "& &Hx!!r>c |j}|d\}}}|d\}}}|r3|d\}}}|d\}}}n|d\}}}|sd}||fS)Nr[]rrrs r?rz!_NetlocResultMixinBytes._hostinfos**4001h%-%7%7%=%="<  9 ) 3 3D 9 9 Ha--JAq$$ ( 2 24 8 8 Ha D~r>Nrr=r>r?rrrr>rrz url fragmentrz!scheme netloc path query fragmentrz(scheme netloc path params query fragmentz DefragResult(url, fragment) A 2-tuple that contains the url without fragment identifier and the fragment identifier as a separate argument. z$The URL with no fragment identifier.z Fragment identifier separated from URL, that allows indirect identification of a secondary resource by reference to a primary resource and additional identifying information. z SplitResult(scheme, netloc, path, query, fragment) A 5-tuple that contains the different components of a URL. Similar to ParseResult, but does not split params. z%Specifies URL scheme for the request.z0 Network location where the request is made to. z@ The hierarchical path, such as the path to a file to download. z The query component, that contains non-hierarchical data, that along with data in path component, identifies a resource in the scope of URI's scheme and network location. z Fragment identifier, that allows indirect identification of a secondary resource by reference to a primary resource and additional identifying information. zq ParseResult(scheme, netloc, path, params, query, fragment) A 6-tuple that contains components of a parsed URL. z Parameters for last path element used to dereference the URI in order to provide access to perform some operation on the resource. ceZdZdZdZdS)rr=cB|jr|jdz|jzS|jS)N#fragmenturlrzs r?geturlzDefragResult.geturlEs& = 8c>DM1 18Or>Nrjrkrlrnrr=r>r?rrC(Ir>ceZdZdZdZdS)rr=c t|SrDr rzs r?rzSplitResult.geturlM$r>Nrr=r>r?rrK(I     r>ceZdZdZdZdS)rr=c t|SrDrrzs r?rzParseResult.geturlRrr>Nrr=r>r?rrPrr>ceZdZdZdZdS)rr=cB|jr|jdz|jzS|jS)N#rrzs r?rzDefragResultBytes.geturlXs& = 8d?T]2 28Or>Nrr=r>r?rrVrr>rceZdZdZdZdS)rr=c t|SrDrrzs r?rzSplitResultBytes.geturl`rr>Nrr=r>r?rr^rr>rceZdZdZdZdS)rr=c t|SrDrrzs r?rzParseResultBytes.geturlerr>Nrr=r>r?rrcrr>rcttfttftt ff}|D]\}}||_||_dSrD)rrrrrrrert) _result_pairs_decoded_encodeds r?_fix_result_transcodingrisW () &' &'M ,11((0%(0%%11r>rTct||\}}}t|||}|\}}}}}|tvrd|vrt|\}}nd}t ||||||} || S)aParse a URL into 6 components: :///;?# The result is a named 6-tuple with fields corresponding to the above. It is either a ParseResult or ParseResultBytes object, depending on the type of the url parameter. The username, password, hostname, and port sub-components of netloc can also be accessed as attributes of the returned object. The scheme argument provides the default value of the scheme component when no scheme is found in url. If allow_fragments is False, no attempt is made to separate the fragment component from the previous component, which can be either path or query. Note that % escapes are not expanded. ;r)r_r uses_params _splitparamsr) rschemeallow_fragments_coerce_result splitresultrqueryrparamsresults r?rrvs(#/sF";";C388K+6(FFC "3'' VV feX F FF >& ! !!r>cd|vr4|d|d}|dkr|dfSn|d}|d|||dzdfS)N/rrrrY)findrfind)ris r?rrso s{{ HHS#))C.. ) ) q557N  HHSMM rr7C!I r>ct|}dD].}|||}|dkrt||}/|||||dfS)Nz/?#r)lenrmin)rstartdelimcwdelims r? _splitnetlocrsd HHE ''!U## Q;;v&&E uU{ S[ ((r>cl|r|rdSddl}|dd}|dd}|dd}|dd}|d|}||krdSdD]}||vrt d |zd zd zdS) Nrrrrr?NFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)r unicodedatareplace normalizer)rrnnetloc2rs r? _checknetlocrs V^^%%sBA #rA #rA #rA##FA..GG|| DD <<Z&03HHBCDD D DDr>c|dr&tjd|stddSt j|}t |tjrtddS)Nvz\Av[a-fA-F0-9]+\..+\ZzIPvFuture address is invalidz%An IPv4 address cannot be in brackets) startswithrematchr ipaddress ip_addressrZ IPv4Address)rips r?_check_bracketed_hostrs3Gx0(;; ><== = > > !( + + b)/ 0 0 GEFF F G Gr>)typedc0t||\}}}|t}|t}tD].}||d}||d}/t |}dx}x}}|d}|dkru|dr[|d rA|d|D] } | tvrn*|d| ||dzd}}|dddkr}t|d\}}d|vrd |vsd |vrd|vrtd d|vrGd |vrC|ddd d} t| |rd |vr|d d\}}d |vr|d d\}}t#|t%|||||} || S) aParse a URL into 5 components: :///?# The result is a named 5-tuple with fields corresponding to the above. It is either a SplitResult or SplitResultBytes object, depending on the type of the url parameter. The username, password, hostname, and port sub-components of netloc can also be accessed as attributes of the returned object. The scheme argument provides the default value of the scheme component when no scheme is found in url. If allow_fragments is False, no attempt is made to separate the fragment component from the previous component, which can be either path or query. Note that % escapes are not expanded. rrrNrY//rrzInvalid IPv6 URLrr)r_lstrip_WHATWG_C0_CONTROL_OR_SPACEstrip_UNSAFE_URL_BYTES_TO_REMOVErboolrrisalpha scheme_charsrrrrrsplitrr) rrrrbrrrrrbracketed_hostrs r?rrs?,#/sF";";C **0 1 1C \\5 6 6F (''kk!R  2&&?++O ""F"UX  A1uuQ!!uc!fnn&6&6uRaR 5 5A $$%bqb'--//3qstt9CF 2A2w$"3**  F]]s&003f#4#4/00 0 &==SF]]#--c2215??DDQGN !. 1 1 1*3#:: #q)) X czzYYsA&& UFFC99A >!  r>c pt|\}}}}}}}|r|d|}|t|||||fS)zPut 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).r)r_r ) componentsrrrrrrrs r?rrs[ 3? 2KAFFC. &ff% >*ffc5(%KLL M MMr>ct|\}}}}}}|s|r6|tvr-|dddkr|r|dddkrd|z}d|pdz|z}|r|dz|z}|r|dz|z}|r|d z|z}||S) akCombine the elements of a tuple as returned by urlsplit() into a complete URL as a string. The data argument can be any five-item iterable. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had unnecessary delimiters (for example, a ? with an empty query; the RFC states that these are equivalent).NrrrYrrrrr)r_ uses_netloc)r rrrrrrs r?r r s+7 *C9FFC. *&*V{22s2A2w$ 23rr7c>>s3fl#c) !slS   Ci%#Ci(" >#  r>c |s|S|s|St||\}}}t|d|\}}}}}} t|||\} } } } }}| |ks | tvr ||S| tvr"| r|t | | | | ||fS|} | s(| s&|} |} |s|}|t | | | | ||fS|d}|ddkr|d=| dddkr| d}n5|| dz}t d|dd|dd<g}|D]J}|dkr& |#t$rY*wxYw|dkr5| |K|ddvr| d|t | | d |pd| ||fS) zaJoin a base URL and a possibly relative URL to form an absolute interpretation of the latter.rrNrY...)rr) r_r uses_relativer rrfilterpop IndexErrorappendjoin)baserrrbschemebnetlocbpathbparamsbquery bfragmentrrpathrrr base_partssegments resolved_pathsegs r?rrs   ,T3 7 7D#~ T2 / /8GWeWfi S'? 3 32FFD&%F-77~c"""   I!>*ffd.4eX.G#H#HII I EE E~j&&$*0%*CDDEE ES!!J"~ rN BQBx3::c?? 3/ hqtn552M & & $;; !!####    CZZ    % % % %|{"" R   >*ffchh777vuh&899 : ::sE E('E(ct|\}}d|vr,t|\}}}}}}t|||||df}nd}|}|t||S)zRemoves any existing fragment from URL. Returns a tuple of the defragmented URL and the fragment. If the URL contained no fragments, the second element is the empty string. rr)r_rrr) rrsrpaqfragdefrags r?rr`sw's++C czz&smm1aAtQ1aB/00 >,vt44 5 55r>0123456789ABCDEFabcdefc|s |jdSt|tr|d}|d}t |dkr|S|dg}|j}t dtDa|ddD]Z} |t |dd||dd5#t$r|d||YWwxYwd |S) z,unquote_to_bytes('abc%20def') -> b'abc def'.r>utf-8rrYrNci|]?}tD]5}||zt||z6@Sr=)_hexdigrIbytesfromhex)rRr%rs r? z$unquote_to_bytes..s\99999+,1unn&& a!e(<(<9999r>r) rrZr[rIrr _hextobyter-KeyErrorr)stringbitsresritems r?rrss7  s&#(w'' <<  D 4yyA~~ 7)C ZF99&999 QRR  F:d2A2h' ( ( ( F48        F4LLL F4LLLLL  88C==s1C C*)C*z([-]+)r+rct|tr#t|||Sd|vr |j|S|d}|d}t |}|dg}|j}tdt|dD]H}|t|||||||dzId |S) aReplace %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'. rNr+rrrYrr) rZr.rrPr_asciirerrangerr)r3rJrKr4r5rrs r?rrs&%  A''..x@@@ &   ~ >>& ! !D 7)C ZF 1c$ii # #Q((//&AABBBtAE{ 773<<r>F&c i}t|||||||}|D]+\} } | |vr|| | %| g|| <,|S)aXParse 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. max_num_fields: int. If set, then throws a ValueError if there are more than n fields read by parse_qsl(). separator: str. The symbol to use for separating the query arguments. Defaults to &. Returns a dictionary. )rJrKmax_num_fieldsr)r r) qskeep_blank_valuesstrict_parsingrJrKr<r parsed_resultpairsnamevalues r?r r s<M b+^'%3y J J JE** e = $  & &u - - - -#('M$   r>cDt|\}}t|\}}|rt|ttfst d|1|rd||znd} || krt dg} |r||ng} | D]} | s|s| dd} t| dkr-|rt d| |r| d n]t| ds|r| d d d }t||| }||}| d d d }t||| }||}| ||f| S) aXParse 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. max_num_fields: int. If set, then throws a ValueError if there are more than n fields read by parse_qsl(). separator: str. The symbol to use for separating the query arguments. Defaults to &. Returns a list, as G-d intended. z*Separator must be of type string or bytes.NrYrzMax number of fields exceeded=rzbad query field: r+ )rJrK) r_rZr[r.rcountrrrrr)r=r>r?rJrKr<rrr num_fieldsr query_args name_valuenvrBrCs r?r r s:&b))B **LIq GZ C<@@GEFFF !029Q),,,, J & &<== = A(*2)$$$J $$  .     c1 % % r77a<< H j**!FGGG   "  r!u:: $* $a5==c**D4(6BBBD!>$''DqEMM#s++EEHVDDDE"N5))E HHdE] # # # Hr>cP|dd}t|||S)zLike unquote(), but also replace plus signs by spaces, as required for unquoting HTML form values. unquote_plus('%7e/abc+def') -> '~/abc def' rFrG)rr)r3rJrKs r?rrs) ^^C % %F 68V , ,,r>sBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c|dkr#tjdtdtSt dt d|)NQuoterzoDeprecated in 3.11. urllib.parse.Quoter will be removed in Python 3.14. It was not intended to be a public API.r stacklevelzmodule z has no attribute )warningswarnDeprecationWarning_QuoterAttributeErrorrj)rBs r? __getattr__rX+sY x @)Q 8 8 8 8 I8IIII J JJr>c$eZdZdZdZdZdZdS)rVzA mapping from bytes numbers (in range(0,256)) to strings. String values are percent-encoded byte values, unless the key < 128, and in either of the specified safe set, or the always safe set. cDt||_dS)zsafe: bytes object.N) _ALWAYS_SAFEunionsafe)rgr]s r?__init__z_Quoter.__init__<s &&t,, r>c(dt|dS)Nz)dictrzs r?__repr__z_Quoter.__repr__@s)$t**))))r>cj||jvrt|nd|}|||<|S)Nz%{:02X})r]chrformat)rgrr5s r? __missing__z_Quoter.__missing__Cs7TYc!fffI,<,N)rjrkrlrmr^rbrfr=r>r?rVrV4sK---***r>rVrct|tr#|s|S|d}|d}|||}n"|td|tdt ||S)aquote('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. The quote function offers a cautious (not minimal) way to quote a string for most of these parts. RFC 3986 Uniform Resource Identifier (URI): Generic Syntax lists the following (un)reserved characters. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" reserved = gen-delims / sub-delims gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" Each of the reserved characters is reserved in some component of a URL, but not necessarily in all of them. The quote function %-escapes all characters that are neither in the unreserved chars ("always safe") nor the additional chars set via the safe arg. The default for the safe arg is '/'. The character is reserved, but in typical usage the quote function is being called on a path where the existing slash characters are to be preserved. Python 3.7 updates from using RFC 2396 to RFC 3986 to quote URL strings. Now, "~" is included in the set of unreserved characters. string and safe may be either str or bytes objects. encoding and errors must not be specified if string is a bytes object. 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). Nr+rBz,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)rZr[rIr\r)r3r]rJrKs r?r r IsN&# J M  H >Fx00  JKK K  HII I FD ) ))r>ct|trd|vst|trd|vrt||||St|trd}nd}t|||z||}|ddS)zLike 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 '/'. rG rF)rZr[r.r r)r3r]rJrKspaces r?rrs FC 5S%6%6 FE " "&7'+6'9'9VT8V444$ 64%<6 : :F >>#s # ##r>c*t|jSrD)rV __getitem__)r]s r?r<r<s 4== $$r>ct|ttfstd|sdSt|tr|dd}ntd|D}|t|zs|St|d fd|DS)zLike quote(), but accepts a bytes object rather than a str, and does not perform string-to-bytes encoding. It always returns an ASCII string. quote_from_bytes(b'abc def?') -> 'abc%20def%3f' z!quote_from_bytes() expected bytesrrAignorecg|] }|dk| S)r=)rRrs r? z$quote_from_bytes..s111ASar>c&g|] }|Sr=r=)rRcharquoters r?rqz$quote_from_bytes..s!000TFF4LL000r>) rZr. bytearrayr\r[rIrstrip_ALWAYS_SAFE_BYTESrPr<r)bsr]rts @r?rrs b5), - -=;<<< r$3{{7H--1111122 99'$. / /yy{{ !$ ' 'F 770000R000 1 11r>cTt|dr|}nU t|r"t|dtst n"#t $r}t d|d}~wwxYwg}|s|D]\}} t|t r |||}n|t||||}t| t r || |} n|t| |||} ||dz| znw|D]s\}} t|t r |||}n|t||||}t| t r(|| |} ||dz| zt| tr*|| |||} ||dz| z t| } | D]Z} t| t r || |} n|t| |||} ||dz| z[.#t $r:|t| |||} ||dz| zYqwxYwd |S)a^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. The safe, encoding, and errors parameters are passed down to the function specified by quote_via (encoding and errors only if a component is a str). itemsrz1not a valid non-string sequence or mapping objectNrEr:) hasattrrzrrZrUr\r.r[rr) rdoseqr]rJrK quote_viaerrlkrrSelts r?r r s"ug:  :5zz *U1Xu"="=   : : :01169 : : A (0 " "DAq!U## >Ia&&Ic!ffdHf==!U## >Ia&&Ic!ffdHf== HHQWq[ ! ! ! ! " 0 0DAq!U## >Ia&&Ic!ffdHf==!U## 0Ia&&S1%%%%As## 0Iax88S1%%%%0AA !00%c511N"+)C"6"6CC"+)CHHdHf"M"MCS3//// 0 !***! #a&&$&AAAHHQWq[)))))* 88A;;s*1A A8#A33A8 IAJJcXtjdtdt|S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8rrQ)rSrTrU _to_bytesrs r?to_bytesrs/ MC$4444 S>>r>ct|trY |d}n0#t$r#t dt |zdzwxYw|S)zto_bytes(u"URL") --> 'URL'.ASCIIzURL z contains non-ASCII characters)rZr[rIrP UnicodeErrorreprrs r?rrs #sA A**W%%,,..CC A A AvS 1? @AA A A Js '?-A,c t|}|dddkr*|dddkr|dd}|dddkr|dd}|S)zTransform a string like '' into 'scheme://host/path'. The string is returned unchanged if it's not a wrapped URL. NrYcXtjdtdt|S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrrQ)rSrTrU _splittypers r? splittyper3 M8$4444 c??r>cttjdtjat|}|r-|\}}||fSd|fS)z:splittype('type:opaquestring') --> 'type', 'opaquestring'.Nz ([^/:]+):(.*)) _typeprogrcompileDOTALLrgroupsr)rrrdatas r?rr"sdJ :: OOC E $||~~ ||~~t## 9r>cXtjdtdt|S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrrQ)rSrTrU _splithostrs r? splithostr/rr>cttjdtjat|}|r.|\}}|r|ddkrd|z}||fSd|fS)z;splithost('//host[:port]/path') --> 'host[:port]', '/path'.Nz//([^/#?]*)(.*)rr) _hostprogrrrrr)rr host_portrs r?rr7syJ0")<< OOC E ,,.. 4  DGsNN:D$ 9r>cXtjdtdt|S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrrQ)rSrTrU _splituserhosts r? splituserrF5 M8$4444 d  r>cD|d\}}}|r|nd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.rNr)ruserrs r?rrMs.,,D% #DDtd **r>cXtjdtdt|S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrrQ)rSrTrU _splitpasswd)rs r? splitpasswdrSs5 M8$4444   r>cD|d\}}}||r|ndfS)z/splitpasswd('user:passwd') -> 'user', 'passwd'.rNr)rrpasswds r?rrZs...--D% E+&&t ,,r>cXtjdtdt|S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrrQ)rSrTrU _splitportrs r? splitportr`rr>cttjdtjat|}|r|\}}|r||fS|dfS)z*splitport('host:port') --> 'host', 'port'.Nz (.*):([0-9]*)) _portprogrrr fullmatchr)rrrs r?rriseJ ::    % %E \\^^ d  :  :r>r cZtjdtdt||S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrrQ)rSrTrU _splitnport)rdefports r? splitnportrws7 M8$4444 tW % %%r>c|d\}}}|s|}n@|r>|r$|rt|}nd}||fS||fS)zSplit host and port, returning numeric port. Return given default port if no ':' found; defaults to -1. Return numerical port if a valid number is found after ':'. Return None if ':' but not a valid number.rN)rrrr)rrrrnports r?rr~sx ,,D%   <<>> dllnn IIEEEU{ =r>cXtjdtdt|S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrrQ)rSrTrU _splitqueryrs r? splitqueryrs5 M8$4444 s  r>cH|d\}}}|r||fS|dfS)z/splitquery('/path?query') --> '/path', 'query'.rNr)rrrrs r?rrs6,,D% U{ 9r>cXtjdtdt|S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrrQ)rSrTrU _splittagrs r?splittagrs3 M8$4444 S>>r>cH|d\}}}|r||fS|dfS)z)splittag('/path#tag') --> '/path', 'tag'.rNr)rrrtags r?rrs6~~c**D% Sy 9r>cXtjdtdt|S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrrQ)rSrTrU _splitattrrs r? splitattrrrr>cP|d}|d|ddfS)zksplitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].rrrYN)r)rwordss r?rrs* IIcNNE 8U122Y r>cXtjdtdt|S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadrrQ)rSrTrU _splitvalue)attrs r? splitvaluers5 M9$4444 t  r>cD|d\}}}||r|ndfS)z-splitvalue('attr=value') --> 'attr', 'value'.rENr)rrrCs r?rrs.,,D% 5*%%d ++r>)rT)r)T)r+r)FFr+rNr:)rNN)rNN)r)r )lrm collectionsr functoolsrsysrrSr__all__rr rnon_hierarchical uses_query uses_fragmentrrrr@_implicit_encoding_implicit_errorsrFrLrWr_objectrarqrvrr_DefragResultBase_SplitResultBase_ParseResultBaserrrrrrr ResultBaserrrrrrrrrrrr lru_cacherrr rrr-r1rrr8rr r r frozensetr[r.rwrXrarVr rr<rr rrrrrrrrrrrrrrrrrrrrrrrrrrr=r>r?rsB#"""""  H H H000  %%% FFF888 %%%  \100'''"4/((((!3.HHHH222"VVVVVfVVVVVVVVVVV#8#8#8#8#8V#8#8#8L2O<46G<J~~>>:688:=??!K&" #N#!" %!  #3"9"A"2"9"A 0 5 =# "2!7!?$4$=$E! # $o     "$9        "$9   )+<     ')@        ')@   111""""<))))DDD(GGG4   666! 6p N N N&B:B:B:B:J666 #  < 2:& ' '8:?PS''''T;@QTA A A A F----y!"" U<((KKKd*4*4*4*4*l$$$$$ %%%2222(!rD"MMMM`                +++ ---      &&&&",,,,,r>