%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/encodings/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/encodings/__pycache__/punycode.cpython-312.pyc

�

���f���8�dZddlZd�Zd�Zd�Zd�Zd�ZdZd	�Zd
�Z	d�Z
d�Zd
�Zd�Z
d�ZGd�dej�ZGd�dej �ZGd�dej"�ZGd�deej$�ZGd�deej&�Zd�Zy)uY Codec for the Punicode encoding, as specified in RFC 3492

Written by Martin v. Löwis.
�Nc���t�}t�}|D]<}t|�dkr|jt|���,|j	|��>t|�}t
|�|fS)z 3.1 Basic code point segregation�)�	bytearray�set�ord�append�add�sorted�bytes)�str�base�extended�cs    �)/usr/lib/python3.12/encodings/punycode.py�	segregater
s`���;�D��u�H�
����q�6�C�<��K�K��A����L�L��O�	�
�h��H���;�� � �c�@�d}|D]}t|�|ks�|dz
}�|S)z@Return the length of str, considering only characters below max.r�)r)r�max�resrs    r�
selective_lenrs1��
�C�
����q�6�C�<��1�H�C���Jrc�h�t|�}	|dz
}||k(ry||}||k(r|dz|fS||kr|dz
}�')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_findrsV��	�C��A�
��q����!�8����H����9���7�C�<��
��X��Q�J�E�rc���d}g}d}|D]c}dx}}t|�}t||�}	|	dz||z
z}
	t||||�\}}|dk(rn!|
||z
z
}
|j|
dz
�|}d}
�8|}�e|S)�3.2 Insertion unsort codingrrrr)rrrr)rr�oldchar�result�oldindexrrrr�curlen�deltas           r�insertion_unsortr'0s����G�
�F��H�
�
�������1�v���s�D�)�����d�W�n�-���&�s�1�U�3�7�I�E�#���{���U�X�%�%�E��M�M�%��'�"��H��E����
��Mrc�4�d|dzz|z
}|dkry|dkDry|S)N�$r��)�j�biasrs   r�Tr.Fs+��
��A��,��
�C�
�Q�w�q�
�R�x���Jrs$abcdefghijklmnopqrstuvwxyz0123456789c���t�}d}	t||�}||kr#|jt|�t	|�S|jt|||z
d|z
zz�||z
d|z
z}|dz
}�i)�(3.3 Generalized variable-length integersrrr))rr.r�digitsr)�Nr-r#r,�ts     r�generate_generalized_integerr4Ns���
�[�F�	�A�
�
�a��J���q�5��M�M�&��)�$���=� ��
�
�f�Q�1�q�5�R�!�V�"4�5�6�7�
��U��Q����	�Q���rc�z�|r|dz}n|dz}|||zz
}d}|dkDr|dz}|dz
}|dkDr�|d|z|dzzz}|S)Ni��ri��#r)�&r+)r&�first�numchars�	divisionsr-s     r�adaptr<[sk���
�#�
��
�!���	�U�h�
��E��I�
�#�+������R��	��#�+���U�
�u�r�z�2�3�D��Krc��t�}d}t|�D]8\}}t||�}|j|�t	||dk(||zdz�}�:t|�S)z3.4 Bias adaptation�Hrr)r�	enumerater4�extendr<r)�baselen�deltasr#r-�pointsr&�ss       r�generate_integersrEjsg���[�F�
�D�"�6�*�9�
���(���5���
�
�a���U�F�A�I�w�v�~�a�'7�8��9���=�rc�x�t|�\}}t||�}tt|�|�}|r|dz|zS|S)N�-)rr'rEr)�textr
rrBs    r�punycode_encoderIusB���t�_�N�D�(�
�d�H�
-�F� ��T��F�3�H���d�{�X�%�%��Orc�d�d}d}d}		t||�}|dz
}d|cxkrdkr	nn|dz
}n1d|cxkrd	kr	nn|d
z
}n|dk(rtd||dz
z��|dfSt||�}	|||zz
}||	kr||fS|d|	z
z}|dz
}��#t$r|dk(rtd��|dzdfcYSwxYw)
r0rr�strictzincomplete punicode stringN�A�Z�0�9�z Invalid extended code point '%s'r))r�
IndexError�UnicodeErrorr.)
r�extposr-�errorsr#�wr,r�digitr3s
          r�decode_generalized_numberrWs
��
�F�	�A�	�A�
�	$��x��'�(�D�
	�!����4��4���4�K�E�
�T�
!�T�
!��2�I�E�
�x�
��A�!)�&��(�!3� 4�5�
5��4�<��
�a��J���%�!�)����1�9��6�>�!�
��a��L��	�Q���-���	$���!�"�#?�@�@��A�:�t�#�#�	$�s�B� B/�.B/c�~�d}d}d}d}|t|�kr�t||||�\}}|�|S||dzz
}||t|�dzzz
}|dkDr|dk(rtd	|z��td
�}|t|�dzz}|d|t	|�z||dz}t||dk(t|��}|}|t|�kr��|S)r!rrr>rNri��rKzInvalid character U+%x�?)rrWrRr�chrr<)	r
rrTrrr-rS�newposr&s	         r�insertion_sortr\�s����D�
�C�
�D�
�F�
�3�x�=�
 �1�(�F�26��@�
����=��K��u�Q�w������D�	�A�
�&�&���(�?���!�"�#;�d�#B�C�C��s�8�D��S��Y��]�#���D�S�z�C��I�%��S�T�
�2���U�V�q�[�3�t�9�5����!�3�x�=�
 �"�Krc�Z�t|t�r|jd�}t|t�rt	|�}|jd�}|dk(rd}t|d�j
�}n0t|d|d|�}t||dzdd�j
�}t|||�S)N�asciirGr�r)�
isinstancer�encode�
memoryviewr�rfind�upperr\)rHrTrr
rs     r�punycode_decodere�s����$����{�{�7�#���$�
�#��T�{��
�*�*�T�
�C�
�b�y����t�W�%�+�+�-���4���:�w��/���t�C��E�F�|�W�-�3�3�5���$��&�1�1rc��eZdZdd�Zdd�Zy)�Codecc�2�t|�}|t|�fS�N)rIr��self�inputrTrs    rrazCodec.encode�s���e�$���C��J��rc�X�|dvrtd|z��t||�}|t|�fS�N)rK�replace�ignorezUnsupported error handling )rRrerrjs    r�decodezCodec.decode�s6���8�8��<�V�C�D�D��e�V�,���C��J��rN)rK)�__name__�
__module__�__qualname__rarqr+rrrgrg�s���rrgc��eZdZdd�Zy)�IncrementalEncoderc��t|�Sri)rI�rkrl�finals   rrazIncrementalEncoder.encode�s
���u�%�%rN�F)rrrsrtrar+rrrvrv�s��&rrvc��eZdZdd�Zy)�IncrementalDecoderc�z�|jdvrtd|jz��t||j�Srn)rTrRrerxs   rrqzIncrementalDecoder.decode�s5���;�;�=�=��<�T�[�[�H�I�I��u�d�k�k�2�2rNrz)rrrsrtrqr+rrr|r|�s��3rr|c��eZdZy)�StreamWriterN�rrrsrtr+rrrr����rrc��eZdZy)�StreamReaderNr�r+rrr�r��r�rr�c	��tjdt�jt�jt
ttt��S)N�punycode)�namerarq�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInforgrarqrvr|rr�r+rr�getregentryr��s6�����
��w�~�~��w�~�~�-�-�!�!��r)�__doc__r�rrrr'r.r1r4r<rErIrWr\rergrvr|rr�r�r+rr�<module>r�s����
�
!���$�,�
1����	���<�22� 
�F�L�L�
�&��2�2�&�3��2�2�3�	�5��,�,�	�	�5��,�,�	�
	r

Zerion Mini Shell 1.0