Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
url.cpython-313.pyc119 linesDownload Raw Back to __pycache__
1�

2��je;���SSKJr SSKrSSKrSSKJr SSKJr Sr\R"S5r3\R"S	5r\R"S4\R\R-5rSrSrS
R#\\S9r\\S.r/SQrSrSSR-\Vs/sHo\-PM	 sn5-S-rS\-S-rS\-S-\-S-rSr\R"S5r\R"S\-S-5r\R"S\-S-5r\R"S\-S-5r\R"S\SS-S-5r\R"S\-S-5r S \<S\<S\<S!3r!\R"\!\R\R-5r"\#"S"5r$\#"S#5r%\$\%-S$1-r&\&S%S&1-r'\'S'1-=r(r)"S(S)\RT"S)S*\RV\,4S+\RV\,4S,\RV\,4S-\RV\-4S.\RV\,4S/\RV\,4S0\RV\,4/55r.\R^S;S1j5r0\R^S<S2j5r0S=S3jr0S>S4jr1\R^S?S5j5r2\R^S@S6j5r2SAS7jr2SBS8jr3SCS9jr4SDS:jr5gs snf)E�)�annotationsN�)�LocationParseError�)�to_str)�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}))�hex�ipv4)r5�ls32)	z(?:%(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)?::zCABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~z(?:�|�)z
(?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z!(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*z!^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$�^�$������(z)\]$z^(z)(?::0*?(|0|[1-9][0-9]{0,4}))?$zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-~z!$&'()*+,;=�:�@�/�?c��^�\rSrSrSrSSU4Sjjjr\S
Sj5r\SSj5r\S
Sj5r	\S
Sj5r6\SSj5rSS	jrS7r
U=r$)�Url�Pz�8Data structure for representing an HTTP URL. Used as a return value for9:func:`parse_url`. Both the scheme and host are normalized as they are10both case-insensitive according to RFC 3986.11c12�>�U(aURS5(dSU-nUbUR5n[TU]
XX#XEXg5$)Nr)�13startswith�lower�super�__new__)	�cls�scheme�auth�host�port�path�query�fragment�	__class__s	        ��VD:\code\apps\devtools\python\user_packages\Python313\site-packages\urllib3/util/url.pyr�Url.__new__dsE��������,�,���:�D����\�\�^�F��w��s�D��E�T�T�c��UR$)z@For backwards-compatibility with urlparse. We're nice like that.)r"��selfs r(�hostname�Url.hostnamets���y�y�r*c�n�UR=(d SnURbUSUR--
nU$)z)Absolute path including the query string.rr)r$r%)r-�uris  r(�request_uri�Url.request_uriys4���i�i��3���:�:�!��3����#�#�C��14r*c�P�URnURnUbUcU$USU3$)z|15Authority component as defined in RFC 3986 3.2.16This includes userinfo (auth), host and port.17 18i.e.19    userinfo@host:port20r)r!�netloc)r-�userinfor5s   r(�	authority�
Url.authority�s6���9�9�������>�X�-��M��Z�q���)�)r*c��URcgUR(aURSUR3$UR$)z�21Network location including host and port.22 23If you need the equivalent of urllib.parse's ``netloc``,24use the ``authority`` property instead.25Nr)r"r#r,s r(r5�26Url.netloc�s;���9�9����9�9��i�i�[��$�)�)��-�-��y�y�r*c��Uupp4pVnSnUbX�S--
nUbX�S--
nUbX�-
nUbUS[U5--
nUbX�-
nUbUSU--
nUbUSU--
nU$)a�27Convert self into a url28 29This function should more or less round-trip with :func:`.parse_url`. The30returned url may not be exactly the same as the url inputted to31:func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls32with a blank port will have : removed).33 34Example:35 36.. code-block:: python37 38    import urllib339 40    U = urllib3.util.parse_url("https://google.com/mail/")41 42    print(U.url)43    # "https://google.com/mail/"44 45    print( urllib3.util.Url("https", "username:password",46                            "host.com", 80, "/path", "query", "fragment"47                            ).url48        )49    # "https://username:password@host.com:80/path?query#fragment"50�z://rrr�#)�str)	r-r r!r"r#r$r%r&�urls	         r(r?�Url.url�s���6;?�7��d�$�x������E�>�!�C����#�:��C����K�C����3��T��?�"�C����K�C����3��;��C����3��>�!�C��51r*c��UR$�N)r?r,s r(�__str__�Url.__str__�s���x�x�r*�)NNNNNNN)r �52str | Noner!rFr"rFr#z53int | Noner$rFr%rFr&rF)�returnrF)rGr>)�__name__�54__module__�__qualname__�__firstlineno__�__doc__r�propertyr.r2r7r5r?rC�__static_attributes__�
__classcell__)r's@r(rrPs�����"����� �#�U��U��U��	U�55�U��
U��U��U�U� ���������
*��
*������-��-�^�r*rr r!r"r#r$r%r&c��grBrE��	component�
allowed_charss  r(�_encode_invalid_charsrT����r*c��grBrErQs  r(rTrT�rUr*c��UcU$[U5n[RSU5upURSS5nX#R	S5:Hn[5n[
S[U55H�nX6US-n[U5nU(aUS:XdUS:aUR5U;aXW-
nMBURS[U5S	SR5RS	5R5-5 M� UR5$)56z^Percent-encodes a URI component without reapplying57onto an already percent-encoded component.58Nc�@�URS5R5$)Nr)�group�upper)�matchs r(�<lambda>�'_encode_invalid_chars.<locals>.<lambda>�s��e�k�k�!�n�*�*�,r*zutf-8�
surrogatepass�%rr�r)r�_PERCENT_RE�subn�encode�count�	bytearray�range�len�ord�decode�extendr59�zfillrZ)	rRrS�percent_encodings�	uri_bytes�is_percent_encoded�encoded_component�i�byte�byte_ords	         r(rTrT�s�������y�!�I�60$/�#3�#3�,�i�$� �I�� � ��/�:�I�*�o�o�d�.C�C��!���
�1�c�)�n�
%���Q��U�#���t�9���4�4�<��s�N�t�{�{�}�
�=��%���� � ���X��q�r�):�)A�)A�)C�)I�)I�!�)L�)R�)R�)T�!U�V�&��#�#�%�%r*c��URS5n/nUH=nUS:XaMUS:waURU5 M$U(dM-UR5 M? URS5(a#U(a61US(aUR	SS5 URS5(aURS5 SR
U5$)Nr�.z..rr<)z/.z/..)�split�append�popr�insert�endswith�join)r$�segments�output�segments    r(�_remove_path_dot_segmentsr~s����z�z�#��H�
�F����c�>���d�?��M�M�'�"��V��J�J�L�����s���V�v�a�y��
�
�a����}�}�]�#�#��
�
�b���8�8�F��r*c��grBrE�r"r s  r(�_normalize_hostr�%s��=@r*c��grBrEr�s  r(r�r�)s��;>r*c62�V�U(GaU[;Ga[RU5nU(a�[R	U5nU(ajURS5upEXUnUR
S5(aUS:waUSSnOUSSn[U[5nUSUR5SUXS3$UR5$[RU5(dD[SRURS5Vs/sHn[U5PM sn5S5$U$s snf)Nrz%25��%�.rt�ascii)�_NORMALIZABLE_SCHEMES�_IPV6_ADDRZ_REr[�_ZONE_ID_RE�search�spanrrT�_UNRESERVED_CHARSr�_IPV4_RErrzru�_idna_encode)r"r �is_ipv6r[�start�end�zone_id�labels        r(r�r�-s����*�*�$�*�*�4�0�G��$�*�*�4�0���!&���A��J�E�"��o�G��)�)�%�0�0�W��5E�")�!�"�+��")�!�"�+��3�G�=N�O�G�"�6�E�l�0�0�2�3�1�W�I�d�4�j�\�J�J��:�:�<�'��^�^�D�)�)���I�I��63�64�3��P��u�|�E�2��P�Q�����K��Qs�D&c�0�UR5(d%SSKnUR	UR5SSS9$UR5R	S5$![a
 [S5Sef=f!URa [SUS35Sef=f)Nrz-Unable to parse URL without the 'idna' moduleT)�strict�65std3_ruleszName 'z' is not a valid IDNA labelr�)�isascii�idna�ImportErrorrrcr�	IDNAError)�namer�s  r(r�r�Js����<�<�>�>�	��	��;�;�t�z�z�|�D�T�;�J�J��:�:�<���w�'�'���	�$�?���
�	���~�~�	�$����9�:���
�	�s�A�A4�A1�4!Bc���[RU5nU(d[U<S35eUR5up#[	U[665nUb[	U[5nUSU--
nU$)z�Percent-encodes a request target so that there are no invalid characters67 68Pre-condition for this function is that 'target' must start with '/'.69If that is the case then _TARGET_RE will always produce a match.70z is not a valid request URIr)�71_TARGET_REr[r�groupsrT�_PATH_CHARS�_QUERY_CHARS)�targetr[r$r%�encoded_targets     r(�_encode_targetr�]si��
���V�$�E�� �F�:�-H�!I�J�J��,�,�.�K�D�*�4��=�N���%�e�\�:���#��+�%���r*c72���U(d73[5$Un[RU5(dSU-n[R	U5R5up#pEnUSL=(d UR
5[;nU(aUR
5nU(akURS5up�n74U=(d Sn[R	U755R5up�U(aU(a[U[5nUS:XaSnOSup�nUb&[U5n
SU
s=::aS::d
O [U5eOSn
[X�5nU(a"U(a[U5n[U[ 5nU(aU(a[U["5nU(aU(a[U[$5nU(dUcUbSnOSn[UUUU
UUUS9$![&[(4an[U5UeSnAff=f)	aH76Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is77performed to parse incomplete urls. Fields not provided will be None.78This parser is RFC 3986 and RFC 6874 compliant.79 80The parser logic and helper functions are based heavily on81work done in the ``rfc3986`` module.82 83:param str url: URL to parse into a :class:`.Url` namedtuple.84 85Partly backwards-compatible with :mod:`urllib.parse`.86 87Example:88 89.. code-block:: python90 91    import urllib392 93    print( urllib3.util.parse_url('http://google.com/mail/'))94    # Url(scheme='http', host='google.com', port=None, path='/mail/', ...)95 96    print( urllib3.util.parse_url('google.com:80'))97    # Url(scheme=None, host='google.com', port=80, path=None, ...)98 99    print( urllib3.util.parse_url('/foo?bar'))100    # Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...)101z//Nrr<)NNNri��)r r!r"r#r$r%r&)r�102_SCHEME_REr��_URI_REr[r�rr��103rpartition�
_HOST_PORT_RErT�_USERINFO_CHARS�intrr�r~r�r��_FRAGMENT_CHARS�104ValueError�AttributeError)r?�105source_urlr r7r$r%r&�
normalize_urir!�_�	host_portr"r#�port_int�es               r(�	parse_urlr�os���8��u���J����S�!�!��S�j��$4�3:�=�=��3E�3L�3L�3N�0��4���$��Q�&�,�,�.�<Q�*Q�
���\�\�^�F��!*�!5�!5�c�!:��D�Y��<�4�D�&�,�,�Y�7�>�>�@�J�D��
�,�T�?�C���r�z����/��D�����4�y�H���*�U�*�(��-�-�+��H��t�,���T�,�T�2�D�(��{�;�D��U�)�%��>�E��X�,�X��G�H����� 4��D��D���
�
�
�
������
��'�4� ��,�!�3��4�s�E2G�G(�G#�#G()rRr>rS�typing.Container[str]rGr>)rR�NonerSr�rGr�)rRrFrSr�rGrF)r$r>rGr>)r"r�r rFrGr�)r"r>r rFrGr>)r"rFr rFrGrF)r�r>rG�bytes)r�r>rGr>)r?r>rGr)6�106__future__r�re�typing�107exceptionsr�utilrr��compilerar��UNICODE�DOTALLr��	_IPV4_PAT�_HEX_PAT�format�	_LS32_PAT�_subs�_variations�_UNRESERVED_PATrz�	_IPV6_PAT�_ZONE_ID_PAT�_IPV6_ADDRZ_PAT�
_REG_NAME_PATr�r��_IPV6_REr��_BRACELESS_IPV6_ADDRZ_REr��_HOST_PORT_PATr��setr��_SUB_DELIM_CHARSr�r�r�r��108NamedTuple�Optionalr>r�r�overloadrTr~r�r�r�r�)�xs0r(�<module>r�s\��"�	�
�+��0���j�j�+�,��
�Z�Z�9�
:�109�110�*�*��111�J�J�����
��
-�	���$�+�+��y�+�I�	��)�,����*Y���C�H�H��=��A�%�i��=�>�>��D�	���0�3H�H���)�#�f�,�|�;�g�E��4�
�
�Z�Z�<�
=�112�
�:�:�c�I�o��+�,��
�:�:�c�I�o��+�,�����C�/�1�C�7�8���:�:�c�O�A�b�,A�&A�C�&G�H���j�j��|�+�g�5�6���
����113�114�115�>�2�:�:��	�	�+A�B�
��H����}�%��#�&6�6�#��>����c�116�*��!,��u�!4�4���B�117���
�
�v���s�+�,�
�V�_�_�S�)�*�
�V�_�_�S�)�*�
�V�_�_�S�)�*�
�V�_�_�S�)�*�
�f�o�o�c�*�+�
�����-�.�	118��B�J������#8������������$9��	����!&��!&�*?�!&��!&�H�<���@��@����>��>��:(�&�$f��w	>s�K119 
codekingpro/portable-devtools · Team Ai