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__/sortperf.cpython-310.pyc
o

�9j��@szdZddlZddlZddlZddlZddlZddlZe��Zdd�Z	dd�Z
dd�Zd	d
�Zdd�Z
ed
kr;e
�dSdS)z_Sort performance test.

See main() for command line syntax.
See tabulate() for output format.

�Ncsftj�td|�}zt|d�}Wnnty~tj��fdd�t|�D�}z=z&t|d�}t�	||�|�
�d}W|rLzt�|�WntyKYnwn|r`zt�|�Wwty_YwwwWnty{}z
td|d|�WYd}~nd}~wwYn+wt�
|�}|�
�td	�D]}t�|�}|d|�}|d|�=|��|�|�~q�t|�|ks�J�|S)
z+Return a list of n random floats in [0, 1).zrr%06d�rbcsg|]}���qS�r)�.0�i��rr�$/usr/lib/python3.10/test/sortperf.py�
<listcomp>szrandfloats.<locals>.<listcomp>�wbNzcan't write�:�
)�os�path�join�td�open�OSError�random�range�marshal�dump�close�unlink�print�load�	randrange�reverse�extend�len)�n�fn�fp�result�msgr�temprrr�
randfloatssV
���������



r%cCstj��dS�N)�sys�stdout�flushrrrrr)8sr)cCs6t��}|��t��}td||dd�t�dS)Nz%6.2f� ��end)�time�perf_counter�sortrr))�L�t0�t1rrr�doit;s

r3c
Cs�tdd�dD��}ddt|�}t|d|�|D]�}d|>}t|�}td||fd	d
�t�t|�|��t|�t|�td�D]}t�	|�}t�	|�}||||||<||<qFt|�|dkrud
d�td�D�|dd�<t|�t|d�D]}t��|t�	|�<qt|�|dkr�|dd�=||d}t
tdd�|��}t|�~t
ttdg|��}t|�~|d}	t
t|	ddd��}|�
t|	��t
tt|��}t|�t�qdS)a:Tabulate sort speed for lists of various sizes.

    The sizes are 2**i for i in r (the argument, a list).

    The output displays i, 2**i, and the time to sort arrays of 2**i
    floating point numbers with the following properties:

    *sort: random data
    \sort: descending data
    /sort: ascending data
    3sort: ascending, then 3 random exchanges
    +sort: ascending, then 10 random at the end
    %sort: ascending, then randomly replace 1% of the elements w/ random values
    ~sort: many duplicates
    =sort: all equal
    !sort: worst case scenario

    cSsg|]}|d�qS)r/r)r�chrrrr	U�ztabulate.<locals>.<listcomp>z	*\/3+%~=!z%2s %7sz %6s)rz2**i�z%2d %7dr*r+�rcSsg|]}t���qSr)r)r�dummyrrrr	kr5i����N�d�cSs|Sr&r)�xrrr�<lambda>ysztabulate.<locals>.<lambda>g�����)�tuplerrr%r)r3rrrr�list�map�absr�float)
r�cases�fmtrrr0r8�i1�i2�halfrrr�tabulateBsN


�rIcCs�d}d}tjdd�rBttjd�}}tjdd�rBttjd�}tjdd�rBd}tjdd�D]
}d|t|�}q2t�|�t||d�}t|�dS)z�Main program when invoked as a script.

    One argument: tabulate a single row.
    Two arguments: tabulate a range (inclusive).
    Extra arguments are used to seed the random generator.

    ��r6Nr=r7i�
)r'�argv�int�hashr�seedrrI)�k1�k2r;�arrrr�main�s	
rS�__main__)�__doc__r'r-rr�tempfiler
�
gettempdirrr%r)r3rIrS�__name__rrrr�<module>s 'L
�

Youez - 2016 - github.com/yon3zu
LinuXploit