ok

Mini Shell

Direktori : /lib64/python3.6/__pycache__/
Upload File :
Current File : //lib64/python3.6/__pycache__/timeit.cpython-36.opt-2.pyc

3


 \4�@s�ddlZddlZddlZddlZddddgZdZdZdZejZ	e
Zd	Zd
d�Z
Gdd�d�Zd
d
e	edfdd�Zd
d
e	eedfdd�Zddd�dd�Zedkr�eje��dS)�N�Timer�timeit�repeat�
default_timerz<timeit-src>i@B�z�
def inner(_it, _timer{init}):
    {setup}
    _t0 = _timer()
    for _i in _it:
        {stmt}
    _t1 = _timer()
    return _t1 - _t0
cCs|jddd|�S)N�
� )�replace)�src�indent�r�/usr/lib64/python3.6/timeit.py�reindentPsrc@sLeZdZddedfdd�Zd
dd�Zefdd�Zeefd	d
�Z	ddd�Z
dS)r�passNcCs�||_i}|dkrt�n|}d}t|t�rJt|td�|d}t|d�}n*t|�rl||d<|d7}d}d}ntd��t|t�r�t||td�t|d	�}n&t|�r�||d
<|d7}d}ntd
��t	j
|||d�}	|	|_t|	td�}
t|
||�|d|_
dS)N��execr��_setupz, _setup=_setupz_setup()z&setup is neither a string nor callable�Z_stmtz
, _stmt=_stmtz_stmt()z%stmt is neither a string nor callable)�stmt�setup�init�inner)�timer�_globals�
isinstance�str�compile�dummy_src_namer�callable�
ValueError�template�formatr
rr)�selfrrr�globalsZlocal_nsZ	global_nsrZ
stmtprefixr
�coderrr
�__init__fs6

zTimer.__init__cCsJddl}ddl}|jdk	r:t|j�d|jjd�tf|jt<|j|d�dS)Nrr)�file)�	linecache�	tracebackr
�len�splitr�cache�	print_exc)r#r'r(r)rrr
r-�s

zTimer.print_excc
CsBtjd|�}tj�}tj�z|j||j�}Wd|r<tj�X|S)N)�	itertoolsr�gc�	isenabled�disablerr�enable)r#�number�itZgcoldZtimingrrr
r�s

zTimer.timeitcCs.g}x$t|�D]}|j|�}|j|�qW|S)N)�ranger�append)r#rr3�r�i�trrr
r�s

zTimer.repeatcCsFx<tdd�D].}d|}|j|�}|r0|||�|dkrPqW||fS)N��
g�������?)r5r)r#�callbackr8r3�
time_takenrrr
�	autorange�s

zTimer.autorange)N)N)�__name__�
__module__�__qualname__rr&r-�default_numberr�default_repeatrr>rrrr
rTs"
rcCst||||�j|�S)N)rr)rrrr3r$rrr
r�scCst||||�j||�S)N)rr)rrrrr3r$rrr
r�s)�_wrap_timerc s^|dkrtjdd�}ddl}y(|j|ddddddd	d
ddg	�\}}Wn2|jk
rx}zt|�td
�dSd}~XnXt}dj|�p�d}d}g}t}	d}
d}dddd�}d��x�|D�]�\}
}|
d8kr�t|�}|
d9kr�|j	|�|
d:k�r||k�r�|}ntdtj
d�dS|
d;k�r0t|�}	|	dk�r0d}	|
d<k�r@tj}|
d=k�rPtj}|
d>k�r`tj
}|
d?k�r�|
�rx�d7�|
d7}
|
d@kr�ttd)d*�dSq�Wdj|��p�d}ddl}tjjd|j�|dk	�r�||�}t|||�}|dk�r(d}|
�r�fd+d,�}y|j|�\}}Wn|j�dSy|j|	|�}Wn|j�dSt|�}|
�rxtd-d)j�fd.d/�|D���td0|d)d*�|d|}|dk	�r�||}n>d1d/�|j�D�}|jd2d3�x|D]\}}||k�r�P�q�Wtd4|	�|||f�t|�}|d|}t|�}||d5k�rZ|d|}ddl}|jd6�|||ftd7d�dS)ANr:rz
n:u:s:r:tcpvhznumber=zsetup=zrepeat=�time�clockZprocess�verbosezunit=�helpz#use -h/--help for command line help�rrg@�@g��.A)�usecZmsecZsecr�-n�--number�-s�--setup�-u�--unitz4Unrecognized unit. Please select usec, msec, or sec.)r'�-r�--repeat�-t�--time�-c�--clock�-p�	--process�-v�	--verbose�-h�--helpr)�endcsd}t|j||�d��dS)Nz#{num} loops -> {secs:.{prec}g} secs)ZnumZsecsZprec)�printr")r3r=�msg)�	precisionrr
r<@szmain.<locals>.callbackz
raw times:csg|]}d�|f�qS)z%.*gr)�.0�x)r`rr
�
<listcomp>Oszmain.<locals>.<listcomp>z	%d loops,cSsg|]\}}||f�qSrr)raZunit�scalerrr
rcUsT)�reversezbest of %d: %.*g %s per looprztThe test results are likely unreliable. The worst
time (%.*g %s) was more than four times slower than the best time.r)rKrL)rMrN)rOrP)rQrR)rSrT)rUrV)rWrX)rYrZ)r[r\)�sys�argv�getopt�errorr^r�joinrC�intr6�stderrrErFZprocess_time�__doc__�os�path�insert�curdirrr>r-r�min�items�sort�max�warnings�
warn_explicit�UserWarning)�argsrDrhZopts�errrrr3rrrGZ	time_unitZunits�o�arnr9r<�_r7ZbestrJrdZscalesZworstrvr)r`r
�main�s�















r~�__main__)N)r/rfrEr.�__all__rrBrCZperf_counterrr$rr!rrrrr~r?�exitrrrr
�<module>5s(
y

Zerion Mini Shell 1.0