AlkantarClanX12

Your IP : 3.145.177.173


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/timeit.cpython-37.opt-2.pyc

B

YI~d�4�@s�ddlZddlZddlZddlZddddgZdZdZdZejZ	e
Zd	Zd
d�Z
Gdd�d�Zd
d
e	edfdd�Zd
d
e	eedfdd�Zddd�dd�Zedkr�e�e��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|�ddd|�S)N�
� )�replace)�src�indent�r�+/opt/alt/python37/lib64/python3.7/timeit.py�reindentOsrc@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__es6

zTimer.__init__cCsJddl}ddl}|jdk	r:t|j�d|j�d�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_exccCsBt�d|�}t��}t��z|�||j�}Wd|r<t��X|S)N)�	itertoolsr�gcZ	isenabledZdisablerrZenable)r#�number�itZgcoldZtimingrrr
r�s

zTimer.timeitcCs.g}x$t|�D]}|�|�}|�|�qW|S)N)�ranger�append)r#rr0�r�i�trrr
r�s

zTimer.repeatcCsTd}xJx<dD]4}||}|�|�}|r0|||�|dkr||fSqW|d9}qWdS)N�)r7�rg�������?�
)r)r#�callbackr5�jr0�
time_takenrrr
�	autorange�s



zTimer.autorange)N)N)�__name__�
__module__�__qualname__rr&r-�default_numberr�default_repeatrr=rrrr
rSs"
rcCst||||��|�S)N)rr)rrrr0r$rrr
r�scCst||||��||�S)N)rr)rrrrr0r$rrr
r�s)�_wrap_timerc
s�|dkrtjdd�}ddl}y(|�|ddddddd	d
ddg	�\}}Wn4|jk
rz}zt|�td
�dSd}~XYnXt}d�|�p�d}d�g}t}d}	d�ddddd��d�x�|D]�\}
}|
dkr�t|��|
dkr�|�	|�|
dk�r|�k�r�|�ntdtj
d�dS|
dk�r0t|�}|dk�r0d}|
dk�r@tj}|
dk�r`|	�rX�d7�|	d7}	|
dkr�tt
d d!�dSq�Wd�|��p�d}ddl}tj�d|j�|dk	�r�||�}t|||�}
�dk�rd}|	�r�fd"d#�}y|
�|�\�}Wn|
��dS|	�rt�y|
�|��}Wn|
��dS���fd$d%�}|	�rltd&d'�t||���t��fd(d)�|D�}t|�}td*��dk�r�d+nd,|||�f�t|�}t|�}||d-k�r�ddl}|�d.||�||�ftd,d�dS)/Nr7rz
n:u:s:r:tcpvhznumber=zsetup=zrepeat=�timeZclockZprocess�verbosezunit=�helpz#use -h/--help for command line helpr8rrg��&�.>g���ư>g����MbP?g�?)ZnsecZusecZmsecZsec�)z-nz--number)z-sz--setup)z-uz--unitz:Unrecognized unit. Please select nsec, usec, msec, or sec.)r')z-rz--repeat)z-pz	--process)z-vz	--verbose)z-hz--helpr)�endcs.d}|dk}t|j||rdnd|�d��dS)Nz%{num} loop{s} -> {secs:.{prec}g} secsr7�sr)ZnumrIZsecsZprec)�printr")r0r<�msg�plural)�	precisionrr
r:?szmain.<locals>.callbackcsb�}|dk	r�|}n:dd����D�}|jdd�x|D]\}}||kr:Pq:Wd�|||fS)NcSsg|]\}}||f�qSrr)�.0�unit�scalerrr
�
<listcomp>Ysz-main.<locals>.format_time.<locals>.<listcomp>T)�reversez%.*g %s)�items�sort)�dtrOrPZscales)rM�	time_unit�unitsrr
�format_timeSs
zmain.<locals>.format_timez
raw times: %sz, csg|]}|��qSrr)rNrU)r0rr
rQdszmain.<locals>.<listcomp>z"%d loop%s, best of %d: %s per looprIrrztThe test results are likely unreliable. The worst time (%s) was more than four times slower than the best time (%s).)�sys�argv�getopt�errorrJr�joinrB�intr3�stderrrDZprocess_time�__doc__�os�path�insert�curdirrr=r-r�map�min�max�warnings�
warn_explicit�UserWarning)�argsrCr[Zopts�errrrrrrE�o�arar6r:�_Zraw_timingsrXZtimingsZbestZworstrhr)r0rMrVrWr
�main�s�










rp�__main__)N)r/rYrDr.�__all__rrArBZperf_counterrr$rr!rrrrrpr>�exitrrrr
�<module>4s*