403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_profile.cpython-36.pyc
3

�w2_��@s�dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZddl
mZddlZddlmZmZGdd	�d	ej�Zd
d�Zedd
��Zdd�Zdd�ZiZded<ded<ded<edkr�e�dS)z"Test suite for the profile module.�N)�unified_diff)�StringIO)�TESTFN�run_unittest�unlink)�contextmanager)�testfunc�timerc@s`eZdZejZeZdddgZdZdd�Z	dd�Z
ed	d
��Zdd�Z
d
d�Zdd�Zdd�ZdS)�ProfileTest�print_stats�
print_callers�
print_calleesz:0(max)cCstt�dS)N)rr)�self�r�6/opt/alt/python36/lib64/python3.6/test/test_profile.py�tearDownszProfileTest.tearDowncCstS)N)�_ProfileOutput)rrrr�get_expected_outputszProfileTest.get_expected_outputcs�g}|jtd�}t�}|jdt�t��|jt�|�x||jD]r}t�}tj	||d�}|j
�jd�t||��|j
�j�}tjjdd�d��fdd�|D�}|jd	j|��q@W|S)
Ng����MbP?z
testfunc())�streamZstdname�.�csg|]}�|kr|j��qSr)�rstrip)�.0�line)�mod_namerr�
<listcomp>.sz,ProfileTest.do_profiling.<locals>.<listcomp>�
)�
profilerclassr	�runctx�globals�locals�append�methodnamesr�pstats�StatsZ
strip_dirsZ
sort_stats�getattr�getvalue�
splitlinesr�
__module__�rsplit�join)�cls�results�profZstart_timerZ
methodname�s�stats�outputr)rr�do_profilingszProfileTest.do_profilingcCs�|j�}|j�}|j|dd�g}xnt|j�D]`\}}||}||d}||kr0|jd|�d|jj�d��|jt	|j
d�|j
d�dd	��q0W|r�|jdj|��dS)
Nri�rz
Stats.z output for z does not fit expectation:r�)Zlineterm)
r1rZassertEqual�	enumerater"r!r�__name__�extendr�split�failr*)rr,Zexpectedr7�i�method�a�brrr�
test_cprofile2szProfileTest.test_cprofilecCs|ddddddg}xf|D]^}t�}|jtd�}|j|t�t��tj||d�}|j�|j	�}|j
|j|d	j||��qWdS)
Nzmax([0])zmax([0], key=int)zmax([0], **dict(key=int))zmax(*([0],))zmax(*([0],), key=int)zmax(*([0],), **dict(key=int))g����MbP?)rz&Profiling {0!r} didn't report max:
{1})
rrr	rrr r#r$rr&ZassertIn�expected_max_output�format)rZstmtsZstmtr.r-r/�resrrr�test_calling_conventionsCs

z$ProfileTest.test_calling_conventionscCsDt��|jjd�WdQRX|jjdtd�|jtjjt��dS)Nzint('1'))�filename)�silent�profilermoduleZrunr�
assertTrue�os�path�exists)rrrr�test_runXszProfileTest.test_runc
CsTt��|jjdt�t��WdQRX|jjdt�t�td�|jtjj	t��dS)Nz
testfunc())rA)
rBrCrrr rrDrErFrG)rrrr�test_runctx^s
zProfileTest.test_runctxN)r4r(�__qualname__�profileZProfilerrCr"r=rr�classmethodr1r<r@rHrIrrrrr
s
r
cCs�|jd�}td|�|j�}g}t|d��*}x"|D]}|j|�|jd�r4Pq4WWdQRXt|d��V}|j|�|jd�x0t|j	�D]"\}}|jd|||df�q�W|jd	�WdQRXdS)
N�cozRegenerating %s...�rz#--cut�wz_ProfileOutput = {}
z _ProfileOutput[%r] = """\
%s"""
rz'
if __name__ == "__main__":
    main()
)
r�printr1�openr!�
startswith�
writelines�writer3r")rAr+r,Znewfile�frr8r9rrr�regenerate_expected_outputfs 





rVccs&tj}zt�t_dVWd|t_XdS)N)�sys�stdoutr)rXrrrrBzs

rBcCstt�dS)N)rr
rrrr�	test_main�srYcCs dtjkrt�n
ttt�dS)Nz-r)rW�argvrYrV�__file__r
rrrr�main�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.912ra�: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__rWr#ZunittestrEZdifflibr�iorZtest.supportrrr�
contextlibrrKZ
test.profileerr	ZTestCaser
rVrBrYr\rr4rrrr�<module>s*V		


Youez - 2016 - github.com/yon3zu
LinuXploit