eprSrSSKrSSKrSSKrSSKrSSKrSSKJrJr SSK J r SSK J r SSK Jr /SQr\"\5"SS 55r\ "S S 9"S S 55r\ "S S 9"SS55r"SS5r"SS5rSrSrSrSrSrSrSr\S:XaSSKrSSKr"SS\R@5r!\""\RF5S:a\RFSr$OSr$\!"\$5r%\RFSSHr&\%RO\&5 M \("S \%RRS!9 \%RU5 \("S"\%RRS!9 gg!\a Nf=f!\+a gf=f)#z3Class for printing reports on profiled python code.N)StrEnum _simple_enum) cmp_to_key) dataclass)Dict)StatsSortKeyFunctionProfile StatsProfilec>\rSrSrSrSrSrSrSrSr Sr S r S r S r S rg )r $)callsncalls) cumulativecumtime)filenamemodulelinenamenflpcallsstdname)timetottimecUSn[RX5nX#lUSSHnX0RU'M XlU$Nr)str__new___value__value2member_map_ _all_values)clsvaluesvalueobj other_values ,/opt/imh/python3.13/lib/python3.13/pstats.pyrSortKey.__new__0sFq kk#% !!":K25 " "; /&  N)__name__ __module__ __qualname____firstlineno__CALLS CUMULATIVEFILENAMELINENAMENFLPCALLSSTDNAMETIMEr__static_attributes__r+r*r(r r $s4 E(J#H D D C FG Dr*r T) unsafe_hashc\\rSrSr%\\S'\\S'\\S'\\S'\\S'\\S'\\S'S rg ) r :rrpercall_tottimerpercall_cumtime file_name line_numberr+N) r,r-r.r/r__annotations__floatintr9r+r*r(r r :s( K N NNr*r c8\rSrSr%Sr\\S'\\\ 4\S'Sr g)r Dz0Class for keeping track of an item in inventory.total_tt func_profilesr+N) r,r-r.r/__doc__rBrArrr r9r+r*r(r r Ds:O_,--r*r c\rSrSrSrSS.SjrSrSrSrS r S r S S S S S SS SSSSSSS. r Sr Sr SrSrSrSrSrSrSrSrSrS rS%S!jrS"rS#rS$rg)&rJawThis 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 either an arbitrary number of quoted strings or SortKey enum to select the sort order. For example sort_stats('time', 'name') or sort_stats(SortKey.TIME, SortKey.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)streamcU=(d [RUl[U5(dSnO USnUSSnUR U5 UR "U6 gr)sysstdoutrKleninitadd)selfrKargsargs r(__init__Stats.__init__lsJ*  4yyCq'C8D # $r*cpSUl/UlSUlSUlSUlSUlSUl[5Ul0Ul 0Ul URU5 UR5 g![a9 [SUR(aURSOS-URS9 ef=f)NrzInvalid timing data %sfile) all_calleesfilesfcn_listrF total_calls prim_calls max_name_lenset top_levelstats sort_arg_dict load_statsget_top_level_stats ExceptionprintrK)rRrTs r(rP Stats.initvs        $ $ &  *%)ZZ4::b>R9?C{{ L  s !A22AB5c.Uc0Ulg[U[5(av[US5n[R "U5UlSSS5 [ R"U5n[R"UR5S-U-nU/Ul O9[US5(a(UR5 URUl0UlUR(d[SUR<SU<35eg!,(df  N=f! N=f)Nrbz create_statszCannot create or construct a z object from )rd isinstanceropenmarshalloadosstatrctimest_mtimer]hasattrrm TypeError __class__)rRrTf file_statss r(rfStats.load_statss ;DJ  S ! !c4A$\\!_ ! WWS\ jj!4!45>DDJ S. ) )    DJCIzz#~~s45 5!  sC?!0Br*cU(dU$[U5GHdn[U5[U5:wa [U5nU=RUR- slU=RUR- slU=R UR - slU=R UR - slURHnURRU5 M URUR:aURUl SUl URR5HCup4X0R;aURUnOSSSS04n[XT5URU'ME GMg U$Nr)reversedtyperr]r_r`rFrcrQrar^rdradd_func_stats)rRarg_listitemrrs old_func_stats r(rQ Stats.adds%KX&DDzT$Z'T{ JJ$** $J    0 0 0  OOt .O MMT]] *M""4('  4#4#44$($5$5! DM"jj..0 ::%$(JJt$4M%&1a$5M#1-#F 4 1'* r*c[US5n[R"URU5 SSS5 g!,(df  g=f)z:Write the profile data to a file we know how to load back.wbN)rorpdumprd)rRrrys r( dump_statsStats.dump_statss, (D !Q LLQ '" ! !s "8 A)))rrXz call count)))rXzcumulative time))rz file name))rz line number))rz function name))rrrzname/file/line)))rrXzprimitive call count)))rz standard name)))rXz internal time) rrrrrrrrrrrrrcUR(da0=Uln0nURR5H-up4UnU(dMXQ;aSX%'MXAU'USSnU(aMM/ UHnX M UR$)z)Expand all abbreviations that are unique.rNrX)resort_arg_dict_defaultr)rRdictbad_listwordtupfragments r(get_sort_arg_defsStats.get_sort_arg_defss!!(* *D H!77==? h'-.*%(N'}H h@!J!!!!r*c.U(d SUlU$[U5S:Xa'[US[5(aSSSSS.US/nOA[U5S:a2USSH)n[ U5[ US5:wdM [ S 5e UR 5nS nS UlS nUHMn[U[5(a URnXCUS-nU=RXSUS-- slS nMO /nURR5H.unuppn URXX4U-[U5U4-5 M0 UR[[!U5R"5S 9 /=UlnUHnURUS5 M U$)Nrrrrrr)rXrrrrzCan't have mixed argument typer+rYz, )keyrX)r^rOrnrCrrwr sort_typer r%rdrappendrsortr TupleCompcompare)rRfieldrT sort_arg_defs sort_tuple connectorr stats_listrrrrrrr^tuples r( sort_statsStats.sort_statssDMK u:?z%(C88$"!')*/q35EZ1_QRy9U1X.#$DEE!..0   D$((zz#D&9!&< gr)r\rdr) rRr\rrrrrrrrs r( calc_calleesStats.calc_callees4s    )++;/3zz/?/?/A +D+227&$& !!( +)+K&,2E"4("10B r*cUn[U[5(aU[R"U5n/nUH5nUR [ U55(dM$URU5 M7 Or[U5n[U[5(a&SUs=::aS:aO O[Xq-S-5nUSUnO,[U[5(aSUs=::aU:a O OUnUSUn[U5[U5:wa$US[U5<S[U5<SU<S 3- nXC4$![Ra USU-- nXC4s$f=f) Nz# gg?g?rz List reduced from z to z due to restriction ) rnrrecompile PatternErrorsearchrrrOrBrC)rRsellistmsgnew_listrexrcounts r(eval_print_amountStats.eval_print_amountGs% c3   %jjoH::od344OOD)IE#u%%#*:s*:EK",-<C%%!s*:U*:< t9H % D 3x=#/ /C}'?? %=CC}$ %sDE?Ec UR(aURSSO"[URR55nU(d [ S05$[ [ UR55n0n[ X#5nUHnURUupgpn Uupn Xv:Xa [U5O[U5S-[U5-n[ [ U55nUS:XaSO[ [ X- 55n[ [ U 55nUS:XaSO[ [ X- 55n[UUUUUU U 5nUX='M U$)aThis method returns an instance of StatsProfile, which contains a mapping of function names to instances of FunctionProfile. Each FunctionProfile instance holds information related to the function's profile such as how long the function took to run, how many times it was called, etc... Nr/rX) r^rrdkeysr rBf8rFrr )rR func_listrFrG stats_profilerrrrrrr?r@ func_namerrr=rr> func_profiles r(get_stats_profileStats.get_stats_profileas  )- DMM!$4 @Q;R 2& &DMM*+ $X= D&*jj&6 #BBG04 -II "SWs2w}s2w/FFBrFmG$&!Gbr"%y1AOBrFmG$&!Gbr"%y1AO*L(4M $#&r*cURnUR(a"URSSnSUR-S-nO%[URR 55nSnUHnUR XSU5up4M [U5nU(dSU4$[X@RS9 U[UR5:a9SnUH1n[[U55U:dM[[U55nM3 US-U4$)Nz Ordered by:  z! Random listing order was used rrZr) rar^rrrdrrrOrirKr)rRsel_listwidth stat_listr selectionrrs r(get_print_listStats.get_print_lists!! == a(I#dnn4t;CTZZ__./I6C!I!33I#NNIs"Ii<  c $ 3tzz? "E!-.6 56E"Qw !!r*cURHn[X RS9 M UR(a[URS9 SnURH!n[U[ U5URS9 M# [X0R SSURS9 UR UR :wa"[SUR -SURS9 [SUR-URS9 [URS9 URU5upVU(aPUR5 UHnURU5 M [URS9 [URS9 U$)NrZ zfunction calls endr[z(%d primitive calls)zin %.3f seconds) r]rirKrcfunc_get_function_namer_r`rFr print_title print_line)rRamountrindentrrrs r( print_statsStats.print_statss H ( -# :: t{{ #NND &06T[[ I# f&&(8c T   t . (4??:$++ V $--/dkkB 4;;))&1      % t{{ # t{{ # r*c`URU5up#U(aUR5 URUS5 UHEnX@R;a!UR X$URU5 M3UR X$05 MG [ UR S9 [ UR S9 U$)Nz called...rZ)rrprint_call_headingr\print_call_linerirK)rRrrrrs r( print_calleesStats.print_calleess))&1        # #E; 7+++((d6F6Ft6LM((b9  t{{ # t{{ # r*cURU5up#U(agURUS5 UH)nURUupVpxn URX$U S5 M+ [ UR S9 [ UR S9 U$)Nzwas called by...z<-rZ)rrrdrrirK) rRrrrrrrrrrs r( print_callersStats.print_callerssx))&1    # #E+= >*.**T*:'$$U'4@ t{{ # t{{ # r*cX[SRU5U-URS9 SnURR 5HBupEpgnU(dM[ [ UR 555n [U [5n O U(a[SU-S-URS9 gg)Nz Function rZFrz ncalls tottime cumtime) riljustrKrdr$nextiterrnr) rR name_size column_title subheaderrrrrrr%s r(rStats.print_call_headings k *\9 L '+zz'8'8': #BBGwT'.."234&ue4  (;  #i-"@@t{{ S r*c r[[U5RU5U-SURS9 U(d[URS9 g[ UR 55nSnUHn[U5nX7n [ U [5(a^U uppX:waSX4-nOSU 4-nURSS[U5--5<S[U 5<S[U 5<S U<3nUS -nO+U<S U <S [URUS 5<3nUS -n[Xo-U-URS9 SnM g)NrrrZrYz%d/%dz%drrz r(z) r) rirrrKsortedrrnrrjustrOrrd)rRrsource call_dictarrowclistrrrr%rrrrsubstats left_widths r(rStats.print_call_lines of%++I6>CdkkZ t{{ # y~~'(D"4(DOE%''!&8&"1H#re|H-5^^AaF mO-L-/VRVTC&] *.r$**T:J1:M7NO&] &#h.T[[ AF!r*cV[SSURS9 [SURS9 g)Nz- ncalls tottime percall cumtime percallrrzfilename:lineno(function)rZrirKrs r(rStats.print_titles" =3T[[Y ) )r,r-r.r/rHrUrPrfrgrQrrrrrrrrrrrrrrrrrr9r+r*r(rrJsB&*&,?4(DCHHBDBFGMFFF ""%N : &4!F"0.   T2=7r*rc$\rSrSrSrSrSrSrg)riaThis 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 descending) 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.cXlgrcomp_select_list)rRrs r(rUTupleComp.__init__s 0r*cdURH up4XnX#nXV:aU*s $XV:dMUs $ grr)rRleftrightindex directionlrs r(rTupleComp.compares@ $ 5 5 E A Au!z!u  !6r*rN)r,r-r.r/rHrUrr9r+r*r(rrs&1r*rcNUupn[RRU5X#4$r)rrpathbasename)rrrrs r(rr!s&$HD 77  H %t 11r*c US$)Nrr+)rs r(rr%s 7Nr*cUSSS:Xa;USnURS5(aURS5(aSUSS-$U$SU-$) Nr)~r<>z{%s}rrXz %s:%d(%s)) startswithendswith)rrs r(rr(sW!} | ??3  DMM#$6$6D2J& &KY&&r*cJUup#pEnUupxpn X'-X8-XI-XZ-[X54$)z3Add together all the stats for two profile entries.) add_callers) targetr rrrrrt_cct_nct_ttt_ct t_callerss r(rr9s=$BBG(.%DI GRWbgrw)- //r*c 0nUR5H up4XBU'M UR5HSup4X2;aE[U[5(a"[S[XBU555X#'MAX#==U- ss'MOXBU'MU U$)z*Combine two caller lists in a single list.c3.# UH upX-v M g7frr+).0ijs r( add_callers..Is)[Add profile info from given file to current statistics object.rZrrs r(help_addProfileBrowser.help_adds RY]YdYd er*c&URSU5$)NrrYrRrs r( do_calleesProfileBrowser.do_callees<<6 6r*cL[SURS9 UR5 g)Nz6Print callees statistics from the current stat object.rZrirKr\rs r( help_calleesProfileBrowser.help_callees JQUQ\Q\ ]    r*c&URSU5$)Nrrgrhs r( do_callersProfileBrowser.do_callersrkr*cL[SURS9 UR5 g)Nz6Print callers statistics from the current stat object.rZrmrs r( help_callersProfileBrowser.help_callersrpr*c,[SURS9 g)NrYrZrrrhs r(do_EOFProfileBrowser.do_EOFs "4;; 'r*c,[SURS9 gNzLeave the profile browser.rZrrs r(help_EOFProfileBrowser.help_EOF .T[[ Ar*cg)Nrr+rhs r(do_quitProfileBrowser.do_quitsr*c,[SURS9 gr{rrs r( help_quitProfileBrowser.help_quitr~r*cU(a[U5UlUS-Ul g[UR5S:a!URSSnURU5 g[SUR S9 g![a+n[URSUR S9 SnAgSnAf[ a5n[URRS-X R S9 SnAgSnAff=f) NrrZ:rIrz1No statistics object is current -- cannot reload.r) rrdr_rirSrKrhrxr,rLrOrM)rRrerrs r(rMProfileBrowser.do_reads!&tDJ#Tk  T[[!A%{{3B' T"IPTP[P[\#((1+DKK8 #--0036++Ns#A33 C%=!B## C%0+C  C%cT[SURS9 [SURS9 g)Nz+Read in profile data from a specified file.rZz*Without argument, reload the current file.rrs r( help_readProfileBrowser.help_reads ?dkk R >T[[ Qr*cUR(aURR5 g[SURS9 g)NrQrZr)rdrrirKrhs r( do_reverseProfileBrowser.do_reverses2zz ((*7dkkJr*c,[SURS9 g)Nz/Reverse the sort order of the profiling report.rZrrs r( help_reverseProfileBrowser.help_reverses C$++ Vr*c^UR(d[SURS9 gURR5mU(aP[ U4SjUR 555(a(URR "UR 56 g[SURS9 [RR5H#up#[U<SUS<3URS9 M% g)NrQrZc3,># UH oT;v M g7frr+)r:rDabbrevss r(r=)ProfileBrowser.do_sort..sALq'\Lsz/Valid sort keys (unique prefixes are accepted):z -- rr) rdrirKrallrRrrrr)rRrrr%rs @r(do_sortProfileBrowser.do_sorts::7dkkJjj224GADJJLAAA %%tzz|4 GdkkZ$)$?$?$E$E$GLSU1X6T[[I%Hr*cT[SURS9 [SURS9 g)Nz.Sort profile data according to specified keys.rZz3(Typing `sort' without arguments lists valid keys.)rrs r( help_sortProfileBrowser.help_sorts B U Gdkk Zr*c|[RVs/sHo3RU5(dMUPM sn$s snfr)rrr.)rRtextrSas r( complete_sortProfileBrowser.complete_sorts+$::Q:!ll4>PA:Q QQs99c&URSU5$)Nrrgrhs r(do_statsProfileBrowser.do_statss<< t4 4r*cL[SURS9 UR5 g)Nz.Print statistics from the current stat object.rZrmrs r( help_statsProfileBrowser.help_statss B U    r*cUR(aURR5 g[SURS9 g)NrQrZ)rdrrirKrhs r(do_stripProfileBrowser.do_strips(zz %%'7dkkJr*c,[SURS9 g)Nzrs9,  & ! A g* t t... |7|7| 22 '"/" z PPd 388}qhhqk    -xx|G NN7 #$ :P jw~~.G    @    s%$E &A!E EEEE