%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/idna/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/idna/__pycache__/core.cpython-312.pyc

�

��=f�1�
�r�ddlmZddlZddlZddlZddlmZmZddlm	Z	dZ
dZejd�Z
Gd	�d
e�ZGd�de�ZGd
�de�ZGd�de�Zdedefd�Zdededefd�Zdedefd�Zdedefd�Zdeeefdefd�Zdeeefdedefd�Zd1dededefd�Zdedefd�Zdedefd �Zdeddfd!�Z ded"edefd#�Z!d1ded"ed$edefd%�Z"deeee#fddfd&�Z$dedefd'�Z%deeee#fdefd(�Z&d2d)ed*ed+edefd,�Z'd3deeee#fd-ed.ed*ed+edefd/�Z(d4deeee#fd-ed.ed*edef
d0�Z)y)5�)�idnadata�N)�Union�Optional)�intranges_contain�	sxn--u[.。.。]c��eZdZdZy)�	IDNAErrorz7 Base exception for all IDNA-encoding related problems N��__name__�
__module__�__qualname__�__doc__���+/usr/lib/python3/dist-packages/idna/core.pyr
r
s��A�rr
c��eZdZdZy)�
IDNABidiErrorz= Exception when bidirectional requirements are not satisfied Nrrrrrrs��G�rrc��eZdZdZy)�InvalidCodepointz> Exception when a disallowed or unallocated codepoint is used Nrrrrrrs��H�rrc��eZdZdZy)�InvalidCodepointContextzE Exception when the codepoint is not valid in the context it is used Nrrrrrrs��O�rr�cp�returnc��tjt|��}|dk(r)tjt|��st	d��|S)Nrz Unknown character in unicodedata)�unicodedata�	combining�chr�name�
ValueError)r�vs  r�_combining_classr" s@�����c�"�g�&�A��A�v�����B��(��?�@�@��Hr�scriptc�N�tt|�tj|�S)N)r�ordr�scripts)rr#s  r�
_is_scriptr''s���S��W�h�&6�&6�v�&>�?�?r�sc�$�|jd�S)N�punycode)�encode�r(s r�	_punycoder-*s���8�8�J��rc�$�dj|�S)NzU+{:04X})�formatr,s r�_unotr0-s�����Q��r�labelc�"�t|�dkDryy)N�?FT��len�r1s r�valid_label_lengthr71s��
�5�z�B���r�trailing_dotc�*�t|�|rdndkDryy)N��FTr4)r1r8s  r�valid_string_lengthr<7s��
�5�z�L�S�c�2��r�	check_ltrc��d}t|d�D]J\}}tj|�}|dk(r$tdj	t|�|���|dvs�Id}�L|s|sytj|d�}|dvrd}n+|d	k(rd}n#td
j	t|����d}d}t|d�D]�\}}tj|�}|rG|dvrtdj	|���|d
vrd}n|dk7rd}|dvs�N|s|}�S||k7s�Ytd��|dvrtdj	|���|dvrd}��|dk7s��d}��|std��y)NFr�z1Unknown directionality in label {} at position {})�R�AL�ANTr)r@rA�Lz=First codepoint in label {} must be directionality L, R or AL)
r@rArB�EN�ES�CS�ET�ON�BN�NSMzGInvalid direction for codepoint at position {} in a right-to-left label)r@rArDrBrJ)rBrDz2Can not mix numeral types in a right-to-left label)rCrDrErFrGrHrIrJzGInvalid direction for codepoint at position {} in a left-to-right label)rCrDz0Label ends with illegal codepoint directionality)�	enumerater�
bidirectionalrr/�repr)	r1r=�
bidi_label�idxr�	direction�rtl�valid_ending�number_types	         r�
check_bidirT=s����J��u�a�(��	��b��-�-�b�1�	���?�� S� Z� Z�[_�`e�[f�hk� l�m�m��)�)��J�
��i���)�)�%��(�3�I��K����	�c�	����[�b�b�cg�hm�cn�o�p�p��L��K��u�a�(�%�	��b��-�-�b�1�	��� \�\�#�$m�$t�$t�ux�$y�z�z��3�3�#���e�#�$���L�(�"�"+�K�"�i�/�+�,`�a�a�� P�P�#�$m�$t�$t�ux�$y�z�z��K�'�#���e�#�$��7%�:��N�O�O�rc�V�tj|d�ddk(rtd��y)Nr�Mz0Label begins with an illegal combining characterT)r�categoryr
r6s r�check_initial_combinerrXxs-�����E�!�H�%�a�(�C�/��J�K�K�rc�`�|dddk(rtd��|ddk(s|ddk(rtd��y	)
N��z--z4Label has disallowed hyphens in 3rd and 4th positionr�-���z)Label must not start or end with a hyphenT)r
r6s r�check_hyphen_okr^~sA���Q�q�z�T���N�O�O��Q�x�3��%��)�s�*��C�D�D�rc�L�tjd|�|k7rtd��y)N�NFCz%Label must be in Normalization Form C)r�	normalizer
r6s r�	check_nfcrb�s(�����U�E�*�e�3��?�@�@�4r�posc��t||�}|dk(�r|dkDr"tt||dz
��tk(ryd}t|dz
dd�D]Y}tj
j
t||��}|td�k(r�=|td�td	�fvrd}nn|syd}t|dzt|��D][}tj
j
t||��}|td�k(r�=|td
�td	�fvrd}|S|S|S|dk(r(|dkDr"tt||dz
��tk(ryyy)Ni rrTFr]�TrC�Dr@i
 )r%r"�_virama_combining_class�ranger�
joining_types�getr5)r1rc�cp_value�ok�i�joining_types      r�valid_contextjro�sl���5��:��H��6����7���E�#��'�N� 3�4�8O�O��
���s�1�u�b�"�%�	�A�#�1�1�5�5�c�%��(�m�D�L��s�3�x�'���#�c�(�C��H�!5�5�����	���
���s�1�u�c�%�j�)�	�A�#�1�1�5�5�c�%��(�m�D�L��s�3�x�'���#�c�(�C��H�!5�5�����	���	�	��	��6����7���E�#��'�N� 3�4�8O�O���r�	exceptionc��t||�}|dk(rDd|cxkrt|�dz
kr,nyt||dz
�dk(rt||dz�dk(ryy|dk(r2|t|�dz
kr t|�dkDrt||dzd�Sy|d	k(s|d
k(r|dkDrt||dz
d�Sy|dk(r4|D].}|d
k(r�	t|d�st|d�s
t|d�s�.yyd|cxkrdkr#nn |D]}dt|�cxkrdks�y�yd|cxkrdkr#ny|D]}dt|�cxkrdks�y�yy)N�rr�lTFiu�Greeki�i��Hebrewi�0u・�Hiragana�Katakana�Hani`iii�i�)r%r5r')r1rcrprkrs     r�valid_contextory�s����5��:��H��6���s�!�S��Z��\�!���5��q��>�"�f�,��U�3��7�^�1D��1N���	�V�	���U��A���#�e�*�q�.��e�C�!�G�n�g�6�6��	�V�	�x�6�1���7��e�C�!�G�n�h�7�7��	�V�	��	�B��X�~���"�j�)�Z��J�-G�:�VX�Z_�K`��		�
�	�(�	#�e�	#��	�B���B��)�6�)��*�	��	�(�	#�e�	#���	�B���B��)�6�)��*�	��rc
�"�t|ttf�r|jd�}t	|�dk(rtd��t
|�t|�t|�t|�D�]\}}t|�}t|tjd�r�0t|tjd�r>t||�r�Ztdj!t#|�|dzt%|����t|tjd�r>t'||�r��td	j!t#|�|dzt%|����t)d
j!t#|�|dzt%|����t+|�y)Nzutf-8rzEmpty Label�PVALID�CONTEXTJz*Joiner {} not allowed at position {} in {}r�CONTEXTO�-Codepoint {} not allowed at position {} in {}z-Codepoint {} at position {} of {} not allowed)�
isinstance�bytes�	bytearray�decoder5r
rbr^rXrKr%rr�codepoint_classesrorr/r0rMryrrT)r1rcrrks    r�check_labelr��ss���%�%��+�,����W�%��
�5�z�Q���
�&�&�
�e���E���5�!��u�%�@�	��b��r�7���X�x�'A�'A�(�'K�L��
�x��)C�)C�J�)O�
P�!�%��-�-�.Z�.a�.a��(�O�S��U�D��K�/9�:�:�
�x��)C�)C�J�)O�
P�!�%��-�-�.]�.d�.d�ej�ks�et�vy�z{�v{�~B�CH�~I�/J�K�K�"�#R�#Y�#Y�Z_�`h�Zi�kn�op�kp�rv�w|�r}�#~���@��u�rc�(�	|jd�}t|�t|�std��|S#t$rYnwxYw|std��t|�}t
|�t|�}t|z}t|�std��|S)N�asciizLabel too longzNo Input)	r+�ulabelr7r
�UnicodeEncodeError�strr�r-�_alabel_prefix�r1�label_bytess  r�alabelr��s���
��l�l�7�+���{��!�+�.��,�-�-�����
��
����
�#�#���J�E�����E�"�K� �;�.�K��k�*��(�)�)��s�36�	A�Ac��t|ttf�s	|jd�}n|}|j
�}|jt�rA|tt�d}|std��|jd�ddk(r'td��t|�|jd�S	|jd�}t|�|S#t$rt|�|cYSwxYw#t$rtd��wxYw)Nr�z5Malformed A-label, no Punycode eligible content foundr]r\z"A-label must not end with a hyphenr*zInvalid A-label)
rr�r�r+r�r��lower�
startswithr�r5r
r��UnicodeErrorr�s  rr�r�s���e�e�Y�/�0�	��,�,�w�/�K�
���#�#�%�K����n�-�!�#�n�"5�"6�7����S�T�T����g�&�r�*�c�1��@�A�A��K� ��!�!�'�*�*�+��"�"�:�.������L��-"�	�����L�	��&�+��)�*�*�+�s�C
�/C)�
C&�%C&�)C>�domain�
std3_rules�transitionalc��ddlm}d}t|�D]�\}}t|�}	||dkr|ntj||df�dz
}|d}	d}
t|�dk(r|d}
|	d	k(s|	d
k(r|r	|	dk(r
|s|
�||z
}n*|
�|	dk(s|	dk(r|r|	d
k(r|r||
z
}n|	d
k7r
t
����tjd|�S#t$r2tdjt|�|dzt|����wxYw)zBRe-map the characters in the string according to UTS46 processing.r)�	uts46datar?��ZN�rZ�Vrf�3rV�Ir~r`)
r�rKr%�bisect�bisect_leftr5�
IndexErrorrr/r0rMrra)r�r�r�r��outputrc�char�
code_point�uts46row�status�replacements           r�uts46_remapr�4s5��$�
�F��v�&�;�	��T���Y�
�	;� �z�C�/?���"�"�9�z�3�.?�@�1�D�F�H��a�[�F��K��8�}��!�&�q�k���#�
��s�]�<��s�]�:�+�:M��$����(�f��m��s�]�:��s�]�|��+�%���3�� �l�"��%;�0� � ���/�/���	;�"�?�F�F��j�!�3��7�D��L�:�;�
;�	;�s�BC�;C=�strict�uts46c��t|t�s
	t|d�}|r
t	|||�}d}g}|r|jd�}ntj|�}|r|dgk(rtd��|ddk(r|d=d}|D]+}t|�}|r|j|��"td	��|r|jd
�dj|�}t||�std��|S#t$rtd��wxYw)
Nr�zGshould pass a unicode string to the function rather than a byte string.F�.r?�Empty domainr]T�Empty labelr�.zDomain too long)rr��UnicodeDecodeErrorr
r��split�_unicode_dots_rer��append�joinr<)	r(r�r�r�r�r8�result�labelsr1s	         rr+r+Ts���a���	g��A�w��A�
���:�|�4���L�
�F�
�������!�'�'��*���V��t�^���'�'�
�b�z�R���2�J����+���5�M����M�M�!���M�*�*�+���
�
�c���	�	�&��A��q�,�/��)�*�*��H��5"�	g��e�f�f�	g�s�C'�'C<c���	t|t�st|d�}|r
t	||d�}d}g}|st
j
|�}n|j
d�}|r|dgk(rtd��|ds|d=d}|D]+}t|�}|r|j|��"td	��|r|jd�dj|�S#t$rtd��wxYw)
Nr�zInvalid ASCII in A-labelFr�r?r�r]Tr�)
rr�r�r
r�r�r�r�r�r�)r(r�r�r�r8r�r�r1s        rr�r�us���4��!�S�!��A�w��A�
���:�u�-���L�
�F��!�'�'��*���������V��t�^���'�'��"�:��2�J����+���5�M����M�M�!���M�*�*�+���
�
�b���8�8�F����/�4��2�3�3�4�s�C�C )F)TF)FFFF)FFF)*r?rr�r�re�typingrr�	intrangesrrgr��compiler�r�r
rrr�intr"r��boolr'r�r-r0r7r<rTrXr^rbroryr�r�r�r�r�r+r�rrr�<module>r�s���
��	�"�(������2�:�:�:�;��	��	�
	�I�	�
	�y�	�
	�i�	�

��
��
�@�3�@��@��@� �� �� � �S� �S� ��e�E�3�J�/��D���u�U�C�Z�0������8�c�8�d�8�t�8�v�#��$���3��4��A�S�A�T�A�
,�#�,�C�,�D�,�^'�#�'�C�'�D�'�T�'�T�u�S�%��2�3����6�#��%��0�%��U�I�-�.��3��:0��0��0�D�0�UX�0�@
�e�C��	�)�*�
�D�
��
�cg�
�@D�
�QV�
�B�e�C��	�)�*��D����cg��tw�r

Zerion Mini Shell 1.0