Your IP : 3.142.142.168


Current Path : /opt/alt/python313/lib64/python3.13/encodings/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/encodings/__pycache__/punycode.cpython-313.opt-1.pyc

�

1}g���8�SrSSKrSrSrSrSrSrSrS	rS
r	Sr
SrS
rSr
Sr"SS\R5r"SS\R 5r"SS\R"5r"SS\\R$5r"SS\\R&5rSrg)uXCodec for the Punycode encoding, as specified in RFC 3492

Written by Martin v. Löwis.
�Nc���[5n[5nUH?n[U5S:aUR[U55 M.UR	U5 MA [U5n[
U5U4$)z 3.1 Basic code point segregation�)�	bytearray�set�ord�append�add�sorted�bytes)�str�base�extended�cs    �9/opt/alt/python313/lib64/python3.13/encodings/punycode.py�	segregater
s[���;�D��u�H�
���q�6�C�<��K�K��A����L�L��O�	�
�h��H���;�� � �c�H�SnUHn[U5U:dMUS-
nM U$)z@Return the length of str, considering only characters below max.r�)r)r�max�resrs    r�
selective_lenrs,��
�C�
���q�6�C�<��1�H�C���Jrc�h�[U5nUS-
nX4:XagXnXQ:XaUS-U4$XQ:aUS-
nM')aReturn a pair (index, pos), indicating the next occurrence of
char in str. index is the position of the character considering
only ordinals up to and including char, and pos is the position in
the full string. index/pos is the starting position in the full
string.r)���r)�len)r�char�index�pos�lrs      r�selective_findrsN��	�C��A�
��q����8���H���9���7�C�<��
�X��Q�J�E�rc���Sn/nSnUH_nS=pg[U5n[X5n	U	S-X�-
-n
[XXg5upgUS:XaO!X�U-
-
n
URU
S-
5 UnSn
M6UnMa U$)z3.2 Insertion unsort codingrrrr)rrrr)rr�oldchar�result�oldindexrrrr�curlen�deltas           r�insertion_unsortr&0s����G�
�F��H�
������1�v���s�)�����d�n�-���&�s�U�7�I�E���{���X�%�%�E��M�M�%��'�"��H��E������Mrc�8�SUS--U-
nUS:agUS:�agU$)N�$r��)�j�biasrs   r�Tr-Fs+��
��A��,��
�C�
�Q�w�q�
�R�x���Jrs$abcdefghijklmnopqrstuvwxyz0123456789c���[5nSn[X15nX:a#UR[U5 [	U5$UR[X@U-
SU-
--5 X-
SU-
-nUS-
nMg)�(3.3 Generalized variable-length integersrrr()rr-r�digitsr)�Nr,r"r+�ts     r�generate_generalized_integerr3Nsx��
�[�F�	�A�
�
�a�J���5��M�M�&��)�$���=� ��
�
�f�Q�q�5�R�!�V�"4�5�6�7�
�U��Q����	�Q���rc��U(aUS-nOUS-nXU--
nSnUS:�aUS-nUS-
nUS:�aMUSU-US---nU$)Ni��ri��#r(�&r*)r%�first�numchars�	divisionsr,s     r�adaptr;[si���
�#�
��
�!���	�h�
��E��I�
�#�+������R��	��#�+���U�
�u�r�z�2�3�D��Krc��[5nSn[U5H5upE[XS5nURU5 [	XTS:HX-S-5nM7 [U5$)z3.4 Bias adaptation�Hrr)r�	enumerater3�extendr;r)�baselen�deltasr"r,�pointsr%�ss       r�generate_integersrDjsZ���[�F�
�D�"�6�*�
��(��5���
�
�a���U�A�I�w�~�a�'7�8��+���=�rc�~�[U5up[X5n[[U5U5nU(aUS-U-$U$)N�-)rr&rDr)�textr
rrAs    r�punycode_encoderHus>���t�_�N�D�
�d�
-�F� ��T��F�3�H���d�{�X�%�%��Orc
�r�SnSnSnXnUS-
nSUs=::aS::a	O OUS-
nO:S	Us=::aS
::a	O OUS-
nO$US:Xa[SXS-
USXS-
S
35eUS4$[Xb5n	XHU--
nX�:aX4$USU	-
-nUS-
nM�![a! US:Xa[SXUS-S5eUS-S4s$f=f)r/rr�strict�punycodezincomplete punycode stringN�A�Z�0�9�zInvalid extended code point '�'r()�
IndexError�UnicodeDecodeErrorr-)
r�extposr,�errorsr"�wr+r�digitr2s
          r�decode_generalized_numberrXs��
�F�	�A�	�A�
�	$��#�D�	�!����4��4���4�K�E�
�T�
!�T�
!��2�I�E�
�x�
�$�Z��!�8�V�'D�X�UV�h�EW�DX�XY�%Z�\�
\��4�<��
�a�J���!�)����9��>�!�
��a��L��	�Q���/���	$���!�(��X�v�a�x�)E�G�G��A�:�t�#�#�		$�s�B�(B6�5B6c	��SnSnSnSnU[U5:a�[XXR5upxUcU$XHS--
nX4[U5S---
nUS:�a&US:Xa[S	XS-
US
US35e[S5nU[U5S--nUSU[	U5-XS-n[X�S:H[U55nUnU[U5:aM�U$)
z3.2 Insertion sort codingrrr=rNri��rJrKzInvalid character U+�x�?)rrXrSr�chrr;)	r
rrUrrr,rT�newposr%s	         r�insertion_sortr^�s����D�
�C�
�D�
�F�
�3�x�=�
 �1�(�26�@�
���=��K��Q�w�����D�	�A�
�&�&���(�?���!�(���a�%��*�4��(�3�5�5��s�8�D��S��Y��]�#���D�S�z�C��I�%��T�
�2���U�q�[�3�t�9�5����%�3�x�=�
 �&�Krc�X�[U[5(aURS5n[U[5(a[	U5nURS5nUS:XaSnUR
5nO&[USUSU5nXS-SR
5n[X4U5$![a2n[SXRURUR5SeSnAff=f![a<nUS-n[SUXeR-XeR-UR5SeSnAff=f)N�asciirFr�rrK)�
isinstancer�encode�
memoryviewr�rfind�upperrS�start�end�reasonr^)rGrUrr
r�exc�offsets       r�punycode_decoderl�s���$�����{�{�7�#���$�
�#�#��T�{��
�*�*�T�
�C�
�b�y����:�:�<��	;��t�D�S�z�7�F�3�D��A���<�%�%�'��7��d�f�5�5��"�	;�$�W�d�I�I�s�w�w�%(�Z�Z�1�6:�
;��	;���7��q��� ��T�!'�	�	�!1�6�'�'�>�!$���-�26�	7��7�s0�2B$�C#�$
C �.-C�C �#
D)�-7D$�$D)c�(�\rSrSrSSjrSSjrSrg)�Codec��c�2�[U5nU[U54$�N)rHr��self�inputrUrs    rrc�Codec.encode�s���e�$���C��J��rc�Z�US;a[SU35e[X5nU[U54$�N)rJ�replace�ignorezUnsupported error handling: )�UnicodeErrorrlrrrs    r�decode�Codec.decode�s6���8�8��!=�f�X�F�G�G��e�,���C��J��rr*N)rJ)�__name__�
__module__�__qualname__�__firstlineno__rcr{�__static_attributes__r*rrrnrn�s���rrnc��\rSrSrSSjrSrg)�IncrementalEncoder��c��[U5$rq)rH�rsrt�finals   rrc�IncrementalEncoder.encode�s
���u�%�%rr*N�F)r}r~rr�rcr�r*rrr�r��s��&rr�c��\rSrSrSSjrSrg)�IncrementalDecoder��c�|�URS;a[SUR35e[XR5$rw)rUrzrlr�s   rr{�IncrementalDecoder.decode�s5���;�;�=�=��!=�d�k�k�]�K�L�L��u�k�k�2�2rr*Nr�)r}r~rr�r{r�r*rrr�r��s��3rr�c��\rSrSrSrg)�StreamWriter��r*N�r}r~rr�r�r*rrr�r�����rr�c��\rSrSrSrg)�StreamReader��r*Nr�r*rrr�r��r�rr�c
��[R"S[5R[5R[
[[[S9$)NrK)�namercr{�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInfornrcr{r�r�r�r�r*rr�getregentryr��s6�����
��w�~�~��w�~�~�-�-�!�!��r)�__doc__r�rrrr&r-r0r3r;rDrHrXr^rlrnr�r�r�r�r�r*rr�<module>r�s����
�
!���$�,�
1����	���>�<7�4
�F�L�L�
�&��2�2�&�3��2�2�3�	�5��,�,�	�	�5��,�,�	�
	r

?>