File: //usr/local/lib/python3.10/test/__pycache__/sortperf.cpython-310.opt-1.pyc
o
�i� � @ sz d Z ddlZddlZddlZddlZddlZddlZe�� Zdd� Z dd� Z
dd� Zd d
� Zdd� Z
ed
kr;e
� dS dS )z_Sort performance test.
See main() for command line syntax.
See tabulate() for output format.
� Nc sj t j�td| �}zt|d�}W nx ty� tj� � fdd�t| �D �}zGz&t|d�}t� ||� |�
� d}W |rLzt �|� W n" tyK Y nw n|r`zt �|� W w ty_ Y w w w W Y |S W Y |S W Y |S ty� } ztd|d|� W Y d}~Y |S d}~ww w t�
|�}|�
� td �D ]}t�| �}|d|� }|d|�= |�� |�|� ~q�|S )
z+Return a list of n random floats in [0, 1).zrr%06d�rbc s g | ]}� � �qS � r )�.0�i��rr �*/usr/local/lib/python3.10/test/sortperf.py�
<listcomp> s zrandfloats.<locals>.<listcomp>�wbNzcan't write�:�
)�os�path�join�td�open�OSError�random�range�marshal�dump�close�unlink�print�load� randrange�reverse�extend)�n�fn�fp�result�msgr Ztempr r r �
randfloats s\
�������
���
r# c C s t j�� d S �N)�sys�stdout�flushr r r r r'