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__/trace.cpython-35.pyc


Fa4{@s@dZddgZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
ZddlmZyddlZWn'ek
rejZddZYnXd	d
ZddZdd
ZdZejdZGdddZddZddZGdddZddZddZ dddZ!ddZ"GdddZ#d d!Z$dd"d#Z%d$d%Z&Gd&d'd'eZ'd(d)Z(d*d+Z)d,d-Z*d.d/Z+dd0d1Z,d2d3Z-e.d4kr<e%dS)5aprogram/module to trace Python program or function execution

Sample use, command line:
  trace.py -c -f counts --ignore-dir '$prefix' spam.py eggs
  trace.py -t --ignore-dir '$prefix' spam.py eggs
  trace.py --trackcalls spam.py eggs

Sample use, programmatically
  import sys

  # create a Trace object, telling it what to ignore, and whether to
  # do tracing or line-counting or both.
  tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,],
                       trace=0, count=1)
  # run the new command using the given tracer
  tracer.run('main()')
  # make a report, placing output in /tmp
  r = tracer.results()
  r.write_results(show_missing=True, coverdir="/tmp")
TraceCoverageResultsN)warn)	monotoniccCstjddS)N)syssettracerr/usr/lib/python3.5/trace.py_unsettraceEsr
cCstj|tj|dS)N)	threadingrr)funcrrr		_settraceHs
r
cCstjdtjddS)N)rrrrrrr	r
Ls
cCs|jdtjddS)Na	Usage: %s [OPTIONS] <file> [ARGS]

Meta-options:
--help                Display this help then exit.
--version             Output version information then exit.

Otherwise, exactly one of the following three options must be given:
-t, --trace           Print each line to sys.stdout before it is executed.
-c, --count           Count the number of times each line is executed
                      and write the counts to <module>.cover for each
                      module executed, in the module's directory.
                      See also `--coverdir', `--file', `--no-report' below.
-l, --listfuncs       Keep track of which functions are executed at least
                      once and write the results to sys.stdout after the
                      program exits.
-T, --trackcalls      Keep track of caller/called pairs and write the
                      results to sys.stdout after the program exits.
-r, --report          Generate a report from a counts file; do not execute
                      any code.  `--file' must specify the results file to
                      read, which must have been created in a previous run
                      with `--count --file=FILE'.

Modifiers:
-f, --file=<file>     File to accumulate counts over several runs.
-R, --no-report       Do not generate the coverage report files.
                      Useful if you want to accumulate over several runs.
-C, --coverdir=<dir>  Directory where the report files.  The coverage
                      report for <package>.<module> is written to file
                      <dir>/<package>/<module>.cover.
-m, --missing         Annotate executable lines that were not executed
                      with '>>>>>> '.
-s, --summary         Write a brief summary on stdout for each file.
                      (Can only be used with --count or --report.)
-g, --timing          Prefix each line with the time since the program started.
                      Only used while tracing.

Filters, may be repeated multiple times:
--ignore-module=<mod> Ignore the given module(s) and its submodules
                      (if it is a package).  Accepts comma separated
                      list of module names
--ignore-dir=<dir>    Ignore files in the given directory (multiple
                      directories can be joined by os.pathsep).
r)writerargv)outfilerrr	_usagePs*rz#pragma NO COVERz^\s*(#.*)?$c@s.eZdZddddZddZdS)_IgnoreNcCsS|stn	t||_|s*gndd|D|_ddi|_dS)NcSs"g|]}tjj|qSr)ospathnormpath).0drrr	
<listcomp>s	z$_Ignore.__init__.<locals>.<listcomp>z<string>)set_mods_dirs_ignore)selfmodulesdirsrrr	__init__s
z_Ignore.__init__cCs||jkr|j|S||jkr:d|j|<dSx5|jD]*}|j|drDd|j|<dSqDW|dkrd|j|<dSx8|jD]-}|j|tjrd|j|<dSqWd|j|<dS)Nr.r)rr
startswithrrsep)rfilename
modulenamemodrrrr	namess$




z
_Ignore.names)__name__
__module____qualname__r!r(rrrr	rsrcCs.tjj|}tjj|\}}|S)z-Return a plausible module name for the patch.)rrbasenamesplitext)rbaser%extrrr	_modnamesr0cCstjj|}d}xitjD]^}tjj|}|j|r"|t|tjkr"t|t|kr"|}q"W|r|t|dd}n|}tjj|\}}|jtjd}tj	r|jtj	d}tjj
|\}}|jdS)z,Return a plausible module name for the path.rNr")rrnormcaserr#lenr$
splitdrivereplacealtsepr-lstrip)rZcomparepathZlongestdirr.Zdriver%r/rrr	_fullmodnames (
	r9c@sgeZdZdddddddZddZddZdd	dd
dZddd
ZdS)rNcCs]||_|jdkr!i|_|jj|_||_|jdkrTi|_|jj|_||_|jdkri|_|jj|_||_||_|jrYyTt|jd}tj	|\}}}WdQRX|j
|j|||WnNtt
tfk
rX}z%td|j|fdtjWYdd}~XnXdS)NrbzSkipping counts file %r: %sfile)countscopyZcountercalledfuncscallersinfileropenpickleloadupdate	__class__OSErrorEOFError
ValueErrorprintrstderr)rr<r>r@r?rferrrrr	r!s,									 zCoverageResults.__init__cCs|jdo|jdS)z_Return True if the filename does not refer to a file
        we want to have reported.
        <>)r#endswith)rr%rrr	is_ignored_filenamesz#CoverageResults.is_ignored_filenamec	Cs|j}|j}|j}|j}|j}|j}x,|D]$}|j|d||||<q=Wx|D]}d||<qlWx|D]}d||<qWdS)z.Merge in the data from another CoverageResultsrrN)r<r>r?get)	rotherr<r>r?Zother_countsZother_calledfuncsZ
other_callerskeyrrr	rDs						
"

zCoverageResults.updateTFc!Cs|jrZttd|j}x4t|D]&\}}}td|||fq0W|jr$ttdd}}	xt|jD]\\}
}}\}
}}|
|krttd|
d|
}d}	|
|
kr|	|
krtd|
|
}	td||||fqWi}xH|jD]=\}}|j|i}||<|j||f||<q4Wi}x|jD]x\}}|j|rq|jdr|d	d}|d	krt	j
jt	j
j|}t
|}n1|}t	j
j|s#t	j|t|}|rDt|}ni}|rtj|}t	j
j||d}t|d}tj|j\}}Wd	QRX|j|||||\}}|r|rtd
||}||||f||<qW|rY|rYtdx<t|D].}||\}}}}td||q'W|jry5tj|j|j|jft|jdd
Wn<tk
r} ztd| dtj WYd	d	} ~ XnXd	S)z!
        @param coverdir
        zfunctions called:z*filename: %s, modulename: %s, funcname: %szcalling relationships:r1z***z  -->z    %s.%s -> %s.%sz.pycNrz.coverr:dzlines   cov%   module   (path)z%5d   %3d%%   %s   (%s)wbz"Can't save counts files because %sr;)!r>rIsortedr?r<rQitemsrPrOrrdirnameabspathr0existsmakedirsr9_find_executable_linenos	linecachegetlinesjoinrAtokenizedetect_encodingreadlinewrite_results_fileintrrBdumprFrrJ)!rZshow_missingsummarycoverdirZcallsr%r&funcnameZlastfileZ	lastcfileZpfileZpmodZpfunccfileZcmodZcfuncZper_filelineno	lines_hitZsumscountr8lnotabsourceZ	coverpathfpencoding_n_hitsn_linesZpercentmrLrrr	
write_results
s~	
		

+


	zCoverageResults.write_resultscCsRyt|dd|}WnFtk
ra}z&td||fdtjdSWYdd}~XnXd}d}	|xt|dD]\}
}|
|kr|jd||
|	d7}	|d7}n^tj|r|jd	n?|
|krt	|kr|jd
|d7}n
|jd	|j|j
dqWWdQRX|	|fS)
z'Return a coverage results file in path.wrqz2trace: Could not open %r for writing: %s- skippingr;rNrz%5d: z       z>>>>>> )rr)rArFrIrrJ	enumeraterrx_blankmatchPRAGMA_NOCOVER
expandtabs)rrlinesrnrlrqrrLrtrsrklinerrr	rd`s,




!z"CoverageResults.write_results_file)r)r*r+r!rPrDrvrdrrrr	rs	VcCs@i}x3tj|D]"\}}||krd||<qW|S)z:Return dict where keys are lines in the line number table.r)disZfindlinestarts)codestrslinenosrrrkrrr	_find_lines_from_codes
rcCsLt||}x6|jD]+}tj|r|jt||qW|S)z<Return lineno dict for all code objects reachable from code.)r	co_constsinspectZiscoderD_find_lines)rrrcrrr	rs
rc
Csi}tj}t|d|}tj|j}x|D]y\}}}}	}
|tjkr|tjkr|\}}|	\}
}x%t||
dD]}d||<qW|}q=WWdQRX|S)zReturn a dict of possible docstring positions.

    The dict maps line numbers to strings.  There is an entry for
    line that contains only a string or a part of a triple-quoted
    string.
    rqrN)tokenINDENTrAragenerate_tokensrcSTRINGrange)r%rqrZ
prev_ttyperKtokZttypeZtstrstartendrZslineZscolZelineZecolirrr	
_find_stringss	rcCsy2tj|}|j}|j}WdQRXWnFtk
rz}z&td||fdtjiSWYdd}~XnXt||d}t	||}t
||S)zAReturn dict where keys are line numbers in the line number table.Nz%Not printing coverage data for %r: %sr;exec)rarAreadrqrFrIrrJcompilerr)r%rKprogrqrLrrrrr	r]sr]c@seZdZddddffddddd	ZddZddd	d
ZddZd
dZddZddZ	ddZ
ddZddZddZ
ddZdS)rrrNFc

Cs||_||_t|||_i|_i|_d|_||_i|_i|_	i|_
d|_|	r~t|_|r|j
|_n|r|j|_nr|r|r|j|_|j|_nK|r|j|_|j|_n*|r|j|_|j|_n	d|_dS)ax
        @param count true iff it should count number of times each
                     line is executed
        @param trace true iff it should print out each line that is
                     being counted
        @param countfuncs true iff it should just output a list of
                     (filename, modulename, funcname,) for functions
                     that were called at least once;  This overrides
                     `count' and `trace'
        @param ignoremods a list of the names of modules to ignore
        @param ignoredirs a list of the names of directories to ignore
                     all of the (recursive) contents of
        @param infile file from which to read stored counts to be
                     added into the results
        @param outfile file in which to write the results
        @param timing true iff timing information be displayed
        rNr)r@rrignorer<Zpathtobasename	donothingtrace_calledfuncs_callers
_caller_cache
start_time_timeglobaltrace_trackcallersglobaltraceglobaltrace_countfuncsglobaltrace_ltlocaltrace_trace_and_count
localtracelocaltrace_tracelocaltrace_count)
rrmr
countfuncscountcallers
ignoremods
ignoredirsr@rtimingrrr	r!s6										zTrace.__init__cCs,ddl}|j}|j|||dS)Nr)__main____dict__runctx)rcmdrdictrrr	runs	z	Trace.runc
Csf|dkri}|dkr$i}|js:t|jzt|||Wd|jsatXdS)N)rr
rrr
)rrglobalslocalsrrr	rs	
	zTrace.runctxcOsPd}|jstj|jz|||}Wd|jsKtjdX|S)N)rrrr)rrargskwresultrrr	runfuncs		z
Trace.runfuncc
CsP|j}|j}|r't|}nd}|j}d}||jkrn|j|dk	r'|j|}nd|j|<ddtj|D}t|dkr'ddtj|dD}t|dkr'ddtj|dD}	t|	dkr'|	dj}||j|<|dk	rCd||f}|||fS)NcSs%g|]}tj|r|qSr)rZ
isfunction)rrKrrr	rs	z1Trace.file_module_function_of.<locals>.<listcomp>rcSs%g|]}t|tr|qSr)
isinstancer)rrrrr	r#s	rcSs%g|]}t|dr|qS)	__bases__)hasattr)rrrrr	r&s	z%s.%s)	f_codeco_filenamer0co_namergcZ
get_referrersr3r))
rframerr%r&riZclsnameZfuncsZdictsclassesrrr	file_module_function_ofs,			
  

zTrace.file_module_function_ofcCsD|dkr@|j|}|j|j}d|j||f<dS)zkHandler for call events.

        Adds information about who called who to the self._callers dict.
        callrN)rf_backr)rrwhyarg	this_funcZparent_funcrrr	r5szTrace.globaltrace_trackcallerscCs,|dkr(|j|}d|j|<dS)zoHandler for call events.

        Adds (filename, modulename, funcname) to the self._calledfuncs dict.
        rrN)rr)rrrrrrrr	r@szTrace.globaltrace_countfuncscCs|dkr|j}|jjdd}|rt|}|dk	r|jj||}|s|jrtd||jf|j	SndSdS)zHandler for call events.

        If the code block being entered is to be ignored, returns `None',
        else returns self.localtrace.
        r__file__Nz! --- modulename: %s, funcname: %s)
r	f_globalsrQr0rr(rrIrr)rrrrrr%r&Z	ignore_itrrr	rIs		
zTrace.globaltrace_ltcCs|dkr|jj}|j}||f}|jj|dd|j|<|jrttdt|jddtj	j
|}td||tj||fdd|j
S)	Nrrrz%.2fr z
%s(%d): %sr1)rrf_linenor<rQrrIrrrr,r^getliner)rrrrr%rkrSbnamerrr	r`s	 	z Trace.localtrace_trace_and_countcCs|dkr|jj}|j}|jrHtdt|jddtjj|}td||t	j
||fdd|jS)Nrz%.2frrz
%s(%d): %sr1)rrrrrIrrrr,r^rr)rrrrr%rkrrrr	ros		zTrace.localtrace_tracecCsT|dkrM|jj}|j}||f}|jj|dd|j|<|jS)Nrrr)rrrr<rQr)rrrrr%rkrSrrr	r|s	 zTrace.localtrace_countc
Cs1t|jd|jd|jd|jd|jS)Nr@rr>r?)rr<r@rrr)rrrr	resultss		z
Trace.results)r)r*r+r!rrrrrrrrrrrrrrr	rs0)	
cCs2tjjdtjd|ftjddS)Nz%s: %s
rr)rrJrrexit)msgrrr		_err_exits!rc#Cs>ddl}|dkr!tj}yV|j|ddddddddd	d
ddd
dddddg\}}Wnq|jk
r}zNtjjdtjd|ftjjdtjdtjdWYdd}~XnXd}d}d}d}d}	d}
g}g}d}
d}d}d}d}x|D]\}}|dkrrttjtjd|dkrtjjdtjd|dks|dkrd}q@|dks|dkrd}q@|dks|dkrd}q@|d ks|d!krd}q@|d"ks7|d#kr@d}q@|d$ksX|d%krad}q@|d&ksy|d'krd}q@|d(ks|d)kr|}	q@|d*ks|d+krd}
q@|d,ks|d-kr|}
q@|d.ks|d/krd}q@|d0krBx*|j	d1D]}|j
|jq"Wq@|d2krx|j	tj
D]}tjj|}|jd3tjjtjd4d5tjdd6}|jd7tjjtjd4d5tjdd6}tjj|}|j
|qaWq@ds@td8q@W|rA|s7|rAtd9|p\|p\|p\|p\|sitd:|r|rtd;|r|	rtd<|rt|dkrtd=|rtd>|	d?|	}|j|
d
|d@|
nK|t_|d}tjj	|dtjd<t||dA|dB|dC|dD|d>|	d?|	d|}yct|}t|j|dE}WdQRXdF|dGdHdIddJdi}|j|||WnQt k
r}z tdKtjd|fWYdd}~Xnt!k
rYnX|j"}|s:|j|
d
|d@|
dS)LNrrztcrRf:d:msC:lTghelpversionrrmreportz	no-reportrgzfile=missingzignore-module=zignore-dir=z	coverdir=	listfuncsZ
trackcallsrz%s: %s
z%Try `%s --help' for more information
Fz--helpz	--versionz
trace 2.0
z-Tz--trackcallsTz-lz--listfuncsz-gz--timingz-tz--tracez-cz--countz-rz--reportz-Rz--no-reportz-fz--filez-mz	--missingz-Cz
--coverdirz-sz	--summaryz--ignore-module,z--ignore-dirz$prefixZlibZpythonz$exec_prefixzShould never get herez8cannot specify both --listfuncs and (--trace or --count)zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz,cannot specify both --report and --no-reportz--report requires a --filezmissing name of file to runr@rrhrrrrrrr)r__package__
__cached__zCannot run file %r because: %s)#getoptrrerrorrJrrrstdoutsplitappendstriprpathsepr
expandvarsr5r`base_prefixrbase_exec_prefixrAssertionErrorrr3rrvrrArrrrF
SystemExitr)rrZoptsZ	prog_argvrrrmrZ	no_reportZcounts_filerZignore_modulesZignore_dirsrhrgrrrZoptvalr'srZprognametrprZglobsrLrrr	mains		! 


		





	
-
rcCstdtdt|dS)Nz(The trace.usage() function is deprecated)_warnDeprecationWarningr)rrrr	usage.s
rc@s"eZdZddddZdS)IgnoreNcCs'tdtdtj|||dS)Nz$The class trace.Ignore is deprecatedr)rrrr!)rrr rrr	r!4s
zIgnore.__init__)r)r*r+r!rrrr	r3srcCstdtdt|S)Nz*The trace.modname() function is deprecatedr)rrr0)rrrr	modname9s
rcCstdtdt|S)Nz.The trace.fullmodname() function is deprecatedr)rrr9)rrrr	fullmodname>s
rcCstdtdt||S)Nz7The trace.find_lines_from_code() function is deprecatedr)rrr)rrrrr	find_lines_from_codeCs
rcCstdtdt||S)Nz-The trace.find_lines() function is deprecatedr)rrr)rrrrr	
find_linesHs
rcCs tdtdt|ddS)Nz/The trace.find_strings() function is deprecatedrrq)rrr)r%rqrrr	find_stringsMs
rcCstdtdt|S)Nz:The trace.find_executable_linenos() function is deprecatedr)rrr])r%rrr	find_executable_linenosRs
rr)/__doc____all__r^rrerrrarrrrBwarningsrrZtimerrrImportErrorrr
r
rr|rrzrr0r9rrrrr]rrrrrrrrrrrr)rrrr	<module>1sX
	-2