grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026B �ÇæFiã@szdZdddgZddlZddlZddd„Zddd„Zejje_ejje_Gd d„dejƒZd d „Z d d „Z e dkrve ƒdS)zUPython interface for the 'lsprof' profiler. Compatible with the 'profile' module. ÚrunÚrunctxÚProfileéNéÿÿÿÿcCst t¡ |||¡S)N)Ú _pyprofileÚ_Utilsrr)Ú statementÚfilenameÚsort©r ú-/opt/alt/python37/lib64/python3.7/cProfile.pyrscCst t¡ |||||¡S)N)rrrr)rÚglobalsÚlocalsr r r r r rsc@sJeZdZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dS)ra`Profile(timer=None, timeunit=None, subcalls=True, builtins=True) Builds a profiler object using the specified timer function. The default timer is a fast built-in one based on real time. For custom timer functions returning integers, timeunit can be a float specifying a scale (i.e. how long each integer unit is, in seconds). rcCs$ddl}| |¡ ¡ |¡ ¡dS)Nr)ÚpstatsÚStatsZ strip_dirsZ sort_statsÚ print_stats)Úselfr rr r r r(szProfile.print_statsc Cs8ddl}t|dƒ�}| ¡| |j|¡WdQRXdS)NrÚwb)ÚmarshalÚopenÚ create_statsÚdumpÚstats)rÚfilerÚfr r r Ú dump_stats,s zProfile.dump_statscCs| ¡| ¡dS)N)ÚdisableÚsnapshot_stats)rr r r r2szProfile.create_statsc Cs6| ¡}i|_i}xX|D]P}t|jƒ}|j}||j}|j}|j}i} | |t|jƒ<||||| f|j|<qWxÄ|D]¼}|j rrt|jƒ}x¦|j D]œ} y|t| jƒ} Wnt k rºwŽYnX| j}|| j}| j}| j}|| k�r| |} || d7}|| d7}|| d7}|| d7}||||f| |<qŽWqrWdS)Nrééé) ZgetstatsrÚlabelÚcodeZ callcountZ reccallcountZ inlinetimeZ totaltimeÚidZcallsÚKeyError) rÚentriesZ callersdictsÚentryÚfuncZncZccZttZctZcallersZsubentryÚprevr r r r6s>            zProfile.snapshot_statscCsddl}|j}| |||¡S)Nr)Ú__main__Ú__dict__r)rÚcmdr)Údictr r r r\sz Profile.runcCs(| ¡zt|||ƒWd| ¡X|S)N)ÚenableÚexecr)rr+r rr r r ras  zProfile.runctxcOsxt|ƒdkr|^}}}n>|s&tdƒ‚n0d|krB| d¡}|^}}ntdt|ƒdƒ‚| ¡z |||ŽS| ¡XdS)Nrz:descriptor 'runcall' of 'Profile' object needs an argumentr'z7runcall expected at least 1 positional argument, got %dr)ÚlenÚ TypeErrorÚpopr-r)ÚargsÚkwrr'r r r Úruncalljs      zProfile.runcallN)r) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrr4r r r r rs & cCs(t|tƒrdd|fS|j|j|jfSdS)Nú~r)Ú isinstanceÚstrÚ co_filenameÚco_firstlinenoÚco_name)r"r r r r!s  r!c Cs^ddl}ddl}ddl}ddl}ddlm}d}||d�}d|_|jdddd dd �|jd d d ddt|j j ƒd�|jdddddd�|j dd…s¦|  ¡|  d¡| ¡\}}||j dd…<t|ƒdk�rR|jrêd} |j|ddœ} nR|d} |j d|j | ¡¡t| dƒ�} t|  ¡| dƒ} WdQRX| ddddœ} t| | d|j|jƒn|  ¡|S)Nr)Ú OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)ÚusageFz-oz --outfileÚoutfilezSave stats to )ÚdestÚhelpÚdefaultz-sz--sortr z?Sort order when printing to stdout, based on pstats.Stats classr)rBrCrDÚchoicesz-mÚmoduleÚ store_truezProfile a library module)rBÚactionrCrDrrz(run_module(modname, run_name='__main__'))Ú run_moduleÚmodnameÚrbr.r))Ú__file__r5Ú __package__Ú __cached__)ÚosÚsysÚrunpyrZoptparser?Zallow_interspersed_argsZ add_optionÚsortedrZsort_arg_dict_defaultÚargvZ print_usageÚexitÚ parse_argsr/rFrIÚpathÚinsertÚdirnamerÚcompileÚreadrrAr ) rOrPrQrr?r@ÚparserZoptionsr2r"ZglobsZprognameÚfpr r r Úmain‡sJ          r]r))Nr)Nr) r8Ú__all__Z_lsprofZprofilerrrZProfilerrr!r]r5r r r r Ús     d1