Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3
\Äg ã @ sf d Z ddlZddlZddlZddlZddlZddlmZ dgZG dd„ dƒZ G dd„ dƒZ
dd „ Zd
d„ Zdd
„ Z
dd„ Zdd„ Zdd„ Zdd„ Zedk�rbddlZyddlZW n ek
rÄ Y nX G dd„ dejƒZeejƒdkròejd ZndZyTeeƒZx"ejdd… D ]Zejeƒ �qW edejd� ej ƒ edejd� W n e!k
�r` Y nX dS )z3Class for printing reports on profiled python code.é N)Ú
cmp_to_keyÚStatsc @ sÚ e Zd ZdZddœdd„Zdd„ Zdd „ Zd
d„ Zdd
„ Zdd„ Z dBdFdJdNdQdTdWdZd]dbdfdidmdqd!œZ
d"d#„ Zd$d%„ Zd&d'„ Z
d(d)„ Zd*d+„ Zd,d-„ Zd.d/„ Zd0d1„ Zd2d3„ Zd4d5„ Zd6d7„ Zdrd9d:„Zd;d<„ Zd=d>„ ZdS )sr a– 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 that are respectively interpreted as
'stdname', 'calls', 'time', and 'cumulative'). 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)
N)Ústreamc G sF |pt j| _t|ƒsd }n|d }|dd … }| j|ƒ | j|Ž d S )Nr é )ÚsysÚstdoutr ÚlenÚinitÚadd)Úselfr ÚargsÚarg© r ú/usr/lib64/python3.6/pstats.pyÚ__init__A s
zStats.__init__c C s’ d | _ g | _d | _d| _d| _d| _d| _tƒ | _i | _ i | _
| j|ƒ y| jƒ W n8 t
k
rŒ td| jrx| jd nd | jd� ‚ Y nX d S )Nr zInvalid timing data %sr Ú )Úfileéÿÿÿÿ)Úall_calleesÚfilesÚfcn_listÚtotal_ttÚtotal_callsÚ
prim_callsÚmax_name_lenÚsetÚ top_levelÚstatsÚ
sort_arg_dictÚ
load_statsÚget_top_level_statsÚ ExceptionÚprintr )r r
r r r r K s"
z
Stats.initc C s´ |d kri | _ d S t|tƒrxt|dƒ�}tj|ƒ| _ W d Q R X y"tj|ƒ}tj |j
ƒd | }W n Y nX |g| _n t|dƒr˜|j
ƒ |j | _ i |_ | j s°td| j|f ƒ‚d S )NÚrbz Úcreate_statsz.Cannot create or construct a %r object from %r)r Ú
isinstanceÚstrÚopenÚmarshalÚloadÚosÚstatÚtimeZctimeÚst_mtimer Úhasattrr$ Ú TypeErrorÚ __class__)r r
ÚfZ
file_statsr r r r ^ s(
zStats.load_statsc C s„ x~| j jƒ D ]p\}\}}}}}| j|7 _| j|7 _| j|7 _d|kr\| jj|ƒ tt|ƒƒ| j krtt|ƒƒ| _ qW d S )NÚjprofiler Úprofiler)r2 r r3 )
r Úitemsr r r r r
r Úfunc_std_stringr )r ÚfuncÚccÚncÚttÚctÚcallersr r r r t s zStats.get_top_level_statsc G sø |s| S xêt |ƒD ]Þ}t| ƒt|ƒkr.t|ƒ}| j|j7 _| j|j7 _| j|j7 _| j|j7 _x|jD ]}| jj|ƒ qvW | j |j k rž|j | _ d | _
xJ|jjƒ D ]<\}}|| jkrÎ| j| }nddddi f}t
||ƒ| j|<