b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/pstats.pyo
Size24.75 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:29
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@s�dZddkZddkZddkZddkZddkZdgZdfd��YZdfd��YZd�Z d�Z
d �Z d
�Z d �Z
d �Zd
�Zd�ZedjoÒddkZyddkZWnej
onXdeifd��YZddkZeei�djoeidZneZy4ee�ZeidIJei�eidIJWnej
onXndS(s3Class for printing reports on profiled python code.iÿÿÿÿNtStatscBs eZdZd�Zd�Zd�Zd�Zd�Zd�Zh
d3d
6d6d
6d9d6d<d6d?d6dBd6dCdDdEfdfd6dHd6dKd6dNd!6Z d"�Z
d#�Z d$�Z d%�Z
d&�Zd'�Zd(�Zd)�Zd*�Zd+�Zd,�Zd-d.�Zd/�Zd0�ZRS(Os=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)
cOsàti|_d|jo|d|_|d=n|o_|i�}|i�dig}|D]}|d|||fq_~�}td|�nt|�p
d}n|d}|d}|i |�|i
|�dS(Ntstreams, s%s=%ssunrecognized keyword args: %sii( tsyststdoutRtkeystsorttjoint
ValueErrortlentNonetinittadd(tselftargstkwdsRt_[1]tktextrastarg((s/usr/lib64/python2.6/pstats.pyt__init__Is 

  
8




cCsÊd|_g|_d|_d|_d|_d|_d|_h|_h|_ h|_
|i |�d}z|i �d}Wd|o:|i
dI|io|i
|idIn|i
JnXdS(NiisInvalid timing dataiÿÿÿÿ(R t all_calleestfilestfcn_listttotal_ttt total_callst
prim_callst max_name_lent top_leveltstatst
sort_arg_dictt
load_statstget_top_level_statsR(R Rttrouble((s/usr/lib64/python2.6/pstats.pyR
_s(          




cCsñ|p
h|_n¶t|t�ort|d�}ti|�|_|i�y-ti|�}t i
|i �d|}WnnX|g|_ n4t
|d�o#|i�|i|_h|_n|iptd|i|f�ndS(Ntrbs t create_statss1Cannot create or construct a %r object from '%r''(Rt
isinstancet
basestringtopentmarshaltloadtclosetoststatttimetctimetst_mtimeRthasattrR"t TypeErrort __class__(R Rtft
file_stats((s/usr/lib64/python2.6/pstats.pyRus(


 

cCs³x¬|ii�D]�\}\}}}}}|i|7_|i|7_|i|7_d|jod|i|<ntt|��|i jott|��|_ qqWdS(Ntjprofileitprofiler(R3iR4(
RtitemsRRRR RRtfunc_std_stringR(R tfunctcctncttttcttcallers((s/usr/lib64/python2.6/pstats.pyR�s
c Gs|p|St|�djo|i|d�n|d}t|�t|�jp|i|ijot|�}n|i|i7_|i|i7_|i|i7_|i|i7_x|i D]}d|i |<qÌW|i |i jo|i |_ nd|_ xi|i
i�D]X\}}||i
jo|i
|}nddddhf}t||�|i
|<qW|S(Nii(RR ttypeR0RRRRRRR RRRt iteritemstadd_func_stats(R targ_listtotherR7R*t
old_func_stat((s/usr/lib64/python2.6/pstats.pyR �s0
,
  cCs8t|d�}zti|i|�Wd|i�XdS(s:Write the profile data to a file we know how to load back.twbN(tfileR&tdumpRR((R tfilenameR1((s/usr/lib64/python2.6/pstats.pyt
dump_stats®siiÿÿÿÿs
call counttcallsiscumulative timet
cumulativeis file nameRDis line numbertlinetmoduleis
function nametnamesname/file/linetnflitpcallsis
standard nametstdnameis
internal timeR+cCs±|ip h|_}h}xn|ii�D]]\}}|}xH|o@|pPn||jod||<Pn|||<|d }qBWq-Wx|D]
}||=q�Wn|iS(s)Expand all abbreviations that are unique.iiÿÿÿÿ(Rtsort_arg_dict_defaultR>(R tdicttbad_listtwordttuptfragment((s/usr/lib64/python2.6/pstats.pytget_sort_arg_defsÅs&

 


c Gs�|pd|_|St|�djoNt|d�td�jo1hdd6dd6dd6dd6|dg}n|i�}d }d |_d }xA|D]9}|||d}|i|||d7_d
}q�Wg}xY|ii�D]H\}\}} }
} } |i|| |
| f|t|�|f�qñW|i d t
t |�i ��g|_}
x|D]}|
i|d�qpW|S(
NiiROiÿÿÿÿRHR+RIits, tkey((
RRR=RVt sort_typeRR>tappendR6RtCmpToKeyt TupleComptcompare(R tfieldt
sort_arg_defst
sort_tuplet connectorRSt
stats_listR7R8R9R:R;R<Rttuple((s/usr/lib64/python2.6/pstats.pyt
sort_statsØs8 0
  

cCs|io|ii�n|S(N(Rtreverse(R ((s/usr/lib64/python2.6/pstats.pyt
reverse_orderøs
c
Cs\|i}h|_}d}xç|i�D]Ù\}\}}}}} t|�}
tt|
��|jott|
��}nh} x*| i�D]\} }
|
| t| �<q�W|
|jo*t||
||||| f�||
<q)||||| f||
<q)W|i}h|_}x|D]}d|t|�<q#W||_d|_ d|_
|S(Ni( RR>tfunc_strip_pathRR6R?RR RRR(R toldstatstnewstatsRR7R8R9R:R;R<tnewfunct
newcallerstfunc2tcallertold_toptnew_top((s/usr/lib64/python2.6/pstats.pyt
strip_dirsýs4 

 

  
   c
Cs°|iodSh|_}x�|ii�D]|\}\}}}}}||joh||<nxC|i�D]5\}} ||joh||<n| |||<qoWq,WdS(N(RRR>(
R RR7R8R9R:R;R<RlRm((s/usr/lib64/python2.6/pstats.pyt calc_calleess




cCs^|}t|�td�joEg}xì|D]0}ti|t|��o|i|�q,q,Wn±t|�}t|�td�jo@d|jo
djno"t||d�}|| }nLt|�td�jo2d|jo
|jno|}|| }nt|�t|�jo'|dt|�t|�|f}n||fS(NRWgð?ggà?iis6 List reduced from %r to %r due to restriction <%r>
(R=tretsearchR6RZRtint(R tseltlisttmsgtnew_listR7tcount((s/usr/lib64/python2.6/pstats.pyteval_print_amount,s$ 77!cCs |i}|io|i}d|id}n|ii�}d}x)|D]!}|i|||�\}}qNWt|�}|p d|fS|i|IJ|t|i�joJd}xA|D]5}tt|��|jott|��}qÁqÁWn|d|fS(Ns Ordered by: s
s! Random listing order was used
ii( RRRYRRRzRRR6(R tsel_listtwidthRvRwt selectionRyR7((s/usr/lib64/python2.6/pstats.pytget_print_listAs( 

  
cGs%x|iD]}|i|IJq
W|io |iJnd}x*|iD]}|i|It|�IJqFW|i|I|iIdI|i|ijo|id|iIn|id|iIJ|iJ|i|�\}}|o:|i�x|D]}|i |�qøW|iJ|iJn|S(Nt isfunction callss(%d primitive calls)sin %.3f CPU secondss (
RRRtfunc_get_function_nameRRRR~t print_titlet
print_line(R tamountRFtindentR7R|Rv((s/usr/lib64/python2.6/pstats.pyt print_statsYs.



 cGs�|i|�\}}|o~|i�|i|d�xO|D]G}||ijo|i|||i|�q=|i||h�q=W|iJ|iJn|S(Ns called...(R~Rqtprint_call_headingRtprint_call_lineR(R R�R|RvR7((s/usr/lib64/python2.6/pstats.pyt
print_calleesos
 c
Gs�|i|�\}}|oe|i|d�x@|D]8}|i|\}}}}} |i||| d�q3W|iJ|iJn|S(Nswas called by...s<-(R~R�RR�R(
R R�R|RvR7R8R9R:R;R<((s/usr/lib64/python2.6/pstats.pyt
print_callers~s c
Cs�|idi|�|IJt}xS|ii�D]B\}}}}}|o&|i�i�} t| t�}Pq0q0W|o|id|dIJndS(Ns Function Rs ncalls tottime cumtime(RtljusttFalseRt
itervaluestnextR#Rc(
R t name_sizet column_titlet subheaderR8R9R:R;R<tvalue((s/usr/lib64/python2.6/pstats.pyR��s s->cCsZ|it|�i|�|I|p |iJdS|i�}|i�d}x|D]ü}t|�}||} t| t�o�| \}
} } }
|
| jod|
| f}nd|
f}d|iddt|��t | �t |
�|f}|d}n/d|| t |i
|d �f}|d }|i|||IJd
}qVWdS( NRWs%d/%ds%ds %s %s %s %siiis %s(%r) %siR( RR6R�RRR#RctrjustRtf8R(R R�tsourcet call_dicttarrowtclistR�R7RLR�R9R8R:R;tsubstatst
left_width((s/usr/lib64/python2.6/pstats.pyR��s.  
 


$
cCs|idI|idIJdS(Ns- ncalls tottime percall cumtime percallsfilename:lineno(function)(R(R ((s/usr/lib64/python2.6/pstats.pyR�¯s
cCs|i|\}}}}}t|�}||jo|dt|�}n|i|id�I|it|�I|djo|idIn|itt|�|�I|it|�I|djo|idIn|itt|�|�I|it|�IJdS(Nt/i iRis s (RtstrRR�R�tfloatR6(R R7R8R9R:R;R<tc((s/usr/lib64/python2.6/pstats.pyR�³s 


(iiÿÿÿÿ((iiÿÿÿÿ(((iiÿÿÿÿs
call count(iiÿÿÿÿ((iiÿÿÿÿ(((iiÿÿÿÿscumulative time(ii((ii(((iis file name(ii((ii(((iis line number(ii((ii(((iis file name(ii((ii(((iis
function name(ii(ii(ii(iiÿÿÿÿ((iiÿÿÿÿ(((iiÿÿÿÿs
call count(ii((ii(((iis
standard name(iiÿÿÿÿ((iiÿÿÿÿ(((iiÿÿÿÿs
internal time(t__name__t
__module__t__doc__RR
RRR RGRPRVRdRfRpRqRzR~R�R�R�R�R�R�R�(((s/usr/lib64/python2.6/pstats.pyR+s@   


          R\cBs eZdZd�Zd�ZRS(s�This 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(tcomp_select_list(R R¡((s/usr/lib64/python2.6/pstats.pyRÍscCsWxP|iD]E\}}||}||}||jo| S||jo|Sq
WdS(Ni(R¡(R tlefttrighttindext directiontltr((s/usr/lib64/python2.6/pstats.pyR]Ðs




 (R�R�R RR](((s/usr/lib64/python2.6/pstats.pyR\Ås cs dtf�fd��Y}|S(s,Convert a cmp= function into a key= functiontKcs eZd�Z�fd�ZRS(cSs
||_dS(N(tobj(R R©((s/usr/lib64/python2.6/pstats.pyRÝscs�|i|i�djS(Niÿÿÿÿ(R©(R RA(tmycmp(s/usr/lib64/python2.6/pstats.pyt__lt__ßs(R�R�RR«((Rª(s/usr/lib64/python2.6/pstats.pyR¨Üs (tobject(RªR¨((Rªs/usr/lib64/python2.6/pstats.pyR[ÚscCs(|\}}}tii|�||fS(N(R)tpathtbasename(t func_nameRFRJRL((s/usr/lib64/python2.6/pstats.pyRgçscCs|dS(Ni((R7((s/usr/lib64/python2.6/pstats.pyR�ëscCs_|d d
joB|d}|id�o |id�od|dd!S|Sn d |SdS( Nit~it<t>s{%s}iiÿÿÿÿs %s:%d(%s)(R°i(t
startswithtendswith(R¯RL((s/usr/lib64/python2.6/pstats.pyR6îs 
 c CsV|\}}}}}|\}}} }
} |||||| ||
t| |�fS(s3Add together all the stats for two profile entries.(t add_callers( ttargetR�R8R9R:R;R<tt_cctt_nctt_tttt_ctt t_callers((s/usr/lib64/python2.6/pstats.pyR?ÿsc
CsÑh}x$|i�D]\}}|||<qWx�|i�D]�\}}||jolt|t�oHtg}t|||�D]}||d|dq~~�||<qÉ||c|7<q:|||<q:W|S(s*Combine two caller lists in a single list.ii(R>R#Rctzip(R¶R�t new_callersR7RmRti((s/usr/lib64/python2.6/pstats.pyRµs



>cCs+d}x|i�D]}||7}qW|S(s@Sum the caller statistics to get total number of calls received.i(R�(R<R9RH((s/usr/lib64/python2.6/pstats.pyt count_callss

cCsd|S(Ns%8.3f((tx((s/usr/lib64/python2.6/pstats.pyR�#st__main__tProfileBrowsercBsõeZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d�Z d �Z d
�Z
d �Zd �Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsatii|�d|_|dj o"t|�|_|ii|_nd|_ti |_dS(Ns% (
tcmdtCmdRtpromptR RRRRR(R tprofile((s/usr/lib64/python2.6/pstats.pyR2s 
 c
Csù|i�}g}x¯|D]§}y|it|��wWntj
onXyNt|�}|djp
|djo|idIJwn|i|�wWntj
onX|i|�qW|iot|i|�|�n|idIJdS(Niis#Fraction argument must be in [0, 1]sNo statistics object is loaded.(tsplitRZRtRR�RRtgetattr(R tfnRJR
t processedttermtfrac((s/usr/lib64/python2.6/pstats.pytgeneric<s.  



cCsR|idIJ|idIJ|idIJ|idIJ|idIJ|idIJdS(NsArguments may be:s0* An integer maximum number of entries to print.s:* A decimal fractional number between 0 and 1, controllings- what fraction of selected entries to print.s8* A regular expression; only entries with function namess that match it are printed.(R(R ((s/usr/lib64/python2.6/pstats.pyt generic_helpTs 




cCs/|io|ii|�n|idIJdS(NsNo statistics object is loaded.i(RR R(R RJ((s/usr/lib64/python2.6/pstats.pytdo_add\s

cCs|idIJdS(Ns>Add profile info from given file to current statistics object.(R(R ((s/usr/lib64/python2.6/pstats.pythelp_addbscCs|id|�S(NR�(RÍ(R RJ((s/usr/lib64/python2.6/pstats.pyt
do_calleesescCs|idIJ|i�dS(Ns6Print callees statistics from the current stat object.(RRÎ(R ((s/usr/lib64/python2.6/pstats.pyt help_calleesgs
cCs|id|�S(NR�(RÍ(R RJ((s/usr/lib64/python2.6/pstats.pyt
do_callerskscCs|idIJ|i�dS(Ns6Print callers statistics from the current stat object.(RRÎ(R ((s/usr/lib64/python2.6/pstats.pyt help_callersms
cCs|idIJdS(NRWi(R(R RJ((s/usr/lib64/python2.6/pstats.pytdo_EOFqs
cCs|idIJdS(NsLeave the profile brower.(R(R ((s/usr/lib64/python2.6/pstats.pythelp_EOFtscCsdS(Ni((R RJ((s/usr/lib64/python2.6/pstats.pytdo_quitwscCs|idIJdS(NsLeave the profile brower.(R(R ((s/usr/lib64/python2.6/pstats.pyt help_quityscCsÌ|o�yt|�|_WnYtj
o}|i|dIJdStj
o'}|i|iidI|IJdSX|d|_nBt|i�djo|id }|i |�n|idIJdS(Nit:s% iiþÿÿÿs1No statistics object is current -- cannot reload.i(
RRtIOErrorRt ExceptionR0R�RÅRtdo_read(R RJR
terr((s/usr/lib64/python2.6/pstats.pyRÜ|s

cCs|idIJ|idIJdS(Ns+Read in profile data from a specified file.s*Without argument, reload the current file.(R(R ((s/usr/lib64/python2.6/pstats.pyt help_read�s
cCs,|io|ii�n|idIJdS(NsNo statistics object is loaded.i(RRfR(R RJ((s/usr/lib64/python2.6/pstats.pyt
do_reverse�s

cCs|idIJdS(Ns/Reverse the sort order of the profiling report.(R(R ((s/usr/lib64/python2.6/pstats.pyt help_reverse�scCsµ|ip|idIJdS|ii�}|o7t|d�|i�� o|ii|i��nI|idIJx8tii�D]'\}}|id||dfIJq�WdS(NsNo statistics object is loaded.cSs
||jS(((RÀta((s/usr/lib64/python2.6/pstats.pyt<lambda>�ss/Valid sort keys (unique prefixes are accepted):s%s -- %sii( RRRVtfilterRÇRdRRPR>(R RJtabbrevsRXR�((s/usr/lib64/python2.6/pstats.pytdo_sort�s

$
 cCs|idIJ|idIJdS(Ns.Sort profile data according to specified keys.s3(Typing `sort' without arguments lists valid keys.)(R(R ((s/usr/lib64/python2.6/pstats.pyt help_sort¦s
cGs6g}tiD]!}|i|�o ||qq~S(N(RRPR³(R ttextR
RRá((s/usr/lib64/python2.6/pstats.pyt
complete_sort©scCs|id|�S(NR�(RÍ(R RJ((s/usr/lib64/python2.6/pstats.pytdo_stats¬scCs|idIJ|i�dS(Ns.Print statistics from the current stat object.(RRÎ(R ((s/usr/lib64/python2.6/pstats.pyt
help_stats®s
cCs,|io|ii�n|idIJdS(NsNo statistics object is loaded.(RRpR(R RJ((s/usr/lib64/python2.6/pstats.pytdo_strip²s
cCs|idIJdS(Ns<Strip leading path information from filenames in the report.(R(R ((s/usr/lib64/python2.6/pstats.pyt
help_strip·scCs|idIJdS(NsShow help for a given command.(R(R ((s/usr/lib64/python2.6/pstats.pyt help_helpºscCs|o|SdS(N(R (R tstopRJ((s/usr/lib64/python2.6/pstats.pytpostcmd½sN(R�R�R RRÍRÎRÏRÐRÑRÒRÓRÔRÕRÖR×RØRÜRÞRßRàRåRæRèRéRêRëRìRíRï(((s/usr/lib64/python2.6/pstats.pyRÂ1s4
                      is*Welcome to the profile statistics browser.sGoodbye.(R RR)R+R&Rrt__all__RR\R[RgR�R6R?RµR¿R�R�RÃtreadlinet ImportErrorRÄRÂRtargvt initprofileR tbrowserRtcmdlooptKeyboardInterrupt(((s/usr/lib64/python2.6/pstats.pyt<module>sF"      ÿ�
     
 �