ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python3.8/lib2to3/__pycache__/btm_matcher.cpython-38.opt-2.pyc
U

e5d@shdZddlZddlZddlmZddlmZddlmZGddde	Z
Gd	d
d
e	ZiaddZ
dS)
z+George Boutsioukis <gboutsioukis@gmail.com>N)defaultdict)pytree)reduce_treec@seZdZeZddZdS)BMNodecCs"i|_g|_ttj|_d|_dS)N)transition_tablefixersnextrcountidcontentselfr+/usr/lib64/python3.8/lib2to3/btm_matcher.py__init__szBMNode.__init__N)__name__
__module____qualname__	itertoolsrrrrrrrsrc@s4eZdZddZddZddZddZd	d
ZdS)
BottomMatchercCs0t|_t|_|jg|_g|_td|_dS)NZRefactoringTool)	setmatchrrootZnodesr	loggingZ	getLoggerZloggerrrrrrs

zBottomMatcher.__init__cCsH|j|t|j}|}|j||jd}|D]}|j|q2dS)Nstart)r	appendrZpattern_treeZget_linear_subpatternaddr)rfixerZtreeZlinearmatch_nodesZ
match_noderrr	add_fixer%s
zBottomMatcher.add_fixerc	Cs|s
|gSt|dtr`g}|dD]6}|j||d}|D]}|||dd|q:q$|S|d|jkrt}||j|d<n|j|d}|ddr|j|dd|d}n|g}|SdS)Nrrr)
isinstancetuplerextendrr)rpatternrr!alternativeZ	end_nodesendZ	next_noderrrr1s"zBottomMatcher.addc	Cs|j}tt}|D]}|}|rd|_|jD]$}t|tjr*|jdkr*d|_qPq*|j	dkrb|j}n|j	}||j
kr|j
|}|jD]}|||qnH|j}|j
dk	r|j
jrq||j
kr|j
|}|jD]}|||q|j
}qq|S)NT;Fr)rrlistZwas_checkedZchildrenr#rZLeafvaluetyperr	rparent)	rZleavesZcurrent_ac_nodeZresultsZleafZcurrent_ast_nodeZchildZ
node_tokenr rrrrunSs8









zBottomMatcher.runcs*tdfdd|jtddS)Nz
digraph g{csZ|jD]J}|j|}td|j|jt|t|jf|dkrLt|j|q
dS)Nz%d -> %d [label=%s] //%sr)rkeysprintr	type_reprstrr	r
)ZnodeZsubnode_keyZsubnode
print_noderrr4s

z*BottomMatcher.print_ac.<locals>.print_node})r0rrrr3rprint_acs
zBottomMatcher.print_acN)rrrrr"rr.r6rrrrrs
"8rcCsDts8ddlm}|jD]\}}t|tkr|t|<qt||S)Nr)python_symbols)_type_reprsZpygramr7__dict__itemsr,int
setdefault)Ztype_numr7namevalrrrr1s
r1)
__author__rrcollectionsrrrZ	btm_utilsrobjectrrr8r1rrrr<module>s