Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_profile.cpython-310.pyc
o

�9j�"�@s�dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZddlZddlmZmZddlmZmZGd	d
�d
ej�Zdd�Zed
d��Zdd�ZiZded<ded<ded<edkrre�dSdS)z"Test suite for the profile module.�N)�unified_diff)�StringIO)�TESTFN�unlink�temp_dir�
change_cwd)�contextmanager)�testfunc�timer)�assert_python_failure�assert_python_okc@sneZdZejZeZgd�ZdZdd�Z	dd�Z
edd��Zd	d
�Z
dd�Zd
d�Zdd�Zdd�Zdd�ZdS)�ProfileTest)�print_stats�
print_callers�
print_calleesz:0(max)cCstt�dS�N)rr��self�r�(/usr/lib/python3.10/test/test_profile.py�tearDownszProfileTest.tearDowncCstSr)�_ProfileOutputrrrr�get_expected_outputszProfileTest.get_expected_outputcs�g}|�td�}t�}|�dt�t��|�t�|�|jD]9}t�}tj	||d�}|�
��d�t||��|�
���}tj�dd�d��fdd�|D�}|�d	�|��q|S)
N���MbP?�
testfunc()��stream�stdname�.�csg|]
}�|vr|���qSr)�rstrip)�.0�line��mod_namerr�
<listcomp>/sz,ProfileTest.do_profiling.<locals>.<listcomp>�
)�
profilerclassr
�runctx�globals�locals�append�methodnamesr�pstats�Stats�
strip_dirs�
sort_stats�getattr�getvalue�
splitlinesr	�
__module__�rsplit�join)�cls�results�prof�start_timer�
methodname�s�stats�outputrr#r�do_profilings
zProfileTest.do_profilingcCs�|��}|��}|�|dd�g}t|j�D]0\}}||}||d}||krG|�d|�d|jj�d��|�t	|�
d�|�
d�dd	��q|rT|�d�|��dSdS)
Nri�rz
Stats.z output for z does not fit expectation:r&�)�lineterm)
r?r�assertEqual�	enumerater,r+r'�__name__�extendr�split�failr6)rr8�expectedrG�i�method�a�brrr�
test_cprofile3s$
����zProfileTest.test_cprofilec	Cspgd�}|D]/}t�}|�td�}|�|t�t��tj||d�}|��|�	�}|�
|j|d�||��qdS)N)zmax([0])zmax([0], key=int)zmax([0], **dict(key=int))zmax(*([0],))zmax(*([0],), key=int)zmax(*([0],), **dict(key=int))rrz&Profiling {0!r} didn't report max:
{1})
rr'r
r(r)r*r-r.rr2�assertIn�expected_max_output�format)r�stmts�stmtr<r9r=�resrrr�test_calling_conventionsDs

��z$ProfileTest.test_calling_conventionscCsXt��|j�d�Wd�n1swY|jjdtd�|�tj�t��dS)Nzint('1')��filename)�silent�profilermodule�runr�
assertTrue�os�path�existsrrrr�test_runYs
�zProfileTest.test_runcCsht��|j�dt�t��Wd�n1swY|jjdt�t�td�|�tj�	t��dS)NrrU)
rWrXr(r)r*rrZr[r\r]rrrr�test_runctx_s��zProfileTest.test_runctxcCs<td|jjd�td|jjdd�td|jjdddd�dS)N�-m�random_module_xyz�timeitz-n�1)rrXrDrrrrr�test_run_profile_as_modulefs
�
�z&ProfileTest.test_run_profile_as_modulec
Cs�t��Y}t|��<t�d�tdddd��
}|�d�Wd�n1s%wYtd|jjdd	d�|�	tj
�d	��Wd�n1sGwYWd�dSWd�dS1s_wYdS)
N�destzdemo.py�wzutf-8)�encodingzimport os; os.chdir("dest")r`z-oz
out.pstats)rrr[�mkdir�open�writerrXrDrZr\r])r�tmpdir�frrr�(test_output_file_when_changing_directoryrs
��P�z4ProfileTest.test_output_file_when_changing_directoryN)rDr4�__qualname__�profile�Profiler'rXr,rOrr�classmethodr?rMrTr^r_rdrmrrrrr
s
r
c	Cs�|�d�}td|�|��}g}t|d��}|D]}|�|�|�d�r'nqWd�n1s2wYt|d��/}|�|�|�d�t|j	�D]\}}|�d|||df�qL|�d	�Wd�dS1snwYdS)
N�cozRegenerating %s...�rz#--cutrfz_ProfileOutput = {}
z _ProfileOutput[%r] = """\
%s"""
rz'
if __name__ == "__main__":
    main()
)
r �printr?rir+�
startswith�
writelinesrjrCr,)rVr7r8�newfilerlr"rIrJrrr�regenerate_expected_output�s*


���


�"�rxccs,�tj}z
t�t_dVW|t_dS|t_wr)�sys�stdoutr)rzrrrrW�s�rWcCs$dtjvrt��dSttt�dS)Nz-r)ry�argv�unittest�mainrx�__file__r
rrrrr}�s
r}a�       28   27.972    0.999   27.972    0.999 profilee.py:110(__getattr__)
        1  269.996  269.996  999.769  999.769 profilee.py:25(testfunc)
     23/3  149.937    6.519  169.917   56.639 profilee.py:35(factorial)
       20   19.980    0.999   19.980    0.999 profilee.py:48(mul)
        2   39.986   19.993  599.830  299.915 profilee.py:55(helper)
        4  115.984   28.996  119.964   29.991 profilee.py:73(helper1)
        2   -0.006   -0.003  139.946   69.973 profilee.py:84(helper2_indirect)
        8  311.976   38.997  399.912   49.989 profilee.py:88(helper2)
        8   63.976    7.997   79.960    9.995 profilee.py:98(subhelper)ra�:0(append)                        <- profilee.py:73(helper1)(4)  119.964
:0(exc_info)                      <- profilee.py:73(helper1)(4)  119.964
:0(hasattr)                       <- profilee.py:73(helper1)(4)  119.964
                                     profilee.py:88(helper2)(8)  399.912
profilee.py:110(__getattr__)      <- :0(hasattr)(12)   11.964
                                     profilee.py:98(subhelper)(16)   79.960
profilee.py:25(testfunc)          <- <string>:1(<module>)(1)  999.767
profilee.py:35(factorial)         <- profilee.py:25(testfunc)(1)  999.769
                                     profilee.py:35(factorial)(20)  169.917
                                     profilee.py:84(helper2_indirect)(2)  139.946
profilee.py:48(mul)               <- profilee.py:35(factorial)(20)  169.917
profilee.py:55(helper)            <- profilee.py:25(testfunc)(2)  999.769
profilee.py:73(helper1)           <- profilee.py:55(helper)(4)  599.830
profilee.py:84(helper2_indirect)  <- profilee.py:55(helper)(2)  599.830
profilee.py:88(helper2)           <- profilee.py:55(helper)(6)  599.830
                                     profilee.py:84(helper2_indirect)(2)  139.946
profilee.py:98(subhelper)         <- profilee.py:88(helper2)(8)  399.912ra�:0(hasattr)                       -> profilee.py:110(__getattr__)(12)   27.972
<string>:1(<module>)              -> profilee.py:25(testfunc)(1)  999.769
profilee.py:110(__getattr__)      ->
profilee.py:25(testfunc)          -> profilee.py:35(factorial)(1)  169.917
                                     profilee.py:55(helper)(2)  599.830
profilee.py:35(factorial)         -> profilee.py:35(factorial)(20)  169.917
                                     profilee.py:48(mul)(20)   19.980
profilee.py:48(mul)               ->
profilee.py:55(helper)            -> profilee.py:73(helper1)(4)  119.964
                                     profilee.py:84(helper2_indirect)(2)  139.946
                                     profilee.py:88(helper2)(6)  399.912
profilee.py:73(helper1)           -> :0(append)(4)   -0.004
profilee.py:84(helper2_indirect)  -> profilee.py:35(factorial)(2)  169.917
                                     profilee.py:88(helper2)(2)  399.912
profilee.py:88(helper2)           -> :0(hasattr)(8)   11.964
                                     profilee.py:98(subhelper)(8)   79.960
profilee.py:98(subhelper)         -> profilee.py:110(__getattr__)(16)   27.972r�__main__)�__doc__ryr-r|r[�difflibr�ior�test.support.os_helperrrrr�
contextlibrro�
test.profileer	r
�test.support.script_helperrr�TestCaser
rxrWr}rrDrrrr�<module>s0p
		

�

Youez - 2016 - github.com/yon3zu
LinuXploit