$29 GRAYBYTE WORDPRESS FILE MANAGER $61

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/python33/lib64/python3.3/lib2to3/__pycache__/

HOME
Current File : /opt/alt/python33/lib64/python3.3/lib2to3/__pycache__//btm_matcher.cpython-33.pyc
�
��f�c@s�dZdZddlZddlZddlmZddlmZddlm	Z	Gdd	�d	e
�ZGd
d�de
�Zia
dd
�ZdS(u�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.u+George Boutsioukis <[email protected]>iN(udefaultdicti(upytree(ureduce_treecBs2|EeZdZdZej�Zdd�ZdS(uBMNodeu?Class for a node of the Aho-Corasick automaton used in matchingcCs1i|_g|_ttj�|_d|_dS(Nu(utransition_tableufixersunextuBMNodeucountuiducontent(uself((u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyu__init__s		uBMNode.__init__N(u__name__u
__module__u__qualname__u__doc__u	itertoolsucountu__init__(u
__locals__((u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyuBMNodesuBMNodecBsV|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS(
u
BottomMatcherugThe main matcher class. After instantiating the patterns should
    be added using the add_fixer methodcCsFt�|_t�|_|jg|_g|_tjd�|_dS(NuRefactoringTool(	usetumatchuBMNodeurootunodesufixersuloggingu	getLoggerulogger(uself((u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyu__init__s
	uBottomMatcher.__init__cCsh|jj|�t|j�}|j�}|j|d|j�}x|D]}|jj|�qJWdS(u�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
        reachedustartN(ufixersuappendureduce_treeupattern_treeuget_linear_subpatternuadduroot(uselfufixerutreeulinearumatch_nodesu
match_node((u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyu	add_fixer%s
uBottomMatcher.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(u5Recursively adds a linear pattern to the AC automatoniustartiN(u
isinstanceutupleuadduextendutransition_tableuBMNode(uselfupatternustartumatch_nodesualternativeu	end_nodesuendu	next_node((u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyuadd1s"
+	"	uBottomMatcher.addc	Cs�|j}tt�}x�|D]y}|}xj|r�d|_x?|jD]4}t|tj�rD|j	dkrDd|_PqDqDW|jdkr�|j	}n	|j}||jkr�|j|}x�|j
D]0}||kr�g||<n||j|�q�Wn�|j}|jdk	r%|jjr%Pn||jkr�|j|}xD|j
D]6}||j�krpg||<n||j|�qKWn|j}q+WqW|S(uuThe 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
        u;iTFN(urootudefaultdictulistuTrueuwas_checkeduchildrenu
isinstanceupytreeuLeafuvalueuFalseutypeutransition_tableufixersuappenduparentuNoneukeys(	uselfuleavesucurrent_ac_nodeuresultsuleafucurrent_ast_nodeuchildu
node_tokenufixer((u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyurunSs>	
		!		

	

uBottomMatcher.runcs7td��fdd���|j�td�dS(u<Prints a graphviz diagram of the BM automaton(for debugging)u
digraph g{cs�xy|jj�D]h}|j|}td|j|jt|�t|j�f�|dkrnt|j�n�|�qWdS(Nu%d -> %d [label=%s] //%si(utransition_tableukeysuprintuidu	type_reprustrufixersucontent(unodeusubnode_keyusubnode(u
print_node(u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyu
print_node�s
)u*BottomMatcher.print_ac.<locals>.print_nodeu}N(uprinturoot(uself((u
print_nodeu8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyuprint_ac�s

uBottomMatcher.print_acN(	u__name__u
__module__u__qualname__u__doc__u__init__u	add_fixeruaddurunuprint_ac(u
__locals__((u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyu
BottomMatchers"=u
BottomMatchercCshtsXddlm}x?|jj�D]+\}}t|�tkr&|t|<q&q&Wntj||�S(Ni(upython_symbols(u_type_reprsupygramupython_symbolsu__dict__uitemsutypeuintu
setdefault(utype_numupython_symbolsunameuval((u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyu	type_repr�su	type_repr(u__doc__u
__author__uloggingu	itertoolsucollectionsudefaultdictuupytreeu	btm_utilsureduce_treeuobjectuBMNodeu
BottomMatcheru_type_reprsu	type_repr(((u8/opt/alt/python33/lib64/python3.3/lib2to3/btm_matcher.pyu<module>s	�


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
24 May 2024 8.33 AM
root / linksafe
0755
__init__.cpython-33.pyc
0.145 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
__init__.cpython-33.pyo
0.145 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
__main__.cpython-33.pyc
0.261 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
__main__.cpython-33.pyo
0.261 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
btm_matcher.cpython-33.pyc
6.728 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
btm_matcher.cpython-33.pyo
6.728 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
btm_utils.cpython-33.pyc
8.581 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
btm_utils.cpython-33.pyo
8.581 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
fixer_base.cpython-33.pyc
8.449 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
fixer_base.cpython-33.pyo
8.449 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
fixer_util.cpython-33.pyc
17.036 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
fixer_util.cpython-33.pyo
17.036 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
main.cpython-33.pyc
10.904 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
main.cpython-33.pyo
10.863 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
patcomp.cpython-33.pyc
8.569 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
patcomp.cpython-33.pyo
8.203 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
pygram.cpython-33.pyc
1.548 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
pygram.cpython-33.pyo
1.548 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
pytree.cpython-33.pyc
36.009 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
pytree.cpython-33.pyo
34.941 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
refactor.cpython-33.pyc
30.326 KB
17 Apr 2024 4.58 PM
root / linksafe
0644
refactor.cpython-33.pyo
30.271 KB
17 Apr 2024 4.58 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF