https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/future/backports/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/future/backports/test/__pycache__/pystone.cpython-310.pyc
o

,�]�@s�dZddlmZddlmZdZdZedd�\ZZ	Z
ZZGdd	�d	e
�ZdZdZefd
d�Zefdd
�Zdaeadadadgdadd�tgdD�adadaefdd�Zdd�Zdd�Zdd�Zdd�Zdd�Z dd �Z!d!d"�Z"d#d$�Z#d%d&�Z$d'd(�Z%d)d*�Z&e'd+kr�ddl(Z(d,d-�Z)e*e(j+�dZ,e,dkr�e)d.e,�n"e,dkr�z	e-e(j+d�Z.Wne/y�e)d/e(j+d�YnweZ.ee.�dSdS)0a�
"PYSTONE" Benchmark Program

Version:        Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)

Author:         Reinhold P. Weicker,  CACM Vol 27, No 10, 10/84 pg. 1013.

                Translated from ADA to C by Rick Richardson.
                Every method to preserve ADA-likeness has been used,
                at the expense of C-ness.

                Translated from C to Python by Guido van Rossum.

Version History:

                Version 1.1 corrects two bugs in version 1.0:

                First, it leaked memory: in Proc1(), NextRecord ends
                up having a pointer to itself.  I have corrected this
                by zapping NextRecord.PtrComp at the end of Proc1().

                Second, Proc3() used the operator != to compare a
                record to None.  This is rather inefficient and not
                true to the intention of the original benchmark (where
                a pointer comparison to None is intended; the !=
                operator attempts to find a method __cmp__ to do value
                comparison of the record).  Version 1.1 runs 5-10
                percent faster than version 1.0, so benchmark figures
                of different versions can't be compared directly.

�)�print_function)�clockiP�z1.1��c@s"eZdZ		ddd�Zdd�ZdS)�RecordNrcCs"||_||_||_||_||_dS�N)�PtrComp�Discr�EnumComp�IntComp�
StringComp)�selfrr	r
rr�r�?/usr/lib/python3/dist-packages/future/backports/test/pystone.py�__init__/s

zRecord.__init__cCst|j|j|j|j|j�Sr)rrr	r
rr)r
rrr�copy7s�zRecord.copy)Nrrrr)�__name__�
__module__�__qualname__rrrrrrr-s

�rcCs.t|�\}}tdt||f�td|�dS)Nz#Pystone(%s) time for %d passes = %gz-This machine benchmarks at %g pystones/second)�pystones�print�__version__)�loops�	benchtime�stonesrrr�main>s
�rcCst|�Sr)�Proc0)rrrrrEsr��3cCsg|]}|dd��qSrr)�.0�xrrr�
<listcomp>Msr!Nc
Cslt�}t|�D]}qt�|}t�at�att_tt_tt_	dt_
dt_d}dtdd<t�}t|�D]i}t
�t�d}d}d	}t}t||�a||kr`d
||}	t||�}	|d}||ksMttt||	�tt�ad}
|
tkr�|t|
d
�kr|tt�}tt|
�d�}
|
tksq||}	|	|}d|	||}t|�}q3t�||}|dkr�d}||fS||}||fS)N�(zDHRYSTONE PROGRAM, SOME STRINGzDHRYSTONE PROGRAM, 1'ST STRING�
����zDHRYSTONE PROGRAM, 2'ND STRING�r�A�Cg)r�ranger�
PtrGlbNext�PtrGlbr�Ident1r	�Ident3r
rr�
Array2Glob�Proc5�Proc4�Ident2�Func2�BoolGlob�Proc7�Proc8�
Array1Glob�Proc1�	Char2Glob�Func1�Proc6�chr�ord�Proc2)
r�	starttime�i�nulltime�
String1Loc�IntLoc1�IntLoc2�
String2Loc�EnumLoc�IntLoc3�	CharIndexr�loopsPerBenchtimerrrrQsZ


��
�rcCsvt��|_}d|_|j|_|j|_t|j�|_|jtkr2d|_t|j�|_tj|_t	|jd�|_n|��}d|_|S)Nr(rr#)
r-rrr�Proc3r	r.r<r
r6)�PtrParIn�
NextRecordrrrr9�s
r9cCs6|d}	tdkr|d}|t}t}|tkr	|Sq)Nr#rr))�	Char1Glob�IntGlobr.)�IntParIO�IntLocrGrrrr?�s�r?cCs$tdurtj}ndatdt�t_|S)N�dr#)r-rrOr6r)�	PtrParOutrrrrK�s
rKcCstdk}|pt}dadS)Nr)�B)rNr5r:)�BoolLocrrrr2�sr2cCsdatadS)Nr))rN�FALSEr5rrrrr1�sr1cCsn|}t|�st}|tkrt}|S|tkr tdkrt}|St}|S|tkr(t}|S|tkr/	|S|tkr5t}|S)NrR)�Func3�Ident4r.r3rOr/�Ident5)�	EnumParIn�
EnumParOutrrrr<�s*�	����r<cCs|d}||}|S)Nr&r)�IntParI1�IntParI2rQ�	IntParOutrrrr6�sr6cCs�|d}|||<||||d<|||d<t||d�D]}||||<q|||dd|||d<||||d|<dadS)Nr(r�r&�)r+rO)�	Array1Par�	Array2Parr\r]rQ�IntIndexrrrr7�s r7cCs|}|}||kr
tStSr)r.r3)�CharPar1�CharPar2�CharLoc1�CharLoc2rrrr;�s
r;cCsrd}|dkrt||||d�tkrd}|d}|dks|dkr'|dkr'd}|dkr-tS||kr7|d}tStS)Nrr)�W�Zr%�X)r;r.�TRUErV)�StrParI1�StrParI2rQ�CharLocrrrr4�s�r4cCs|}|tkrtStSr)r/rkrV)rZrGrrrrW�srW�__main__cCs6t|dtjd�tdtjdtjd�t�d�dS)N� )�end�filezusage: %s [number_of_loops]r)rrrR)r�sys�stderr�argv�exit)�msgrrr�errorsrxz%d arguments are too many;zInvalid argument %r;)0�__doc__�
__future__r�timer�LOOPSrr+r.r3r/rXrY�objectrrkrVrrrOr5rNr:r8r0r-r,rr9r?rKr2r1r<r6r7r;r4rWrrsrx�lenru�nargs�intr�
ValueErrorrrrr�<module>sZ 
:

��

https://t.me/RX1948 - 2025