Your IP : 3.142.36.215


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

�

c��fFm���	dZddlZddlmZdZiad�ZGd�de��ZGd�d	e��Z	Gd
�de��Z
d�ZGd
�de��ZGd�de��Z
Gd�de��ZGd�de��ZGd�de��Zd�ZdS)z#Guido van Rossum <guido@python.org>�N)�StringIOi���c���tsGddlm}|j���D]'\}}t|��tkr
|t|<�(t�||��S)N�)�python_symbols)�_type_reprs�pygramr�__dict__�items�type�int�
setdefault)�type_numr�name�vals    �5/opt/alt/python311/lib64/python3.11/lib2to3/pytree.py�	type_reprrsq���9�*�*�*�*�*�*�(�0�6�6�8�8�	9�	9�I�D�#��C�y�y�C���D��S�!1���!�!�(�H�5�5�5�c���eZdZ	dZdZdZdZdZd�Zd�Z	dZ
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zed���Zed���Zd�Zd�Zd�Zejdkrd�ZdSdS)�BaseN�Fc�8�	t�|��S�N��object�__new__��cls�args�kwdss   rrzBase.__new__1s��E��~�~�c�"�"�"rc�X�	|j|jurtS|�|��Sr)�	__class__�NotImplemented�_eq��self�others  r�__eq__zBase.__eq__6s.��	�
�>���0�0�!�!��x�x����rc��	t�r��NotImplementedErrorr$s  rr#zBase._eqBs��	�"�!rc��	t�rr)�r%s r�clonez
Base.cloneM���	�
"�!rc��	t�rr)r,s r�
post_orderzBase.post_orderUr.rc��	t�rr)r,s r�	pre_orderzBase.pre_order]r.rc�>�	t|t��s|g}g}d}|jjD]5}||ur|�|�|��d}� |�|���6|j���||j_|D]}|j|_�d|_dS�NFT)�
isinstance�list�parent�children�extend�append�changed)r%�new�
l_children�found�ch�xs      r�replacezBase.replacees���=��#�t�$�$�	��%�C��
����+�&�	&�	&�B��T�z�z��?��%�%�c�*�*�*�����!�!�"�%�%�%�%��������)�����	#�	#�A��{�A�H�H�����rc��	|}t|t��s+|jsdS|jd}t|t���+|jS�Nr)r5�Leafr8�lineno�r%�nodes  r�
get_linenozBase.get_lineno|sU��G����T�4�(�(�	$��=�
����=��#�D��T�4�(�(�	$��{�rc�T�|jr|j���d|_dS�NT)r7r;�was_changedr,s rr;zBase.changed�s.���;�	"��K���!�!�!�����rc���	|jrTt|jj��D]<\}}||ur1|j���|jj|=d|_|cS�;dSdSr)r7�	enumerater8r;)r%�irGs   r�removezBase.remove�s���	��;�	�$�T�[�%9�:�:�
�
���4��4�<�<��K�'�'�)�)�)���,�Q�/�"&�D�K��H�H�H�	 �	�	�
�
rc��	|j�dSt|jj��D]3\}}||ur*	|jj|dzcS#t$rYdSwxYw�4dS)Nr)r7rMr8�
IndexError�r%rN�childs   r�next_siblingzBase.next_sibling�s���	��;���4�"�$�+�"6�7�7�	 �	 �H�A�u���}�}� ��;�/��!��4�4�4�4��!� � � ��4�4�4� �����	 �	 s�A�
A�Ac��	|j�dSt|jj��D])\}}||ur |dkrdS|jj|dz
cS�*dS�Nrr)r7rMr8rRs   r�prev_siblingzBase.prev_sibling�sz��	��;���4�"�$�+�"6�7�7�	1�	1�H�A�u���}�}���6�6��4�4��{�+�A�a�C�0�0�0�0��	1�	1rc#�RK�|jD]}|���Ed{V���dSr)r8�leaves�r%rSs  rrYzBase.leaves�sD�����]�	&�	&�E��|�|�~�~�%�%�%�%�%�%�%�%�	&�	&rc�L�|j�dSd|j���zSrV)r7�depthr,s rr\z
Base.depth�s(���;���1��4�;�$�$�&�&�&�&rc�(�	|j}|�dS|jS�N�)rT�prefix)r%�next_sibs  r�
get_suffixzBase.get_suffix�s$��	��$�����2���r��rc�F�t|���d��S)N�ascii)�str�encoder,s r�__str__zBase.__str__�s���t�9�9�#�#�G�,�,�,r)�__name__�
__module__�__qualname__rr7r8rK�was_checkedrr'�__hash__r#r-r0r2rArHr;rO�propertyrTrWrYr\rb�sys�version_inforirrrrrs[��������D�
�F��H��K��K�#�#�#�
����H�	"�	"�	"�"�"�"�"�"�"�"�"�"����.��� � � �
���� � ��X� � �
1�
1��X�
1�&�&�&�'�'�'�
�����&� � �	-�	-�	-�	-�	-�!� rrc��eZdZ				dd�Zd�Zd�ZejdkreZd�Z	d�Z
d�Zd	�Ze
d
���Zejd���Zd�Zd
�Zd�ZdS)�NodeNc��	||_t|��|_|jD]	}||_�
|�||_|r|dd�|_dSd|_dSr)rr6r8r7r`�fixers_applied)r%rr8�contextr`rur?s       r�__init__z
Node.__init__�sq��	���	��X����
��-�	�	�B��B�I�I��� �D�K��	'�"0����"3�D����"&�D���rc�\�	|jj�dt|j���d|j�d�S�N�(�, �))r!rjrrr8r,s r�__repr__z
Node.__repr__�s9��7�#�~�6�6�6�(���3�3�3�3�#�}�}�}�.�	.rc�^�	d�tt|j����Sr^)�join�maprgr8r,s r�__unicode__zNode.__unicode__�s'��	�
�w�w�s�3��
�.�.�/�/�/rrcc�@�	|j|jf|j|jfkSr)rr8r$s  rr#zNode._eq�s"��-��	�4�=�)�e�j�%�.�-I�I�Irc�Z�	t|jd�|jD��|j���S)Nc�6�g|]}|�����Sr)r-)�.0r?s  r�
<listcomp>zNode.clone.<locals>.<listcomp>s ��C�C�C�r����
�
�C�C�Cr�ru)rsrr8rur,s rr-z
Node.clones9��2��D�I�C�C�T�]�C�C�C�#'�#6�8�8�8�	8rc#�\K�	|jD]}|���Ed{V���|V�dSr)r8r0rZs  rr0zNode.post_ordersN����8��]�	*�	*�E��'�'�)�)�)�)�)�)�)�)�)�)��
�
�
�
�
rc#�\K�	|V�|jD]}|���Ed{V���dSr)r8r2rZs  rr2zNode.pre_ordersR����7��
�
�
��]�	)�	)�E����(�(�(�(�(�(�(�(�(�(�	)�	)rc�:�	|jsdS|jdjS)Nr_r�r8r`r,s rr`zNode.prefixs(��	��}�	��2��}�Q��&�&rc�<�|jr||jd_dSdSrCr��r%r`s  rr`zNode.prefixs+���=�	-�&,�D�M�!��#�#�#�	-�	-rc�v�	||_d|j|_||j|<|���dSr)r7r8r;rRs   r�	set_childzNode.set_child s<��	����"&��
�a��� ��
�a���������rc�t�	||_|j�||��|���dSr)r7r8�insertr;rRs   r�insert_childzNode.insert_child*s9��	�����
���Q��&�&�&��������rc�r�	||_|j�|��|���dSr)r7r8r:r;rZs  r�append_childzNode.append_child3s7��	�����
���U�#�#�#��������r�NNN)rjrkrlrwr}r�rprqrir#r-r0r2ror`�setterr�r�r�rrrrsrs�s
������5��� $�'�'�'�'�2.�.�.�0�0�0���&� � ���J�J�J�8�8�8�
���)�)�)��'�'��X�'��]�-�-��]�-�����������rrsc��eZdZ	dZdZdZddgfd�Zd�Zd�Ze	j
dkreZd�Zd	�Z
d
�Zd�Zd�Zed
���Zejd���ZdS)rDr_rNc��	|�|\|_\|_|_||_||_|�||_|dd�|_dSr)�_prefixrE�columnr�valueru)r%rr�rvr`rus      rrwz
Leaf.__init__FsV��	���7>�4�D�L�4�4�;�����	���
���!�D�L�,�Q�Q�Q�/����rc�B�	|jj�d|j�d|j�d�Sry)r!rjrr�r,s rr}z
Leaf.__repr__Ys/��7�#�~�6�6�6�#�y�y�y�#�z�z�z�+�	+rc�<�	|jt|j��zSr)r`rgr�r,s rr�zLeaf.__unicode___s��	�
�{�S���_�_�,�,rrcc�@�	|j|jf|j|jfkSr)rr�r$s  rr#zLeaf._eqjs"��-��	�4�:�&�5�:�u�{�*C�C�Crc�n�	t|j|j|j|j|jff|j���S)Nr�)rDrr�r`rEr�rur,s rr-z
Leaf.clonens=��2��D�I�t�z��[�4�;���"<�=�#'�#6�8�8�8�	8rc#�K�|V�dSrrr,s rrYzLeaf.leavests�����
�
�
�
�
rc#�K�	|V�dSrrr,s rr0zLeaf.post_orderws����8��
�
�
�
�
rc#�K�	|V�dSrrr,s rr2zLeaf.pre_order{s����7��
�
�
�
�
rc��	|jSr)r�r,s rr`zLeaf.prefixs��	��|�rc�<�|���||_dSr)r;r�r�s  rr`zLeaf.prefix�s������������r)rjrkrlr�rEr�rwr}r�rprqrir#r-rYr0r2ror`r�rrrrDrD=s������1��G�
�F�
�F��� "�0�0�0�0�&+�+�+�-�-�-���&� � ���D�D�D�8�8�8��������������X���]����]���rrDc��	|\}}}}|s	||jvr-t|��dkr|dSt|||���St|||���S)Nrr)rv)�
number2symbol�lenrsrD)�gr�raw_noderr�rvr8s      r�convertr��ss���&.�"�D�%��(��2�4�2�+�+�+��x�=�=�A����A�;���D�(�G�4�4�4�4��D�%��1�1�1�1rc�D�eZdZ	dZdZdZd�Zd�Zd�Zdd�Z	dd�Z
d�ZdS)	�BasePatternNc�8�	t�|��Srrrs   rrzBasePattern.__new__�s��L��~�~�c�"�"�"rc���t|j��|j|jg}|r|d�
|d=|r|d�
|jj�dd�tt|�����d�S)N���rzr{r|)	rr�contentrr!rjrr��repr)r%rs  rr}zBasePattern.__repr__�sw���$�)�$�$�d�l�D�I�>���	�t�B�x�'��R���	�t�B�x�'��>�2�2�2�D�I�I�c�$��o�o�4N�4N�4N�4N�O�Orc��	|Srrr,s r�optimizezBasePattern.optimize�s��	�
�rc���	|j�|j|jkrdS|j�5d}|�i}|�||��sdS|r|�|��|�|jr
|||j<dSr4)rr��	_submatch�updater)r%rG�results�rs    r�matchzBasePattern.match�s���		��9� �T�Y�$�)�%;�%;��5��<�#��A��"����>�>�$��*�*�
��u��
"����q�!�!�!���4�9��!%�G�D�I���trc�f�	t|��dkrdS|�|d|��S)NrFr)r�r�)r%�nodesr�s   r�	match_seqzBasePattern.match_seq�s5��	�
�u�:�:��?�?��5��z�z�%��(�G�,�,�,rc#�`K�	i}|r$|�|d|��r
d|fV�dSdSdSrV)r�)r%r�r�s   r�generate_matcheszBasePattern.generate_matches�sX����	�

���	�T�Z�Z��a��!�,�,�	��Q�$�J�J�J�J�J�	�	�	�	rr)rjrkrlrr�rrr}r�r�r�r�rrrr�r��s���������D��G��D�#�#�#�
P�P�P��������2-�-�-�-�����rr�c�&�eZdZdd�Zdd�Zdd�ZdS)�LeafPatternNc�:�	|�|�||_||_||_dSr)rr�r)r%rr�rs    rrwzLeafPattern.__init__�s.��
	�������	������	�	�	rc�j�	t|t��sdSt�|||��S�NF)r5rDr�r��r%rGr�s   rr�zLeafPattern.match
s4��8��$��%�%�	��5�� � ��t�W�5�5�5rc�$�	|j|jkSr)r�r�r�s   rr�zLeafPattern._submatchs��	��|�t�z�)�)rr�r)rjrkrlrwr�r�rrrr�r��sP����������(6�6�6�6�
*�
*�
*�
*�
*�
*rr�c�"�eZdZdZdd�Zdd�ZdS)�NodePatternFNc��	|�|�@t|��}t|��D]!\}}t|t��rd|_�"||_||_||_dSrJ)r6rMr5�WildcardPattern�	wildcardsrr�r)r%rr�rrN�items      rrwzNodePattern.__init__$sn��	������7�m�m�G�$�W�-�-�
*�
*���4��d�O�4�4�*�%)�D�N����	������	�	�	rc��	|jrTt|j|j��D]7\}}|t	|j��kr|�|�|��dS�8dSt	|j��t	|j��krdSt
|j|j��D]\}}|�||��sdS�dS�NTF)r�r�r�r8r�r��zipr�)r%rGr��cr��
subpatternrSs       rr�zNodePattern._submatchAs���	��>�	�(���t�}�E�E�
 �
 ���1���D�M�*�*�*�*��*����q�)�)�)��4�4�+��5��t�|����D�M� 2� 2�2�2��5�!$�T�\�4�=�!A�!A�	�	��J���#�#�E�7�3�3�
��u�u�
��trr�r)rjrkrlr�rwr�rrrr�r� sA�������I�����:�����rr�c�N�eZdZ	ddedfd�Zd�Zdd�Zdd�Zd�Zd�Z	d	�Z
d
�ZdS)r�Nrc��	|�'ttt|����}|D]}�||_||_||_||_dSr)�tupler�r��min�maxr)r%r�r�r�r�alts      rrwzWildcardPattern.__init__ksY��	�.���C��w�/�/�0�0�G��
+�
+��������������	�	�	rc�>�	d}|j�It|j��dkr1t|jd��dkr|jdd}|jdkrM|jdkrB|j�t	|j���S|�$|j|jkr|���S|jdkrft|t��rQ|jdkrF|j|jkr6t|j|j|jz|j|jz|j��S|S)Nrr)r)	r�r�r�r�r�rr�r5r�)r%r�s  rr�zWildcardPattern.optimize�s��9��
��L�$�������"�"�s�4�<��?�';�';�q�'@�'@���a���+�J��8�q�=�=�T�X��]�]��|�#�"��	�2�2�2�2��%�4�9�
��+G�+G�!�*�*�,�,�,��H��M�M�j��_�E�E�M��N�a���D�I���$@�$@�"�:�#5�#'�8�J�N�#:�#'�8�J�N�#:�#-�?�4�4�
4��rc�2�	|�|g|��Sr)r�r�s   rr�zWildcardPattern.match�s��5��~�~�t�f�g�.�.�.rc���	|�|��D]P\}}|t|��kr8|�3|�|��|jrt	|��||j<dS�QdSr�)r�r�r�rr6)r%r�r�r�r�s     rr�zWildcardPattern.match_seq�s|��B��)�)�%�0�0�	�	�D�A�q��C��J�J����&��N�N�1�%�%�%��y�9�-1�%�[�[���	�*��t�t���urc	#�0K�	|j�^t|jdtt|��|j��z��D]#}i}|jr|d|�||j<||fV��$dS|jdkr|�|��V�dSttd��r$tj	}t��t_		|�|d��D]$\}}|jr|d|�||j<||fV��%nJ#t$r=|�
|��D]$\}}|jr|d|�||j<||fV��%YnwxYwttd��r|t_	dSdS#ttd��r|t_	wxYw)Nr�	bare_name�getrefcountr)r��ranger�r�r�r�_bare_name_matches�hasattrrp�stderrr�_recursive_matches�RuntimeError�_iterative_matches)r%r��countr��save_stderrs     rr�z WildcardPattern.generate_matches�s�����
	��<���t�x��S��U���T�X�-F�-F�)F�G�G�
�
�����9�1�#(��%��=�A�d�i�L��Q�h�����	
�
�
�Y�+�
%�
%��)�)�%�0�0�0�0�0�0�0��s�M�*�*�
(�!�j��%�Z�Z��
�
-� $� 7� 7��q� A� A�#�#�H�E�1��y�5�',�V�e�V�}��$�)����(�N�N�N�N�#�� �
#�
#�
#�!%� 7� 7�� >� >�#�#�H�E�1��y�5�',�V�e�V�}��$�)����(�N�N�N�N�#�#�
#�����3�
�.�.�-�!,�C�J�J�J�-�-��7�3�
�.�.�-�!,�C�J�,�,�,�,s+�;D�E2�AE
�E2�	E
�
E2�2#Fc#�
K�	t|��}d|jkrdifV�g}|jD]5}t||��D]"\}}||fV�|�||f���#�6|r�g}|D]�\}}	||kr�||jkr}|jD]u}t|||d���D]Z\}
}|
dkrOi}|�|	��|�|��||
z|fV�|�||
z|f���[�v��|}|��dSdSrC)r�r�r�r�r:r�r�)r%r��nodelenr�r�r�r��new_results�c0�r0�c1�r1s            rr�z"WildcardPattern._iterative_matches�s�����6��e�*�*�����=�=��R�%�K�K�K����<�	'�	'�C�(��e�4�4�
'�
'���1���d�
�
�
�����1�v�&�&�&�&�
'�
�
	"��K�!�

A�

A���B���<�<�B�$�(�N�N�#�|�A�A��&6�s�E�"�#�#�J�&G�&G�A�A�F�B��!�A�v�v�$&�� !������� !�������&(�2�g�q�j� 0� 0� 0� +� 2� 2�B��G�Q�<� @� @� @��
A��"�G��
	"�
	"�
	"�
	"�
	"rc���	d}i}d}t|��}|sE||kr?d}|jD]-}|d�|||��r	|dz
}d}n�.|s||k�?|d|�||j<||fS)NrFTr)r�r�r�r)r%r�r�r��doner��leafs       rr�z"WildcardPattern._bare_name_matches�s���6��������%�j�j���	�5�3�;�;��D���
�
����7�=�=��u��q�1�1���Q�J�E� �D��E���	�5�3�;�;��V�e�V�}��$�)���a�x�rc#�@K�	||jkrdifV�||jkr||jD]v}t||��D]a\}}|�||d�|dz��D]:\}}i}|�|��|�|��||z|fV��;�b�udSdSrV)r�r�r�r�r�r�)	r%r�r�r�r�r�r�r�r�s	         rr�z"WildcardPattern._recursive_matches
s�����6��D�H����R�%�K�K�K��4�8����|�
)�
)��.�s�E�:�:�)�)�F�B��"&�"9�"9�%����*�e�A�g�"N�"N�)�)���B����������������� �2�g�q�j�(�(�(�(�	)�)���
)�
)rr)rjrkrl�HUGErwr�r�r�r�r�r�r�rrrr�r�]s�������
� $���4�!�!�!�!�F���&/�/�/�/�	�	�	�	�+-�+-�+-�Z"�"�"�:��� )�)�)�)�)rr�c�(�eZdZdd�Zd�Zd�Zd�ZdS)�NegatedPatternNc��	|�||_dSr)r�)r%r�s  rrwzNegatedPattern.__init__s��	�������rc��dSr�rrFs  rr�zNegatedPattern.match(s���urc�(�t|��dkSrC)r�)r%r�s  rr�zNegatedPattern.match_seq,s���5�z�z�Q��rc#�K�|j�t|��dkrdifV�dSdS|j�|��D]\}}dSdifV�dSrC)r�r�r�)r%r�r�r�s    rr�zNegatedPattern.generate_matches0sr�����<���5�z�z�Q�����e����������5�5�e�<�<�
�
���1�����R�%�K�K�K�K�Krr)rjrkrlrwr�r�r�rrrr�r�sU����������������	�	�	�	�	rr�c#�2K�	|sdifV�dS|d|dd�}}|�|��D]a\}}|s||fV��t|||d���D]:\}}i}|�|��|�|��||z|fV��;�bdSrV)r�r�)	�patternsr��p�restr�r�r�r�r�s	         rr�r�<s�������%���e�������1�+�x����|�4���(�(��/�/�	%�	%�F�B���
%��"�f�����.�t�U�2�3�3�Z�@�@�%�%�F�B���A��H�H�R�L�L�L��H�H�R�L�L�L��r�'�1�*�$�$�$�$�	%�		%�	%r)�
__author__rp�iorr�rrrrrsrDr�r�r�r�r�r�r�rrr�<module>r�s����3�
�
�
�
�
�����������6�6�6�n-�n-�n-�n-�n-�6�n-�n-�n-�`k�k�k�k�k�4�k�k�k�\L�L�L�L�L�4�L�L�L�\2�2�2�&S�S�S�S�S�&�S�S�S�l)*�)*�)*�)*�)*�+�)*�)*�)*�X:�:�:�:�:�+�:�:�:�zy)�y)�y)�y)�y)�k�y)�y)�y)�x � � � � �[� � � �F%�%�%�%�%r

?>