SILENT KILLERPanel

Current Path: > > opt > alt > python310 > lib64 > python3.10 > 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/python310/lib64/python3.10/lib2to3/__pycache__

NameTypeSizeLast ModifiedActions
__init__.cpython-310.opt-1.pyc File 319 bytes June 18 2025 15:55:26.
__init__.cpython-310.opt-2.pyc File 319 bytes June 18 2025 15:55:26.
__init__.cpython-310.pyc File 319 bytes June 18 2025 15:55:26.
__main__.cpython-310.opt-1.pyc File 232 bytes June 18 2025 15:55:26.
__main__.cpython-310.opt-2.pyc File 232 bytes June 18 2025 15:55:26.
__main__.cpython-310.pyc File 232 bytes June 18 2025 15:55:26.
btm_matcher.cpython-310.opt-1.pyc File 4916 bytes June 18 2025 15:55:26.
btm_matcher.cpython-310.opt-2.pyc File 3373 bytes June 18 2025 15:55:29.
btm_matcher.cpython-310.pyc File 4916 bytes June 18 2025 15:55:26.
btm_utils.cpython-310.opt-1.pyc File 6177 bytes June 18 2025 15:55:26.
btm_utils.cpython-310.opt-2.pyc File 4697 bytes June 18 2025 15:55:29.
btm_utils.cpython-310.pyc File 6177 bytes June 18 2025 15:55:26.
fixer_base.cpython-310.opt-1.pyc File 6295 bytes June 18 2025 15:55:26.
fixer_base.cpython-310.opt-2.pyc File 3597 bytes June 18 2025 15:55:29.
fixer_base.cpython-310.pyc File 6295 bytes June 18 2025 15:55:26.
fixer_util.cpython-310.opt-1.pyc File 12084 bytes June 18 2025 15:55:26.
fixer_util.cpython-310.opt-2.pyc File 10041 bytes June 18 2025 15:55:29.
fixer_util.cpython-310.pyc File 12084 bytes June 18 2025 15:55:26.
main.cpython-310.opt-1.pyc File 8700 bytes June 18 2025 15:55:28.
main.cpython-310.opt-2.pyc File 6967 bytes June 18 2025 15:55:29.
main.cpython-310.pyc File 8718 bytes June 18 2025 15:55:26.
patcomp.cpython-310.opt-1.pyc File 5354 bytes June 18 2025 15:55:28.
patcomp.cpython-310.opt-2.pyc File 4871 bytes June 18 2025 15:55:29.
patcomp.cpython-310.pyc File 5552 bytes June 18 2025 15:55:26.
pygram.cpython-310.opt-1.pyc File 1283 bytes June 18 2025 15:55:26.
pygram.cpython-310.opt-2.pyc File 1086 bytes June 18 2025 15:55:29.
pygram.cpython-310.pyc File 1283 bytes June 18 2025 15:55:26.
pytree.cpython-310.opt-1.pyc File 23801 bytes June 18 2025 15:55:28.
pytree.cpython-310.opt-2.pyc File 15311 bytes June 18 2025 15:55:29.
pytree.cpython-310.pyc File 24420 bytes June 18 2025 15:55:26.
refactor.cpython-310.opt-1.pyc File 20727 bytes June 18 2025 15:55:28.
refactor.cpython-310.opt-2.pyc File 16762 bytes June 18 2025 15:55:29.
refactor.cpython-310.pyc File 20755 bytes June 18 2025 15:55:26.

Reading File: //opt/alt/python310/lib64/python3.10/lib2to3/__pycache__/btm_matcher.cpython-310.pyc

o

�=?h��@sldZdZddlZddlZddlmZddlmZddlm	Z	Gdd	�d	e
�ZGd
d�de
�Zia
d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@s eZdZdZe��Zdd�ZdS)�BMNodez?Class for a node of the Aho-Corasick automaton used in matchingcCs"i|_g|_ttj�|_d|_dS)N�)�transition_table�fixers�nextr�count�id�content��self�r�:/opt/alt/python310/lib64/python3.10/lib2to3/btm_matcher.py�__init__s
zBMNode.__init__N)�__name__�
__module__�__qualname__�__doc__�	itertoolsrrrrrrrsrc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�
BottomMatcherzgThe main matcher class. After instantiating the patterns should
    be added using the add_fixer methodcCs0t�|_t�|_|jg|_g|_t�d�|_dS)NZRefactoringTool)	�set�matchr�rootZnodesr	�loggingZ	getLoggerZloggerrrrrrs

zBottomMatcher.__init__cCsH|j�|�t|j�}|��}|j||jd�}|D]}|j�|�qdS)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	�appendrZpattern_treeZget_linear_subpattern�addr)r�fixerZtreeZlinear�match_nodesZ
match_noderrr�	add_fixer%s
�zBottomMatcher.add_fixerc	Cs�|s|gSt|dt�r0g}|dD]}|j||d�}|D]}|�|�|dd�|��qq|S|d|jvrBt�}||j|d<n|j|d}|dd�r\|j|dd�|d�}|S|g}|S)z5Recursively adds a linear pattern to the AC automatonrrrN)�
isinstance�tupler �extendrr)r�patternrr"ZalternativeZ	end_nodes�endZ	next_noderrrr 1s&��zBottomMatcher.addc	Cs�|j}tt�}|D]l}|}|rud|_|jD]}t|tj�r'|jdkr'd|_nq|j	dkr1|j}n|j	}||j
vrL|j
|}|jD]	}||�|�qAn$|j}|j
durY|j
jrYn||j
vrp|j
|}|jD]	}||�|�qf|j
}|sq	|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�;FrN)rr�listZwas_checked�childrenr$rZLeaf�value�typerr	r�parent)	rZleavesZcurrent_ac_nodeZresultsZleafZcurrent_ast_node�childZ
node_tokenr!rrr�runSs@
�



�
�


��"zBottomMatcher.runcs*td��fdd���|j�td�dS)z<Prints a graphviz diagram of the BM automaton(for debugging)z
digraph g{csZ|j��D]%}|j|}td|j|jt|�t|j�f�|dkr&t|j��|�qdS)Nz%d -> %d [label=%s] //%sr)r�keys�printr�	type_repr�strr	r
)ZnodeZsubnode_keyZsubnode��
print_noderrr6�s
�

�z*BottomMatcher.print_ac.<locals>.print_node�}N)r2rrrr5r�print_ac�s
zBottomMatcher.print_acN)	rrrrrr#r r0r8rrrrrs"8rcCsDtsddlm}|j��D]\}}t|�tkr|t|<q
t�||�S)Nr)�python_symbols)�_type_reprsZpygramr9�__dict__�itemsr-�int�
setdefault)Ztype_numr9�name�valrrrr3�s�r3)r�
__author__rr�collectionsrrrZ	btm_utilsr�objectrrr:r3rrrr�<module>s	

SILENT KILLER Tool