403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/lib2to3/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/lib2to3/btm_utils.pyc
ó
—|_c@s§dZddlmZddlmZmZddlmZmZeZ	eZ
ejZeZ
dZdZdZdefd	„ƒYZd
d
„Zd„Zd„Zd
S(s0Utility functions used by the btm_matcher modulei(tpytree(tgrammarttoken(tpattern_symbolstpython_symbolsiÿÿÿÿiþÿÿÿiýÿÿÿtMinNodecBsAeZdZddd„Zd„Zd„Zd„Zd„ZRS(s‰This class serves as an intermediate representation of the
    pattern tree during the conversion to sets of leaf-to-root
    subpatternscCsC||_||_g|_t|_d|_g|_g|_dS(N(	ttypetnametchildrentFalsetleaftNonetparenttalternativestgroup(tselfRR((s'/usr/lib/python2.7/lib2to3/btm_utils.pyt__init__s						cCst|jƒdt|jƒS(Nt (tstrRR(R((s'/usr/lib/python2.7/lib2to3/btm_utils.pyt__repr__scCsU|}g}xB|rP|jtkr|jj|ƒt|jƒt|jƒkr|t|jƒg}g|_|j}qq|j}d}Pn|jt	kr|j
j|ƒt|j
ƒt|jƒkrót|j
ƒ}g|_
|j}qq|j}d}Pn|jtj
kr4|jr4|j|jƒn|j|jƒ|j}qW|S(s°Internal method. Returns a characteristic path of the
        pattern tree. This method must be run for all leaves until the
        linear subpatterns are merged into a singleN(RtTYPE_ALTERNATIVESR
tappendtlenRttupleRRt
TYPE_GROUPRtget_characteristic_subpatternttoken_labelstNAMER(Rtnodetsubp((s'/usr/lib/python2.7/lib2to3/btm_utils.pytleaf_to_root!s8							
cCs1x*|jƒD]}|jƒ}|r
|Sq
WdS(s‹Drives the leaf_to_root method. The reason that
        leaf_to_root must be run multiple times is because we need to
        reject 'group' matches; for example the alternative form
        (a | b c) creates a group [b c] that needs to be matched. Since
        matching multiple linear patterns overcomes the automaton's
        capabilities, leaf_to_root merges each group into a single
        choice based on 'characteristic'ity,

        i.e. (a|b c) -> (a|b) if b more characteristic than c

        Returns: The most 'characteristic'(as defined by
          get_characteristic_subpattern) path for the compiled pattern
          tree.
        N(tleavesR(RtlR((s'/usr/lib/python2.7/lib2to3/btm_utils.pytget_linear_subpatternKsccsEx-|jD]"}x|jƒD]}|VqWq
W|jsA|VndS(s-Generator that returns the leaves of the treeN(RR(Rtchildtx((s'/usr/lib/python2.7/lib2to3/btm_utils.pyR`s

	N(	t__name__t
__module__t__doc__RRRRR!R(((s'/usr/lib/python2.7/lib2to3/btm_utils.pyRs			*	c
Csd}|jtjkr(|jd}n|jtjkrØt|jƒdkrht|jd|ƒ}qütdt	ƒ}x‚|jD]P}|jj
|ƒdr£qnt||ƒ}|dk	r|jj|ƒqqWn$|jtjkrxt|jƒdkr_tdt
ƒ}x9|jD].}t||ƒ}|r|jj|ƒqqW|jsud}quqüt|jd|ƒ}n„|jtjkrüt|jdtjƒrÍ|jdjdkrÍt|jd|ƒSt|jdtjƒrü|jdjdks=t|jƒdkrAt|jddƒrA|jdjdkrAdSt}d}d}t}d}	t}
x•|jD]Š}|jtjkr–t}|}n<|jtjkr·t}|}	n|jtjkrÒ|}nt|dƒro|jdkrot}
qoqoW|
rA|jd}t|dƒrN|jdkrN|jd	}qNn
|jd}|jtjkrÏ|jd
krtdtƒ}qTtt|jƒr±tdtt|jƒƒ}qTtdtt|jƒƒ}n…|jtjkr0|jjdƒ}|tkrtdt|ƒ}qTtdtjd|ƒ}n$|jtjkrTt||ƒ}n|r›|	jdjd
kryd}q›|	jdjdkr’q›t ‚n|rü|dk	rüxI|jdd!D]4}t||ƒ}|dk	r¾|jj|ƒq¾q¾Wqün|r||_!n|S(sÏ
    Internal function. Reduces a compiled pattern tree to an
    intermediate representation suitable for feeding the
    automaton. This also trims off any optional pattern elements(like
    [a], a*).
    iiRit(t[tvaluet=itanyt'Rt*t+iÿÿÿÿN("RRtsymstMatcherRtAlternativesRtreduce_treeRRtindexRtAlternativeRtUnitt
isinstanceRtLeafR)thasattrtTrueR	tDetailstRepeaterRRtTYPE_ANYtgetattrtpysymstSTRINGtstripttokenstNotImplementedErrorR(
RRtnew_nodeR"treducedR
tdetails_nodetalternatives_nodethas_repeatert
repeater_nodethas_variable_namet	name_leafR((s'/usr/lib/python2.7/lib2to3/btm_utils.pyR2hs¦				


	cs,t|tƒs|St|ƒdkr-|dSg}g}dddddg‰g}d‰x’|D]Š}tt|d	„ƒƒratt|‡fd
†ƒƒr­|j|ƒqëtt|‡fd†ƒƒrÛ|j|ƒqë|j|ƒqaqaW|rþ|}n|r
|}n|r|}nt|dtƒS(
s„Picks the most characteristic from a list of linear patterns
    Current order used is:
    names > common_names > common_chars
    iitintfortiftnotRs[]().,:cSst|ƒtkS(N(RR(R#((s'/usr/lib/python2.7/lib2to3/btm_utils.pyt<lambda>ÿscst|tƒo|ˆkS(N(R6R(R#(tcommon_chars(s'/usr/lib/python2.7/lib2to3/btm_utils.pyROscst|tƒo|ˆkS(N(R6R(R#(tcommon_names(s'/usr/lib/python2.7/lib2to3/btm_utils.pyROstkey(R6tlistRR+trec_testRtmax(tsubpatternstsubpatterns_with_namestsubpatterns_with_common_namestsubpatterns_with_common_charst
subpattern((RQRPs'/usr/lib/python2.7/lib2to3/btm_utils.pyRîs2
					ccsWxP|D]H}t|ttfƒrDx*t||ƒD]}|Vq2Wq||ƒVqWdS(sPTests test_func on all items of sequence and items of included
    sub-iterablesN(R6RSRRT(tsequencet	test_funcR#ty((s'/usr/lib/python2.7/lib2to3/btm_utils.pyRTs

N(R&tRtpgen2RRtpygramRRR/R>topmapRARR<RRtobjectRRR2RRT(((s'/usr/lib/python2.7/lib2to3/btm_utils.pyt<module>s	X†	%

Youez - 2016 - github.com/yon3zu
LinuXploit