SILENT KILLERPanel

Current Path: > > usr > lib64 > python3.6 > 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: //usr/lib64/python3.6/lib2to3/__pycache__

NameTypeSizeLast ModifiedActions
__init__.cpython-36.opt-1.pyc File 123 bytes July 01 2025 22:14:43.
__init__.cpython-36.opt-2.pyc File 123 bytes July 01 2025 22:14:43.
__init__.cpython-36.pyc File 123 bytes July 01 2025 22:14:43.
__main__.cpython-36.opt-1.pyc File 207 bytes July 01 2025 22:14:43.
__main__.cpython-36.opt-2.pyc File 207 bytes July 01 2025 22:14:43.
__main__.cpython-36.pyc File 207 bytes July 01 2025 22:14:43.
btm_matcher.cpython-36.opt-1.pyc File 4934 bytes July 01 2025 22:14:43.
btm_matcher.cpython-36.opt-2.pyc File 3363 bytes July 01 2025 22:14:46.
btm_matcher.cpython-36.pyc File 4934 bytes July 01 2025 22:14:43.
btm_utils.cpython-36.opt-1.pyc File 6133 bytes July 01 2025 22:14:43.
btm_utils.cpython-36.opt-2.pyc File 4613 bytes July 01 2025 22:14:46.
btm_utils.cpython-36.pyc File 6133 bytes July 01 2025 22:14:43.
fixer_base.cpython-36.opt-1.pyc File 6225 bytes July 01 2025 22:14:43.
fixer_base.cpython-36.opt-2.pyc File 3464 bytes July 01 2025 22:14:46.
fixer_base.cpython-36.pyc File 6225 bytes July 01 2025 22:14:43.
fixer_util.cpython-36.opt-1.pyc File 12038 bytes July 01 2025 22:14:43.
fixer_util.cpython-36.opt-2.pyc File 9870 bytes July 01 2025 22:14:46.
fixer_util.cpython-36.pyc File 12038 bytes July 01 2025 22:14:43.
main.cpython-36.opt-1.pyc File 8498 bytes July 01 2025 22:14:44.
main.cpython-36.opt-2.pyc File 6743 bytes July 01 2025 22:14:46.
main.cpython-36.pyc File 8532 bytes July 01 2025 22:14:43.
patcomp.cpython-36.opt-1.pyc File 5357 bytes July 01 2025 22:14:44.
patcomp.cpython-36.opt-2.pyc File 4847 bytes July 01 2025 22:14:46.
patcomp.cpython-36.pyc File 5604 bytes July 01 2025 22:14:43.
pygram.cpython-36.opt-1.pyc File 1178 bytes July 01 2025 22:14:43.
pygram.cpython-36.opt-2.pyc File 973 bytes July 01 2025 22:14:46.
pygram.cpython-36.pyc File 1178 bytes July 01 2025 22:14:43.
pytree.cpython-36.opt-1.pyc File 24449 bytes July 01 2025 22:14:44.
pytree.cpython-36.opt-2.pyc File 15055 bytes July 01 2025 22:14:46.
pytree.cpython-36.pyc File 25136 bytes July 01 2025 22:14:43.
refactor.cpython-36.opt-1.pyc File 20758 bytes July 01 2025 22:14:44.
refactor.cpython-36.opt-2.pyc File 16710 bytes July 01 2025 22:14:46.
refactor.cpython-36.pyc File 20791 bytes July 01 2025 22:14:43.

Reading File: //usr/lib64/python3.6/lib2to3/__pycache__/btm_matcher.cpython-36.pyc

3


 \��@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 eZdZdZej�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�+/usr/lib64/python3.6/lib2to3/btm_matcher.py�__init__szBMNode.__init__N)�__name__�
__module__�__qualname__�__doc__�	itertoolsrrrrrrrsrc@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|_tjd�|_dS)NZRefactoringTool)	�set�matchr�rootZnodesr	�loggingZ	getLoggerZlogger)rrrrrs

zBottomMatcher.__init__cCsL|jj|�t|j�}|j�}|j||jd�}x|D]}|jj|�q4WdS)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_fixercCs�|s
|gSt|dt�rhg}xF|dD]:}|j||d�}x&|D]}|j|j|dd�|��q>Wq&W|S|d|jkr�t�}||j|d<n|j|d}|dd�r�|j|dd�|d�}n|g}|SdS)z5Recursively adds a linear pattern to the AC automatonr)rrN)�
isinstance�tupler�extendrr)r�patternrr �alternativeZ	end_nodes�endZ	next_noderrrr1s"
"zBottomMatcher.addc	Cs0|j}tt�}�x|D�]}|}�x|�r&d|_x,|jD]"}t|tj�r8|jdkr8d|_Pq8W|j	dkrp|j}n|j	}||j
kr�|j
|}x�|jD]"}||kr�g||<||j|�q�Wnd|j}|j
dk	r�|j
jr�P||j
k�r|j
|}x2|jD](}||j�k�rg||<||j|�q�W|j
}q$WqW|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_checkedZchildrenr"rZLeaf�value�typerr	r�parent�keys)	rZleavesZcurrent_ac_nodeZresultsZleafZcurrent_ast_nodeZchildZ
node_tokenrrrr�runSs>





zBottomMatcher.runcs*td��fdd���|j�td�dS)z<Prints a graphviz diagram of the BM automaton(for debugging)z
digraph g{cs^xX|jj�D]J}|j|}td|j|jt|�t|j�f�|dkrNt|j��|�qWdS)Nz%d -> %d [label=%s] //%sr)rr-�printr�	type_repr�strr	r
)ZnodeZsubnode_keyZsubnode)�
print_noderrr2�s

z*BottomMatcher.print_ac.<locals>.print_node�}N)r/r)rr)r2r�print_ac�s
zBottomMatcher.print_acN)	rrrrrr!rr.r4rrrrrs"=rcCsHts<ddlm}x*|jj�D]\}}t|�tkr|t|<qWtj||�S)Nr)�python_symbols)�_type_reprsZpygramr5�__dict__�itemsr+�int�
setdefault)Ztype_numr5�name�valrrrr0�sr0)r�
__author__rr�collectionsrrrZ	btm_utilsr�objectrrr6r0rrrr�<module>s	

SILENT KILLER Tool