zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
U
I=®d6ã    @sddlmZddlZddlmZddlmZddlmZddd    d
d d d gZ    dZ
e  d¡Z e  d¡Z e  dejejB¡ZdZdZdjeedZeedœZdddddddddg    Zd Zd!d" d#d$„eDƒ¡d%Zd&ed'Zd(ed!ed)Zd*Ze  d+¡Ze  d,ed-¡Ze  d,ed-¡Ze  d,ed-¡Z e  d,edd.…d-¡Z!e  d/ed0¡Z"d1eeefZ#e  e#ejejB¡Z$e%d2ƒZ&e%d3ƒZ'e&e'Bd4hBZ(e(d5d6hBZ)e)d7hBZ*Z+Gd8d9„d9ed9e    ƒƒZ,d:d;„Z-dKd=d>„Z.d?d@„Z/dAdB„Z0dCdD„Z1dEdF„Z2dGdH„Z3dIdJ„Z4dS)Lé)Úabsolute_importN)Ú
namedtupleé)ÚLocationParseError)ÚsixÚschemeÚauthÚhostÚportÚpathÚqueryÚfragment)ÚhttpÚhttpsNz%[a-fA-F0-9]{2}z^(?:[a-zA-Z][a-zA-Z0-9+-]*:|/)zS^(?:([a-zA-Z][a-zA-Z0-9+.-]*):)?(?://([^\\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$z(?:[0-9]{1,3}\.){3}[0-9]{1,3}z[0-9A-Fa-f]{1,4}z(?:{hex}:{hex}|{ipv4}))ÚhexZipv4)rÚls32z(?:%(hex)s:){6}%(ls32)sz::(?:%(hex)s:){5}%(ls32)sz%(?:%(hex)s)?::(?:%(hex)s:){4}%(ls32)sz2(?:(?:%(hex)s:)?%(hex)s)?::(?:%(hex)s:){3}%(ls32)sz6(?:(?:%(hex)s:){0,2}%(hex)s)?::(?:%(hex)s:){2}%(ls32)sz/(?:(?:%(hex)s:){0,3}%(hex)s)?::%(hex)s:%(ls32)sz'(?:(?:%(hex)s:){0,4}%(hex)s)?::%(ls32)sz&(?:(?:%(hex)s:){0,5}%(hex)s)?::%(hex)sz(?:(?:%(hex)s:){0,6}%(hex)s)?::zDABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._!\-~z(?:ú|cCsg|] }|t‘qS©)Ú_subs©Ú.0ÚxrrúSD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_vendor/urllib3/util/url.pyÚ
<listcomp>6srú)z (?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z!(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*z!^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$ú^ú$éþÿÿÿú(z)\]$z(^(?:(.*)@)?(%s|%s|%s)(?::([0-9]{0,5}))?$zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-~z !$&'()*+,;=ú:ú@ú/ú?cs^eZdZdZdZd‡fdd„    Zedd„ƒZedd    „ƒZed
d „ƒZ    ed d „ƒZ
dd„Z ‡Z S)ÚUrlzÍ
    Data structure for representing an HTTP URL. Used as a return value for
    :func:`parse_url`. Both the scheme and host are normalized as they are
    both case-insensitive according to RFC 3986.
    rNc
sD|r| d¡sd|}|dk    r&| ¡}tt|ƒ ||||||||¡S)Nr!)Ú
startswithÚlowerÚsuperr#Ú__new__)Úclsrrr    r
r r r ©Ú    __class__rrr'[s
 
ÿz Url.__new__cCs|jS)z@For backwards-compatibility with urlparse. We're nice like that.)r    ©ÚselfrrrÚhostnamemsz Url.hostnamecCs&|jpd}|jdk    r"|d|j7}|S)z)Absolute path including the query string.r!Nr")r r )r,ÚurirrrÚ request_urirs
 
zUrl.request_uricCs|jrd|j|jfS|jS)z(Network location including host and portz%s:%d)r
r    r+rrrÚnetloc|sz
Url.netlocc    Cs¢|\}}}}}}}d}|dk    r*||d7}|dk    r>||d7}|dk    rN||7}|dk    rf|dt|ƒ7}|dk    rv||7}|dk    rŠ|d|7}|dk    rž|d|7}|S)aˆ
        Convert self into a url
 
        This function should more or less round-trip with :func:`.parse_url`. The
        returned url may not be exactly the same as the url inputted to
        :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls
        with a blank port will have : removed).
 
        Example: ::
 
            >>> U = parse_url('http://google.com/mail/')
            >>> U.url
            'http://google.com/mail/'
            >>> Url('http', 'username:password', 'host.com', 80,
            ... '/path', 'query', 'fragment').url
            'http://username:password@host.com:80/path?query#fragment'
        ÚNz://r rr"ú#)Ústr)    r,rrr    r
r r r Úurlrrrr4ƒs"    zUrl.urlcCs|jS©N)r4r+rrrÚ__str__«sz Url.__str__)NNNNNNN) Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú    __slots__r'Úpropertyr-r/r0r4r6Ú __classcell__rrr)rr#Rs&ø
 
    
 
'r#cCsvd}d}|D]0}| |¡}|dkr$q |dks4||kr |}|}q |dksN|dkrX|ddfS|d|…||dd…|fS)aì
    .. deprecated:: 1.25
 
    Given a string and an iterable of delimiters, split on the first found
    delimiter. Return two split parts and the matched delimiter.
 
    If not found, then the first part is the full input string.
 
    Example::
 
        >>> split_first('foo/bar?baz', '?/=')
        ('foo', 'bar?baz', '/')
        >>> split_first('foo/bar?baz', '123')
        ('foo/bar?baz', '', None)
 
    Scales linearly with number of delims. Not ideal for large number of delims.
    Nrr1é)Úfind)ÚsÚdelimsÚmin_idxÚ    min_delimÚdÚidxrrrÚ split_first¯s
 
rFúutf-8c
CsÒ|dkr |St |¡}t dd„|¡\}}| dd¡}|| d¡k}tƒ}tdt|ƒƒD]n}|||d…}t    |ƒ}    |r€|dks”|    d    krž| 
¡|krž||7}qX|  dt |    ƒd
d… ¡  d
¡ ¡¡qX| 
|¡S) zfPercent-encodes a URI component without reapplying
    onto an already percent-encoded component.
    NcSs| d¡ ¡S)Nr)ÚgroupÚupper)ÚmatchrrrÚ<lambda>ßóz'_encode_invalid_chars.<locals>.<lambda>rGÚ surrogatepassó%rr>é€r)rÚ ensure_textÚ
PERCENT_REÚsubnÚencodeÚcountÚ    bytearrayÚrangeÚlenÚordÚdecodeÚextendrÚzfillrI)
Ú    componentÚ allowed_charsÚencodingÚpercent_encodingsÚ    uri_bytesÚis_percent_encodedÚencoded_componentÚiÚbyteÚbyte_ordrrrÚ_encode_invalid_charsÒs,
ÿ  ÿ
ÿ*rfcCs„| d¡}g}|D]0}|dkr"qq|dkr6| |¡q|r| ¡q| d¡rf|rZ|drf| dd¡| d¡rz| d¡d |¡S)Nr!Ú.z..rr1)z/.z/..)ÚsplitÚappendÚpopr$ÚinsertÚendswithÚjoin)r ÚsegmentsÚoutputÚsegmentrrrÚ_remove_path_dot_segmentsôs
 
 
 
rqcCsê|ræt|tjƒrt |¡}|tkræt |¡}|r¼t |¡}|r²|     d¡\}}|||…}| 
d¡rx|dkrx|dd…}n |dd…}dt |t ƒ}|d|…  ¡|||d…S|  ¡Sn*t |¡sæt d dd„| d¡Dƒ¡¡S|S)    Nr>z%25éú%ó.cSsg|] }t|ƒ‘qSr)Ú _idna_encode)rÚlabelrrrr)sz#_normalize_host.<locals>.<listcomp>rg)Ú
isinstancerÚ binary_typeÚ
ensure_strÚNORMALIZABLE_SCHEMESÚ IPV6_ADDRZ_RErJÚ
ZONE_ID_REÚsearchÚspanr$rfÚUNRESERVED_CHARSr%ÚIPV4_RErmrh)r    rÚis_ipv6rJÚstartÚendÚzone_idrrrÚ_normalize_hosts* 
 
 
   
 
ÿr…cCsœ|rŽtdd„|DƒƒrŽzddlm}Wn$tk
rJt tdƒd¡YnXz|j| ¡dddWS|j    k
rŒt td|ƒd¡YnX| ¡ d    ¡S)
NcSsg|]}t|ƒdk‘qS)rO)rXrrrrr/sz _idna_encode.<locals>.<listcomp>r)Úidnaz-Unable to parse URL without the 'idna' moduleT)ÚstrictÚ
std3_rulesz#Name '%s' is not a valid IDNA labelÚascii)
ÚanyÚ pip._vendorr†Ú ImportErrorrÚ
raise_fromrrSr%Ú    IDNAError)Únamer†rrrru.s þ
 
ÿ
rucCs>t |¡ ¡\}}t|tƒ}t|tƒ}|dk    r:|d|7}|S)zHPercent-encodes a request target so that there are no invalid charactersNr")Ú    TARGET_RErJÚgroupsrfÚ
PATH_CHARSÚ QUERY_CHARS)Útargetr r rrrÚ_encode_target@s 
 
 r•c     sÂ|s
tƒS|}t |¡s d|}züt |¡ ¡\}}}}}|dkpL| ¡tk}|rZ| ¡}|r’t |¡ ¡\}}    }
|r„|r„t    |t
ƒ}|
dkrœd}
n
d\}}    }
|
dk    rÊt |
ƒ}
d|
krÀdksÊnt |ƒ‚t |    |ƒ}    |rî|rît|ƒ}t    |tƒ}|r|rt    |tƒ}|r|rt    |tƒ}Wn*ttfk
rFt t |ƒd¡YSX|sl|dk    sb|dk    rhd}nd}t|tjƒr‚tj‰ntj‰‡fdd„} t| |ƒ| |ƒ| |    ƒ|
| |ƒ| |ƒ| |ƒd    S)
a 
    Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is
    performed to parse incomplete urls. Fields not provided will be None.
    This parser is RFC 3986 compliant.
 
    The parser logic and helper functions are based heavily on
    work done in the ``rfc3986`` module.
 
    :param str url: URL to parse into a :class:`.Url` namedtuple.
 
    Partly backwards-compatible with :mod:`urlparse`.
 
    Example::
 
        >>> parse_url('http://google.com/mail/')
        Url(scheme='http', host='google.com', port=None, path='/mail/', ...)
        >>> parse_url('google.com:80')
        Url(scheme=None, host='google.com', port=80, path=None, ...)
        >>> parse_url('/foo?bar')
        Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...)
    z//Nr1)NNNriÿÿcs|dkr |Sˆ|ƒSr5r)r©Ú ensure_funcrrÚ ensure_type›szparse_url.<locals>.ensure_type)rrr    r
r r r )r#Ú    SCHEME_REr}ÚURI_RErJr‘r%rzÚSUBAUTHORITY_RErfÚUSERINFO_CHARSÚintrr…rqr’r“ÚFRAGMENT_CHARSÚ
ValueErrorÚAttributeErrorrrrwÚ    text_typerPry) r4Ú
source_urlrÚ    authorityr r r Ú normalize_urirr    r
r˜rr–rÚ    parse_urlJs`
 
 
 
 
 
  ùr¥cCst|ƒ}|jpd|j|jfS)z4
    Deprecated. Use :func:`parse_url` instead.
    r)r¥rr-r
)r4ÚprrrÚget_host©sr§)rG)5Ú
__future__rÚreÚ collectionsrÚ
exceptionsrÚpackagesrÚ    url_attrsrzÚcompilerQr™ÚUNICODEÚDOTALLršÚIPV4_PATÚHEX_PATÚformatÚLS32_PATrÚ _variationsÚUNRESERVED_PATrmÚIPV6_PATÚ ZONE_ID_PATÚIPV6_ADDRZ_PATÚ REG_NAME_PATrr€ÚIPV6_REr{ÚBRACELESS_IPV6_ADDRZ_REr|ÚSUBAUTHORITY_PATr›ÚsetrÚSUB_DELIM_CHARSrœr’r“ržr#rFrfrqr…rur•r¥r§rrrrÚ<module>sv    
 
 
ú    
î 
ýÿ ]#
"
_