SILENT KILLERPanel

Current Path: > > opt > alt > python311 > lib64 > python3.11 > lib2to3 > __pycache__


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/alt/python311/lib64/python3.11/lib2to3/__pycache__

NameTypeSizeLast ModifiedActions
__init__.cpython-311.opt-1.pyc File 387 bytes June 23 2025 15:48:01.
__init__.cpython-311.opt-2.pyc File 387 bytes June 23 2025 15:48:01.
__init__.cpython-311.pyc File 387 bytes June 23 2025 15:48:01.
__main__.cpython-311.opt-1.pyc File 331 bytes June 23 2025 15:48:01.
__main__.cpython-311.opt-2.pyc File 331 bytes June 23 2025 15:48:01.
__main__.cpython-311.pyc File 331 bytes June 23 2025 15:48:01.
btm_matcher.cpython-311.opt-1.pyc File 7814 bytes June 23 2025 15:48:01.
btm_matcher.cpython-311.opt-2.pyc File 6264 bytes June 23 2025 15:48:05.
btm_matcher.cpython-311.pyc File 7814 bytes June 23 2025 15:48:01.
btm_utils.cpython-311.opt-1.pyc File 11530 bytes June 23 2025 15:48:01.
btm_utils.cpython-311.opt-2.pyc File 10056 bytes June 23 2025 15:48:05.
btm_utils.cpython-311.pyc File 11530 bytes June 23 2025 15:48:01.
fixer_base.cpython-311.opt-1.pyc File 8431 bytes June 23 2025 15:48:01.
fixer_base.cpython-311.opt-2.pyc File 5752 bytes June 23 2025 15:48:06.
fixer_base.cpython-311.pyc File 8431 bytes June 23 2025 15:48:01.
fixer_util.cpython-311.opt-1.pyc File 22381 bytes June 23 2025 15:48:01.
fixer_util.cpython-311.opt-2.pyc File 20368 bytes June 23 2025 15:48:06.
fixer_util.cpython-311.pyc File 22381 bytes June 23 2025 15:48:01.
main.cpython-311.opt-1.pyc File 15220 bytes June 23 2025 15:48:03.
main.cpython-311.opt-2.pyc File 13484 bytes June 23 2025 15:48:05.
main.cpython-311.pyc File 15266 bytes June 23 2025 15:48:01.
patcomp.cpython-311.opt-1.pyc File 10223 bytes June 23 2025 15:48:03.
patcomp.cpython-311.opt-2.pyc File 9744 bytes June 23 2025 15:48:05.
patcomp.cpython-311.pyc File 10725 bytes June 23 2025 15:48:01.
pygram.cpython-311.opt-1.pyc File 2070 bytes June 23 2025 15:48:01.
pygram.cpython-311.opt-2.pyc File 1873 bytes June 23 2025 15:48:05.
pygram.cpython-311.pyc File 2070 bytes June 23 2025 15:48:01.
pytree.cpython-311.opt-1.pyc File 35210 bytes June 23 2025 15:48:03.
pytree.cpython-311.opt-2.pyc File 26861 bytes June 23 2025 15:48:05.
pytree.cpython-311.pyc File 36993 bytes June 23 2025 15:48:01.
refactor.cpython-311.opt-1.pyc File 38444 bytes June 23 2025 15:48:03.
refactor.cpython-311.opt-2.pyc File 34539 bytes June 23 2025 15:48:05.
refactor.cpython-311.pyc File 38526 bytes June 23 2025 15:48:01.

Reading File: //opt/alt/python311/lib64/python3.11/lib2to3/__pycache__/btm_matcher.cpython-311.pyc

�

!A?h����dZdZddlZddlZddlmZddlmZddlm	Z	Gd�d	e
��ZGd
�de
��Zia
d�ZdS)
a�A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes for further
matching. This reduces significantly the number of candidate nodes.z+George Boutsioukis <gboutsioukis@gmail.com>�N)�defaultdict�)�pytree)�reduce_treec�6�eZdZdZej��Zd�ZdS)�BMNodez?Class for a node of the Aho-Corasick automaton used in matchingc�l�i|_g|_ttj��|_d|_dS)N�)�transition_table�fixers�nextr�count�id�content��selfs �:/opt/alt/python311/lib64/python3.11/lib2to3/btm_matcher.py�__init__zBMNode.__init__s-�� "�������v�|�$�$��������N)�__name__�
__module__�__qualname__�__doc__�	itertoolsrr�rrrrs8������I�I��I�O���E�����rrc�0�eZdZdZd�Zd�Zd�Zd�Zd�ZdS)�
BottomMatcherzgThe main matcher class. After instantiating the patterns should
    be added using the add_fixer methodc��t��|_t��|_|jg|_g|_t
jd��|_dS)N�RefactoringTool)	�set�matchr�root�nodesr�logging�	getLogger�loggerrs rrzBottomMatcher.__init__sA���U�U��
��H�H��	��i�[��
�����'�(9�:�:����rc��|j�|��t|j��}|���}|�||j���}|D]}|j�|���dS)z�Reduces a fixer's pattern tree to a linear path and adds it
        to the matcher(a common Aho-Corasick automaton). The fixer is
        appended on the matching states and called when they are
        reached��startN)r�appendr�pattern_tree�get_linear_subpattern�addr")r�fixer�tree�linear�match_nodes�
match_nodes      r�	add_fixerzBottomMatcher.add_fixer%s���
	
����5�!�!�!��5�-�.�.���+�+�-�-���h�h�v�T�Y�h�7�7��%�	,�	,�J���$�$�U�+�+�+�+�	,�	,rc	���|s|gSt|dt��r\g}|dD]O}|�||���}|D]3}|�|�|dd�|�����4�P|S|d|jvrt��}||j|d<n|j|d}|dd�r |�|dd�|���}n|g}|S)z5Recursively adds a linear pattern to the AC automatonrr(rN)�
isinstance�tupler-�extendrr)r�patternr)r1�alternative�	end_nodes�end�	next_nodes        rr-zBottomMatcher.add1s&���	��7�N��g�a�j�%�(�(�	��K�&�q�z�
C�
C��!�H�H�[��H�>�>�	�$�C�C�C��&�&�t�x�x������S�'A�'A�B�B�B�B�C����q�z��!7�7�7�"�H�H�	�5>��&�w�q�z�2�2�"�2�7�1�:�>�	��q�r�r�{�
(� �H�H�W�Q�R�R�[�	�H�B�B�	�	�&�K�	��rc�6�|j}tt��}|D]�}|}|r�d|_|jD]0}t|tj��r|jdkr	d|_n�1|j	dkr|j}n|j	}||j
vr3|j
|}|jD]}||�|���nV|j}|j
�
|j
jrnD||j
vr2|j
|}|jD]}||�|���|j
}|��|S)auThe main interface with the bottom matcher. The tree is
        traversed from the bottom using the constructed
        automaton. Nodes are only checked once as the tree is
        retraversed. When the automaton fails, we give it one more
        shot(in case the above tree matches as a whole with the
        rejected leaf), then we break for the next leaf. There is the
        special case of multiple arguments(see code comments) where we
        recheck the nodes

        Args:
           The leaves of the AST tree to be matched

        Returns:
           A dictionary of node matches with fixers as the keys
        T�;Fr)r"r�list�was_checked�childrenr5r�Leaf�value�typerrr*�parent)	r�leaves�current_ac_node�results�leaf�current_ast_node�child�
node_tokenr.s	         r�runzBottomMatcher.runSs�� �)���d�#�#���#	;�#	;�D�#��"�!
;�/3� �,�-�6���E�!�%���5�5��%�+��:L�:L�7<�(�4����#�(�A�-�-�!1�!7�J�J�!1�!6�J���!A�A�A�&5�&F�z�&R�O�!0�!7�@�@�����-�-�.>�?�?�?�?�@�'+�i�O�(�/�;�,�3�?�<��"�_�%E�E�E�*9�*J�:�*V��%4�%;�D�D�E�#�E�N�1�1�2B�C�C�C�C�#3�#:� �C#�!
;��D�rc�n��td���fd���|j��td��dS)z<Prints a graphviz diagram of the BM automaton(for debugging)z
digraph g{c
�"��|j���D]s}|j|}td|j|jt	|��t|j��fz��|dkrt|j���|���tdS)Nz%d -> %d [label=%s] //%sr)r�keys�printr�	type_repr�strrr)�node�subnode_key�subnode�
print_nodes   �rrWz*BottomMatcher.print_ac.<locals>.print_node�s����#�4�9�9�;�;�
$�
$���/��<���0��w��
�I�k�,B�,B�C���DW�DW�X�Y�Z�Z�Z��!�#�#��'�/�*�*�*��
�7�#�#�#�#�

$�
$r�}N)rQr")rrWs @r�print_aczBottomMatcher.print_ac�sM���
�l����	$�	$�	$�	$�	$�	�
�4�9����
�c�
�
�
�
�
rN)	rrrrrr3r-rMrYrrrrrsk������+�+�;�;�;�
,�
,�
,� � � �D6�6�6�p����rrc���tsGddlm}|j���D]'\}}t|��tkr
|t|<�(t�||��S)Nr)�python_symbols)�_type_reprs�pygramr[�__dict__�itemsrD�int�
setdefault)�type_numr[�name�vals    rrRrR�sq���9�*�*�*�*�*�*�(�0�6�6�8�8�	9�	9�I�D�#��C�y�y�C���D��S�!1���!�!�(�H�5�5�5r)r�
__author__r$r�collectionsrr
r�	btm_utilsr�objectrrr\rRrrr�<module>ris���G�G�;�
���������#�#�#�#�#�#�������"�"�"�"�"�"������V����}�}�}�}�}�F�}�}�}�@��6�6�6�6�6r

SILENT KILLER Tool