Your IP : 18.217.241.235


Current Path : /opt/alt/python312/lib64/python3.12/lib2to3/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/lib2to3/__pycache__/pytree.cpython-312.opt-2.pyc

�

�Q�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�Zy)z#Guido van Rossum <guido@python.org>�N)�StringIOi���c���tsDddlm}|jj	�D]!\}}t|�tk(s�|t|<�#tj||�S)N�)�python_symbols)�_type_reprs�pygramr�__dict__�items�type�int�
setdefault)�type_numr�name�vals    �5/opt/alt/python312/lib64/python3.12/lib2to3/pytree.py�	type_reprrsO���*�(�0�0�6�6�8�I�D�#��C�y�C��D��S�!1�9��!�!�(�H�5�5�c��eZdZ	dZdZdZdZdZd�Zd�Z	dZ
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zed��Zed��Zd�Zd�Zd�Zej4dkrd�Zyy)�BaseN�Fc�.�	tj|�S�N��object�__new__��cls�args�kwdss   rrzBase.__new__1s��E��~�~�c�"�"rc�b�	|j|jurtS|j|�Sr)�	__class__�NotImplemented�_eq��self�others  r�__eq__zBase.__eq__6s-��	�
�>�>����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|t�s|g}g}d}|jjD]-}||ur|�|j	|�d}�|j|��/|jj
�||j_|D]}|j|_�d|_y�NFT)�
isinstance�list�parent�children�extend�append�changed)r%�new�
l_children�found�ch�xs      r�replacezBase.replacees���=��#�t�$��%�C��
����+�+�&�&�B��T�z��?��%�%�c�*����!�!�"�%�'�	
������)������A��{�{�A�H����rc��	|}t|t�s-|jsy|jd}t|t�s�-|jS�Nr)r5�Leafr8�lineno�r%�nodes  r�
get_linenozBase.get_lineno|sD��G����T�4�(��=�=���=�=��#�D��T�4�(��{�{�rc�^�|jr|jj�d|_y�NT)r7r;�was_changedr,s rr;zBase.changed�s!���;�;��K�K���!���rc���	|jrht|jj�D]E\}}||us�|jj�|jj|=d|_|cSyyr)r7�	enumerater8r;)r%�irGs   r�removezBase.remove�sg��	��;�;�$�T�[�[�%9�%9�:���4��4�<��K�K�'�'�)����,�,�Q�/�"&�D�K��H�;�rc���	|j�yt|jj�D](\}}||us�	|jj|dzcSy#t$rYywxYw)Nr)r7rMr8�
IndexError�r%rN�childs   r�next_siblingzBase.next_sibling�sn��	��;�;���"�$�+�+�"6�"6�7�H�A�u���}� ��;�;�/�/��!��4�4�8��"� �� �s�A�	A'�&A'c��	|j�yt|jj�D].\}}||us�|dk(ry|jj|dz
cSy�Nrr)r7rMr8rRs   r�prev_siblingzBase.prev_sibling�s_��	��;�;���"�$�+�+�"6�"6�7�H�A�u���}���6���{�{�+�+�A�a�C�0�0�	8rc#�bK�|jD]}|j�Ed{����y7��wr)r8�leaves�r%rSs  rrYzBase.leaves�s&�����]�]�E��|�|�~�%�%�#�%�s�#/�-�/c�V�|j�yd|jj�zSrV)r7�depthr,s rr\z
Base.depth�s'���;�;����4�;�;�$�$�&�&�&rc�:�	|j}|�y|jS�N�)rT�prefix)r%�next_sibs  r�
get_suffixzBase.get_suffix�s'��	��$�$��������r��rc�6�t|�jd�S)N�ascii)�str�encoder,s r�__str__zBase.__str__�s���t�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�	"�"�"�"��.� �
�� �� � �
1��
1�&�'�
����&� �	-�!rrc��eZdZ				dd�Zd�Zd�ZejdkDreZd�Z	d�Z
d�Zd	�Ze
d
��Zejd��Zd�Zd
�Zd�Zy)�NodeNc��	||_t|�|_|jD]	}||_�|�||_|r|dd|_yd|_yr)rr6r8r7r`�fixers_applied)r%rr8�contextr`rur?s       r�__init__z
Node.__init__�sW��	���	��X���
��-�-�B��B�I� ��� �D�K��"0��"3�D��"&�D�rc�|�	|jj�dt|j��d|j�d�S�N�(�, �))r!rjrrr8r,s r�__repr__z
Node.__repr__�s/��7�#�~�~�6�6�(����3�#�}�}�.�	.rc�V�	djtt|j��Sr^)�join�maprgr8r,s r�__unicode__zNode.__unicode__�s#��	�
�w�w�s�3��
�
�.�/�/rrcc�f�	|j|jf|j|jfk(Sr)rr8r$s  rr#zNode._eq�s*��-��	�	�4�=�=�)�e�j�j�%�.�.�-I�I�Irc��	t|j|jD�cgc]}|j���c}|j��Scc}w�N)ru)rsrr8r-ru)r%r?s  rr-z
Node.clones?��2��D�I�I�T�]�]�C�]�r����
�]�C�#'�#6�#6�8�	8��Cs�A

c#�lK�	|jD]}|j�Ed{����|��y7��wr)r8r0rZs  rr0zNode.post_orders3����8��]�]�E��'�'�)�)�)�#��
�
*�s�$4�2�4c#�lK�	|��|jD]}|j�Ed{����y7��wr)r8r2rZs  rr2zNode.pre_orders/����7��
��]�]�E����(�(�(�#�(�s�(4�2�4c�P�	|jsy|jdjS)Nr_r�r8r`r,s rr`zNode.prefixs(��	��}�}���}�}�Q��&�&�&rc�F�|jr||jd_yyrCr��r%r`s  rr`zNode.prefixs���=�=�&,�D�M�M�!��#�rc�z�	||_d|j|_||j|<|j�yr)r7r8r;rRs   r�	set_childzNode.set_child s8��	����"&��
�
�a��� ��
�
�a�����rc�l�	||_|jj||�|j�yr)r7r8�insertr;rRs   r�insert_childzNode.insert_child*s-��	�����
�
���Q��&����rc�j�	||_|jj|�|j�yr)r7r8r:r;rZs  r�append_childzNode.append_child3s+��	�����
�
���U�#����r�NNN)rjrkrlrwr}r�rprqrir#r-r0r2ror`�setterr�r�r�rrrrsrs�s���5��� $�'�2.�0����&� ���J�8�
�)��'��'��]�]�-��-���rrsc��eZdZ	dZdZdZddgfd�Zd�Zd�Ze	jdkDreZd�Zd	�Z
d
�Zd�Zd�Zed
��Zej&d��Zy)rDr_rNc�z�	|�|\|_\|_|_||_||_|�||_|dd|_yr)�_prefixrE�columnr�valueru)r%rr�rvr`rus      rrwz
Leaf.__init__FsL��	���7>�4�D�L�4�4�;�����	���
���!�D�L�,�Q�/��rc�j�	|jj�d|j�d|j�d�Sry)r!rjrr�r,s rr}z
Leaf.__repr__Ys*��7�#�~�~�6�6�#�y�y�#�z�z�+�	+rc�H�	|jt|j�zSr)r`rgr�r,s rr�zLeaf.__unicode___s ��	�
�{�{�S����_�,�,rrcc�f�	|j|jf|j|jfk(Sr)rr�r$s  rr#zLeaf._eqjs*��-��	�	�4�:�:�&�5�:�:�u�{�{�*C�C�Crc��	t|j|j|j|j|j
ff|j��Sr�)rDrr�r`rEr�rur,s rr-z
Leaf.clonens@��2��D�I�I�t�z�z��[�[�4�;�;����"<�=�#'�#6�#6�8�	8rc#�K�|��y�wrrr,s rrYzLeaf.leavests�����
�s�c#�K�	|��y�wrrr,s rr0zLeaf.post_orderws����8��
���	c#�K�	|��y�wrrr,s rr2zLeaf.pre_order{s����7��
�r�c��	|jSr)r�r,s rr`zLeaf.prefixs��	��|�|�rc�2�|j�||_yr)r;r�r�s  rr`zLeaf.prefix�s��������r)rjrkrlr�rEr�rwr}r�rprqrir#r-rYr0r2ror`r�rrrrDrD=s���1��G�
�F�
�F��� "�0�&+�-����&� ���D�8���������]�]���rrDc��	|\}}}}|s||jvr!t|�dk(r|dSt|||��St|||��S)Nrr)rv)�
number2symbol�lenrsrD)�gr�raw_noderr�rvr8s      r�convertr��s]���&.�"�D�%��(��4�2�+�+�+��x�=�A���A�;���D�(�G�4�4��D�%��1�1rc�B�eZdZ	dZdZdZd�Zd�Zd�Zdd�Z	dd�Z
d�Zy)	�BasePatternNc�.�	tj|�Srrrs   rrzBasePattern.__new__�s��L��~�~�c�"�"rc���t|j�|j|jg}|r|d�|d=|r|d��|jj
�ddj
tt|���d�S)N���rzr{r|)	rr�contentrr!rjrr��repr)r%rs  rr}zBasePattern.__repr__�sd���$�)�)�$�d�l�l�D�I�I�>���t�B�x�'��R���t�B�x�'��>�>�2�2�D�I�I�c�$��o�4N�O�Orc��	|Srrr,s r�optimizezBasePattern.optimize�s��	�
�rc��	|j�|j|jk7ry|j�,d}|�i}|j||�sy|r|j|�|�|jr|||j<yr4)rr��	_submatch�updater)r%rG�results�rs    r�matchzBasePattern.match�s|��		��9�9� �T�Y�Y�$�)�)�%;���<�<�#��A��"����>�>�$��*������q�!���4�9�9�!%�G�D�I�I��rc�L�	t|�dk7ry|j|d|�S)NrFr)r�r�)r%�nodesr�s   r�	match_seqzBasePattern.match_seq�s,��	�
�u�:��?���z�z�%��(�G�,�,rc#�PK�	i}|r|j|d|�rd|f��yyy�wrV)r�)r%r�r�s   r�generate_matcheszBasePattern.generate_matches�s6����	�

���T�Z�Z��a��!�,��Q�$�J�-�5�s�$&r)rjrkrlrr�rrr}r�r�r�r�rrrr�r��s7����D��G��D�#�
P���2-�rr�c�$�eZdZdd�Zdd�Zdd�Zy)�LeafPatternNc�8�	|�|�||_||_||_yr)rr�r)r%rr�rs    rrwzLeafPattern.__init__�s*��
	�������	������	rc�T�	t|t�sytj|||�S�NF)r5rDr�r��r%rGr�s   rr�zLeafPattern.match
s'��8��$��%��� � ��t�W�5�5rc�6�	|j|jk(Sr)r�r�r�s   rr�zLeafPattern._submatchs��	��|�|�t�z�z�)�)rr�r)rjrkrlrwr�r�rrrr�r��s���(6�
*rr�c� �eZdZdZdd�Zdd�Zy)�NodePatternFNc��	|�|�6t|�}t|�D]\}}t|t�s�d|_�||_||_||_yrJ)r6rMr5�WildcardPattern�	wildcardsrr�r)r%rr�rrN�items      rrwzNodePattern.__init__$sY��	������7�m�G�$�W�-���4��d�O�4�%)�D�N�.���	������	rc��	|jrVt|j|j�D]2\}}|t	|j�k(s�|�|j|�yyt	|j�t	|j�k7ryt
|j|j�D]\}}|j||�r�yy�NTF)r�r�r�r8r�r��zipr�)r%rGr��cr��
subpatternrSs       rr�zNodePattern._submatchAs���	��>�>�(����t�}�}�E���1���D�M�M�*�*��*����q�)��	F�
��t�|�|���D�M�M� 2�2��!$�T�\�\�4�=�=�!A��J���#�#�E�7�3��"B�rr�r)rjrkrlr�rwr�rrrr�r� s���I��:rr�c�L�eZdZ	ddedfd�Zd�Zdd�Zdd�Zd�Zd�Z	d	�Z
d
�Zy)r�Nrc��	|� ttt|��}|D]}�||_||_||_||_yr)�tupler�r��min�maxr)r%r�r�r�r�alts      rrwzWildcardPattern.__init__ksE��	�.���C��w�/�0�G���w������������	rc��	d}|j�Et|j�dk(r-t|jd�dk(r|jdd}|jdk(r\|jdk(rM|j�t	|j
��S|�)|j
|j
k(r|j
�S|jdkr�t|t�rx|jdkri|j
|j
k(rPt|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�L�$�������"�s�4�<�<��?�';�q�'@����a���+�J��8�8�q�=�T�X�X��]��|�|�#�"��	�	�2�2��%�4�9�9�
���+G�!�*�*�,�,��H�H��M�j��_�E��N�N�a��D�I�I����$@�"�:�#5�#5�#'�8�8�J�N�N�#:�#'�8�8�J�N�N�#:�#-�?�?�4�
4��rc�*�	|j|g|�Sr)r�r�s   rr�zWildcardPattern.match�s��5��~�~�t�f�g�.�.rc���	|j|�D]L\}}|t|�k(s�|�5|j|�|jrt	|�||j<yyr�)r�r�r�rr6)r%r�r�r�r�s     rr�zWildcardPattern.match_seq�s\��B��)�)�%�0�D�A�q��C��J���&��N�N�1�%��y�y�-1�%�[���	�	�*��
1�rc	#�(K�	|j�bt|jdtt|�|j�z�D](}i}|j
r|d|||j
<||f���*y|j
dk(r|j
|���yttd�r#tj}t�t_		|j|d�D])\}}|j
r|d|||j
<||f���+	ttd�rt_	yy#t$r@|j|�D])\}}|j
r|d|||j
<||f���+Y�ewxYw#ttd�rt_	wwxYw�w)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�si����
	��<�<���t�x�x��S��U��T�X�X�-F�)F�G�����9�9�#(��%�=�A�d�i�i�L��Q�h��	H�
�Y�Y�+�
%��)�)�%�0�0��s�M�*�!�j�j��%�Z��
�
-� $� 7� 7��q� A�H�E�1��y�y�',�V�e�}��$�)�)����(�N�!B��3�
�.�!,�C�J�/�� �
#�!%� 7� 7�� >�H�E�1��y�y�',�V�e�}��$�)�)����(�N�!?�
#���3�
�.�!,�C�J�/�s=�CF�	>D%�E1�F�%AE.�+E1�-E.�.E1�1F�Fc#�K�	t|�}d|jk\rdif��g}|jD]/}t||�D]\}}||f��|j	||f�� �1|r�g}|D]�\}}	||ks�||j
ks�|jD]b}t|||d�D]N\}
}|
dkDs�i}|j
|	�|j
|�||
z|f��|j	||
z|f��P�d��|}|r��yy�wrC)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����<�<�C�(��e�4���1���d�
�����1�v�&�5� ���K�!���B���<�B�$�(�(�N�#�|�|��&6�s�E�"�#�J�&G�F�B��!�A�v�$&�� !����� !�����&(�2�g�q�j� 0� +� 2� 2�B��G�Q�<� @�
'H� ,�"�"�G��s�A3D�6D�)D�0A
D�>Dc���	d}i}d}t|�}|sA||kr<d}|jD]#}|dj|||�s�|dz
}d}n|s||kr�<|d|||j<||fS)NrFTr)r�r�r�r)r%r�r�r��doner��leafs       rr�z"WildcardPattern._bare_name_matches�s���6��������%�j���5�3�;��D�������7�=�=��u��q�1��Q�J�E� �D��	%��5�3�;��V�e�}��$�)�)���a�x�rc#�<K�	||jk\rdif��||jkrs|jD]c}t||�D]R\}}|j	||d|dz�D]2\}}i}|j|�|j|�||z|f���4�T�eyy�wrV)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�H���R�%�K��4�8�8���|�|��.�s�E�:�F�B��"&�"9�"9�%���*�e�A�g�"N���B������������� �2�g�q�j�(�	#O�;�$��s�BBr)rjrkrl�HUGErwr�r�r�r�r�r�r�rrrr�r�]s<��
� $���4�!�F�&/�	�+-�Z"�:� )rr�c�&�eZdZdd�Zd�Zd�Zd�Zy)�NegatedPatternNc��	|�||_yr)r�)r%r�s  rrwzNegatedPattern.__init__s��	�����rc��yr�rrFs  rr�zNegatedPattern.match(s��rc��t|�dk(SrC)r�)r%r�s  rr�zNegatedPattern.match_seq,s���5�z�Q��rc#�K�|j�t|�dk(rdif��yy|jj|�D]\}}ydif��y�wrC)r�r�r�)r%r�r�r�s    rr�zNegatedPattern.generate_matches0sT�����<�<���5�z�Q����e������5�5�e�<���1��=��R�%�K�s�AAr)rjrkrlrwr�r�r�rrrr�r�s�����	rr�c#�K�	|sdif��y|d|dd}}|j|�D]R\}}|s||f���t|||d�D]2\}}i}|j|�|j|�||z|f���4�Ty�wrV)r�r�)	�patternsr��p�restr�r�r�r�r�s	         rr�r�<s���������e���1�+�x���|�4���(�(��/�F�B����"�f��.�t�U�2�3�Z�@�F�B���A��H�H�R�L��H�H�R�L��r�'�1�*�$�	A�	0�s�A<A>)�
__author__rp�iorr�rrrrrsrDr�r�r�r�r�r�r�rrr�<module>r�s����3�
�
������6�n-�6�n-�`k�4�k�\L�4�L�\2�&S�&�S�l)*�+�)*�X:�+�:�zy)�k�y)�x �[� �F%r

?>