ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ???????????????????????????????????? ???????????????????????????????????? ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ???????????????????????????????????? ????????????????????????????????????  V~gc@sdZdZddlZddlZddlmZddlmZddlm Z de fd YZ d e fd YZ ia d ZdS( sA 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.s+George Boutsioukis iN(t defaultdicti(tpytree(t reduce_treetBMNodecBs#eZdZejZdZRS(s?Class for a node of the Aho-Corasick automaton used in matchingcCs1i|_g|_ttj|_d|_dS(Nt(ttransition_tabletfixerstnextRtcounttidtcontent(tself((s8/opt/alt/python27/lib64/python2.7/lib2to3/btm_matcher.pyt__init__s  (t__name__t __module__t__doc__t itertoolsRR (((s8/opt/alt/python27/lib64/python2.7/lib2to3/btm_matcher.pyRs t BottomMatchercBs;eZdZdZdZdZdZdZRS(sgThe main matcher class. After instantiating the patterns should be added using the add_fixer methodcCsFt|_t|_|jg|_g|_tjd|_dS(NtRefactoringTool( tsettmatchRtroottnodesRtloggingt getLoggertlogger(R ((s8/opt/alt/python27/lib64/python2.7/lib2to3/btm_matcher.pyR s    cCsh|jj|t|j}|j}|j|d|j}x|D]}|jj|qJWdS(sReduces 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 reachedtstartN(RtappendRt pattern_treetget_linear_subpatterntaddR(R tfixerttreetlineart match_nodest match_node((s8/opt/alt/python27/lib64/python2.7/lib2to3/btm_matcher.pyt add_fixer%s   cCs|s |gSt|dtrg}xU|dD]I}|j|d|}x+|D]#}|j|j|d|qSWq1W|S|d|jkrt}||j|d     !          cs*dGHfd|jdGHdS(s<Prints a graphviz diagram of the BM automaton(for debugging)s digraph g{csvxo|jjD]^}|j|}d|j|jt|t|jfGH|dkrd|jGHn|qWdS(Ns%d -> %d [label=%s] //%si(RR7R t type_reprtstrRR (tnodet subnode_keytsubnode(t print_node(s8/opt/alt/python27/lib64/python2.7/lib2to3/btm_matcher.pyREs '  t}N(R(R ((REs8/opt/alt/python27/lib64/python2.7/lib2to3/btm_matcher.pytprint_acs (R RRR R$RR?RG(((s8/opt/alt/python27/lib64/python2.7/lib2to3/btm_matcher.pyRs   " =cCshtsXddlm}x?|jjD]+\}}t|tkr&|t|s