ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/lib2to3/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/lib2to3/__pycache__/btm_utils.cpython-311.opt-2.pyc

�

�f�&���	ddlmZddlmZmZddlmZmZeZeZ	ej
ZeZdZ
dZdZGd�de��Zd
d
�Zd�Zd�Zd	S)�)�pytree)�grammar�token)�pattern_symbols�python_symbols���������c�0�eZdZ	dd�Zd�Zd�Zd�Zd�ZdS)�MinNodeNc�h�||_||_g|_d|_d|_g|_g|_dS)NF)�type�name�children�leaf�parent�alternatives�group)�selfrrs   �8/opt/alt/python311/lib64/python3.11/lib2to3/btm_utils.py�__init__zMinNode.__init__s8����	���	���
���	���������
�
�
�c�Z�t|j��dzt|j��zS)N� )�strrr)rs r�__repr__zMinNode.__repr__s"���4�9�~�~��#�c�$�)�n�n�4�4rc���	|}g}|�r^|jtkrr|j�|��t	|j��t	|j��kr$t
|j��g}g|_|j}�{|j}d}n�|jtkrq|j	�|��t	|j	��t	|j��kr#t|j	��}g|_	|j}��|j}d}n[|jtjkr"|j
r|�|j
��n|�|j��|j}|��^|S�N)r�TYPE_ALTERNATIVESr�append�lenr�tupler�
TYPE_GROUPr�get_characteristic_subpattern�token_labels�NAMEr)r�node�subps   r�leaf_to_rootzMinNode.leaf_to_root!s_��	7������!	��y�-�-�-��!�(�(��.�.�.��t�(�)�)�S���-?�-?�?�?�!�$�"3�4�4�5�D�(*�D�%��;�D���;�D��D���y�J�&�&��
�!�!�$�'�'�'��t�z�?�?�c�$�-�&8�&8�8�8�8���D�D�D�!#�D�J��;�D���;�D��D���y�L�-�-�-�$�)�-����D�I�&�&�&�&����D�I�&�&�&��;�D�C�!	�D�rc�j�	|���D]}|���}|r|cS�dSr)�leavesr))r�lr(s   r�get_linear_subpatternzMinNode.get_linear_subpatternKsO��
	������	�	�A��>�>�#�#�D��
�����
�	�	rc#�nK�	|jD]}|���Ed{V���|js|V�dSdSr)rr+)r�childs  rr+zMinNode.leaves`s^����7��]�	&�	&�E��|�|�~�~�%�%�%�%�%�%�%�%��}�	��J�J�J�J�J�	�	r)NN)�__name__�
__module__�__qualname__rrr)r-r+�rrrrsj�����������5�5�5�(�(�(�T���*����rrNc��	�	d}|jtjkr
|jd}|jtjkr�t|j��dkrt
|jd|��}�nstt���}|jD]L}|j�	|��dzr� t
||��}|�|j�
|���M�n|jtjkr�t|j��dkrVtt���}|jD].}t
||��}|r|j�
|���/|jsd}�n�t
|jd|��}�nh|jtj
k�rRt|jdtj��r1|jdjdkrt
|jd|��St|jdtj��r|jdjdksIt|j��dkr3t%|jdd��r|jdjdkrdSd}d}d}d	}d}	d	}
|jD]j}|jtjkrd	}|}n1|jtjkrd}|}	n|jtjkr|}t%|d��r
|jd
krd}
�k|
r6|jd}t%|d��r|jdkr
|jd}n
|jd}|jt*jkr�|jdkrtt.���}�nt%t*|j��r)tt1t*|j�����}n�tt1t2|j�����}n�|jt*jkr[|j�d
��}|t8vrtt8|���}nAtt*j|���}n%|jtjkrt
||��}|r7|	jdjdkrd}n|	jdjdkrnt:�|r@|�>|jdd�D].}t
||��}|�|j�
|���/|r||_|S)N��)rr�(�[�valueTF�=��any�')rr�*�+r)r�syms�Matcherr�Alternativesr!�reduce_treerr�indexr �Alternativer#�Unit�
isinstancer�Leafr9�hasattr�Details�Repeaterr%r&�TYPE_ANY�getattr�pysyms�STRING�strip�tokens�NotImplementedErrorr)
r'r�new_noder/�reducedr�details_node�alternatives_node�has_repeater�
repeater_node�has_variable_name�	name_leafrs
             rrCrCgs�����H��y�D�L� � ��}�Q����y�D�%�%�%��t�}����"�"�"�4�=��#3�V�<�<�H�H��$5�6�6�6�H���
6�
6���=�&�&�u�-�-�a�/���%�e�X�6�6���&��%�,�,�W�5�5�5��
6�
��d�&�	&�	&��t�}����!�!��J�/�/�/�H���
6�
6��%�e�X�6�6���6��%�,�,�W�5�5�5���$�
 ����#�4�=��#3�V�<�<�H�H�	
��d�i�	�	��t�}�Q�'���5�5�	9��M�!��"�c�)�)��t�}�Q�/��8�8�8�
��
�a�(�&�+�
6�
6�	��}�Q��%��,�,��D�M�"�"�1�$�$��t�}�Q�'��1�1�%��}�Q��%��,�,��4����� �����
�!���]�
	)�
	)�E��z�T�\�)�)���$�����t�}�,�,�#�� %�
�
���t�0�0�0�$)�!��u�g�&�&�
)�5�;�#�+=�+=�$(�!���	)��
�a�(�I��y�'�*�*�
-�y��#�/E�/E� �M�!�,�	���
�a�(�I��>�\�.�.�.���%�'�'�"��1�1�1����<���9�9�N�&�G�L�)�/�,R�,R�S�S�S�H�H�&�G�F�I�O�,L�,L�M�M�M�H�H�
�^�|�2�
2�
2��?�(�(��-�-�D��v�~�~�"��t��5�5�5���"��(9��E�E�E���
�^�t�0�
0�
0�"�#4�f�=�=�H��		*��%�a�(�.�#�5�5�����'��*�0�C�7�7��*�)��	6�H�0�%�.�q��t�4�
6�
6��%�e�X�6�6���&��%�,�,�W�5�5�5���!� ����Orc����	t|t��s|St|��dkr|dSg}g}gd��g}d�|D]�}tt	|d�����r�tt	|�fd�����r|�|���Vtt	|�fd�����r|�|����|�|����|r|}n	|r|}n|r|}t
|t���S)	Nrr5)�in�for�if�not�Nonez[]().,:c�.�t|��tuSr)rr)�xs r�<lambda>z/get_characteristic_subpattern.<locals>.<lambda>�s��d�1�g�g��n�rc�6��t|t��o|�vSr�rGr)rb�common_charss �rrcz/get_characteristic_subpattern.<locals>.<lambda>�s���j��C�&8�&8�&N�Q�,�=N�rc�6��t|t��o|�vSrre)rb�common_namess �rrcz/get_characteristic_subpattern.<locals>.<lambda>s���
�1�c�(:�(:�(P�q�L�?P�r)�key)rG�listr!r<�rec_testr �max)�subpatterns�subpatterns_with_names�subpatterns_with_common_names�subpatterns_with_common_chars�
subpatternrfrhs     @@rr$r$�st������k�4�(�(����
�;�������1�~�� ��$&�!�6�6�6�L�$&�!��L�!�
:�
:�
��x�
�$<�$<�=�=�>�>�		:��8�J�N�N�N�N�P�P�Q�Q�
:�-�4�4�Z�@�@�@�@��X�j�P�P�P�P�R�R�S�S�
:�-�4�4�Z�@�@�@�@�'�-�-�j�9�9�9���4�,���	&�4�3���	&�4�3���{��$�$�$�$rc#�K�	|D]B}t|ttf��rt||��Ed{V���5||��V��CdSr)rGrjr"rk)�sequence�	test_funcrbs   rrkrksv�����
�����a�$���'�'�	���9�-�-�-�-�-�-�-�-�-�-��)�A�,�,�����	�rr)�r�pgen2rr�pygramrrr@rN�opmaprQr%rLrr#�objectrrCr$rkr3rr�<module>rzs���2�������!�!�!�!�!�!�!�!�3�3�3�3�3�3�3�3���	��	�����
����
�
�U�U�U�U�U�f�U�U�U�nB�B�B�B�J#%�#%�#%�J����r

Zerion Mini Shell 1.0