Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
codec.cpython-313.pyc65 linesDownload Raw Back to __pycache__
1�

2�j���f�SSKrSSKJrJrJr SSKJrJrJrJ	r	J3r4Jr "SS\R5r"SS\R5r"S	S5\R5r"SS\\R"5r"S
S\\R$5rS\S\\R(4Sjr\R,"\5 g)�N)�Any�Optional�Tuple�)�	IDNAError�_unicode_dots_re�alabel�decode�encode�ulabelc	�`�\rSrSrSrS6S\S\S\\\44Sjjr	S7S\S\S\\\44Sjjr8Srg	)�Codec�aNStateless IDNA 2008 codec.9 10Implements the :class:`codecs.Codec` protocol so that the whole-domain11encoder (:func:`idna.encode`) and decoder (:func:`idna.decode`) are12accessible through the standard codec machinery as ``"idna2008"``.13 14Only the ``"strict"`` error handler is supported; any other handler15raises :exc:`~idna.IDNAError`.16�data�errors�returnc�h�US:wa[SUS35eU(dg[U5[U54$)N�strict�Unsupported error handling "�"��r)rr�len��selfrrs   �PD:\code\apps\devtools\python\user_packages\Python313\site-packages\idna/codec.pyr�Codec.encodes8���X���:�6�(�!�D�E�E����d�|�S��Y�&�&rc�h�US:wa[SUS35eU(dg[U5[U54$)Nrrr��r)rr17rrs   rr18�Codec.decodes8���X���:�6�(�!�D�E�E����d�|�S��Y�&�&r�N)r)�__name__�19__module__�__qualname__�__firstlineno__�__doc__�strr�bytes�intrr20�__static_attributes__r"rrrrsQ���'�3�'��'�5����;L�'�'�5�'�#�'�U�3��8�_�'�'rrc21�<�\rSrSrSrS\S\S\S\\\	44Sjr22Srg	)23�IncrementalEncoder�%a�Incremental IDNA 2008 encoder.24 25Buffers a partial trailing label across calls until either the next26label separator is seen or ``final=True``, so that streamed input is27encoded one whole label at a time. Any of the four Unicode label28separators (``U+002E``, ``U+3002``, ``U+FF0E``, ``U+FF61``) ends a29label; the result always uses ``U+002E`` as the separator.30 31Only the ``"strict"`` error handler is supported.32rr�finalrc��US:wa[SUS35eU(dg[R"U5nSnU(a#US(dSnUS	OU(dUS	U(aSn/nSnUH7nUR[	U55 U(aUS	-
nU[U5-
nM9 SR
U5U-n	U[U5-
nX�4$)33Nrrrrr������.rr)rr�split�appendr	r�join)34rrrr/�labels�trailing_dot�result�size�label�result_bytess35          r�_buffer_encode�!IncrementalEncoder._buffer_encode1s����X���:�6�(�!�D�E�E���!�'�'��-������"�:�#���2�J���2�J��#'�L������E��M�M�&��-�(����	���C��J��D�	��y�y��(�<�7����L�!�!���!�!rr"N)r#r$r%r&r'r(�boolrr)r*r<r+r"rrr-r-%s2��	�"�3�"��"�D�"�U�5�RU�:�EV�"rr-c36�<�\rSrSrSrS\S\S\S\\\	44Sjr37Srg	)38�IncrementalDecoder�Rz�Incremental IDNA 2008 decoder.39 40Buffers a partial trailing label across calls until either the next41label separator is seen or ``final=True``, so that streamed input is42decoded one whole label at a time.43 44Only the ``"strict"`` error handler is supported.45rrr/rc���US:wa[SUS35eU(dg[U[5(d[US5n[R"U5nSnU(a#US(dSnUS	OU(dUS	U(aSn/nS	nUH7nUR[
U55 U(aUS46-
nU[U5-
nM9 SRU5U-n	U[U5-
nX�4$)Nrrrr�asciir r1�.rr)	r�47isinstancer(rr3r4rrr5)48rrrr/r6r7r8r9r:�49result_strs50          r�_buffer_decode�!IncrementalDecoder._buffer_decode\s����X���:�6�(�!�D�E�E����$��$�$��t�W�%�D�!�'�'��-������"�:�"���2�J���2�J��#&�L������E��M�M�&��-�(����	���C��J��D�	��X�X�f�%��4�51���L�!�!���!�!rr"N)r#r$r%r&r'rr(r>rr*rGr+r"rrr@r@Rs1��� "�3� "�� "�D� "�U�3�PS�8�_� "rr@c��\rSrSrSrg)�StreamWriter�r"N�r#r$r%r&r+r"rrrJrJ���rrJc��\rSrSrSrg)�StreamReader�r"NrLr"rrrOrO�rMrrO�namerc52��US:wag[R"U[5R[5R[53[[[S9$)a�Codec search function registered with :mod:`codecs`.54 55Returns a :class:`codecs.CodecInfo` for the ``"idna2008"`` codec name56so that ``str.encode("idna2008")`` and ``bytes.decode("idna2008")``57invoke the IDNA 2008 codec defined in this module.58 59:param name: The codec name being looked up.60:returns: A :class:`codecs.CodecInfo` instance if ``name`` is61    ``"idna2008"``, otherwise ``None``.62�idna2008N)rQrr63�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInforrr64r-r@rJrO)rQs r�search_functionrZ�sC���z������
��w�~�~��w�~�~�-�-�!�!��r)rX�typingrrr�corerrr	r65rrr�BufferedIncrementalEncoderr-�BufferedIncrementalDecoderr@rJrOr(rYrZ�registerr"rr�<module>r`s���
�'�'�M�M�'�F�L�L�'�<*"��:�:�*"�Z*"��:�:�*"�Z	�5�&�-�-�	�	�5�&�-�-�	��#��(�6�+;�+;�"<��0���� r
codekingpro/portable-devtools · Team Ai