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_sort.cpython-36.pyc
3

�w2_�!�@s�ddlmZddlZddlZddlmZejZdad
dd�ZGdd�dej	�Z
Gdd	�d	ej	�ZGd
d�dej	�Ze
dkr�ej�dS)�)�supportN)�
cmp_to_keycCs�trtd|�|dd�}|r0|jt|�d�n|j�t|�t|�kr�td|�tdt|�t|��t|�t|�t|�td7adSx`t|�D]T\}}||}||k	r�td|�td|||�t|�t|�t|�td7adSq�WdS)Nz    checking)�keyzerror inzlength mismatch;�zout of order at index)�verbose�print�sortr�len�nerrors�	enumerate)�tagZexpected�rawZcompareZorig�iZgood�maybe�r�3/opt/alt/python36/lib64/python3.6/test/test_sort.py�check
s0


rc@seZdZdd�ZdS)�TestBasec

sXdg}x2tdd�D]$}d|}|jt|d|d��qW|jdddg�G�fdd�dt��Gd	d
�d
t���x�|D�]�}tt|��}tr�td|�|dd�}td||�|dd�}|j�td
||�|dd�}tj	|�td||�|dd�}|j�|dd�}td||dd��t�r8td�td�|dd�}|j
tdd��d�td||�t|�dk�r�dd�}|dd�}|j
t|j
|d��fdd�|D�}|dd�}tj	|�d�_d}y|j
�Wntk
�r�d}YnX|�r
d�_td||��fdd�t|�D�}dd�|D�}	|	j
�d d�|	D�}td!||�qvWdS)"Nrr�
��di�cs,eZdZdZdd�Z�fdd�Zdd�ZdS)	z+TestBase.testStressfully.<locals>.ComplainsTcSs
||_dS)N)r)�selfrrrr�__init__6sz4TestBase.testStressfully.<locals>.Complains.__init__cs2�jr&tj�dkr&tr"td||�t�|j|jkS)Ng����MbP?z        complaining at)�maybe_complain�randomrr�RuntimeErrorr)r�other)�	Complainsrr�__lt__9s
z2TestBase.testStressfully.<locals>.Complains.__lt__cSs
d|jS)Nz
Complains(%d))r)rrrr�__repr__@sz4TestBase.testStressfully.<locals>.Complains.__repr__N)�__name__�
__module__�__qualname__rrrrr)rrrr3src@s$eZdZdd�Zdd�Zdd�ZdS)z(TestBase.testStressfully.<locals>.StablecSs||_||_dS)N)r�index)rrrrrrrDsz1TestBase.testStressfully.<locals>.Stable.__init__cSs|j|jkS)N)r)rrrrrrHsz/TestBase.testStressfully.<locals>.Stable.__lt__cSsd|j|jfS)NzStable(%d, %d))rr#)rrrrrKsz1TestBase.testStressfully.<locals>.Stable.__repr__N)r r!r"rrrrrrr�StableCsr$zTesting sizeZidentity�reversedzrandom permutationzreversed via functioncSs||k||kS)Nr)�a�brrr�<lambda>asz*TestBase.testStressfully.<locals>.<lambda>z3    Checking against an insane comparison function.z?        If the implementation isn't careful, this may segfault.cSsttj�d�dS)N�r)�intr)r&r'rrrr(gs)rz(an insane function left some permutationcSst�dS)N)r)�xrrr�bad_keyksz)TestBase.testStressfully.<locals>.bad_keycsg|]}�|��qSrr)�.0r)rrr�
<listcomp>psz,TestBase.testStressfully.<locals>.<listcomp>TFz+exception during sort left some permutationcsg|]}�tjd�|��qS)r)r�	randrange)r-r)r$rrr.}scSsg|]}||jf�qSr)r#)r-�errrr.~scSsg|]\}}|�qSrr)r-r0rrrrr.�sZ	stability)�range�extend�object�listrrr�reverser�shufflerrr	�assertRaisesrr)
rZsizesZpower�nr+�s�yr,Z
it_complainedZ	augmentedr)rr$r�testStressfully+sd



zTestBase.testStressfullyN)r r!r"r;rrrrr*src@seZdZdd�Zdd�ZdS)�TestBugscs:G�fdd�d���fdd�td�D��|jt�j�dS)NcseZdZ�fdd�ZdS)z"TestBugs.test_bug453523.<locals>.Ccs0�rtj�dkr�j�n
�jd�tj�dkS)Ng�?r)g�?)r�pop�append)rr)�Lrrr�s

z)TestBugs.test_bug453523.<locals>.C.__lt__N)r r!r"rr)r?rr�C�sr@csg|]
}���qSrr)r-r)r@rrr.�sz+TestBugs.test_bug453523.<locals>.<listcomp>�2)r1r7�
ValueErrorr)rr)r@r?r�test_bug453523�szTestBugs.test_bug453523cslg}xbtd�D]V}�fdd�}ddg�|jt�jt|�d��fdd�}|jt�jt|�d�|g}qWdS)N�cs"�jd��j�||k||kS)Nr))r>r=)r+r:)r?rr�mutating_cmp�s
z7TestBugs.test_undetected_mutation.<locals>.mutating_cmprr)rcs$�jd��dd�=||k||kS)Nr))r>)r+r:)r?rrrE�s

)r1r7rBrr)rZmemorywasterrrEr)r?r�test_undetected_mutation�sz!TestBugs.test_undetected_mutationN)r r!r"rCrFrrrrr<�sr<c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�TestDecorateSortUndecoratecCsHdj�}|dd�}tj|�|jtjd�dd�}|jt|�d�dS)Nz,The quick Brown fox Jumped over The lazy Dog)rcSs"|j�|j�}}||k||kS)N)�lower)r+r:ZxlowerZylowerrrr�my_cmp�sz9TestDecorateSortUndecorate.test_decorated.<locals>.my_cmp)�splitrr6r�strrHr)r�data�copyrIrrr�test_decorated�s
z)TestDecorateSortUndecorate.test_decoratedcCs"dj�}|jt|jdd�d�dS)Nz,The quick Brown fox Jumped over The lazy DogcSsdS)Nrr)r+r:rrrr(�sz>TestDecorateSortUndecorate.test_baddecorator.<locals>.<lambda>)r)rJr7�	TypeErrorr)rrLrrr�test_baddecorator�sz,TestDecorateSortUndecorate.test_baddecoratorcCsFdd�td�D�}|dd�}|jdd�d�|j�|j||�dS)NcSsg|]}tjd�|f�qS)r)rr/)r-rrrrr.�sz=TestDecorateSortUndecorate.test_stability.<locals>.<listcomp>��cSs|dS)Nrr)�trrrr(�sz;TestDecorateSortUndecorate.test_stability.<locals>.<lambda>)r)r1r�assertEqual)rrLrMrrr�test_stability�s
z)TestDecorateSortUndecorate.test_stabilitycCs@ttdd��}|dd�}|jt|jdd�d�|j||�dS)NrcSsd|S)Nrr)r+rrrr(�szDTestDecorateSortUndecorate.test_key_with_exception.<locals>.<lambda>)r���)r4r1r7�ZeroDivisionErrorrrS)rrL�duprrr�test_key_with_exception�sz2TestDecorateSortUndecorate.test_key_with_exceptioncs.ttd����fdd�}|jt�j|d�dS)Nrcs�dd�=td��dd�<|S)NrD)r1)r+)rLrr�k�s
z<TestDecorateSortUndecorate.test_key_with_mutation.<locals>.k)r)r4r1r7rBr)rrYr)rLr�test_key_with_mutation�sz1TestDecorateSortUndecorate.test_key_with_mutationcs6ttd���G�fdd�dt�}|jt�j|d�dS)Nrcs(eZdZdd�Z�fdd�Zdd�ZdS)zITestDecorateSortUndecorate.test_key_with_mutating_del.<locals>.SortKillercSsdS)Nr)rr+rrrr�szRTestDecorateSortUndecorate.test_key_with_mutating_del.<locals>.SortKiller.__init__cs�dd�=td��dd�<dS)NrD)r1)r)rLrr�__del__�s
zQTestDecorateSortUndecorate.test_key_with_mutating_del.<locals>.SortKiller.__del__cSst|�t|�kS)N)�id)rrrrrr�szPTestDecorateSortUndecorate.test_key_with_mutating_del.<locals>.SortKiller.__lt__N)r r!r"rr[rr)rLrr�
SortKiller�sr])r)r4r1r3r7rBr)rr]r)rLr�test_key_with_mutating_del�sz5TestDecorateSortUndecorate.test_key_with_mutating_delcs6ttd���G�fdd�dt�}|jt�j|d�dS)Nrcs eZdZdd�Z�fdd�ZdS)zWTestDecorateSortUndecorate.test_key_with_mutating_del_and_exception.<locals>.SortKillercSs|dkrt�dS)Nr)r)rr+rrrr�sz`TestDecorateSortUndecorate.test_key_with_mutating_del_and_exception.<locals>.SortKiller.__init__cs"�dd�=ttd���dd�<dS)NrD)r4r1)r)rLrrr[�s
z_TestDecorateSortUndecorate.test_key_with_mutating_del_and_exception.<locals>.SortKiller.__del__N)r r!r"rr[r)rLrrr]�sr])r)r4r1r3r7rr)rr]r)rLr�(test_key_with_mutating_del_and_exception�szCTestDecorateSortUndecorate.test_key_with_mutating_del_and_exceptioncCs>ttd��}tj|�|jdd�|j|ttddd���dS)NrT)r5�cr���ra)r4r1rr6rrS)rrLrrr�test_reverse�s
z'TestDecorateSortUndecorate.test_reversecCs�dd�td�D�}|dd�}|dd�}dd�}dd�}|jt|�dd	�|jt|�d
�|j||�|jdd�dd	�|j||�dS)
NcSsg|]}tjd�|f�qS)r)rr/)r-rrrrr.�szETestDecorateSortUndecorate.test_reverse_stability.<locals>.<listcomp>rQcSs"|d|d}}||k||kS)Nrr)r+r:�x0�y0rrrrI�szATestDecorateSortUndecorate.test_reverse_stability.<locals>.my_cmpcSs"|d|d}}||k||kS)Nrr)r+r:rcrdrrr�my_cmp_reversed�szJTestDecorateSortUndecorate.test_reverse_stability.<locals>.my_cmp_reversedT)rr5)rcSs|dS)Nrr)r+rrrr(szCTestDecorateSortUndecorate.test_reverse_stability.<locals>.<lambda>)r1rrrS)rrLZcopy1Zcopy2rIrerrr�test_reverse_stability�sz1TestDecorateSortUndecorate.test_reverse_stabilityN)r r!r"rNrPrTrXrZr^r_rbrfrrrrrG�s
rG�__main__)N)ZtestrrZunittest�	functoolsrrr
rZTestCaserr<rGr �mainrrrr�<module>s
 [%^

Youez - 2016 - github.com/yon3zu
LinuXploit