|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/test/__pycache__/ |
U
>��g� � @ sv d Z ddlZddlZddlZddlZddlZddlZe�� Zdd� Z dd� Z
dd� Zd d
� Zdd� Z
ed
krre
� dS )z_Sort performance test.
See main() for command line syntax.
See tabulate() for output format.
� Nc sD t j�td| �}zt|d�}W n� tk
r� tj� � fdd�t| �D �}zVz&t|d�}t �
||� |�� d}W 5 |r�zt �|� W n tk
r� Y nX X W n0 tk
r� } ztd|d|� W 5 d}~X Y nX Y nVX t �
|�}|�� td �D ]8}t�| �}|d|� }|d|�= |�� |�|� ~q�t|�| k�s@t�|S )
z+Return a list of n random floats in [0, 1).zrr%06d�rbc s g | ]
}� � �qS � r )�.0�i��rr �,/opt/cppython/lib/python3.8/test/sortperf.py�
<listcomp> s zrandfloats.<locals>.<listcomp>�wbNzcan't write�:�
)�os�path�join�td�open�OSError�random�range�unlink�marshal�dump�close�print�load� randrange�reverse�extend�len�AssertionError)�n�fn�fp�result�msgr Ztempr r r �
randfloats s<