Sindbad~EG File Manager
�
%Μgir����dZddlZddlZddlZddlZddlZddlmZmZddl m
Z
ddlmZddl
mZgd�Zee�Gd�d ��Zed
��Gd�d
��Zed
��Gd�d��ZGd�d�ZGd�d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zedk(r�ddlZ ddlZGd�dej@�Z!e"ejF�dkDrejFdZ$ndZ$ e!e$�Z%ejFddD]Z&e%jOe&��e(d e%jR�!�e%jU�e(d"e%jR�!�yy#e$rY��wxYw#e+$rYywxYw)#z3Class for printing reports on profiled python code.�N)�StrEnum�_simple_enum)�
cmp_to_key)� dataclass)�Dict)�Stats�SortKey�FunctionProfile�StatsProfilec�6�eZdZdZdZdZdZdZdZdZ dZ
d Zd
�Zy)r )�calls�ncalls)�
cumulative�cumtime)�filename�module�line�name�nfl�pcalls�stdname)�time�tottimec��|d}tj||�}||_|ddD]}||j|<�||_|S�Nr�)�str�__new__�_value_�_value2member_map_�_all_values)�cls�values�value�obj�other_values �#/usr/local/lib/python3.12/pstats.pyrzSortKey.__new__0sN���q� ���k�k�#�u�%�����!�!�"�:�K�25�C�"�"�;�/�&� ����
�N)
�__name__�
__module__�__qualname__�CALLS�
CUMULATIVE�FILENAME�LINE�NAME�NFL�PCALLS�STDNAME�TIMEr�r(r'r r $s4���E�(�J�#�H��D��D�
�C�
�F��G��D�r(r T)�unsafe_hashc�T�eZdZUeed<eed<eed<eed<eed<eed<eed<y) r
rr�percall_tottimer�percall_cumtime� file_name�line_numberN)r)r*r+r�__annotations__�float�intr5r(r'r
r
:s(���K�
�N���
�N����N��r(r
c�0�eZdZUdZeed<eeefed<y)rz0Class for keeping track of an item in inventory.�total_tt�
func_profilesN) r)r*r+�__doc__r=r<rrr
r5r(r'rrDs��:��O���_�,�-�-r(rc��eZdZdZdd�d�Zd�Zd�Zd�Zd�Zd �Z d
d
dddd
dddddddd�
Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd#d �Zd!�Zd"�Zy)$ra�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 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)�streamc��|xstj|_t|�sd}n
|d}|dd}|j |�|j
|�yr)�sys�stdoutrD�len�init�add)�selfrD�args�args r'�__init__zStats.__init__lsJ���*��
�
����4�y��C��q�'�C����8�D�� � �#������$�r(c�j�d|_g|_d|_d|_d|_d|_d|_t�|_i|_ i|_
|j|� |j�y#t$r7td|jr|jdndz|j���wxYw)NrzInvalid timing data %s������file)�all_callees�files�fcn_listr@�total_calls�
prim_calls�max_name_len�set� top_level�stats�
sort_arg_dict�
load_stats�get_top_level_stats� Exception�printrD)rKrMs r'rIz
Stats.initvs��������
���
���
����������������
��������� ��$�$�&��� ��*�%)�Z�Z�4�:�:�b�>�R�9�?C�{�{�
L�� �s
�!A2�2AB2c��|�i|_yt|t�rst|d�5}t j
|�|_ddd� t
j|�}tj|j�dz|z}|g|_n4t|d�r(|j�|j|_i|_|jstd|j�d|����y#1swY��xYw#Y�uxYw)N�rbz �create_statszCannot create or construct a z
object from )r\�
isinstancer�open�marshal�load�os�statr�ctime�st_mtimerU�hasattrrd� TypeError� __class__)rKrM�f�
file_statss r'r^zStats.load_stats�s����;��D�J��
��S�
!��c�4��A�$�\�\�!�_��
�!�
��W�W�S�\�
��j�j��!4�!4�5��>��D����D�J�
�S�.�
)��������D�J��C�I��z�z��#�~�~�s�4�5�
5��!���
��s�C*�:C6�*C3�6C:c��|jj�D]�\}\}}}}}|xj|z
c_|xj|z
c_|xj|z
c_d|vr|j
j
|�tt|��|jkDs��tt|��|_ ��y)N)�jprofiler�profiler)
r\�itemsrWrXr@r[rJrH�func_std_stringrY)rK�func�cc�nc�tt�ct�callerss r'r_zStats.get_top_level_stats�s���/3�z�z�/?�/?�/A�+�D�+�2�r�2�r�7�����"���O�O��"�O��M�M��"�M�*�g�5����"�"�4�(��?�4�(�)�D�,=�,=�=�$'���(=�$>��!�0Br(c���|s|St|�D�]^}t|�t|�k7rt|�}|xj|jz
c_|xj|jz
c_|xj
|j
z
c_|xj|jz
c_|jD]}|jj|��|j|jkr|j|_ d|_
|jj�D]C\}}||jvr|j|}nddddif}t||�|j|<�E��a|S�Nr)�reversed�typerrUrWrXr@r[rJrYrVr\ru�add_func_stats)rK�arg_list�itemrwrj�
old_func_stats r'rJz Stats.add�s+����K��X�&�D��D�z�T�$�Z�'��T�{���J�J�$�*�*�$�J����� 0� 0�0���O�O�t���.�O��M�M�T�]�]�*�M��������"�"�4�(�'�� � �4�#4�#4�4�$(�$5�$5��!� �D�M�"�j�j�.�.�0�
��d��4�:�:�%�$(�J�J�t�$4�M�%&��1�a��$5�M�#1�-��#F��
�
�4� �1�'�*�r(c��t|d�5}tj|j|�ddd�y#1swYyxYw)z:Write the profile data to a file we know how to load back.�wbN)rfrg�dumpr\)rKrrps r'�
dump_statszStats.dump_stats�s,��
�(�D�
!�Q��L�L����Q�'�"�
!�
!�s �!7�A)))rrPz
call count)))�rPzcumulative time))��rz file name))��rzline number))��rz
function name))r�r�r�zname/file/line)))rrPzprimitive call count)))�rz
standard name)))�rPz
internal time)
r
rrrrrrrrrrrrc���|jsSix|_}i}|jj�D]!\}}|}|s�||vrd||<�|||<|dd}|r��#|D]}||=�|jS)z)Expand all abbreviations that are unique.rNrP)r]�sort_arg_dict_defaultru)rK�dict�bad_list�word�tup�fragments r'�get_sort_arg_defszStats.get_sort_arg_defs�s����!�!�(*�*�D����H�!�7�7�=�=�?� ��c�����4�'�-.���*��%(�D��N�'���}�H��@�!����J�!��!�!�!r(c��|s d|_|St|�dk(r"t|dt�rddddd�|dg}n=t|�dk\r/|ddD]'}t |�t |d�k7s�td ��|j
�}d
}d|_d}|D]I}t|t�r|j}|||dz}|xj|||dzz
c_d}�Kg}|jj�D]1\}\} }
}}}
|j| |
||f|zt|�|fz��3|jtt!|�j"��
�gx|_}|D]}|j|d��|S)Nrrrr
rr)rPrrr�r�zCan't have mixed argument typer5rQz, )�keyrP)rVrHrer>r�rnr�� sort_typer r$r\ru�appendrv�sortr� TupleComp�compare)rK�fieldrM�
sort_arg_defs�
sort_tuple� connectorr��
stats_listrwrxryrzr{r|rV�tuples r'�
sort_statszStats.sort_stats�s�����D�M��K��u�:��?�z�%��(�C�8�$�"�!�'�)�*/�q��3�5�E���Z�1�_��Q�R�y����9��U�1�X��.�#�$D�E�E�!��.�.�0�
��
����� ��D��$��(��z�z��#�m�D�&9�!�&<�<�J��N�N�i�-��*=�a�*@�@�@�N��I���
�/3�z�z�/?�/?�/A�+�D�+�2�r�2�r�7����r�2�r�2�.��5�.�t�4�d�;�<�
=�0B� ���J�y��'<�'D�'D�E��F�#%�%��
���E��O�O�E�"�I�&� ��r(c�R�|jr|jj�|S�N)rV�reverse�rKs r'�
reverse_orderzStats.reverse_orders���=�=��M�M�!�!�#��r(c ��|j}ix|_}d}|j�D]�\}\}}}}} t|�}
tt |
��|kDrtt |
��}i}| j�D]\}}
|
|t|�<�|
|vrt||
|||||f�||
<��|||||f||
<��|j}t�x|_}|D]}|jt|���||_ d|_
d|_|Sr~)r\ru�func_strip_pathrHrvr�r[rZrJrYrVrT)rK�oldstats�newstatsrYrwrxryrzr{r|�newfunc�
newcallers�func2�caller�old_top�new_tops r'�
strip_dirszStats.strip_dirss*���:�:�� "�"��
�X���/7�~�~�/?�+�D�+�2�r�2�r�7�%�d�+�G��?�7�+�,�|�;�"�?�7�#;�<���J�!(����
��v�5;�
�?�5�1�2�"1��(�"�$2�(0��(9�)+�R��R��(D�%F���!�&(��R��Z�$@���!�0@��.�.��#&�5�(�����D��K�K���-�.��)�����
�����r(c���|jryix|_}|jj�D]=\}\}}}}}||vri||<|j�D]\}} ||vri||<| |||<��?yr�)rTr\ru)
rKrTrwrxryrzr{r|r�r�s
r'�calc_calleeszStats.calc_callees4s�������)+�+���;�/3�z�z�/?�/?�/A�+�D�+�2�r�2�r�7��;�&�$&��D�!�!(����
��v���+�)+�K��&�,2��E�"�4�(�"1�0B� r(c�J�|}t|t�rL tj|�}g}|D].}|jt
|��s�|j|��0net|�}t|t�r%d|cxkrdkrnnt||zdz�}|d|}n%t|t�rd|cxkr|kr
nn|}|d|}t|�t|�k7r!|dt|��dt|��d|�d �z
}||fS#tj$r|d|zz
}||fcYSwxYw)
Nz# <Invalid regular expression %r>
gg�?g�?rz List reduced from z to z due to restriction <z>
)rer�re�compile�error�searchrvr�rHr=r>)rK�sel�list�msg�new_list�rexrw�counts r'�eval_print_amountzStats.eval_print_amountGs�����c�3��
%��j�j��o���H����:�:�o�d�3�4��O�O�D�)����I�E��#�u�%�#��*:�s�*:��E�C�K�"�,�-�����<���C��%�!�s�*:�U�*:������<���t�9��H�
�%���D� �3�x�=�#�/�
/�C���}���'�8�8�
%��=��C�C����}�$�
%�s�D�D"�!D"c
��|jr|jddn"t|jj��}|st di�Stt
|j��}i}t ||�}|D]�}|j|\}}}} }
|\}}}
||k(rt|�nt|�dzt|�z}tt
|��}|dk(rdntt
||z��}tt
| ��}|dk(rdntt
| |z��}t|||||||�}|||
<��|S)a?This 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�/rP)
rVr�r\�keysrr=�f8r@rr
)rK� func_listr@rA�
stats_profilerwrxryrzr{r|r:r;� func_namerrr8rr9�func_profiles r'�get_stats_profilezStats.get_stats_profileas0��)-�
�
�D�M�M�!�$�4��
�
���@Q�;R� ����2�&�&���D�M�M�*�+���
�$�X�}�=�
��D�&*�j�j��&6�#�B��B��G�04�-�I�{�I� "�b��S��W�s�2�w��}�s�2�w�/F�F��B�r�F�m�G�$&�!�G�b��r�"�R�%�y�1A�O��B�r�F�m�G�$&�!�G�b��r�"�R�%�y�1A�O�*���������L�(4�M�)�$�#�&�r(c���|j}|jr"|jdd}d|jzdz}n%t|jj��}d}|D]}|j
|||�\}}�t|�}|sd|fSt||j��|t|j�kr5d}|D].}tt|��|kDs�tt|��}�0|dz|fS)Nz Ordered by: �
z! Random listing order was used
rrRr�)rYrVr�r�r\r�r�rHrarDrv)rK�sel_list�width� stat_listr�� selectionr�rws r'�get_print_listzStats.get_print_list�s����!�!���=�=��
�
�a�(�I�#�d�n�n�4�t�;�C��T�Z�Z�_�_�.�/�I�6�C�!�I�!�3�3�I�y�#�N�N�I�s�"��I�����i�<��
�c����$��3�t�z�z�?�"��E�!�����-�.��6���� 5�6�E�"��Q�w� �!�!r(c��|jD]}t||j���|jrt|j��d}|jD]#}t|t |�|j���%t||j
dd|j��|j
|jk7r%td|jzd|j��td|jz|j��t|j��|j|�\}}|rT|j�|D]}|j|��t|j��t|j��|S)NrR� zfunction calls� ��endrSz(%d primitive calls)zin %.3f seconds)rUrarDr[�func_get_function_namerWrXr@r��print_title�
print_line)rK�amountr�indentrwr�r�s r'�print_statszStats.print_stats�s���
�
�H��(����-�#��:�:��t�{�{�#����N�N�D��&�0��6�T�[�[�I�#� �f�d�&�&�(8�c����T����t���.��(�4�?�?�:��$�+�+�V�
��$�-�-�/�d�k�k�B�
�4�;�;���)�)�&�1���t������������%���t�{�{�#��t�{�{�#��r(c�`�|j|�\}}|r�|j�|j|d�|D]D}||jvr!|j |||j|��2|j ||i��Ft|j��t|j��|S)Nz called...rR)r�r��print_call_headingrT�print_call_linerarD)rKr�r�r�rws r'�
print_calleeszStats.print_callees�s����)�)�&�1���t�������#�#�E�;�7����4�+�+�+��(�(���d�6F�6F�t�6L�M��(�(���b�9� �
�t�{�{�#��t�{�{�#��r(c��|j|�\}}|rn|j|d�|D]+}|j|\}}}}} |j||| d��-t |j
��t |j
��|S)Nzwas called by...z<-rR)r�r�r\r�rarD)
rKr�r�r�rwrxryrzr{r|s
r'�
print_callerszStats.print_callers�s����)�)�&�1���t���#�#�E�+=�>���*.�*�*�T�*:�'��B��B���$�$�U�D�'�4�@��
�t�{�{�#��t�{�{�#��r(c�P�tdj|�|z|j��d}|jj �D]>\}}}}}|s�tt
|j ���} t| t�}n|rtd|zdz|j��yy)Nz Function rRFr�z ncalls tottime cumtime) ra�ljustrDr\r#�next�iterrer�)
rK� name_size�column_title� subheaderrxryrzr{r|r$s
r'r�zStats.print_call_heading�s���
�k��� �*�\�9����L�� �'+�z�z�'8�'8�':�#�B��B��G���T�'�.�.�"2�3�4��&�u�e�4� �� (;�
��#�i�-�"@�@�t�{�{�S�r(c �h�tt|�j|�|zd|j��|st|j��yt |j��}d}|D]�}t|�}||} t
| t�r]| \}
}}}
|
|k7rd|
|fz}nd|
fz}|jddt|�zz��dt|��dt|
��d |��}|d
z}n(|�d| �dt|j|d
���}|d
z}t||z|z|j��d}��y)Nr�r�rRrQz%d/%dz%dr�r�z r�(z) r�)rarvr�rD�sortedr�rer��rjustrHr�r\)rKr��source� call_dict�arrow�clistr�rwrr$ryrxrzr{�substats�
left_widths r'r�zStats.print_call_line�s ��
�o�f�%�+�+�I�6��>�C�d�k�k�Z���t�{�{�#���y�~�~�'�(�����D�"�4�(�D��d�O�E��%��'�!&���B��B���8�&�"�b��1�H�#�r�e�|�H�-5�^�^�A�a��F��m�O�-L�-/��V�R��V�T�C��&��]�
�*.��r�$�*�*�T�:J�1�:M�7N�O��&��]�
��&��#�h�.�T�[�[�A��F�!r(c�b�tdd|j��td|j��y)Nz- ncalls tottime percall cumtime percallr�r�zfilename:lineno(function)rR�rarDr�s r'r�zStats.print_title�s"��
�=�3�T�[�[�Y�
�)����<r(c��|j|\}}}}}t|�}||k7r|dzt|�z}t|jd�d|j��tt|�d|j��|dk(rtdd|j��n$tt||z�d|j��tt|�d|j��|dk(rtdd|j��n$tt||z�d|j��tt
|�|j��y)Nr�� r�r�rr�rR)r\rrar�rDr�rv)rKrwrxryrzr{r|�cs r'r�zStats.print_line�s���"&�*�*�T�"2���B��B����G��
��8��C��#�b�'�!�A�
�a�g�g�a�j�c����4�
�b��f�#�D�K�K�0�
��7��%�S�t�{�{�3��"�R��U�)��4�;�;�7�
�b��f�#�D�K�K�0�
��7��%�S�t�{�{�3��"�R��U�)��4�;�;�7�
�o�d�#�$�+�+�6r()z->)r)r*r+rBrNrIr^r_rJr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r5r(r'rrJs����B&*���&�,?��4(�D�C�H�H�B�D�B�F�G�M�F�F�F��� "�"%�N�
�:�&�4!�F"�0�.
� �
T��2=�7r(rc��eZdZdZd�Zd�Zy)r�a�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 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.c��||_yr���comp_select_list)rKrs r'rNzTupleComp.__init__s
�� 0��r(c�f�|jD]"\}}||}||}||kr|cS||kDs� |cSyr~r�)rK�left�right�index� direction�l�rs r'r�zTupleComp.comparesJ�� $� 5� 5��E�9��U��A��e��A��1�u�!�z�!��1�u� � �
!6�r(N)r)r*r+rBrNr�r5r(r'r�r�s��&�1�r(r�c�R�|\}}}tjj|�||fSr�)ri�path�basename)r�rrrs r'r�r�!s*��$��H�d�D�
�7�7���H�%�t�T�1�1r(c��|dS)Nr�r5)rws r'r�r�%s����7�Nr(c�~�|dddk(r1|d}|jd�r|jd�rd|ddzS|Sd|zS) Nr�)�~r�<�>z{%s}rrPz %s:%d(%s))�
startswith�endswith)r�rs r'rvrv(sQ����!�}�� ���|���?�?�3��D�M�M�#�$6��D��2�J�&�&��K��Y�&�&r(c�\�|\}}}}}|\}}} }
}||z||z|| z||
zt||�fS)z3Add together all the stats for two profile entries.)�add_callers)�targetr�rxryrzr{r|�t_cc�t_nc�t_tt�t_ct� t_callerss r'r�r�9sO��$��B��B��G�(.�%�D�$��d�I��t�G�R��W�b��g�r�$�w��)�W�-�/�/r(c ��i}|j�D]
\}}|||<�|j�D]O\}}||vrAt|t�r#td�t|||�D��||<�=||xx|z
cc<�K|||<�Q|S)z*Combine two caller lists in a single list.c3�,K�|]\}}||z���y�wr�r5)�.0�i�js r'� <genexpr>zadd_callers.<locals>.<genexpr>Is����)[�<Z�D�A�q�!�a�%�<Z�s�)rurer��zip)rr��new_callersrwr�s r'rr@s����K�������f�"��D��'�������f��;���&�%�(�$)�)[�C���TX�HY�<Z�)[�$[��D�!��D�!�V�+�!� &�K���'��r(c�>�d}|j�D]}||z
}� |S)z@Sum the caller statistics to get total number of calls received.r)r#)r|ryr
s r'�count_callsr#Qs&��
�B����!��
�e���"�
�Ir(c��d|zS)Nz%8.3fr5)�xs r'r�r�\s���Q�;�r(�__main__c��eZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z d �Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�ProfileBrowserNc��tjj|�d|_d|_t
j|_|�|j|�yy)N�% ) �cmd�CmdrN�promptr\rFrGrD�do_read)rK�profiles r'rNzProfileBrowser.__init__ksD���G�G���T�"��D�K��D�J��*�*�D�K��"����W�%�#r(c���|j�}g}|D]} |jt|���|jrt|j|�|�ytd|j��y#t$rYnwxYw t |�}|dkDs|dkrtd|j����|j|���#t$rYnwxYw|j|���)Nrrz#Fraction argument must be in [0, 1]rR�No statistics object is loaded.) �splitr�r>�
ValueErrorr=rarDr\�getattr)rK�fnrrL� processed�term�fracs r'�genericzProfileBrowser.genericss����:�:�<�D��I�����$�$�S��Y�/��� �z�z�'���
�
�B�'��3���7�d�k�k�J���!"������ ��;�D��a�x�4�!�8��C�$�+�+�V� ��$�$�T�*���!������ � ��&s)�A3�3 A?�>A?�,C�0C� C�
Cc��td|j��td|j��td|j��td|j��td|j��td|j��y)NzArguments may be:rRz0* An integer maximum number of entries to print.z:* A decimal fractional number between 0 and 1, controllingz- what fraction of selected entries to print.z8* A regular expression; only entries with function namesz that match it are printed.r�r�s r'�generic_helpzProfileBrowser.generic_help�sb���%�D�K�K�8��D�4�;�;�W��N�UY�U`�U`�a��A����T��L�SW�S^�S^�_��0�t�{�{�Cr(c���|jr |jj|�ytd|j��y#t$r'}td|�d|��|j��Yd}~yd}~wwxYw)NzFailed to load statistics for z: rRr1r)r\rJ�OSErrorrarD)rKr�es r'�do_addzProfileBrowser.do_add�sj���z�z�`��J�J�N�N�4�(�
��7�d�k�k�J��� �`��D�!�L�SW�S^�S^�_�_��� `�s�A� A2�A-�-A2c�2�td|j��y)Nz>Add profile info from given file to current statistics object.rRr�r�s r'�help_addzProfileBrowser.help_add�s���R�Y]�Yd�Yd�er(c�&�|jd|�S)Nr��r9�rKrs r'�
do_calleeszProfileBrowser.do_callees�����<�<���6�6r(c�R�td|j��|j�y)Nz6Print callees statistics from the current stat object.rR�rarDr;r�s r'�help_calleeszProfileBrowser.help_callees�� ���J�QU�Q\�Q\�]����r(c�&�|jd|�S)Nr�rCrDs r'�
do_callerszProfileBrowser.do_callers�rFr(c�R�td|j��|j�y)Nz6Print callers statistics from the current stat object.rRrHr�s r'�help_callerszProfileBrowser.help_callers�rJr(c�2�td|j��y)NrQrRrr�rDs r'�do_EOFzProfileBrowser.do_EOF�s���"�4�;�;�'�r(c�2�td|j��y�NzLeave the profile browser.rRr�r�s r'�help_EOFzProfileBrowser.help_EOF�����.�T�[�[�Ar(c��y)Nrr5rDs r'�do_quitzProfileBrowser.do_quit�s��r(c�2�td|j��yrRr�r�s r'� help_quitzProfileBrowser.help_quit�rTr(c���|r t|�|_|dz|_ yt|j�dkDr!|jdd}|j|�ytd|j
��y#t$r.}t|jd|j
��Yd}~yd}~wt$r9}t|jjdz||j
��Yd}~yd}~wwxYw) NrrR�:r*r����z1No statistics object is current -- cannot reload.r)rr\r=rarLrDr`ror)r-rHr.)rKr�errs r'r.zProfileBrowser.do_read�s�����!&�t��D�J�#�T�k�����T�[�[�!�A�%��{�{�3�B�'�����T�"���I�PT�P[�P[�\������#�(�(�1�+�D�K�K�8��� ���#�-�-�0�0�3�6��$�+�+�N����s#�A0�0 C'�9$B"�"C'�./C"�"C'c�`�td|j��td|j��y)Nz+Read in profile data from a specified file.rRz*Without argument, reload the current file.r�r�s r'� help_readzProfileBrowser.help_read�s ���?�d�k�k�R��>�T�[�[�Qr(c��|jr|jj�ytd|j��y)Nr1rRr)r\r�rarDrDs r'�
do_reversezProfileBrowser.do_reverse�s2���z�z��
�
�(�(�*���7�d�k�k�J�r(c�2�td|j��y)Nz/Reverse the sort order of the profiling report.rRr�r�s r'�help_reversezProfileBrowser.help_reverse�s���C�$�+�+�Vr(c����|jstd|j��y|jj��|rJt �fd�|j�D��r(|jj|j��ytd|j��tjj�D]$\}}t|�d|d��|j���&y)Nr1rRc3�&�K�|]}|�v���
y�wr�r5)rr%�abbrevss �r'rz)ProfileBrowser.do_sort.<locals>.<genexpr>�s�����A�L�q�Q�'�\�L�s�z/Valid sort keys (unique prefixes are accepted):z -- rr)
r\rarDr��allr2r�rr�ru)rKrr�r$res @r'�do_sortzProfileBrowser.do_sort�s�����:�:��7�d�k�k�J���j�j�2�2�4�G���A�D�J�J�L�A�A�%��
�
�%�%�t�z�z�|�4�
��G�d�k�k�Z�$)�$?�$?�$E�$E�$G�L�S�%���U�1�X�6�T�[�[�I�%H�r(c�`�td|j��td|j��y)Nz.Sort profile data according to specified keys.rRz3(Typing `sort' without arguments lists valid keys.)r�r�s r'� help_sortzProfileBrowser.help_sort�s ���B����U��G�d�k�k�Zr(c�l�tjD�cgc]}|j|�s�|��c}Scc}wr�)rr�r)rK�textrL�as r'�
complete_sortzProfileBrowser.complete_sort�s-��$�:�:�Q�:�!�a�l�l�4�>P�A�:�Q�Q��Qs�1�1c�&�|jd|�S)Nr�rCrDs r'�do_statszProfileBrowser.do_stats�s���<�<�
�t�4�4r(c�R�td|j��|j�y)Nz.Print statistics from the current stat object.rRrHr�s r'�
help_statszProfileBrowser.help_stats�s���B����U����r(c��|jr|jj�ytd|j��y)Nr1rR)r\r�rarDrDs r'�do_stripzProfileBrowser.do_strip�s(���z�z��
�
�%�%�'��7�d�k�k�Jr(c�2�td|j��y)Nz<Strip leading path information from filenames in the report.rRr�r�s r'�
help_stripzProfileBrowser.help_strip�s���P�W[�Wb�Wb�cr(c�2�td|j��y)NzShow help for a given command.rRr�r�s r'� help_helpzProfileBrowser.help_help�s���2����Er(c��|r|Syr�r5)rK�stoprs r'�postcmdzProfileBrowser.postcmd�s
�����r(r�)r)r*r+rNr9r;r?rArErIrLrNrPrSrVrXr.r^r`rbrgrirmrorqrsrurwrzr5r(r'r(r(js��� &� �0 D� � f� 7� � 7� � � B� � B� �" R� � W� � [� R� 5� � K�
d� F� r(r(rr�z*Welcome to the profile statistics browser.rRzGoodbye.),rBrFrirrgr��enumrr� functoolsr�dataclassesr�typingr�__all__r r
rrr�r�r�rvr�rr#r�r)r+�readline�ImportErrorr,r(rH�argv�initprofile�browserr/r?rarD�cmdloop�KeyboardInterruptr5r(r'�<module>r�s���9�,� ��� �&� �!��
A��
�g������*�t�������t��.�.��.�
|7�|7�|
��22�� '�"/��"���z���
��P����P�d�3�8�8�}�q���h�h�q�k����
� ��-���x�x���|�G��N�N�7�#�$�
�:����P�����
�j�w�~�~�.�G���
��
��@�
��
�s%�)E�*A%E�E�E�E$�#E$
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists