HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, 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
Upload Files
File: //usr/lib/python3.5/__pycache__/pstats.cpython-35.pyc


Fajg@sdZddlZddlZddlZddlZddlZddlmZdgZGdddZ	GdddZ
dd	Zd
dZdd
Z
ddZddZddZddZedkrddlZyddlZWnek
rYnXGdddejZeejdkrPejdZndZykeeZx(ejddD]ZejeqyWeddejej eddejWne!k
rYnXdS)z3Class for printing reports on profiled python code.N)
cmp_to_keyStatsc@sieZdZdZddddZddZdd	Zd
dZdd
ZddZ	ddOddSddWdd[dd^ddadddddgd djd#dod%dsd(dvd+dzd.d~iZ
d/d0Zd1d2Zd3d4Z
d5d6Zd7d8Zd9d:Zd;d<Zd=d>Zd?d@ZdAdBZdCdDZdEdFdGZdHdIZdJdKZdS)ra<This class is used for creating reports from data generated by the
    Profile class.  It is a "friend" of that class, and imports data either
    by direct access to members of Profile class, or by reading in a dictionary
    that was emitted (via marshal) from the Profile class.

    The big change from the previous Profiler (in terms of raw functionality)
    is that an "add()" method has been provided to combine Stats from
    several distinct profile runs.  Both the constructor and the add()
    method now take arbitrarily many file names as arguments.

    All the print methods now take an argument that indicates how many lines
    to print.  If the arg is a floating point number between 0 and 1.0, then
    it is taken as a decimal percentage of the available lines to be printed
    (e.g., .1 means print 10% of all available lines).  If it is an integer,
    it is taken to mean the number of lines of data that you wish to have
    printed.

    The sort_stats() method now processes some additional options (i.e., in
    addition to the old -1, 0, 1, or 2).  It takes an arbitrary number of
    quoted strings to select the sort order.  For example sort_stats('time',
    'name') sorts on the major key of 'internal function time', and on the
    minor key of 'the name of the function'.  Look at the two tables in
    sort_stats() and get_sort_arg_defs(self) for more examples.

    All methods return self, so you can string together commands like:
        Stats('foo', 'goo').strip_dirs().sort_stats('calls').                            print_stats(5).print_callers(5)
    streamNcGs_|ptj|_t|s'd}n|d}|dd}|j||j|dS)Nr)sysstdoutrleninitadd)selfrargsargr/usr/lib/python3.5/pstats.py__init__>s	

zStats.__init__cCsd|_g|_d|_d|_d|_d|_d|_t|_i|_	i|_
|j|y|jWnBt
k
rtd|jr|jdndd|jYnXdS)NrzInvalid timing data %srfile)all_calleesfilesfcn_listtotal_tttotal_calls
prim_callsmax_name_lenset	top_levelstats
sort_arg_dict
load_statsget_top_level_stats	Exceptionprintr)rr
rrrr	Hs"									

'z
Stats.initcCs|dkri|_dSt|trt|d}tj||_WdQRXy-tj|}tj	|j
d|}WnYnX|g|_n.t|dr|j
|j|_i|_|jstd|j|fdS)Nrbz    create_statsz.Cannot create or construct a %r object from %r)r
isinstancestropenmarshalloadosstattimeZctimest_mtimerhasattrr$	TypeError	__class__)rr
fZ
file_statsrrrr[s(	
		zStats.load_statscCsx|jjD]\}\}}}}}|j|7_|j|7_|j|7_d|krt|jj|tt||j	krtt||_	qWdS)Njprofilerprofiler)r2rr3)
ritemsrrrrr
rfunc_std_stringr)rfuncccncttctcallersrrrr qs+zStats.get_top_level_statscGsF|s
|Sx5t|D]'}t|t|krAt|}|j|j7_|j|j7_|j|j7_|j|j7_x!|jD]}|jj|qW|j	|j	kr|j	|_	d|_
xg|jjD]V\}}||jkr|j|}nddddif}t
|||j|<qWqW|S)Nr)reversedtyperrrrrrr
rrrr4add_func_stats)rarg_listitemr6r+Z
old_func_statrrrr
{s(	z	Stats.addc
Cs0t|d}tj|j|WdQRXdS)z:Write the profile data to a file we know how to load back.wbN)r'r(dumpr)rfilenamer1rrr
dump_statsszStats.dump_statscallsr
call countZncallsZcumtimecumulative time
cumulativer	file namerClineline numbermodulename
function nameZnflname/file/lineZpcallsrprimitive call countstdname
standard namer,
internal timeZtottimecCs|jsi|_}i}xh|jjD]W\}}|}xB|r|sNP||kred||<P|||<|dd}qAWq,Wx|D]
}||=qW|jS)z)Expand all abbreviations that are unique.rNrr)rsort_arg_dict_defaultr4)rdictZbad_listwordtupZfragmentrrrget_sort_arg_defss 	
	


zStats.get_sort_arg_defscGsz|sd|_|St|dkrat|dtraddddddddi|dg}|j}f}d|_d}xA|D]9}|||d}|j|||d7_d	}qWg}xY|jjD]H\}\}}	}
}}|j||	|
|f|t	||fqW|j
d
tt|j
g|_}
x|D]}|
j|dq[W|S)
NrrrUrEr,rXrIrz, keyrr)rrr%intr^	sort_typerr4appendr5sortr	TupleCompcompare)rZfieldZ
sort_arg_defsZ
sort_tupleZ	connectorr\Z
stats_listr6r7r8r9r:r;rtuplerrr
sort_statss2	%	

+

zStats.sort_statscCs|jr|jj|S)N)rreverse)rrrr
reverse_orders	
zStats.reverse_ordercCs[|j}i|_}d}x|jD]\}\}}}}}	t|}
tt|
|krztt|
}i}x*|	jD]\}}
|
|t|<qW|
|krt||
|||||f||
<q)|||||f||
<q)W|j}t|_}x!|D]}|jt|qW||_	d|_
d|_|S)Nr)rr4func_strip_pathrr5r>rrr
rrr)rZoldstatsZnewstatsrr6r7r8r9r:r;ZnewfuncZ
newcallersfunc2callerZold_topZnew_toprrr
strip_dirss.	
(	
			zStats.strip_dirsc
Cs|jr
dSi|_}x|jjD]r\}\}}}}}||kr[i||<x>|jD]0\}}	||kri||<|	|||<qhWq*WdS)N)rrr4)
rrr6r7r8r9r:r;rkrlrrrcalc_calleess	
+

zStats.calc_calleesc
Csx|}t|trytj|}Wn-tjk
rW|d|7}||fSYnXg}x|D](}|jt|re|j|qeWnt|}t|t	rd|kodknrt
||d}|d|}nAt|t
r3d|ko|knr3|}|d|}t|t|krn|dt|t||f7}||fS)Nz#   <Invalid regular expression %r>
gg?g?rz6   List reduced from %r to %r due to restriction <%r>
)r%r&recompileerrorsearchr5rbrfloatr`)rZsellistmsgZnew_listZrexr6countrrreval_print_amounts,
++zStats.eval_print_amountcCs|j}|jr9|jdd}d|jd}nt|jj}d}x)|D]!}|j|||\}}q[Wt|}|sd|fSt|d|j	|t|jkrd}x8|D]0}tt
||krtt
|}qW|d|fS)Nz   Ordered by: 
z!   Random listing order was used
rrrX)rrrartrkeysrwrr"rr5)rZsel_listwidthZ	stat_listruZ	selectionrvr6rrrget_print_list/s$		


zStats.get_print_listcGs[x$|jD]}t|d|jq
W|jr@td|jd}x-|jD]"}t|t|d|jqPWt||jdddd|j|j|jkrtd|jddd|jtd|jd|jtd|j|j|\}}|rW|j	x|D]}|j
|q Wtd|jtd|j|S)	Nr zfunction callsendz(%d primitive calls)zin %.3f secondsz        )rr"rrfunc_get_function_namerrrr{print_title
print_line)ramountrCindentr6rzrtrrrprint_statsGs(	 " 

zStats.print_statscGs|j|\}}|r|j|j|dxM|D]E}||jkrn|j|||j|q<|j||iq<Wtd|jtd|j|S)Nz	called...r)r{rnprint_call_headingrprint_call_liner"r)rrrzrtr6rrr
print_callees^s

zStats.print_calleesc
Gs|j|\}}|r|j|dx@|D]8}|j|\}}}}}	|j|||	dq2Wtd|jtd|j|S)Nzwas called by...z<-r)r{rrrr"r)
rrrzrtr6r7r8r9r:r;rrr
print_callersms
zStats.print_callersc
Cstdj||d|jd}xT|jjD]C\}}}}}|r6tt|j}	t|	t}Pq6W|rtd|dd|jdS)Nz	Function rFr|z    ncalls  tottime  cumtime)	r"ljustrrvaluesnextiterr%rf)
r	name_sizeZcolumn_titleZ	subheaderr7r8r9r:r;valuerrrrxs %zStats.print_call_headingz->cCsktt|j||ddd|j|sFtd|jdSt|j}d}x|D]}t|}||}	t|	tr|	\}
}}}
|
|krd|
|f}n
d|
f}d|jdd	t	|t
|t
|
|f}|d
}n.d||	t
|j|df}|d}t|||d|jd}qeWdS)
Nr~r|rrz%d/%dz%dz%s %s %s  %srVrXrz	%s(%r) %srG)r"r5rrsortedryr%rfrjustrf8r)rrsourceZ	call_dictZarrowZclistrr6rPrr8r7r9r:ZsubstatsZ
left_widthrrrrs*,



$
zStats.print_call_linecCs0tdddd|jtdd|jdS)Nz-   ncalls  tottime  percall  cumtime  percallr~r|rzfilename:lineno(function))r"r)rrrrrszStats.print_titlecCs[|j|\}}}}}t|}||krH|dt|}t|jdddd|jtt|ddd|j|dkrtdddd|jn#tt||ddd|jtt|ddd|j|dkrtd	ddd|jn#tt||ddd|jtt|d|jdS)
N/	r~r|rrr}z        z        )rr&r"rrrr5)rr6r7r8r9r:r;crrrrs"##zStats.print_linerrrr)rrFrrrr)rrFrrGrr)rrHrrGrr)rrHrJrr)rrKrJrr)rrKrMrr)rrNrJrr)rrKrQrr)rrRrQrrJrrMrrrr)rrSrrrr)rrTrVrr)rrWrrXrr)rrYrrXrr)rrY)__name__
__module____qualname____doc__rr	rr r
rDrZr^rgrirmrnrwr{rrrrrrrrrrrr sF

 c@s.eZdZdZddZddZdS)rdaThis class provides a generic function for comparing any two tuples.
    Each instance records a list of tuple-indices (from most significant
    to least significant), and sort direction (ascending or decending) for
    each tuple-index.  The compare functions can then be used as the function
    argument to the system sort() function when a list of tuples need to be
    sorted in the instances order.cCs
||_dS)N)comp_select_list)rrrrrrszTupleComp.__init__cCsSxL|jD]A\}}||}||}||kr;|S||kr
|Sq
WdS)Nr)r)rleftrightindex	directionlrrrrres

zTupleComp.compareN)rrrrrrerrrrrdsrdcCs(|\}}}tjj|||fS)N)r*pathbasename)	func_namerCrLrPrrrrjsrjcCs|dS)NrXr)r6rrrrsrcCsc|ddd	krW|d}|jdrP|jdrPd|dd
S|Snd|SdS)NrX~r<>z{%s}rz	%s:%d(%s))rrr)
startswithendswith)rrPrrrr5s
r5cCsV|\}}}}}|\}}}	}
}||||||	||
t||fS)z3Add together all the stats for two profile entries.)add_callers)targetrr7r8r9r:r;Zt_ccZt_ncZt_ttZt_ctZ	t_callersrrrr>sr>cCsi}x$|jD]\}}|||<qWx}|jD]o\}}||krt|trtddt|||D||<q|||7<q:|||<q:W|S)z*Combine two caller lists in a single list.cSs"g|]}|d|dqS)rrr).0irrr
<listcomp>s	zadd_callers.<locals>.<listcomp>)r4r%rfzip)rrZnew_callersr6rlrrrrs!rcCs+d}x|jD]}||7}qW|S)z@Sum the caller statistics to get total number of calls received.r)r)r;r8rErrrcount_callssrcCsd|S)Nz%8.3fr)xrrrrsr__main__c@sKeZdZdddZddZddZdd	Zd
dZdd
ZddZ	ddZ
ddZddZddZ
ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5ZdS)6ProfileBrowserNcCsKtjj|d|_d|_tj|_|dk	rG|j|dS)Nz% )	cmdCmdrpromptrrrrdo_read)rprofilerrrrs		zProfileBrowser.__init__cCs|j}g}x|D]}y|jt|wWntk
rMYnXyNt|}|dksu|dkrtdd|jw|j|wWntk
rYnX|j|qW|jrt|j||ntdd|jdS)Nrrz#Fraction argument must be in [0, 1]rzNo statistics object is loaded.)	splitrbr`
ValueErrorrsr"rrgetattr)rfnrLrZ	processedZtermZfracrrrgenerics,



	zProfileBrowser.genericcCsvtdd|jtdd|jtdd|jtdd|jtdd|jtdd|jdS)NzArguments may be:rz0* An integer maximum number of entries to print.z:* A decimal fractional number between 0 and 1, controllingz-  what fraction of selected entries to print.z8* A regular expression; only entries with function namesz  that match it are printed.)r"r)rrrrgeneric_help7szProfileBrowser.generic_helpcCs||jrey|jj|Wqxtk
ra}z"td||fd|jWYdd}~XqxXntdd|jdS)Nz$Failed to load statistics for %s: %srzNo statistics object is loaded.r)rr
IOErrorr"r)rrLerrrdo_add?s	3zProfileBrowser.do_addcCstdd|jdS)Nz>Add profile info from given file to current statistics object.r)r"r)rrrrhelp_addHszProfileBrowser.help_addcCs|jd|S)Nr)r)rrLrrr
do_calleesKszProfileBrowser.do_calleescCs!tdd|j|jdS)Nz6Print callees statistics from the current stat object.r)r"rr)rrrrhelp_calleesMszProfileBrowser.help_calleescCs|jd|S)Nr)r)rrLrrr
do_callersQszProfileBrowser.do_callerscCs!tdd|j|jdS)Nz6Print callers statistics from the current stat object.r)r"rr)rrrrhelp_callersSszProfileBrowser.help_callerscCstdd|jdS)Nrrr)r"r)rrLrrrdo_EOFWszProfileBrowser.do_EOFcCstdd|jdS)NzLeave the profile brower.r)r"r)rrrrhelp_EOFZszProfileBrowser.help_EOFcCsdS)Nrr)rrLrrrdo_quit]szProfileBrowser.do_quitcCstdd|jdS)NzLeave the profile brower.r)r"r)rrrr	help_quit_szProfileBrowser.help_quitcCs|ryt||_Wntk
r^}z#t|jdd|jdSWYdd}~XnItk
r}z)t|jjd|d|jdSWYdd}~XnX|d|_	nKt
|j	dkr|j	dd}|j|ntdd|jdS)	Nrr:z% rXz1No statistics object is current -- cannot reload.r)rrOSErrorr"rrr!r0rrrr)rrLerrrrrrbs zProfileBrowser.do_readcCs*tdd|jtdd|jdS)Nz+Read in profile data from a specified file.rz*Without argument, reload the current file.)r"r)rrrr	help_readsszProfileBrowser.help_readcCs0|jr|jjntdd|jdS)NzNo statistics object is loaded.rr)rrir"r)rrLrrr
do_reversews	zProfileBrowser.do_reversecCstdd|jdS)Nz/Reverse the sort order of the profiling report.r)r"r)rrrrhelp_reverse}szProfileBrowser.help_reversecs|js tdd|jdS|jj|rstfdd|jDrs|jj|jnTtdd|jx>tjj	D]-\}}td||dfd|jqWdS)	NzNo statistics object is loaded.rc3s|]}|kVqdS)Nr)rr)abbrevsrr	<genexpr>sz)ProfileBrowser.do_sort.<locals>.<genexpr>z/Valid sort keys (unique prefixes are accepted):z%s -- %srr)
rr"rr^allrrgrrZr4)rrLr_rr)rrdo_sorts	+%zProfileBrowser.do_sortcCs*tdd|jtdd|jdS)Nz.Sort profile data according to specified keys.rz3(Typing `sort' without arguments lists valid keys.))r"r)rrrr	help_sortszProfileBrowser.help_sortcsfddtjDS)Ncs%g|]}|jr|qSr)r)ra)textrrrs	z0ProfileBrowser.complete_sort.<locals>.<listcomp>)rrZ)rrrr)rr
complete_sortszProfileBrowser.complete_sortcCs|jd|S)Nr)r)rrLrrrdo_statsszProfileBrowser.do_statscCs!tdd|j|jdS)Nz.Print statistics from the current stat object.r)r"rr)rrrr
help_statsszProfileBrowser.help_statscCs0|jr|jjntdd|jdS)NzNo statistics object is loaded.r)rrmr"r)rrLrrrdo_strips	zProfileBrowser.do_stripcCstdd|jdS)Nz<Strip leading path information from filenames in the report.r)r"r)rrrr
help_stripszProfileBrowser.help_stripcCstdd|jdS)NzShow help for a given command.r)r"r)rrrr	help_helpszProfileBrowser.help_helpcCs|r
|SdS)Nr)rstoprLrrrpostcmdszProfileBrowser.postcmd)rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrs4	rrrXz*Welcome to the profile statistics browser.rzGoodbye.)"rrr*r,r(ro	functoolsr__all__rrdrjrr5r>rrrrrreadlineImportErrorrrrargvZinitprofileZbrowserrrr"rZcmdloopKeyboardInterruptrrrr<module>sH