python (3.11.7)

(root)/
lib/
python3.11/
__pycache__/
profile.cpython-311.opt-1.pyc

ecYdZddlZddlZddlZddlZgdZGddZd
dZd
dZGd	d
Z	dZ
edkre
dSdS)z Class for profiling Python code.N)runrunctxProfilec*eZdZdZdZdZdZdZdS)_UtilszSupport class for utility functions which are shared by
    profile.py and cProfile.py modules.
    Not supposed to be used directly.
    c||_dSN)profiler)selfr
s  ;/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/profile.py__init__z_Utils.__init__0s
 


c|}	||n#t$rYnwxYw||||dS#||||wxYwr	)r
r
SystemExit_show)r	statementfilenamesortprofs     rrz
_Utils.run3s}}	-HHY			D	
JJtXt,,,,,DJJtXt,,,,s!,A
9A9AA.c|}	||||n#t$rYnwxYw||||dS#||||wxYwr	)r
rrr)rrglobalslocalsrrrs       rrz
_Utils.runctx<s}}	-KK	7F3333			D	
JJtXt,,,,,DJJtXt,,,,s!.A
;A;AA0cb|||dS||dSr	)
dump_statsprint_stats)rrrrs    rrz_Utils._showEs:OOH%%%%%T"""""rN)__name__
__module____qualname____doc__r
rrrrrrr*sZ
!!!------#####rrcTtt|||S)aRun statement under profiler optionally saving results in filename

    This function takes a single argument that can be passed to the
    "exec" statement, and an optional file name.  In all cases this
    routine attempts to "exec" its first argument and gather profiling
    statistics from the execution. If no file name is present, then this
    function automatically prints a simple profiling report, sorted by the
    standard name string (file/line/function-name) that is presented in
    each line.
    )rrr)rrrs   rrrQs"'??y(D999rcXtt|||||S)zRun statement under profiler, supplying your own globals and locals,
    optionally saving results in filename.

    statement and filename have the same semantics as profile.run
    )rrr)rrrrrs     rrr^s&'??!!)WfhMMMrceZdZdZdZddZdZdZdZdZ	d	Z
d
ZdZdZ
ee
e
ee
e
d
ZdZGddZGddZdZdZd dZdZdZdZdZdZdZd!dZdZdS)"raProfiler class.

    self.cur is always a tuple.  Each such tuple corresponds to a stack
    frame that is currently active (self.cur[-2]).  The following are the
    definitions of its members.  We use this external "parallel stack" to
    avoid contaminating the program that we are profiling. (old profiler
    used to write into the frames local dictionary!!) Derived classes
    can change the definition of some entries, as long as they leave
    [-2:] intact (frame and previous tuple).  In case an internal error is
    detected, the -3 element is used as the function name.

    [ 0] = Time that needs to be charged to the parent frame's function.
           It is used so that a function call will not have to access the
           timing data for the parent frame.
    [ 1] = Total time spent in this frame's function, excluding time in
           subfunctions (this latter is tallied in cur[2]).
    [ 2] = Total time spent in subfunctions, excluding time executing the
           frame's function (this latter is tallied in cur[1]).
    [-3] = Name of the function that corresponds to this frame.
    [-2] = Actual frame that we correspond to (used to sync exception handling).
    [-1] = Our parent 6-tuple (corresponds to frame.f_back).

    Timing data for each function is stored as a 5-tuple in the dictionary
    self.timings[].  The index is always the name stored in self.cur[-3].
    The following are the definitions of the members:

    [0] = The number of times this function was called, not counting direct
          or indirect recursion,
    [1] = Number of times this function appears on the stack, minus one
    [2] = Total time spent internal to this function
    [3] = Cumulative time that this function was present on the stack.  In
          non-recursive functions, this is the total execution time from start
          to finish of each invocation of a function, including time spent in
          all subfunctions.
    [4] = A dictionary indicating for each function name, the number of times
          it was called by us.
    rNci|_d|_d|_d|_||j}||_|s%t
jx|_|_|j	|_
n||_|}	t|}|dkr
|j|_
n|j
|_
|tfd}||_n##t$r||_|j	|_
YnwxYw||_|ddS)Nc(||Sr	r )timersums  rget_time_timerz(Profile.__init__.<locals>.get_time_timers3uuww<<'rr
)timingscurcmdc_func_namebiastimeprocess_timer)get_timetrace_dispatch_i
dispatcherlentrace_dispatchtrace_dispatch_lr*	TypeErrort
simulate_call)rr)r0r:lengthr+s      rr
zProfile.__init__s<9D		/)-)::DJ"3DOODJ

A
/Q
Q;;&*&9DOO&*&;DO*/C(((( .


8
8
8 %
"&"7
8 :&&&&&s0B11CCcH|j}|}|d|dz|jz
|jz
}|dkr|j|_|j||||r"|}|d|dz|_dS|}|d|dz|z
|_dS)Nrc_callr)r:r0rr/dispatch)rframeeventargr)r:rs       rr7zProfile.trace_dispatchs
EGG
aD1Q4K$& 49,H"|D4=eA..	%AqTAaD[DFFFAqTAaD[1_DFFFrc|j}||jz
|jz
}|dkr|j|_|j||||r||_dS||z
|_dSNr?r@rrBrCrDr)r:s      rr4zProfile.trace_dispatch_isz
EGGdfty(H"|D4=eQ//	!UWWDFFFUWWq[DFFFrc|j}|dz|jz
|jz
}|dkr|j|_|j||||r|dz|_dS|dz|z
|_dS)NgN@r?r@rHs      rtrace_dispatch_maczProfile.trace_dispatch_macs
EGGDL46!DI-H"|D4=eQ//	&UWWT\DFFFUWWT\A%DFFFrc|j}||jz
|jz
}|dkr|j|_|j||||r||_dS||z
|_dSrG)r3r:r0rr/rA)rrBrCrDr3r:s      rr8zProfile.trace_dispatch_lsz=HJJ$)+H"|D4=eQ//	$XZZDFFFXZZ!^DFFFrcz|j\}}}}}}||ur|r|||S|||z||||f|_dSNr>)r-trace_dispatch_return)	rrBr:rptritretrfnrframercurs	         rtrace_dispatch_exceptionz Profile.trace_dispatch_exceptionsY+/8(S#sFD%T--fa888AsC5qrct|jrR|j|jdur>|j\}}}}}}t|tjs||d|j}	|	j|	j|	j	f}
|dd|
||jf|_|j
}|
|vr||
\}}
}}}||
dz|||f||
<n
ddddif||
<dSNrr>)r-f_back
isinstancer
fake_framerNf_codeco_filenameco_firstlinenoco_namer,)rrBr:rOrPrQrRrSrTfcodefnr,ccnsttctcallerss                 rtrace_dispatch_callzProfile.trace_dispatch_calls8		FDHRL88/3x,Cc3fg&899
F**61555!5u}
Eq!R1,
==&-bk#BBGb1fb"g5GBKKQ1b.GBKqrcdd|jf}|dd|||jf|_|j}||vr||\}}}}}	||dz|||	f||<n
ddddif||<dS)Nr&rr>)r/r-r,)
rrBr:rar,rbrcrdrerfs
          rtrace_dispatch_c_callzProfile.trace_dispatch_c_calls}!T%
&q!R1,
==&-bk#BBGbdBG3GBKKQ1b.GBKqrc`||jdur!||jdd|j\}}}}}}||z}||z}|\}	}
}}}
}|	|
|z||z||
|f|_|j}||\}}}}}|s
||z}|dz}||vr||dz||<nd||<||dz
||z||f||<dSrW)r-rNr,)rrBr:rOrPrQrRrTframe_totalpptpitpetpfnpframepcurr,rbrcrdrerfs                     rrNzProfile.trace_dispatch_return"s$$&&tx|Q777
+/('S#sE4AgCi+/(S#sFDc	3#4c64G,")#,BB	
k!BaB'>>"3<!+GCLL
GCL2628R8qr)call	exceptionreturnr?c_exceptionc_returnc\|jdrdS||_||dSNr!)r-r.r;)rr.s  rset_cmdzProfile.set_cmdXs38B<3rceZdZdZdZdS)Profile.fake_codec>||_||_||_d|_dSNr)r]co_liner_r^)rrlinenames    rr
zProfile.fake_code.__init__^s&'DDLDL"#DrcDt|j|j|jfSr	)reprr]r~r_rs r__repr__zProfile.fake_code.__repr__ds)4<FGGGrN)rrrr
rr rr	fake_coder{]s7	$	$	$	H	H	H	H	HrrceZdZdZdS)Profile.fake_framec"||_||_dSr	)r\rY)rcodepriors   rr
zProfile.fake_frame.__init__hsDKDKKKrN)rrrr
r rrr[rgs#	 	 	 	 	 rr[c|dd|}|jr|jd}nd}|||}|jd||ddS)NprofilerrXrr)rr-r[rA)rrrrprBs     rr;zProfile.simulate_calllsg~~iD118	Xb\FFFf--
fdE1-----rc|j}||jz
}|jdr2|jd||jd|d}|jd2||z
|_dS)Nr!rtrXr)r3r:r-rA)rr3r:s   rsimulate_cmd_completezProfile.simulate_cmd_completexsx=HJJhrl	
$DM(#D$(2,:::A	hrl	
arr!cddl}|||dSr})pstatsStats
strip_dirs
sort_statsr)rrrs   rrzProfile.print_statssC


T%%''22488+-----rct|d5}|tj|j|ddddS#1swxYwYdS)Nwb)opencreate_statsmarshaldumpstats)rfilefs   rrzProfile.dump_statss
$

	(LQ'''	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(s/A

AAcV||dSr	)rsnapshot_statsrs rrzProfile.create_statss,""$$$rci|_|jD]L\}\}}}}}|}d}|D]}||z
}|||||f|j|<MdSr})rr,itemscopyvalues)	rfuncrbrcrdrerfnccallcnts	         rrzProfile.snapshot_statss
/3|/A/A/C/C	7	7+D+2r2r7llnnGB">>++

g
!2r2w6DJt	7	7rcFddl}|j}||||Sr})__main____dict__r)rr.rdicts    rrzProfile.runs) {{3d+++rc||tj|j	t	|||tjdn#tjdwxYw|Sr	)rysys
setprofiler5exec)rr.rrs    rrzProfile.runctxskSt'''	!gv&&&N4    CN4    sAA,c|t|tj|j	||i|tjdS#tjdwxYwr	)ryrrrr5)rrargskws    rruncallzProfile.runcallslT$ZZ   t'''	!4$$$N4    CN4    sAA/c|jturtd|j}d|_	|||||_S#||_wxYw)Nz&Subclasses must override .calibrate().r)	__class__rr9r0_calibrate_inner)rmverbose
saved_biass    r	calibratezProfile.calibrates`>((DEEEY
		#((G44"DII
DI""""sA

	Ac|j}d}|fd}|||}|||}||z
}|rtd|t}	|}|	dt	t|}||z
}
|rtd|
d}d}|	jD]\\}
}}\}}}}}|dvr
||z
}||z
}|r td|td	|||d
zkrtd|z||z
dz|z}|rtd
||S)Nc.t|D]}d}dSrMrange)nixs   rf1z$Profile._calibrate_inner.<locals>.f1s(1XX



rc@t|D]
}|ddS)Ndr)rrrs   rrz#Profile._calibrate_inner.<locals>.fs01XX

3

rz elapsed time without profiling =zf(m)zelapsed time with profiling =g)rrz!'CPU seconds' profiler reported =ztotal # calls =r>z internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)	r3printrrrrr,r
ValueError)rrrr3rrt0t1elapsed_noprofilepelapsed_profiletotal_calls
reported_timerrfuncnamerbrcrdrerfmeans                      rrzProfile._calibrate_inners=								
!XZZ	!
XZZG	I46GHHH

II
XZZ	FHH---
XZZr'	D1?CCC
	!!	$	$A&XtX(ARR;&&r!#
	25}EEE#[111!a%?+MNNN 11S8;F	G?FFFr)NN)r!)r)rrrrr0r
r7r4rJr8rUrgrirNrAryrr[r;rrrrrrrrrrr rrrrgs$$L
D#'#'#'#'N
%
%
%$
!
!
!
&
&
&
$
$
$&,			###N$-'',)


H    
HHHHHHHH        
...       
(((
777,,,
!!!b	#	#	#	#<<<<<rrclddl}ddlm}d}||}d|_|dddd	d
|ddd
dd|ddddd
t
jdds(|tjd|	\}}|t
jdd<|j
$|j|j
|_
t|dkr|jrddl}d}|j|dd}n|d}	t
jd|j|	t'j|	5}
t+|
|	d}dddn#1swxYwY|	dddd}	t/||d|j
|jnP#t2$r/}dt
_tj|jYd}~nd}~wwxYw||S)Nr)OptionParserzMprofile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)usageFz-oz	--outfileoutfilezSave stats to <outfile>)desthelpdefaultz-mmodule
store_truezProfile a library module.)ractionrrz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classr!r>r'z(run_module(modname, run_name='__main__'))
run_modulemodnamerr)__file__r__package__
__cached__)osoptparserallow_interspersed_args
add_optionrargvprint_usageexit
parse_argsrpathabspathr6rrunpyrinsertdirnameio	open_codecompilereadrrBrokenPipeErrorstdouterrno)rrrparseroptionsrrrglobsprognamefpexcs            rmainr)s
III%%%%%%[E
\
&
&
&F%*F"
dKi
&666
d,
(%999
dH6
N8ABB<''))OWdCHQQQK"'//'/::
4yy1}}>	LLL=D#.7EE
AwHHOOArwx88999h''
<2rwwyy(F;;
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<%&#"	E	 4gow|DDDD	 	 	 CJHSY	 
	Ms*$F33F7:F7G$$
H.%HHrrx)rrrr1r__all__rrrrrrr rr<module>rs'&$
			




&
&
&########N::::NNNN~~~~~~~~D666rzDFFFFFr