Your IP : 3.22.166.101
U
e5db�@s�dZdddgZddlZddlZddlZddd�Zddd�Zejje_ejje_Gd d�dej�Z d
d�Z
dd
�Zedkr~e�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� /usr/lib64/python3.8/cProfile.pyrscCst�t��|||||�Sr)rrrr)r �globals�localsr
rrrr
rs�c@s`eZdZdZddd�Zdd�Zdd�Zd d
�Zdd�Zd
d�Z dd�Z
de
_dd�Zdd�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)�selfrrrrr
r)szProfile.print_statsc Cs8ddl}t|d��}|��|�|j|�W5QRXdS)Nr�wb)�marshal�open�create_stats�dump�stats)r�filer�frrr
�
dump_stats-szProfile.dump_statscCs|��|��dSr)�disable�snapshot_stats�rrrr
r3szProfile.create_statsc
Cs,|��}i|_i}|D]P}t|j�}|j}||j}|j}|j}i} | |t|j�<||||| f|j|<q|D]�}|j rlt|j�}|j D]�}
z|t|
j�} Wnt
k
r�Yq�YnX|
j}||
j}|
j}|
j}|| k�r| |}||d7}||d7}||d7}||d7}||||f| |<q�qldS)Nr���)Zgetstatsr�label�codeZ callcountZreccallcountZ
inlinetimeZ totaltime�idZcalls�KeyError)r�entriesZcallersdicts�entry�funcZncZccZttZctZcallersZsubentry�prevrrr
r7s>
zProfile.snapshot_statscCsddl}|j}|�|||�Sr)�__main__�__dict__r)r�cmdr,�dictrrr
r]szProfile.runcCs(|��zt|||�W5|��X|Sr)�enabler�exec)rr.rrrrr
rbs
zProfile.runctxcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|��z|||�W�S|��XdS) Nr"z:descriptor 'runcall' of 'Profile' object needs an argumentr*rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr!)�len� TypeError�pop�warnings�warn�DeprecationWarningr0r)�args�kwrr*r6rrr
�runcallks&
�
�zProfile.runcallz($self, func, /, *args, **kw)cCs|��|Sr)r0r rrr
� __enter__�szProfile.__enter__cGs|��dSr)r)r�exc_inforrr
�__exit__�szProfile.__exit__N)r)�__name__�
__module__�__qualname__�__doc__rrrrrrr;�__text_signature__r<r>rrrr
rs
& cCs(t|t�rdd|fS|j|j|jfSdS)N�~r)�
isinstance�str�co_filename�co_firstlineno�co_name)r%rrr
r$�s
r$c
Cs�ddl}ddl}ddl}ddl}ddlm}d}||d�}d|_|jdddd dd
�|jddd
ddt|j j
�d�|jdddddd�|jdd�s�|��|�
d�|��\}}||jdd�<|jdk r�|j�|j�|_t|�dk�r�|j�rd} |j|dd�}
nR|d}|j�d|j�|��t�|��}t|��|d�} W5QRX|dddd�}
zt| |
d|j|j�Wn6tk
�r�}
zd|_|�
|
j�W5d}
~
XYnXn|��|S)Nr)�OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz --outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classr)rMrNrO�choicesz-m�module�
store_truezProfile a library module)rM�actionrNrOr!r"z(run_module(modname, run_name='__main__'))�
run_module�modnamer1r,)�__file__r?�__package__�
__cached__) �os�sys�runpyrZoptparserJZallow_interspersed_argsZ
add_option�sortedrZsort_arg_dict_default�argvZprint_usage�exit�
parse_argsrL�path�abspathr3rQrT�insert�dirname�io� open_code�compile�readrr�BrokenPipeError�stdout�errno)rYrZr[rrJrK�parserZoptionsr9r%ZglobsZprogname�fp�excrrr
�main�sd
�
�
�
�� rnr,)Nr)Nr)
rB�__all__Z_lsprofrdZprofilerrrZProfilerrr$rnr?rrrr
�<module>s
o;
?>