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_sort.cpython-310.pyc
o

�9j�5�@s�ddlmZddlZddlZddlmZejZdaddd�ZGdd�dej	�Z
Gdd	�d	ej	�ZGd
d�dej	�Zdd
�Z
Gdd�dej	�ZedkrPe��dSdS)�)�supportN��
cmp_to_keycCs�trtd|�|dd�}|r|jt|�d�n|��t|�t|�krEtd|�tdt|�t|��t|�t|�t|�td7adSt|�D]+\}}||}||urttd|�td|||�t|�t|�t|�td7adSqIdS)Nz    checking��keyzerror inzlength mismatch;�zout of order at index)�verbose�print�sortr�len�nerrors�	enumerate)�tag�expected�raw�compare�orig�i�good�maybe�r�%/usr/lib/python3.10/test/test_sort.py�check
s4


��rc@�eZdZdd�ZdS)�TestBasec
	s@dg}tdd�D]}d|}|�t|d|d��q|�gd��G�fdd�dt��Gdd	�d	t��|D]�}tt|��}trEtd
|�|dd�}td||�|dd�}|��td||�|dd�}t�	|�td
||�|dd�}|��|dd�}td||dd��tr�td�td�|dd�}|j
tdd��d�td||�t|�dkr�dd�}|dd�}|j
t|j
|d��fdd�|D�}|dd�}t�	|�d�_d}z|�
�Wnty�d}Ynw|r�d�_td||��fdd�t|�D�}dd�|D�}	|	�
�dd�|	D�}td ||�q6dS)!Nrr�
�)r�di�cs,eZdZdZdd�Z�fdd�Zdd�ZdS)	z+TestBase.testStressfully.<locals>.ComplainsTcSs
||_dS�N�r)�selfrrrr�__init__6�
z4TestBase.testStressfully.<locals>.Complains.__init__cs2�jrt��dkrtrtd||�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�r rrr�__repr__@r"z4TestBase.testStressfully.<locals>.Complains.__repr__N)�__name__�
__module__�__qualname__r#r!r*r,rr(rrr)3s
r)c@s$eZdZdd�Zdd�Zdd�ZdS)z(TestBase.testStressfully.<locals>.StablecSs||_||_dSr�r�index)r rrrrrr!Ds
z1TestBase.testStressfully.<locals>.Stable.__init__cSs|j|jkSrrr&rrrr*Hsz/TestBase.testStressfully.<locals>.Stable.__lt__cSsd|j|jfS)NzStable(%d, %d)r0r+rrrr,K�z1TestBase.testStressfully.<locals>.Stable.__repr__N)r-r.r/r!r*r,rrrr�StableCsr3zTesting size�identity�reversedzrandom permutationzreversed via functioncSs||k||kSrr��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.cSstt��d�dS)N�r)�intr$r6rrrr9g�rz(an insane function left some permutationcS�t�r�r%��xrrr�bad_keyk�z)TestBase.testStressfully.<locals>.bad_keycsg|]}�|��qSrr��.0rr(rr�
<listcomp>pr<z,TestBase.testStressfully.<locals>.<listcomp>TFz+exception during sort left some permutationcsg|]
}�t�d�|��qS)r�r$�	randrangerC)r3rrrE}�cSsg|]}||jf�qSr)r1)rD�errrrE~scSsg|]\}}|�qSrr)rDrIrrrrrE�r<�	stability)�range�extend�object�listrr	r�reverser$�shuffler
rr�assertRaisesr%r#)
r �sizes�power�nr@�s�yrA�
it_complained�	augmentedr)r)r3r�testStressfully+sh


��zTestBase.testStressfullyN)r-r.r/rYrrrrr*�rc@seZdZdd�Zdd�ZdS)�TestBugscs:G�fdd�d���fdd�td�D��|�t�j�dS)NcseZdZ�fdd�ZdS)z"TestBugs.test_bug453523.<locals>.Ccs0�r
t��dkr
���n��d�t��dkS)Ng�?r:g�?)r$�pop�appendr&��Lrrr*�s

z)TestBugs.test_bug453523.<locals>.C.__lt__N�r-r.r/r*rr^rr�C�sracsg|]}���qSrrrC)rarrrE��z+TestBugs.test_bug453523.<locals>.<listcomp>�2)rKrQ�
ValueErrorr
r+r)rar_r�test_bug453523�szTestBugs.test_bug453523cshg}td�D]+}�fdd�}ddg�|jt�jt|�d��fdd�}|jt�jt|�d�|g}qdS)N�cs"��d����||k||kS�Nr:)r]r\�r@rVr^rr�mutating_cmp�s
z7TestBugs.test_undetected_mutation.<locals>.mutating_cmprrrcs$��d��dd�=||k||kSrg)r]rhr^rrri�s

)rKrQrdr
r)r �memorywasterrrirr^r�test_undetected_mutation�s�z!TestBugs.test_undetected_mutationN)r-r.r/rerkrrrrr[�sr[c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�TestDecorateSortUndecoratecCsHd��}|dd�}t�|�|jtjd�dd�}|jt|�d�dS)N�,The quick Brown fox Jumped over The lazy DogrcSs"|��|��}}||k||kSr)�lower)r@rV�xlower�ylowerrrr�my_cmp��z9TestDecorateSortUndecorate.test_decorated.<locals>.my_cmp)�splitr$rPr
�strrnr)r �data�copyrqrrr�test_decorated�s
z)TestDecorateSortUndecorate.test_decoratedcCs"d��}|jt|jdd�d�dS)NrmcSsdS�Nrrrhrrrr9�sz>TestDecorateSortUndecorate.test_baddecorator.<locals>.<lambda>r)rsrQ�	TypeErrorr
�r rurrr�test_baddecorator�sz,TestDecorateSortUndecorate.test_baddecoratorcCsFdd�td�D�}|dd�}|jdd�d�|��|�||�dS)NcS�g|]	}t�d�|f�qS�rrFrCrrrrE��z=TestDecorateSortUndecorate.test_stability.<locals>.<listcomp>��cS�|dSrxr)�trrrr9��z;TestDecorateSortUndecorate.test_stability.<locals>.<lambda>r)rKr
�assertEqual)r rurvrrr�test_stability�s
z)TestDecorateSortUndecorate.test_stabilitycCs@ttdd��}|dd�}|jt|jdd�d�|�||�dS)N���rcSsd|S)Nrrr?rrrr9�r�zDTestDecorateSortUndecorate.test_key_with_exception.<locals>.<lambda>r)rNrKrQ�ZeroDivisionErrorr
r�)r ru�duprrr�test_key_with_exception�sz2TestDecorateSortUndecorate.test_key_with_exceptioncs.ttd����fdd�}|jt�j|d�dS)Nrcs�dd�=td��dd�<|S�Nrf�rKr?�rurr�k�s
z<TestDecorateSortUndecorate.test_key_with_mutation.<locals>.kr)rNrKrQrdr
)r r�rr�r�test_key_with_mutation�sz1TestDecorateSortUndecorate.test_key_with_mutationc�6ttd���G�fdd�dt�}|jt�j|d�dS)Nrcs(eZdZdd�Z�fdd�Zdd�ZdS)zITestDecorateSortUndecorate.test_key_with_mutating_del.<locals>.SortKillercSsdSrr�r r@rrrr!�rBzRTestDecorateSortUndecorate.test_key_with_mutating_del.<locals>.SortKiller.__init__cs�dd�=td��dd�<dSr�r�r+r�rr�__del__�s
zQTestDecorateSortUndecorate.test_key_with_mutating_del.<locals>.SortKiller.__del__cSst|�t|�kSr)�idr&rrrr*�r2zPTestDecorateSortUndecorate.test_key_with_mutating_del.<locals>.SortKiller.__lt__N)r-r.r/r!r�r*rr�rr�
SortKiller�sr�r)rNrKrMrQrdr
�r r�rr�r�test_key_with_mutating_del�sz5TestDecorateSortUndecorate.test_key_with_mutating_delcr�)Nrcs eZdZdd�Z�fdd�ZdS)zWTestDecorateSortUndecorate.test_key_with_mutating_del_and_exception.<locals>.SortKillercSs|dkrt�dS)Nrr>r�rrrr!�s�z`TestDecorateSortUndecorate.test_key_with_mutating_del_and_exception.<locals>.SortKiller.__init__cs"�dd�=ttd���dd�<dSr�)rNrKr+r�rrr��s
z_TestDecorateSortUndecorate.test_key_with_mutating_del_and_exception.<locals>.SortKiller.__del__N)r-r.r/r!r�rr�rrr��sr�r)rNrKrMrQr%r
r�rr�r�(test_key_with_mutating_del_and_exception�szCTestDecorateSortUndecorate.test_key_with_mutating_del_and_exceptioncCs>ttd��}t�|�|jdd�|�|ttddd���dS)NrT)rO�c���)rNrKr$rPr
r�rzrrr�test_reverse�s
z'TestDecorateSortUndecorate.test_reversecCs�dd�td�D�}|dd�}|dd�}dd�}dd�}|jt|�dd	�|jt|�d
�|�||�|jdd�dd	�|�||�dS)
NcSr|r}rFrCrrrrE�r~zETestDecorateSortUndecorate.test_reverse_stability.<locals>.<listcomp>rcSs"|d|d}}||k||kSrxr�r@rV�x0�y0rrrrq�rrzATestDecorateSortUndecorate.test_reverse_stability.<locals>.my_cmpcSs"|d|d}}||k||kSrxrr�rrr�my_cmp_reversed�rrzJTestDecorateSortUndecorate.test_reverse_stability.<locals>.my_cmp_reversedT)rrOrcSr�rxrr?rrrr9r�zCTestDecorateSortUndecorate.test_reverse_stability.<locals>.<lambda>)rKr
rr�)r ru�copy1�copy2rqr�rrr�test_reverse_stability�sz1TestDecorateSortUndecorate.test_reverse_stabilityN)r-r.r/rwr{r�r�r�r�r�r�r�rrrrrl�s
rlc	Cs�t�d�t�|�|dd�}dd�|D�}dd�|D�}|||fD]$}t|�}dd�tdd�|D��D�}t||�D]
\}}|�||�q<q#dS)NrcS�g|]}|f�qSrr�rDr@rrrrErbz:check_against_PyObject_RichCompareBool.<locals>.<listcomp>cS�g|]}|ff�qSrrr�rrrrEr<cSsg|]}|d�qS)rr)rDrVrrrrEr<cSsg|]}d|f�qS)rrr�rrrrEr<)r$�seedrP�sorted�zip�assertIs)	r r_�L_1�L_2�L_3�	optimized�	reference�opt�refrrr�&check_against_PyObject_RichCompareBools

��r�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�TestOptimizedComparescCs�ddgddgddgg}|D]!}|�t|j�|�tdd�|D�j�|�tdd�|D�j�q
dd	gd
d	gd	dgd	d
gg}|D]}t||�q?dS)Nr�foog)r�cSr�rrr�rrrrE*rbzBTestOptimizedCompares.test_safe_object_compare.<locals>.<listcomp>cSr�rrr�rrrrE+r<rg�������?�)rQryr
r�)r �heterogeneous_listsr_�float_int_listsrrr�test_safe_object_compare$s ���z.TestOptimizedCompares.test_safe_object_comparecs�G��fdd�dt��Gdd�dt��Gdd�dt����fdd�td	�D�}|d
�|�t��|��Wd�n1s?wY��fdd�td	�D�}|d
�|�t��dd�|D���Wd�n1smwYGd
d�d�}|�|�g}|�t|j�|�tdd�|D�j�ttd��dgdd�td�D�dgdd�td�D�dd�td�D�g}|D]}t||�q�dS)NcseZdZ��fdd�ZdS)zITestOptimizedCompares.test_unsafe_object_compare.<locals>.WackyComparatorcs��_t�||�Sr)�	__class__r;r*r&��
WackyList2�elemrrr*:szPTestOptimizedCompares.test_unsafe_object_compare.<locals>.WackyComparator.__lt__Nr`rr�rr�WackyComparator9sr�c@seZdZdS)zDTestOptimizedCompares.test_unsafe_object_compare.<locals>.WackyList1N)r-r.r/rrrr�
WackyList1>sr�c@r)zDTestOptimizedCompares.test_unsafe_object_compare.<locals>.WackyList2cSr=r)rdr&rrrr*BrBzKTestOptimizedCompares.test_unsafe_object_compare.<locals>.WackyList2.__lt__Nr`rrrrr�ArZr�c�g|]
}��|�|g��qSrrrC�r�r�rrrEErHzDTestOptimizedCompares.test_unsafe_object_compare.<locals>.<listcomp>rr�cr�rrrCr�rrrEJrHcSr�rrr�rrrrEMrbc@r)zMTestOptimizedCompares.test_unsafe_object_compare.<locals>.PointlessComparatorcSstSr)�NotImplementedr&rrrr*RrBzTTestOptimizedCompares.test_unsafe_object_compare.<locals>.PointlessComparator.__lt__Nr`rrrr�PointlessComparatorQrZr�cSr�rrr�rrrrEVrbrr�cS�g|]}t|��qSr�rtr�rrrrE[r<u￿cSr�r)�bytesr�rrrrE\r<cSsg|]
}tdd��|��qS)cSs||kSrrrhrrrr9]r�zMTestOptimizedCompares.test_unsafe_object_compare.<locals>.<listcomp>.<lambda>rr�rrrrE]rH)r;rNrKrQrdr
ryr�)r r_r��listsr)r�r�r�r�r�test_unsafe_object_compare4s2
����z0TestOptimizedCompares.test_unsafe_object_comparecC�t|dd�td�D��dS)NcSr�rr�r�rrrrEb��zCTestOptimizedCompares.test_unsafe_latin_compare.<locals>.<listcomp>r�r�rKr+rrr�test_unsafe_latin_comparea�
�z/TestOptimizedCompares.test_unsafe_latin_comparecCr�)NcSsg|]}|�qSrrr�rrrrEfs�zBTestOptimizedCompares.test_unsafe_long_compare.<locals>.<listcomp>rr�r+rrr�test_unsafe_long_compareer�z.TestOptimizedCompares.test_unsafe_long_comparecCr�)NcSr�r��floatr�rrrrEjr�zCTestOptimizedCompares.test_unsafe_float_compare.<locals>.<listcomp>rr�r+rrr�test_unsafe_float_compareir�z/TestOptimizedCompares.test_unsafe_float_comparecCs0t|td�gd�t|dd�td�D��dS)N�nanrcSsg|]}td��qS)r�r�)rD�_rrrrEvr�zCTestOptimizedCompares.test_unsafe_tuple_compare.<locals>.<listcomp>)r�r�rKr+rrr�test_unsafe_tuple_comparems
�z/TestOptimizedCompares.test_unsafe_tuple_comparecCs:|�tgd�j�|�tddgj�|�tddgj�dS)N))��?r�)F�A�)r7r)rr7)rQryr
r+rrr�test_not_all_tuplesysz)TestOptimizedCompares.test_not_all_tuplesN)
r-r.r/r�r�r�r�r�r�r�rrrrr�#s-r��__main__r)�testrr$�unittest�	functoolsrrrr�TestCaserr[rlr�r�r-�mainrrrr�<module>s
 [%]\�

Youez - 2016 - github.com/yon3zu
LinuXploit