mò {:"ids...it.s(...)s%s=%siit*is**s%s(%s)s, N(RtfuncRt func_codetcodetco_nametfnamet co_argcounttcallargstlistt co_varnamestargst func_defaultstlentitdefaulttreprtrtargtco_flagsR tstringtjoin( RRRR#R R$R&RR'((Rtfunc_sigPs:          s ([ ]*)[^ ]icCs)y|||ƒdƒ} Wn dSnXt| ƒdjo¬ti}t|| ƒ} xct dt| ƒƒD]L} |i | | ƒ} | o,| idd} | |jo | }q´qhqhW|| dƒgt|d„| dƒ} nt|| ƒ} t||d„| ƒ} || dƒd} | GHdS(Ns \| \| iicCs||S(N(txtindent(R,R-((Rt—scCs |||S(N(RtnR,(R,R/R((RR.šss (tsplittstriptdoctlR"tsystmaxintR-tmapt expandtabstrangeR#tspacestmatchR tregstsptlevelRR*ts(R2R=R0RR*R1R7R9R-R#R<R R3R>((RRs(  .RcCsìt|ƒtitifjo0yt|ƒ}Wqtj o |}qXnOt|ƒti jod|}n+t|ƒti jod|}n|}|p3y |i }Wq×tj ot |ƒ}q×Xnt ||GdGHdS(NsModule sClass t:(ttypeRttypest FunctionTypet MethodTypeR+tobjreprRRt ModuleTypet ClassTypet__name__R%RR=(RRR=RD((RRžs  cCs8dGHddGHt|ƒHdGHddGHt|dƒdS(s4 info(c) -- print all the information known about c sDocumentation:t-iHsAttributes, Internals, etc.:iN(RRtshow(R((Rtinfo´s   icCsþyHt|ƒ}t|ƒdjo|d d}nd|||fGHWn dSnX|d}||jodSnt|d||ƒt|d||ƒt|d||ƒt |d ||ƒt |d ||ƒt |d ||ƒt |d ||ƒdS( s) show(c) -- print all the internals of c i(s ...s%s%sNiRGt __class__t __bases__R t __members__t__attributes__R ( R%RR&R"RR=tmaxdepthtshowobjtshowseqtshowattrtshowdict(RROR=RR&((RRIÀs$   ic Cs3yt||ƒ}|iƒWntj o dSnXd|||fGH|d}||jodSnxÃ|D]»}yt||ƒ}t |ƒ}Wnd}d}nXt|ƒdjo|d d}n||jo8|dj o+d|||fGHt|||dƒqpd||||fGHqpWdS(s0 showattr(c,name) -- for a in c.name: print c.a Ns%s%s :is *exception*i(s ...s %s%s : %s(RRRR RRRR=ROR,taR%R&tNoneR"RI( RRROR=RRTR R&R,((RRRÜs0    cCssyt||ƒ}Wntj o dSnXd|||fGH|d}||jodSnt|||ƒdS(s( showobj(c,name) -- print object c.name Ns%s%s :i( RRRR,RRR=RORI(RRROR=RR,((RRPûs   cCs9yt||ƒ}Wntj o dSnXd|||fGH|d}||jodSn|pd|||fGHdSnx±|D]©}yt |ƒ}Wnd}d}nXt |ƒdjo|d d}n||jo8|dj o+d|||fGHt |||dƒqˆd|||fGHqˆWdS(s* showseq(c,name) -- print sequence c.name Ns%s%s :is%s%ss *exception*i(s ...(RRRR RRR=ROR,R%R&RUR"RI(RRROR=RR R&R,((RRQ s2    c Csy)t||ƒ}|iƒ}|iƒWntj o dSnXd|||fGH|d}||jodSn|pd|||fGHdSnxÿ|D]÷\} }yt | ƒ}Wn d}nXt|ƒdjo|d d}nyt|ƒ} Wnd} d}nXt| ƒdjo| d d} n||jo8|dj o+d|||fGHt|||dƒqžd|||| fGHqžWdS( s* showdict(c,name) -- print c.name.items() Ns%s%s :is%s%ss *exception*i(s ...s %s%s : %s(RRRtdictR RRRR=ROtkeytvaluetstrtkR"R%tvRURI( RRROR=RR RZRXRVRWR[((RRS-sB       cCs¥t|ƒtijot|ddƒ}n`t|ƒtijo |i}n=t|ƒtijpt|ƒtijo|i i}ndk }|i |ƒdS(s[ dis(c) -- disassemble c; can be a code-string, -object a function or a method thackingtexecN( R@RRAt StringTypetcompileRBRRCtUnboundMethodTypeRtdistdisco(RRa((RRaXs , cBsKd|d}e|ddƒ}|o ||Undk}||iUdS(s clock(code[,namespace]) -- clock the code executed in namespace which defaults to the top level namespace __main__. s0import time;hack_timer=time.time(),time.clock() sl hack_timer=time.time()-hack_timer[0],time.clock()-hack_timer[1]; print '%.3fabs %.3fusr sec.' % hack_timer shack.clock-codeR]NR(RR_Rt namespacet__main__R (RRcRRd((Rtclockfs   ttimercBswtZdZdZdZeieid„Zeieid„Zeieid„Z eieid„Z d„Z RS(s timer class with a quite obvious interface - .start() starts a fairly accurate CPU-time timer plus an absolute timer - .stop() stops the timer and returns a tuple: the CPU-time in seconds and the absolute time elapsed since .start() was called icCs|ƒ|_|ƒ|_dS(N(ttimetselftatimeRetutime(RhReRg((Rtstartƒs cCs6|ƒ|i|_|ƒ|i|_|i|ifS(N(ReRhRjRgRi(RhReRg((RtstopˆscCs-|ƒ|i|_|ƒ|i|_|iS(N(ReRhRjRgRi(RhReRg((RtusertimeŽscCs-|ƒ|i|_|ƒ|i|_|iS(N(ReRhRjRgRi(RhReRg((Rtabstime”scCsd|i|ifS(Ns%0.2fu %0.2fa sec.(RhRjRi(Rh((Rt__str__šs( RGt __module__RRjRiRgReRkRlRmRnRo(((RRfws cBsKd|d}e|ddƒ}|o ||Undk}||iUdS(s… profile(code[,namespace]) -- profile the code executed in namespace which defaults to the top level namespace __main__. simport profile;profile.run("s")t profilingR]N(RR_RRcRdR (RRcRRd((Rtprofiležs  cCsbttdƒoIti}x|idjo |i}qW|i}dGHt|i ƒndGHdS(s5 why() -- show locals that caused the last exception tlast_tracebackslocals() of the last exception:sno exception available !N( RR4Rsttbttb_nextRUttb_frametframeRVtf_locals(RwRt((Rtwhy«s  ic Cst|dƒo||dGH||joÈ|iƒ}|iƒx¼|D]£\}}||dG|GdGHygt |||dƒ}|oFt |ƒ}t |ƒdjo|d d}n|d|G|GHnWqG|d|GdGHqGXqGWn||GdGH||d GHd Snd Sd S( sI dict(d,maxindent,indent) -- show dict d with given indentation (=0) R t{t R?ii(s...s *exception*t}sError: no items-methodN(RtdR-Rt maxindentR RRZR[RVt print_hereR%R>R"RU( R}R~R-RRR RZR>R[((RRV¹s,        i cCsæyŽt|ƒt|ƒtdƒjp ||jo t‚nx@|D]8}yt|||dƒWqDtj o dGqDXqDW|dGHdSWnQtj oE|dGt |ƒ}t|ƒdjo|d d}n|GHnXdS(s” seq(l,maxindent=10,indent=0) -- show sequence l with given indentation (=0), limiting the indent-depth at maxindent (=10) Ris *exception*s |Ni(s...( R"R3R@R-R~t TypeErrorR#tseqt ValueErrorR%R>(R3R~R-R#R>((RRÕs& &    cCsÙtiiƒ}|iƒdGHx´|D]¬\}}ti|dƒ}x(t t |ƒdƒD]}d||