SILENT KILLERPanel

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

NameTypeSizeLast ModifiedActions
__init__.cpython-35.opt-1.pyc File 136 bytes May 31 2024 13:51:50.
__init__.cpython-35.opt-2.pyc File 128 bytes May 31 2024 13:51:30.
__init__.cpython-35.pyc File 136 bytes May 31 2024 13:51:55.
__main__.cpython-35.opt-1.pyc File 233 bytes May 31 2024 13:51:51.
__main__.cpython-35.opt-2.pyc File 225 bytes May 31 2024 13:51:30.
__main__.cpython-35.pyc File 233 bytes May 31 2024 13:51:55.
btm_matcher.cpython-35.opt-1.pyc File 5316 bytes May 31 2024 13:51:51.
btm_matcher.cpython-35.opt-2.pyc File 3731 bytes May 31 2024 13:51:30.
btm_matcher.cpython-35.pyc File 5316 bytes May 31 2024 13:51:55.
btm_utils.cpython-35.opt-1.pyc File 6786 bytes May 31 2024 13:51:50.
btm_utils.cpython-35.opt-2.pyc File 5254 bytes May 31 2024 13:51:30.
btm_utils.cpython-35.pyc File 6786 bytes May 31 2024 13:51:55.
fixer_base.cpython-35.opt-1.pyc File 6503 bytes May 31 2024 13:51:51.
fixer_base.cpython-35.opt-2.pyc File 3728 bytes May 31 2024 13:51:30.
fixer_base.cpython-35.pyc File 6503 bytes May 31 2024 13:51:55.
fixer_util.cpython-35.opt-1.pyc File 13352 bytes May 31 2024 13:51:51.
fixer_util.cpython-35.opt-2.pyc File 11174 bytes May 31 2024 13:51:30.
fixer_util.cpython-35.pyc File 13352 bytes May 31 2024 13:51:55.
main.cpython-35.opt-1.pyc File 9139 bytes May 31 2024 13:51:50.
main.cpython-35.opt-2.pyc File 7372 bytes May 31 2024 13:51:30.
main.cpython-35.pyc File 9178 bytes May 31 2024 13:51:55.
patcomp.cpython-35.opt-1.pyc File 6035 bytes May 31 2024 13:51:50.
patcomp.cpython-35.opt-2.pyc File 5515 bytes May 31 2024 13:51:30.
patcomp.cpython-35.pyc File 6332 bytes May 31 2024 13:51:55.
pygram.cpython-35.opt-1.pyc File 1259 bytes May 31 2024 13:51:50.
pygram.cpython-35.opt-2.pyc File 1044 bytes May 31 2024 13:51:30.
pygram.cpython-35.pyc File 1259 bytes May 31 2024 13:51:55.
pytree.cpython-35.opt-1.pyc File 26005 bytes May 31 2024 13:51:50.
pytree.cpython-35.opt-2.pyc File 16591 bytes May 31 2024 13:51:30.
pytree.cpython-35.pyc File 26869 bytes May 31 2024 13:51:55.
refactor.cpython-35.opt-1.pyc File 22761 bytes May 31 2024 13:51:50.
refactor.cpython-35.opt-2.pyc File 18701 bytes May 31 2024 13:51:30.
refactor.cpython-35.pyc File 22803 bytes May 31 2024 13:51:55.

Reading File: //opt/alt/python35/lib64//python3.5/lib2to3/__pycache__/btm_matcher.cpython-35.pyc



��Yf��@s�dZdZddlZddlZddlmZddlmZddlm	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 matchingcCs1i|_g|_ttj�|_d|_dS)N�)�transition_table�fixers�nextr�count�id�content)�self�r�8/opt/alt/python35/lib64/python3.5/lib2to3/btm_matcher.py�__init__s		zBMNode.__init__N)�__name__�
__module__�__qualname__�__doc__�	itertoolsrrrrrrrsrc@sReZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�
BottomMatcherzgThe main matcher class. After instantiating the patterns should
    be added using the add_fixer methodcCsFt�|_t�|_|jg|_g|_tjd�|_dS)NZRefactoringTool)	�set�matchr�rootZnodesr	�loggingZ	getLoggerZlogger)rrrrrs
	zBottomMatcher.__init__cCsh|jj|�t|j�}|j�}|j|d|j�}x|D]}|jj|�qJWdS)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�r�g}x[|dD]O}|j|d|�}x1|D])}|j|j|dd�|��qSWq1W|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 automatonrrrN)�
isinstance�tupler�extendrr)r�patternrr ZalternativeZ	end_nodes�endZ	next_noderrrr1s"
+	"	zBottomMatcher.addc	Cs�|j}tt�}xr|D]j}|}x[|r�d|_x<|jD]1}t|tj�rD|jdkrDd|_PqDW|j	dkr�|j}n	|j	}||j
kr�|j
|}x�|jD]-}||kr�g||<||j|�q�Wn�|j}|j
dk	r|j
jrP||j
kry|j
|}x>|jD]3}||j�krdg||<||j|�qBW|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.runcs7td��fdd���|j�td�dS)z<Prints a graphviz diagram of the BM automaton(for debugging)z
digraph g{cs}xv|jj�D]e}|j|}td|j|jt|�t|j�f�|dkrkt|j��|�qWdS)Nz%d -> %d [label=%s] //%sr)rr,�printr�	type_repr�strr	r
)ZnodeZsubnode_keyZsubnode)�
print_noderrr1�s
)
z*BottomMatcher.print_ac.<locals>.print_node�}N)r.r)rr)r1r�print_ac�s

zBottomMatcher.print_acN)	rrrrrr!rr-r3rrrrrs"=rcCsbtsRddlm}x9|jj�D](\}}t|�tkr&|t|<q&Wtj||�S)Nr)�python_symbols)�_type_reprsZpygramr4�__dict__�itemsr*�int�
setdefault)Ztype_numr4�name�valrrrr/�sr/)r�
__author__rr�collectionsrrrZ	btm_utilsr�objectrrr5r/rrrr�<module>s	�

SILENT KILLER Tool