Edit File: pstats.cpython-37.opt-2.pyc
B ����0��c�j������������������@���s���d�dl�Z�d�dlZd�dlZd�dlZd�dlZd�dlmZ�d�dlmZ�ddgZ G�dd��de e�ZG�dd��d�ZG�dd ��d �Z d d��Zdd ��Zdd��Zdd��Zdd��Zdd��Zdd��Zedk�r�d�dlZyd�dlZW�n�ek r����Y�nX�G�dd��dej�Zee�j�dk�re�jd�ZndZyTee�Zx"e�jdd��D�]Ze� e���q.W�e!dej"d��e�#���e!dej"d��W�n�e$k �r~���Y�nX�dS�) �����N)�Enum)� cmp_to_key�Stats�SortKeyc���������������@���s8���e�Zd�ZdZdZdZdZdZdZdZ dZ d Zd d��ZdS�) r���)�calls�ncalls)� cumulative�cumtime)�filename�module�line�name�nfl�pcalls�stdname)�time�tottimec�������������G���s>���t��|��}|d�|_x|dd���D�]}||�j|<�q"W�||_|S�)Nr�������)�str�__new__�_value_�_value2member_map_Z_all_values)�cls�values�objZother_value��r����+/opt/alt/python37/lib64/python3.7/pstats.pyr���-���s���� zSortKey.__new__N) �__name__� __module__�__qualname__ZCALLSZ CUMULATIVEZFILENAMEZLINE�NAMEZNFLZPCALLSZSTDNAMEZTIMEr���r���r���r���r���r���"���s���c���������������@���s����e�Zd�Zdd�dd�Zdd��Zdd��Zd d ��Zdd��Zd d��Zdddddddddddddd� Z dd��Z dd��Zdd��Zdd ��Z d!d"��Zd#d$��Zd%d&��Zd'd(��Zd)d*��Zd+d,��Zd-d.��Zd6d0d1�Zd2d3��Zd4d5��ZdS�)7r���N)�streamc������������G���sF���|pt�j|�_t|�sd�}n|d�}|dd���}|��|��|�j|���d�S�)Nr���r���)�sys�stdoutr!����len�init�add)�selfr!����args�argr���r���r����__init__Y���s���� zStats.__init__c�������������C���s����d�|�_�g�|�_d�|�_d|�_d|�_d|�_d|�_t��|�_i�|�_ i�|�_ |��|��y|�����W�n8�t k r����td|�jrx|�jd�nd�|�jd����Y�nX�d�S�)Nr���zInvalid timing data %s�����)�file)�all_callees�files�fcn_list�total_tt�total_calls� prim_calls�max_name_len�set� top_level�stats� sort_arg_dict� load_stats�get_top_level_stats� Exception�printr!���)r'���r)���r���r���r���r%���c���s"���� z Stats.initc���������� ���C���s����|d�kri�|�_�d�S�t|t�rxt|d��}t�|�|�_�W�d�Q�R�X�y"t�|�}t� |j �d�|�}W�n���Y�nX�|g|�_n t|d�r�|� ���|j�|�_�i�|_�|�j�s�td|�j|f���d�S�)N�rbz �create_statsz.Cannot create or construct a %r object from %r)r7���� isinstancer����open�marshal�load�os�statr���Zctime�st_mtimer/����hasattrr>���� TypeError� __class__)r'���r)����fZ file_statsr���r���r���r9���v���s(���� zStats.load_statsc�������������C���s����x~|�j����D�]p\}\}}}}}|��j|7��_|��j|7��_|��j|7��_d|kr\|�j�|��tt|��|�j krtt|��|�_ qW�d�S�)N)Zjprofiler���Zprofiler) r7����itemsr2���r3���r1���r6���r&���r$����func_std_stringr4���)r'����func�cc�nc�tt�ct�callersr���r���r���r:�������s����zStats.get_top_level_statsc�������������G���s����|s|�S�x�t�|�D�]�}t|��t|�kr.t|�}|��j|j7��_|��j|j7��_|��j|j7��_|��j|j7��_x|jD�]}|�j�|��qvW�|�j |j k�r�|j |�_ d�|�_ xJ|j���D�]<\}}||�jkr�|�j|�}nddddi�f}t ||�|�j|<�q�W�qW�|�S�)Nr���)�reversed�typer���r/���r2���r3���r1���r6���r&���r4���r0���r7���rJ����add_func_stats)r'����arg_list�itemrL���rD���Z old_func_statr���r���r���r&�������s(���� z Stats.addc���������� ���C���s(���t�|d��}t�|�j|��W�d�Q�R�X�d�S�)N�wb)r@���rA����dumpr7���)r'���r ���rI���r���r���r���� dump_stats����s����zStats.dump_stats)))r���r+���z call count)))����r+���zcumulative time)))����r���z file name)))����r���zline number)))����r���z function name)))r]���r���)r[���r���)r\���r���zname/file/line)))r���r+���zprimitive call count)))����r���z standard name)))����r+���z internal time) r���r���r ���r���r ���r���r���r ���r���r���r���r���r���c�������������C���s����|�j�szi��|�_�}i�}xP|�j���D�]B\}}|}x4|r`|s8P�||krJd||<�P�|||<�|d�d��}q.W�q W�x|D�] }||=�qlW�|�j�S�)Nr���r+���)r8����sort_arg_dict_defaultrJ���)r'����dictZbad_list�word�tupZfragmentr���r���r����get_sort_arg_defs����s ���� zStats.get_sort_arg_defsc�������������G���sl��|sd|�_�|�S�t|�dkrBt|d�t�rBddddd�|d��g}n>t|�dkr�x0|dd���D�] }t|�t|d��kr\td ��q\W�|����}d }d|�_d}xJ|D�]B}t|t�r�|j }|||�d��}|��j|||�d��7��_d}q�W�g�}xB|�j ���D�]4\}\} } }}} |�| | ||f|�t |�|f���q�W�|jtt|�j�d ��g��|�_�}x|D�]}|�|d����qPW�|�S�)Nr���r���r���r���r���r���)r+���r���r���r_���r_���zCan't have mixed argument typer���r,���z, )�keyr+���)r0���r$���r?����intrS���rG���rd���� sort_typer����valuer7���rJ����appendrK����sortr���� TupleComp�compare)r'���Zfieldr)���Z sort_arg_defsZ sort_tupleZ connectorrb���Z stats_listrL���rM���rN���rO���rP���rQ���r0����tupler���r���r���� sort_stats����s>���� zStats.sort_statsc�������������C���s���|�j�r|�j�����|�S�)N)r0����reverse)r'���r���r���r���� reverse_order��s���� zStats.reverse_orderc�������������C���s����|�j�}i��|�_�}d}x�|���D�]�\}\}}}}} t|�} tt| ��|krTtt| ��}i�}x | ���D�]\}} | |t|�<�qbW�| |kr�t|| �|||||f�|| <�q|||||f|| <�qW�|�j}t���|�_}x|D�]}|�t|���q�W�||�_ d�|�_ d�|�_|�S�)Nr���)r7���rJ����func_strip_pathr$���rK���rT���r6���r5���r&���r4���r0���r.���)r'���ZoldstatsZnewstatsr4���rL���rM���rN���rO���rP���rQ���ZnewfuncZ newcallers�func2�callerZold_topZnew_topr���r���r���� strip_dirs��s.���� zStats.strip_dirsc������� ������C���s|���|�j�r d�S�i��|�_�}xb|�j���D�]T\}\}}}}}||krBi�||<�x0|���D�]$\}} ||krdi�||<�| ||�|<�qLW�q W�d�S�)N)r.���r7���rJ���) r'���r.���rL���rM���rN���rO���rP���rQ���rr���rs���r���r���r����calc_callees#��s���� zStats.calc_calleesc�������������C���s��|}t�|t�rpyt�|�}W�n&�tjk rB���|d|�7�}||fS�X�g�}x�|D�]}|�t|��rN|�|��qNW�nzt|�}t�|t �r�d|��kr�dk�r�n�nt ||�d��}|d�|��}n2t�|t �r�d|��kr�|k�r�n�n|}|d�|��}t|�t|�k�r|dt|�t|�|f�7�}||fS�)Nz# <Invalid regular expression %r> g��������g�������?g�������?r���z6 List reduced from %r to %r due to restriction <%r> )r?���r����re�compile�error�searchrK���ri���r$����floatrf���)r'���Zsel�list�msgZnew_listZrexrL����countr���r���r����eval_print_amount6��s,���� ""zStats.eval_print_amountc�������������C���s����|�j�}|�jr*|�jd�d���}d|�j�d�}nt|�j����}d}x|D�]}|��|||�\}}qBW�t|�}|spd|fS�t||�j d��|t|�j�k�r�d}x(|D�] }tt |��|kr�tt |��}q�W�|d�|fS�)Nz Ordered by: � z! Random listing order was used r���)r-���r_���)r4���r0���rg���r{���r7����keysr~���r$���r<���r!���rK���)r'���Zsel_list�widthZ stat_listr|���Z selectionr}���rL���r���r���r����get_print_listP��s$���� zStats.get_print_listc�������������G���s����x|�j�D�]}t||�jd��qW�|�j�r0t|�jd��d}x"|�jD�]}t|t|�|�jd��q<W�t||�jdd|�jd��|�j|�jkr�td|�j�d|�jd��td|�j�|�jd��t|�jd��|��|�\}}|r�|�� ���x|D�]}|�� |��q�W�t|�jd��t|�jd��|�S�)N)r-���z zfunction calls� )�endr-���z(%d primitive calls)zin %.3f seconds)r/���r<���r!���r6����func_get_function_namer2���r3���r1���r�����print_title� print_line)r'����amountr ����indentrL���r����r{���r���r���r����print_statsh��s(���� zStats.print_statsc�������������G���s~���|���|�\}}|rz|�����|��|d��x:|D�]2}||�jkrP|��|||�j|���q,|��||i���q,W�t|�jd��t|�jd��|�S�)Nz called...)r-���)r����ru����print_call_headingr.����print_call_liner<���r!���)r'���r����r����r{���rL���r���r���r���� print_callees��s���� zStats.print_calleesc������� ������G���sl���|���|�\}}|rh|��|d��x0|D�](}|�j|�\}}}}} |��||| d��q$W�t|�jd��t|�jd��|�S�)Nzwas called by...z<-)r-���)r����r����r7���r����r<���r!���) r'���r����r����r{���rL���rM���rN���rO���rP���rQ���r���r���r���� print_callers���s���� zStats.print_callersc������� ������C���sx���t�d�|�|�|�jd��d}x<|�j���D�].\}}}}}|r(tt|�����} t| t�}P�q(W�|rtt�d|�d�|�jd��d�S�)Nz Function )r-���Fr����z ncalls tottime cumtime) r<����ljustr!���r7���r����next�iterr?���rm���) r'���� name_sizeZcolumn_titleZ subheaderrM���rN���rO���rP���rQ���rh���r���r���r���r�������s���� zStats.print_call_heading�->c�������������C���s��t�t|��|�|�d|�jd��|s2t�|�jd��d�S�t|����}d}x�|D�]�}t|�}||�} t| t�r�| \} }}} | |kr�d| |f�}n d| f�}d|�dd t |����t |�t | �|f�}|d �}n$d|| t |�j|�d��f�}|d�}t�||�|�|�jd��d}qHW�d�S�) Nr����)r����r-���)r-���r,���z%d/%dz%dz%s %s %s %sr^���r_���r���z %s(%r) %srZ���)r<���rK���r����r!����sortedr����r?���rm����rjustr$����f8r7���)r'���r�����sourceZ call_dictZarrowZclistr����rL���r ���rh���rN���rM���rO���rP���ZsubstatsZ left_widthr���r���r���r�������s*���� zStats.print_call_linec�������������C���s"���t�dd|�jd��t�d|�jd��d�S�)Nz- ncalls tottime percall cumtime percallr����)r����r-���zfilename:lineno(function))r-���)r<���r!���)r'���r���r���r���r�������s����zStats.print_titlec�������������C���s����|�j�|�\}}}}}t|�}||kr4|d�t|��}t|�d�d|�jd��tt|�d|�jd��|dkrxtdd|�jd��ntt||��d|�jd��tt|�d|�jd��|dkr�tdd|�jd��ntt||��d|�jd��tt|�|�jd��d�S�)N�/� ���r����)r����r-���r���z )r-���)r7���r���r<���r����r!���r����rK���)r'���rL���rM���rN���rO���rP���rQ����cr���r���r���r�������s����zStats.print_line)r����)r���r���r���r*���r%���r9���r:���r&���rY���r`���rd���rn���rp���rt���ru���r~���r����r����r����r����r����r����r����r����r���r���r���r���r���7���sB���" ' c���������������@���s���e�Zd�Zdd��Zdd��ZdS�)rk���c�������������C���s ���||�_�d�S�)N)�comp_select_list)r'���r����r���r���r���r*������s����zTupleComp.__init__c�������������C���sB���x<|�j�D�]2\}}||�}||�}||k�r.|�S�||kr|S�qW�dS�)Nr���)r����)r'����left�right�index� direction�l�rr���r���r���rl������s����zTupleComp.compareN)r���r���r���r*���rl���r���r���r���r���rk������s���rk���c�������������C���s���|�\}}}t�j�|�||fS�)N)rC����path�basename)� func_namer ���r���r ���r���r���r���rq������s���� rq���c�������������C���s���|�d�S�)Nr_���r���)rL���r���r���r���r�������s����r����c�������������C���sN���|�d�d��dkrB|�d�}|��d�r<|�d�r<d|dd���S�|S�nd|��S�d�S�) Nr_���)�~r����<�>z{%s}r���r+���z %s:%d(%s))� startswith�endswith)r����r ���r���r���r���rK������s����rK���c�������������C���s@���|\}}}}}|�\}}} } }||�||�|| �|| �t�||�fS�)N)�add_callers)�targetr����rM���rN���rO���rP���rQ���Zt_ccZt_ncZt_ttZt_ctZ t_callersr���r���r���rT�����s����rT���c�������������C���s����i�}x|�����D�]\}}|||<�qW�xb|����D�]V\}}||krzt|t�rhtdd��t|||��D���||<�q�||��|7��<�q,|||<�q,W�|S�)Nc�������������s���s���|�]\}}||�V��qd�S�)Nr���)�.0�i�jr���r���r���� <genexpr>��s����zadd_callers.<locals>.<genexpr>)rJ���r?���rm����zip)r����r����Znew_callersrL���rs���r���r���r���r������s���� "r����c�������������C���s"���d}x|�����D�]}||7�}qW�|S�)Nr���)r���)rQ���rN���r���r���r���r����count_calls��s����r����c�������������C���s���d|��S�)Nz%8.3fr���)�xr���r���r���r����(��s����r�����__main__c���������������@���s����e�Zd�Zd6dd�Zdd��Zdd��Zdd ��Zd d��Zdd ��Zdd��Z dd��Z dd��Zdd��Zdd��Z dd��Zdd��Zdd��Zdd��Zd d!��Zd"d#��Zd$d%��Zd&d'��Zd(d)��Zd*d+��Zd,d-��Zd.d/��Zd0d1��Zd2d3��Zd4d5��ZdS�)7�ProfileBrowserNc�������������C���s6���t�j�|���d|�_d�|�_tj|�_|d�k r2|��|��d�S�)Nz% ) �cmd�Cmdr*����promptr7���r"���r#���r!����do_read)r'����profiler���r���r���r*���7��s����zProfileBrowser.__init__c���������� ���C���s����|����}g�}x�|D�]�}y|�t|���wW�n�tk r>���Y�nX�y8t|�}|dksZ|dk�rjtd|�jd��w|�|��wW�n�tk r����Y�nX�|�|��qW�|�jr�t|�j|�|���ntd|�jd��dS�)Nr���r���z#Fraction argument must be in [0, 1])r-���zNo statistics object is loaded.) �splitri���rf���� ValueErrorrz���r<���r!���r7����getattr)r'����fnr���r(���Z processedZtermZfracr���r���r����generic?��s,���� zProfileBrowser.genericc�������������C���sX���t�d|�jd��t�d|�jd��t�d|�jd��t�d|�jd��t�d|�jd��t�d|�jd��d�S�)NzArguments may be:)r-���z0* 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!���)r'���r���r���r����generic_helpW��s����zProfileBrowser.generic_helpc���������� ���C���sd���|�j�rRy|�j��|��W�q`�tk rN�}�ztd||f�|�jd��W�d�d�}~X�Y�q`X�ntd|�jd��dS�)Nz$Failed to load statistics for %s: %s)r-���zNo statistics object is loaded.r���)r7���r&����OSErrorr<���r!���)r'���r����er���r���r����do_add_��s����*zProfileBrowser.do_addc�������������C���s���t�d|�jd��d�S�)Nz>Add profile info from given file to current statistics object.)r-���)r<���r!���)r'���r���r���r����help_addh��s����zProfileBrowser.help_addc�������������C���s���|���d|�S�)Nr����)r����)r'���r���r���r���r���� do_calleesk��s����zProfileBrowser.do_calleesc�������������C���s���t�d|�jd��|�����d�S�)Nz6Print callees statistics from the current stat object.)r-���)r<���r!���r����)r'���r���r���r����help_calleesm��s����zProfileBrowser.help_calleesc�������������C���s���|���d|�S�)Nr����)r����)r'���r���r���r���r���� do_callersq��s����zProfileBrowser.do_callersc�������������C���s���t�d|�jd��|�����d�S�)Nz6Print callers statistics from the current stat object.)r-���)r<���r!���r����)r'���r���r���r����help_callerss��s����zProfileBrowser.help_callersc�������������C���s���t�d|�jd��dS�)Nr,���)r-���r���)r<���r!���)r'���r���r���r���r����do_EOFw��s����zProfileBrowser.do_EOFc�������������C���s���t�d|�jd��d�S�)NzLeave the profile brower.)r-���)r<���r!���)r'���r���r���r����help_EOFz��s����zProfileBrowser.help_EOFc�������������C���s���dS�)Nr���r���)r'���r���r���r���r����do_quit}��s����zProfileBrowser.do_quitc�������������C���s���t�d|�jd��d�S�)NzLeave the profile brower.)r-���)r<���r!���)r'���r���r���r���� help_quit��s����zProfileBrowser.help_quitc���������� ���C���s����|r�yt�|�|�_W�nn�tk rH�}�zt|jd�|�jd��d�S�d�}~X�Y�n:�tk r��}�zt|jjd�||�jd��d�S�d�}~X�Y�nX�|d�|�_ n6t |�j �dkr�|�j d�d��}|��|��ntd|�jd��dS�) Nr���)r-����:z% r_������z1No statistics object is current -- cannot reload.r���)r���r7���r����r<���r(���r!���r;���rH���r���r����r$���r����)r'���r����errr���r���r���r�������s����zProfileBrowser.do_readc�������������C���s ���t�d|�jd��t�d|�jd��d�S�)Nz+Read in profile data from a specified file.)r-���z*Without argument, reload the current file.)r<���r!���)r'���r���r���r���� help_read���s����zProfileBrowser.help_readc�������������C���s$���|�j�r|�j�����ntd|�jd��dS�)NzNo statistics object is loaded.)r-���r���)r7���rp���r<���r!���)r'���r���r���r���r���� do_reverse���s����zProfileBrowser.do_reversec�������������C���s���t�d|�jd��d�S�)Nz/Reverse the sort order of the profiling report.)r-���)r<���r!���)r'���r���r���r����help_reverse���s����zProfileBrowser.help_reversec����������������s����|�j�std|�jd��d�S�|�j������|rRt��fdd�|���D���rR|�j�j|������n@td|�jd��x0tj� ��D�]"\}}td||d�f�|�jd��qlW�dS�) NzNo statistics object is loaded.)r-���c�������������3���s���|�]}|��kV��qd�S�)Nr���)r����r����)�abbrevsr���r���r�������s����z)ProfileBrowser.do_sort.<locals>.<genexpr>z/Valid sort keys (unique prefixes are accepted):z%s -- %sr���r���) r7���r<���r!���rd����allr����rn���r���r`���rJ���)r'���r���re���rh���r���)r����r����do_sort���s���� zProfileBrowser.do_sortc�������������C���s ���t�d|�jd��t�d|�jd��d�S�)Nz.Sort profile data according to specified keys.)r-���z3(Typing `sort' without arguments lists valid keys.))r<���r!���)r'���r���r���r���� help_sort���s����zProfileBrowser.help_sortc����������������s�����fdd�t�jD��S�)Nc����������������s���g�|�]}|�����r|�qS�r���)r����)r�����a)�textr���r���� <listcomp>���s����z0ProfileBrowser.complete_sort.<locals>.<listcomp>)r���r`���)r'���r����r(���r���)r����r���� complete_sort���s����zProfileBrowser.complete_sortc�������������C���s���|���d|�S�)Nr����)r����)r'���r���r���r���r����do_stats���s����zProfileBrowser.do_statsc�������������C���s���t�d|�jd��|�����d�S�)Nz.Print statistics from the current stat object.)r-���)r<���r!���r����)r'���r���r���r���� help_stats���s����zProfileBrowser.help_statsc�������������C���s$���|�j�r|�j�����ntd|�jd��d�S�)NzNo statistics object is loaded.)r-���)r7���rt���r<���r!���)r'���r���r���r���r����do_strip���s����zProfileBrowser.do_stripc�������������C���s���t�d|�jd��d�S�)Nz<Strip leading path information from filenames in the report.)r-���)r<���r!���)r'���r���r���r���� help_strip���s����zProfileBrowser.help_stripc�������������C���s���t�d|�jd��d�S�)NzShow help for a given command.)r-���)r<���r!���)r'���r���r���r���� help_help���s����zProfileBrowser.help_helpc�������������C���s���|r|S�d�S�)Nr���)r'����stopr���r���r���r����postcmd���s����zProfileBrowser.postcmd)N)r���r���r���r*���r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r���r���r���r���r����6��s4��� r����r���r_���z*Welcome to the profile statistics browser.)r-���zGoodbye.)%r"���rC���r���rA���rv����enumr���� functoolsr����__all__r���r���r���rk���rq���r����rK���rT���r����r����r����r���r�����readline�ImportErrorr����r����r$����argvZinitprofileZbrowserr����r����r<���r!���Zcmdloop�KeyboardInterruptr���r���r���r����<module>���sP������ �