One Hat Cyber Team
Your IP :
18.220.129.8
Server IP :
103.133.214.160
Server :
Linux venus.ewebguru.net 4.18.0-553.30.1.el8_10.x86_64 #1 SMP Tue Nov 26 02:30:26 EST 2024 x86_64
Server Software :
Apache/2
PHP Version :
8.1.30
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
lib64
/
python3.6
/
__pycache__
/
Edit File:
trace.cpython-36.pyc
3 � \=p������������������@���s,��d�Z�ddgZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl mZ�yddlZW�n"�ek r����ejZdd��ZY�nX�dd ��Zd d��ZdZG�dd ��d �Zdd��Zdd��ZG�dd��d�Zdd��Zdd��Zddd�Zdd��ZG�dd��d�Zdd��Ze dk�r(e���dS�) a���program/module to trace Python program or function execution Sample use, command line: trace.py -c -f counts --ignore-dir '$prefix' spam.py eggs trace.py -t --ignore-dir '$prefix' spam.py eggs trace.py --trackcalls spam.py eggs Sample use, programmatically import sys # create a Trace object, telling it what to ignore, and whether to # do tracing or line-counting or both. tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,], trace=0, count=1) # run the new command using the given tracer tracer.run('main()') # make a report, placing output in /tmp r = tracer.results() r.write_results(show_missing=True, coverdir="/tmp") �Trace�CoverageResults�����N)� monotonicc���������������C���s���t�jd���d�S�)N)�sys�settrace��r���r����/usr/lib64/python3.6/trace.py�_unsettraceE���s����r ���c�������������C���s���t�j|���tj|���d�S�)N)� threadingr���r���)�funcr���r���r���� _settraceH���s���� r���c���������������C���s���t�jd���tjd���d�S�)N)r���r���r ���r���r���r���r���r ���L���s���� z#pragma NO COVERc���������������@���s���e�Zd�Zddd�Zdd��ZdS�)�_IgnoreNc�������������C���s:���|s t���nt�|�|�_|sg�ndd��|D��|�_ddi|�_d�S�)Nc�������������S���s���g�|�]}t�jj|��qS�r���)�os�path�normpath)�.0�dr���r���r���� <listcomp>U���s���z$_Ignore.__init__.<locals>.<listcomp>z<string>����)�set�_mods�_dirs�_ignore)�self�modules�dirsr���r���r����__init__S���s���� z_Ignore.__init__c�������������C���s����||�j�kr|�j�|�S�||�jkr,d|�j�|<�dS�x*|�jD�] }|j|d��r4d|�j�|<�dS�q4W�|d�krnd|�j�|<�dS�x,|�jD�]"}|j|tj��rvd|�j�|<�dS�qvW�d|�j�|<�dS�)Nr����.r���)r���r���� startswithr���r����sep)r����filename� modulename�modr���r���r���r����namesY���s$���� z _Ignore.names)NN)�__name__� __module__�__qualname__r���r#���r���r���r���r���r ���R���s��� r ���c�������������C���s ���t�jj|��}t�jj|�\}}|S�)z-Return a plausible module name for the patch.)r���r����basename�splitext)r����baser ����extr���r���r����_modname����s����r+���c�������������C���s����t�jj|��}d}xJtjD�]@}t�jj|�}|j|�r|t|��t�jkrt|�t|�kr|}qW�|rv|�t|�d�d��}n|�}t�jj|�\}}|jt�jd�}t�j r�|jt�j d�}t�jj |�\}}|jd�S�)z,Return a plausible module name for the path.��r���Nr���)r���r����normcaser���r����lenr���� splitdrive�replace�altsepr(����lstrip)r���ZcomparepathZlongest�dirr)���Zdriver ���r*���r���r���r����_fullmodname����s ����r4���c���������������@���s:���e�Zd�Zddd�Zdd��Zdd��Zdd d�Zddd �ZdS�)r���Nc�������������C���s����||�_�|�j�d�kri�|�_�|�j�j��|�_||�_|�jd�kr8i�|�_|�jj��|�_||�_|�jd�krZi�|�_|�jj��|�_||�_||�_|�jr�y@t|�jd��}tj |�\}}}W�d�Q�R�X�|�j |�j|||���W�n@�tt tfk r��}�ztd|�j|f�tjd��W�Y�d�d�}~X�nX�d�S�)N�rbzSkipping counts file %r: %s)�file)�counts�copyZcounter�calledfuncs�callers�infile�outfile�open�pickle�load�update� __class__�OSError�EOFError� ValueError�printr����stderr)r���r7���r9���r;���r:���r<����f�errr���r���r���r�������s,���� zCoverageResults.__init__c�������������C���s���|j�d�o|jd�S�)z_Return True if the filename does not refer to a file we want to have reported. �<�>)r����endswith)r���r ���r���r���r����is_ignored_filename����s����z#CoverageResults.is_ignored_filenamec������� ������C���sz���|�j�}|�j}|�j}|j�}|j}|j}x$|D�]}|j|d�||��||<�q*W�x|D�]}d||<�qPW�x|D�]}d||<�qfW�dS�)z.Merge in the data from another CoverageResultsr���r���N)r7���r9���r:����get) r����otherr7���r9���r:���Zother_countsZother_calledfuncsZ other_callers�keyr���r���r���r@�������s���� zCoverageResults.updateTFc�������!������C���s���|�j�rDt���td��|�j�}x(t|�D�]\}}}td|||f���q$W�|�jr�t���td��d�}} xvt|�j�D�]h\\} }}\} }}| |kr�t���td| d��| }d} | | kr�| | kr�td| ��| } td||||f���qlW�i�}x8|�jD�].\}}|j|i���}||<�|�j||f�||<�q�W�i�}�x$|j��D��]\}}|�j|��r@�q&|jd��rX|d d��}|d k�r�t j jt j j|��}t |�}n$|}t j j|��s�t j|��t|�}|�r�t|�}ni�}tj|�}t j j||d��}t|d��}tj|j�\}}W�d Q�R�X�|�j|||||�\}}|�r&|�r&td |�|��}||||f||<��q&W�|�r�|�r�td��x2t|�D�]&}||�\}}}}td||�����q`W�|�j�r�y&tj|�j|�j�|�jft|�jd�d ��W�n6�tk �r��} �ztd| �tj d��W�Y�d d } ~ X�nX�d S�)af�� Write the coverage results. :param show_missing: Show lines that had no hits. :param summary: Include coverage summary per module. :param coverdir: If None, the results of each module are placed in its directory, otherwise it is included in the directory specified. zfunctions called:z*filename: %s, modulename: %s, funcname: %szcalling relationships:r,���z***z -->z %s.%s -> %s.%sz.pycNr���z.coverr5����d���zlines cov% module (path)z%5d %3d%% %s (%s)�wbz"Can't save counts files because %s)r6������)!r9���rE����sortedr:���r7���rM����itemsrL���rK���r���r����dirname�abspathr+����exists�makedirsr4����_find_executable_linenos� linecache�getlines�joinr=����tokenize�detect_encoding�readline�write_results_file�intr<���r>����dumprB���r���rF���)!r���Zshow_missing�summary�coverdirZcallsr ���r!����funcnameZlastfileZ lastcfileZpfileZpmodZpfunc�cfileZcmodZcfuncZper_file�lineno� lines_hitZsums�countr3����lnotab�sourceZ coverpath�fp�encoding�_�n_hits�n_linesZpercent�mrH���r���r���r���� write_results����s|���� zCoverageResults.write_resultsc�������������C���s����yt�|d|d�}W�n6�tk rH�}�ztd||f�tjd��dS�d}~X�nX�d}d} |���x�t|d�D�]r\} }| |kr�|jd|| ����| d7�} |d7�}n.| |kr�t|kr�|jd ��|d7�}n |jd ��|j|jd���qdW�W�dQ�R�X�| |fS�) z'Return a coverage results file in path.�w)rm���z3trace: Could not open %r for writing: %s - skipping)r6���r���Nr���z%5d: z>>>>>> z ����)r���r���) r=���rB���rE���r���rF���� enumerate�write�PRAGMA_NOCOVER� expandtabs)r���r����linesrj���rh���rm���r<���rH���rp���ro���rg����liner���r���r���r`���5��s(���� z"CoverageResults.write_results_file)NNNNN)TFN)N)r$���r%���r&���r���rL���r@���rr���r`���r���r���r���r���r�������s���� [c�������������C���s0���i�}x&t�j|��D�]\}}||krd||<�qW�|S�)z:Return dict where keys are lines in the line number table.r���)�disZfindlinestarts)�code�strs�linenosrn���rg���r���r���r����_find_lines_from_codeU��s ����r���c�������������C���s8���t�|�|�}x(|�jD�]}tj|�r|jt||���qW�|S�)z<Return lineno dict for all code objects reachable from code.)r���� co_consts�inspectZiscoder@����_find_lines)r|���r}���r~����cr���r���r���r����_��s ���� r����c���������� ���C���s����i�}t�j}t|�|d��r}tj|j�}x^|D�]V\}}}} } |t�jkr||t�jkr||\}}| \} }xt|| d��D�]}d||<�qlW�|}q*W�W�dQ�R�X�|S�)z�Return a dict of possible docstring positions. The dict maps line numbers to strings. There is an entry for line that contains only a string or a part of a triple-quoted string. )rm���r���N)�token�INDENTr=���r]����generate_tokensr_����STRING�range)r ���rm���r���Z prev_ttyperG����tokZttypeZtstr�start�endrz���ZslineZscolZelineZecol�ir���r���r���� _find_stringsk��s���� r����c�������������C���s����y(t�j|���}|j��}|j}W�dQ�R�X�W�n6�tk r^�}�ztd|�|f�tjd��i�S�d}~X�nX�t||�d�}t |�|�}t ||�S�)zAReturn dict where keys are line numbers in the line number table.Nz%Not printing coverage data for %r: %s)r6����exec)r]���r=����readrm���rB���rE���r���rF����compiler����r����)r ���rG����progrm���rH���r|���r}���r���r���r���rY������s���� rY���c������������ ���@���s����e�Zd�Zddddf�f�dddf dd�Zdd��Zdd d �Zdd��Zd d��Zdd��Zdd��Z dd��Z dd��Zdd��Zdd��Z dd��ZdS�)r���r���r���NFc ������� ������C���s����||�_�||�_t||�|�_i�|�_i�|�_d|�_||�_i�|�_i�|�_ i�|�_ d|�_| rTt��|�_|rb|�j |�_nZ|rp|�j|�_nL|r�|r�|�j|�_|�j|�_n2|r�|�j|�_|�j|�_n|r�|�j|�_|�j|�_nd|�_dS�)ax�� @param count true iff it should count number of times each line is executed @param trace true iff it should print out each line that is being counted @param countfuncs true iff it should just output a list of (filename, modulename, funcname,) for functions that were called at least once; This overrides `count' and `trace' @param ignoremods a list of the names of modules to ignore @param ignoredirs a list of the names of directories to ignore all of the (recursive) contents of @param infile file from which to read stored counts to be added into the results @param outfile file in which to write the results @param timing true iff timing information be displayed r���Nr���)r;���r<���r ����ignorer7���Zpathtobasename� donothing�trace�_calledfuncs�_callers� _caller_cache� start_time�_time�globaltrace_trackcallers�globaltrace�globaltrace_countfuncs�globaltrace_lt�localtrace_trace_and_count� localtrace�localtrace_trace�localtrace_count) r���ri���r����� countfuncs�countcallers� ignoremods� ignoredirsr;���r<����timingr���r���r���r������s6���� zTrace.__init__c�������������C���s ���dd�l�}|j}|�j|||��d�S�)Nr���)�__main__�__dict__�runctx)r����cmdr�����dictr���r���r����run���s����z Trace.runc���������� ���C���sL���|d�kri�}|d�kri�}|�j�s(t|�j��zt|||��W�d�|�j�sFt���X�d�S�)N)r����r���r����r����r ���)r���r�����globals�localsr���r���r���r�������s������ zTrace.runctxc�������������O���s<���d�}|�j�stj|�j��z|||�}W�d�|�j�s6tjd���X�|S�)N)r����r���r���r����)r���r����args�kw�resultr���r���r����runfunc���s����z Trace.runfuncc������� ������C���s����|j�}|j}|rt|�}nd�}|j}d�}||�jkrL|�j|�d�k r�|�j|�}n�d�|�j|<�dd��tj|�D��}t|�dkr�dd��tj|d��D��}t|�dkr�dd��tj|d��D��} t| �dkr�| d�j}||�j|<�|d�k r�d||f�}|||fS�)Nc�������������S���s���g�|�]}t�j|�r|�qS�r���)r����Z isfunction)r���rG���r���r���r���r������s����z1Trace.file_module_function_of.<locals>.<listcomp>r���c�������������S���s���g�|�]}t�|t�r|�qS�r���)� isinstancer����)r���r���r���r���r���r������s����r���c�������������S���s���g�|�]}t�|d��r|�qS�)� __bases__)�hasattr)r���r����r���r���r���r������s����z%s.%s) �f_code�co_filenamer+����co_namer�����gcZ get_referrersr.���r$���) r����framer|���r ���r!���re���ZclsnameZfuncsZdicts�classesr���r���r����file_module_function_of���s,���� zTrace.file_module_function_ofc�������������C���s0���|dkr,|�j�|�}|�j�|j�}d|�j||f<�dS�)zkHandler for call events. Adds information about who called who to the self._callers dict. �callr���N)r�����f_backr����)r���r�����why�arg� this_funcZparent_funcr���r���r���r������s���� zTrace.globaltrace_trackcallersc�������������C���s ���|dkr|�j�|�}d|�j|<�dS�)zoHandler for call events. Adds (filename, modulename, funcname) to the self._calledfuncs dict. r����r���N)r����r����)r���r����r����r����r����r���r���r���r������s���� zTrace.globaltrace_countfuncsc�������������C���sj���|dkrf|j�}|jjdd�}|rbt|�}|dk rf|�jj||�}|sf|�jrZtd||jf���|�j S�ndS�dS�)z�Handler for call events. If the code block being entered is to be ignored, returns `None', else returns self.localtrace. r�����__file__Nz! --- modulename: %s, funcname: %s) r����� f_globalsrM���r+���r����r#���r����rE���r����r����)r���r����r����r����r|���r ���r!���Z ignore_itr���r���r���r������s����zTrace.globaltrace_ltc�������������C���s����|dkr~|j�j}|j}||f}|�jj|d�d�|�j|<�|�jrTtdt��|�j��dd��tj j |�}td||tj||�f�dd��|�j S�) Nrz���r���r���z%.2f� )r����z %s(%d): %sr,���)r����r�����f_linenor7���rM���r����rE���r����r���r���r'���rZ����getliner����)r���r����r����r����r ���rg���rO����bnamer���r���r���r����2��s����z Trace.localtrace_trace_and_countc�������������C���sd���|dkr^|j�j}|j}|�jr4tdt��|�j��dd��tjj|�}td||t j ||�f�dd��|�jS�)Nrz���z%.2fr����)r����z %s(%d): %sr,���)r����r����r����r����rE���r����r���r���r'���rZ���r����r����)r���r����r����r����r ���rg���r����r���r���r���r����A��s����zTrace.localtrace_tracec�������������C���s<���|dkr6|j�j}|j}||f}|�jj|d�d�|�j|<�|�jS�)Nrz���r���r���)r����r����r����r7���rM���r����)r���r����r����r����r ���rg���rO���r���r���r���r����N��s����zTrace.localtrace_countc�������������C���s���t�|�j|�j|�j|�j|�jd�S�)N)r;���r<���r9���r:���)r���r7���r;���r<���r����r����)r���r���r���r����resultsV��s���� z Trace.results)NN)r$���r%���r&���r���r����r����r����r����r����r����r����r����r����r����r����r���r���r���r���r������s���0 ) c�����������������s���t�j��}�|�jdddd��|�jdd�}|jddd d d��|jdd d dd��|jddd dd��|jddd dd��|�jd�}|j��}|jddd dd��|jddd dd��|jdddd��|jd d!d"d��|jd#d$d d%d��|jd&d'd d(d��|jd)d*d d+d��|�jd,d-�}|jd.d/g�d0d1��|jd2d/g�d3d1��|�jd4d5d6d7��|�jd8t�jd9d7��|�j��}|j�r�d:d;jt j �f}tjj t jf|����tjj t jf|��������fd<d=��d>d?��|jD��|_�fd@d?�|jD��|_|j�r|j�s�|�jdA��t|j|jdB�}|j|j|j|j�S�t|j|j|j|jg��s*|�jdC��|j�rL|j�sB|j�rL|�jdD��|j�rh|j��rh|�jdE��|jd�k�r~|�jdF��|jf|j�t _ tjj!|j�t jdG<�t"|j|j|j|j|j|j|j|j|j#dH� }yJt$|j��}t%|j&��|jdI�}W�d�Q�R�X�|jdJd�d�dK�} |j'|| | ��W�nP�t(k �rT�} �zt j)dLt j dG�| f���W�Y�d�d�} ~ X�n�t*k �rh���Y�nX�|j+��}|j,�s�|j|j|j|j��d�S�)MNz --version�versionz trace 2.0)�actionr����zMain optionsz(One of these (or --report) must be givenz-cz--count� store_truez�Count the number of times each line is executed and write the counts to <module>.cover for each module executed, in the module's directory. See also --coverdir, --file, --no-report below.)r�����helpz-tz--tracez3Print each line to sys.stdout before it is executedz-lz--listfuncsz�Keep track of which functions are executed at least once and write the results to sys.stdout after the program exits. Cannot be specified alongside --trace or --count.z-Tz--trackcallsz^Keep track of caller/called pairs and write the results to sys.stdout after the program exits.Z Modifiersz-rz--reportz�Generate a report from a counts file; does not execute any code. --file must specify the results file to read, which must have been created in a previous run with --count --file=FILEz-Rz--no-reportz^Do not generate the coverage report files. Useful if you want to accumulate over several runs.z-fz--filez+File to accumulate counts over several runs)r����z-Cz --coverdirz�Directory where the report files go. The coverage report for <package>.<module> will be written to file <dir>/<package>/<module>.coverz-mz --missingz?Annotate executable lines that were not executed with ">>>>>> "z-sz --summaryz\Write a brief summary for each file to sys.stdout. Can only be used with --count or --reportz-gz--timingzQPrefix each line with the time since the program started. Only used while tracingZFilterszCan be specified multiple timesz--ignore-module�appendzqIgnore the given module(s) and its submodules (if it is a package). Accepts comma separated list of module names.)r�����defaultr����z--ignore-dirzWIgnore files in the given directory (multiple directories can be joined by os.pathsep).r ����?zfile to run as main program)�nargsr����� argumentszarguments to the program�libzpython{0.major}.{0.minor}c����������������s4���t�jjt�jj|���}�|�jd��jd���}�t�jj|��S�)Nz$prefixz$exec_prefix)r���r���� expanduser� expandvarsr0���r���)�s)�_exec_prefix�_prefixr���r����parse_ignore_dir���s����zmain.<locals>.parse_ignore_dirc�������������S���s$���g�|�]}|j�d��D�]}|j���qqS�)�,)�split�strip)r���r����r"���r���r���r���r������s���zmain.<locals>.<listcomp>c����������������s&���g�|�]}|j�tj�D�]}��|��qqS�r���)r����r����pathsep)r���r����r����)r����r���r���r������s���z-r/--report requires -f/--file)r;���r<���zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz8cannot specify both --listfuncs and (--trace or --count)z3--summary can only be used with --count or --reportz3filename is missing: required with the main optionsr���)r����r����r����r����r;���r<���r����r����r����)r����r$����__package__� __cached__zCannot run file %r because: %s)-�argparse�ArgumentParser�add_argumentZadd_argument_groupZadd_mutually_exclusive_groupZ REMAINDER� parse_argsZ ignore_dir�formatr����version_infor���r���r\����base_prefix�base_exec_prefixZ ignore_moduleZreportr6����errorr���rr���Zmissingrc���rd����anyr����ri���Z listfuncsZ trackcallsr ���r�����argvrU���r���r����r=���r����r����r����rB����exit� SystemExitr����Z no_report)�parserZgrpZ_grpZoptsZrel_pathr�����trl���r|���ZglobsrH���r���)r����r����r����r����main\��s����� (r����r����)N)!�__doc__�__all__r����rZ���r����rer���r����r]���r����r����r{���r>���Ztimer���r����r ����ImportErrorr���r���r ���rw���r ���r+���r4���r���r���r����r����rY���r���r����r$���r���r���r���r����<module>1���sH���2�/ �M�
Simpan