Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python311/lib64/python3.11/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python311/lib64/python3.11/__pycache__/random.cpython-311.opt-2.pyc
�

�,d�}��r�	ddlmZddlmZmZmZ	m
ZmZ
ddlmZmZmZmZddlmZmZmZddlmZddlm Z!m"Z#ddl$m%Z&ddl'm(Z)m*Z+dd	l,m,Z-dd
lZ.dd
l/Z/	ddl0m1Z0n#e2$r	ddl3m1Z0YnwxYwgd�Z4d
ed��zed��zZ5ed��Z6ded��zZ7dZ8de8zZ9dZ:Gd�de/j;��Z;Gd�de;��Z<e;��Z=e=j>Z>e=j?Z?e=j@Z@e=jAZAe=jBZBe=jCZCe=jDZDe=jEZEe=jFZFe=jGZGe=jHZHe=jIZIe=jJZJe=jKZKe=jLZLe=jMZMe=jNZNe=jOZOe=jPZPe=jQZQe=jRZRe=jSZSe=jTZTd�ZUd d�ZVeWe.d��re.jXe=j>���eYdkreV��d
Sd
S)!�)�warn)�log�exp�pi�e�ceil)�sqrt�acos�cos�sin)�tau�floor�isfinite)�urandom)�Set�Sequence)�index)�
accumulate�repeat)�bisectN)�sha512)�Random�SystemRandom�betavariate�choice�choices�expovariate�gammavariate�gauss�getrandbits�getstate�lognormvariate�
normalvariate�
paretovariate�	randbytes�randint�random�	randrange�sample�seed�setstate�shuffle�
triangular�uniform�vonmisesvariate�weibullvariate�g��@�@��?�@�5��c���eZdZ	dZd%d�Zd&�fd�	Z�fd�Z�fd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
e
zfd�ZeZd�Zdefd�Zd�Zd�Zd�Zdd�d�Zd%dd
d�d�Zd�Zd'd�Zd(d�Zd(d�Zd�Zd�Zd �Zd!�Zd"�Z d#�Z!d$�Z"�xZ#S))r�Nc�@�	|�|��d|_dS�N)r*�
gauss_next)�self�xs  �-/opt/alt/python311/lib64/python3.11/random.py�__init__zRandom.__init__ws#��	�
	
�	�	�!���������r7c	�`��	|dkr�t|ttf��r�t|t��r|�d��n|}|rt	|d��dznd}tt|��D]
}d|z|zdz}�|t
|��z}|dkrdn|}n�|d	kr�t|tttf��rft|t��r|���}t�
|t|�����z��}nKt|td��tttttf��std
���t!���|��d|_dS)Nr8zlatin-1r�iCBl����������r7zOThe only supported seed types are: None,
int, float, str, bytes, and bytearray.)�
isinstance�str�bytes�decode�ord�map�len�	bytearray�encode�int�
from_bytes�_sha512�digest�type�float�	TypeError�superr*r=)r>�a�versionr?�c�	__class__s     �r@r*zRandom.seed�s}���	�"�a�<�<�J�q�3��,�7�7�<�'1�!�U�';�';�B�����#�#�#��A�"#�*��A�a�D�	�	�Q����A���a�[�[�
=�
=����k�Q�&�*<�<���
��Q���K�A��2�g�g���1�A�A�
��\�\�j��S�%��,C�D�D�\��!�S�!�!�
��H�H�J�J�����q�7�1�:�:�#4�#4�#6�#6�6�7�7�A�A��A��T�
�
�C���U�I�N�O�O�	F��E�F�F�
F�	�����Q��������rBc�`��	|jt�����|jfSr<)�VERSIONrWr!r=)r>r[s �r@r!zRandom.getstate�s'���G��|�U�W�W�-�-�/�/���@�@rBc���	|d}|dkr.|\}}|_t���|��dS|dkrc|\}}|_	td�|D����}n#t$r
}t
|�d}~wwxYwt���|��dSt	d|�d|j�����)Nrr:r7c3� K�|]	}|dzV��
dS)lN�)�.0r?s  r@�	<genexpr>z"Random.setstate.<locals>.<genexpr>�s&����%K�%K��a�7�m�%K�%K�%K�%K�%K�%KrBzstate with version z( passed to Random.setstate() of version )r=rWr+�tuple�
ValueErrorrVr])r>�staterY�
internalstaterr[s     �r@r+zRandom.setstate�s����H���(���a�<�<�6;�3�G�]�D�O��G�G���]�+�+�+�+�+�
��\�\�6;�3�G�]�D�O�

'� %�%K�%K�]�%K�%K�%K� K� K�
�
���
'�
'�
'��Q�&�����
'�����G�G���]�+�+�+�+�+��*�%�g�g�t�|�|�5�6�6�
6s�A+�+
B�5A=�=Bc�*�|���Sr<)r!�r>s r@�__getstate__zRandom.__getstate__�s���}�}���rBc�0�|�|��dSr<)r+)r>res  r@�__setstate__zRandom.__setstate__�s���
�
�e�����rBc�:�|jd|���fS)Nr`)r[r!rhs r@�
__reduce__zRandom.__reduce__�s���~�r�4�=�=�?�?�2�2rBc��	|jD]>}d|jvrdSd|jvr|j|_dSd|jvr|j|_dS�?dS)N�
_randbelowr r')�__mro__�__dict__�_randbelow_with_getrandbitsro�_randbelow_without_getrandbits)�cls�kwargsrZs   r@�__init_subclass__zRandom.__init_subclass__�sy��	���		�		�A��q�z�)�)������
�*�*�!$�!@�������1�:�%�%�!$�!C������&�		�		rBc��	|j}|���}||��}||kr||��}||k�|Sr<)r �
bit_length)r>�nr �k�rs     r@rrz"Random._randbelow_with_getrandbits�sM��E��&��
�L�L�N�N���K��N�N���1�f�f���A���A��1�f�f��rBr8c���	|j}||kr)td��t|��|z��S||z}||z
|z}|��}||kr|��}||k�t||z��|zS)Nz�Underlying random() generator does not supply 
enough bits to choose from a population range this large.
To remove the range limitation, add a getrandbits() method.)r'�_warn�_floor)r>ry�maxsizer'�rem�limitr{s       r@rsz%Random._randbelow_without_getrandbits�s���	�
�����<�<��N�
O�
O�
O��&�&�(�(�Q�,�'�'�'���k���3��'�)���F�H�H���5�j�j�����A��5�j�j��a�'�k�"�"�Q�&�&rBc�\�	|�|dz���|d��S)N��little)r �to_bytes�r>rys  r@r%zRandom.randbytess-��&�����A��&�&�/�/��8�<�<�<rBc�t�		t|��}n`#t$rSt|��}||kr%tdtd��td���tdtd��YnwxYw|�B|turtd���|dkr|�|��Std���	t|��}n`#t$rSt|��}||kr%tdtd��td���tdtd��YnwxYw||z
}	t|��}n`#t$rSt|��}||kr%tdtd��td	���tdtd��YnwxYw|d
kr3|dkr||�|��zStd|||fz���|dkr||zd
z
|z}n!|dkr||zd
z|z}ntd���|dkrtd���|||�|��zzS)
Nz.randrange() will raise TypeError in the futurer7z!non-integer arg 1 for randrange()zwnon-integer arguments to randrange() have been deprecated since Python 3.10 and will be removed in a subsequent versionz Missing a non-None stop argumentrzempty range for randrange()z non-integer stop for randrange()z non-integer step for randrange()r8z(empty range for randrange() (%d, %d, %d)zzero step for randrange())�_indexrVrPr}�DeprecationWarningrd�_ONEro)	r>�start�stop�step�istart�istop�width�isteprys	         r@r(zRandom.randranges���	�	)��E�]�]�F�F���		)�		)�		)���Z�Z�F������F�(�!�-�-�-� �!D�E�E�E���%�a�
)�
)�
)�
)�
)�
		)�����<��4���� B�C�C�C���z�z����v�.�.�.��:�;�;�;�	)��4�L�L�E�E���		)�		)�		)���I�I�E���}�}��F�(�!�-�-�-� �!C�D�D�D���%�a�
)�
)�
)�
)�
)�
		)��������	)��4�L�L�E�E���		)�		)�		)���I�I�E���}�}��F�(�!�-�-�-� �!C�D�D�D���%�a�
)�
)�
)�
)�
)�
		)�����A�:�:��q�y�y������ 6� 6�6�6��G�6�SX�Z_�J`�`�a�a�a��1�9�9�����"�u�,�A�A�
�Q�Y�Y�����"�u�,�A�A��8�9�9�9���6�6��:�;�;�;������� 2� 2�2�2�2s6��AA0�/A0�8C�AD%�$D%�.D>�>AF�Fc�6�	|�||dz��S�Nr8)r(�r>rX�bs   r@r&zRandom.randintfs!��	��~�~�a��1��%�%�%rBc��	t|��std���||�t|����S)Nz$Cannot choose from an empty sequence)rM�
IndexErrorro)r>�seqs  r@rz
Random.choiceosB��@��3�x�x�	E��C�D�D�D��4�?�?�3�s�8�8�,�,�-�-rBc��	|j}ttdt|������D]'}||dz��}||||c||<||<�(dSr�)ro�reversed�rangerM)r>r?�	randbelow�i�js     r@r,zRandom.shufflexsm��7��O�	��%��3�q�6�6�*�*�+�+�	$�	$�A��	�!�a�%� � �A��1��q��t�J�A�a�D�!�A�$�$�	$�	$rB)�countsc�����	t�t��std���t���}|��t	t|�����t���|krt
d�������}t|t��std���|dkrt
d���|�	t|��|���}t����fd�|D��S|j}d|cxkr|ksnt
d���dg|z}d	}	|d
kr&|	dtt|dzd����zz
}	||	krLt	���}
t|��D],}|||z
��}|
|||<|
||z
d
z
|
|<�-n[t��}
|
j}t|��D]6}||��}||
vr||��}||
v�||���|||<�7|S)NzAPopulation must be a sequence.  For dicts or sets, use sorted(d).z2The number of counts does not match the populationzCounts must be integersrz)Total of counts must be greater than zero)rzc�4��g|]}���|����Sr`r`)ra�sr�
cum_counts�
populations  ���r@�
<listcomp>z!Random.sample.<locals>.<listcomp>�s*���J�J�J�!�J�v�v�j�!�4�4�5�J�J�JrBz,Sample larger than population or is negative��r1r:r8)rG�	_SequencerVrM�list�_accumulaterd�poprPr)r��_bisectro�_ceil�_log�set�add)r>r�rzr�ry�total�
selectionsr��result�setsize�poolr�r��selected�selected_addrr�s `             @@r@r)z
Random.sample�sQ�����	�h�*�i�0�0�	A��@�A�A�
A��
�O�O�����k�&�1�1�2�2�J��:���!�#�#� �!U�V�V�V��N�N�$�$�E��e�S�)�)�
;�� 9�:�:�:���z�z� �!L�M�M�M����U�5�\�\�Q��7�7�J��F�J�J�J�J�J�J�z�J�J�J�J��O�	��A�{�{�{�{��{�{�{�{��K�L�L�L���!������q�5�5��q�E�$�q�1�u�a�.�.�1�1�1�1�G���<�<��
�#�#�D��1�X�X�
*�
*���I�a�!�e�$�$�� ��G��q�	��q�1�u�q�y�/��Q���
*�
�u�u�H�#�<�L��1�X�X�
*�
*���I�a�L�L���8�m�m�!�	�!���A��8�m�m���Q����&�q�M��q�	�	��
rB)�cum_weightsrzc��������	�
�	|j�	t�������|�+t��dz
�����	fd�td|��D��S	t	t|�����nJ#t$r,t|t��s�|}t
d|����d�wxYw|�t
d���t����krtd����ddz�
�
dkrtd���t�
��std���t��d	z
������	�
fd
�td|��D��S)N�c�H��g|]}������z����Sr`r`)rar�rryr�r's  ����r@r�z"Random.choices.<locals>.<listcomp>�s2���R�R�R�A�
�5�5�����A��#6�#6�7�R�R�RrBz4The number of choices must be a keyword argument: k=z2Cannot specify both weights and cumulative weightsz3The number of weights does not match the populationrEz*Total of weights must be greater than zerozTotal of weights must be finiter8c	�N��g|]!}�������zd�����"S)rr`)rar�rr��hir�r'r�s  ������r@r�z"Random.choices.<locals>.<listcomp>sI���+�+�+���6�6�+�v�v�x�x�%�/?��B�G�G�H�+�+�+rB)r'rMr~�_repeatr�r�rVrGrPrd�	_isfiniter�)r>r��weightsr�rzrrr�ryr'r�s ` ` @@@@@@r@rzRandom.choices�s�����������	�����
�O�O���������S���R�R�R�R�R�R�R���q�AQ�AQ�R�R�R�R�
�"�;�w�#7�#7�8�8�����
�
�
�!�'�3�/�/������M��M�M�����	
�����
 ��P�Q�Q�Q��{���q� � ��R�S�S�S��B��#�%���C�<�<��I�J�J�J�����	@��>�?�?�?���
��U��+�+�+�+�+�+�+�+�+� ��q�)�)�+�+�+�	+s�A-�-6B#c�>�	|||z
|���zzSr<�r'r�s   r@r.zRandom.uniforms!��R��A��E�T�[�[�]�]�*�*�*rBr�r4c���	|���}	|�dn
||z
||z
z}n#t$r|cYSwxYw||krd|z
}d|z
}||}}|||z
t||z��zzS)N��?r4)r'�ZeroDivisionError�_sqrt)r>�low�high�mode�urZs      r@r-zRandom.triangulars���	�
�K�K�M�M��	��|���$��*����)D�A�A�� �	�	�	��J�J�J�	�����q�5�5��a��A��a��A��c��C��d�S�j�E�!�a�%�L�L�0�0�0s�'�6�6c��	|j}	|��}d|��z
}t|dz
z|z}||zdz}|t|��krn�E|||zzS)NTr4r�r3)r'�
NV_MAGICCONSTr�)r>�mu�sigmar'�u1�u2�z�zzs        r@r#zRandom.normalvariate sx��	����	�����B��v�v�x�x��B���c��*�R�/�A��Q����B��d�2�h�h�Y����
	��A��I�~�rBc��	|j}|j}d|_|�e|��tz}tdt	d|��z
��z��}t|��|z}t
|��|z|_|||zzS)Ng�r4)r'r=�TWOPIr�r��_cos�_sin)r>r�r�r'r��x2pi�g2rads       r@rzRandom.gauss5s���	�4����O������9��6�8�8�e�#�D��$��c�F�F�H�H�n�!5�!5�5�6�6�E��T�
�
�U�"�A�"�4�j�j�5�0�D�O��A��I�~�rBc�J�	t|�||����Sr<)�_expr#)r>r�r�s   r@r"zRandom.lognormvariate[s'��	��D�&�&�r�5�1�1�2�2�2rBc�T�	td|���z
��|zS�Nr4)r�r')r>�lambds  r@rzRandom.expovariatees,��	��S�4�;�;�=�=�(�)�)�)�E�1�1rBc���	|j}|dkrt|��zSd|z}|td||zz��z}	|��}tt|z��}|||zz}|��}	|	d||zz
ks|	d|z
t|��zkrn�Zd|z}
|
|zd|
|zzz}|��}|dkr|t
|��ztz}
n|t
|��z
tz}
|
S)Ng���ư>r�r4)r'r�r�r��_pir��_acos)r>r��kappar'r�r{r�r��dr��q�f�u3�thetas              r@r/zRandom.vonmisesvariatevs��	�����D�=�=��6�6�8�8�#�#��%�K��
��c�A��E�k�"�"�"��	�����B��S�2�X���A��Q��U��A�����B��C�!�a�%�K���2�#��'�T�!�W�W�)<�#<�#<��	�
�!�G��
��U�s�Q��U�{�#��
�V�X�X��
��8�8��%��(�(�]�e�+�E�E��%��(�(�]�e�+�E��rBc��	|dks|dkrtd���|j}|dkr�td|zdz
��}|tz
}||z}	|��}d|cxkrdksn�d|��z
}t	|d|z
z��|z}	|t|	��z}
||z|z}|||	zz|
z
}|tzd|zz
dks|t	|��kr|
|zS��|dkrt	d|��z
��|zS	|��}
t|ztz}||
z}|dkr	|d|zz}
nt	||z
|z��}
|��}|dkr||
|dz
zkrnn|t|
��krn�z|
|zS)	Nr�z*gammavariate: alpha and beta must be > 0.0r4r2TgH�����z>g�P���?r5)rdr'r��LOG4r�r��
SG_MAGICCONST�_e)r>�alpha�betar'�ainv�bbb�cccr�r��vr?r�r{r�r��ps                r@rzRandom.gammavariate�s���
	��C�<�<�4�3�;�;��I�J�J�J�����3�;�;���u��s�*�+�+�D��$�,�C��$�,�C�

$��V�X�X���b�,�,�,�,�9�,�,�,�,���6�6�8�8�^����s�R�x��)�)�D�0���D��G�G�O����G�b�L���#��'�M�A�%���}�$�s�Q�w�.�#�5�5��d�1�g�g����t�8�O�

$��c�\�\���v�v�x�x��(�(�(�4�/�/�


��F�H�H���%�Z�2�%����E����8�8��c�E�k�*�A�A��q�1�u��o�.�.�.�A��V�X�X���s�7�7��Q�5�3�;�/�/�/��0��4���8�8�^�^��

��t�8�OrBc�p�	|�|d��}|r|||�|d��zzSdS)Nr4r�)r)r>r�r��ys    r@rzRandom.betavariate�sK��	�*
���e�S�)�)���	:���D�-�-�d�C�8�8�8�9�9��srBc�B�	d|���z
}|d|zzS)Nr4g�r�)r>r�r�s   r@r$zRandom.paretovariate�s(��A�
�$�+�+�-�-����T�E�\�"�"rBc�d�	d|���z
}|t|��d|zzzSr�)r'r�)r>r�r�r�s    r@r0zRandom.weibullvariates7��	�
�$�+�+�-�-�����a����c�D�j�1�1�1rBr<)Nr7)r�r4N�r�r4)$�__name__�
__module__�__qualname__r]rAr*r!r+rirkrmrvrr�BPFrsror%r�r(r&rr,r)rr.r-r#rr"rr/rrr$r0�
__classcell__)r[s@r@rrgs_���������G�����$�$�$�$�$�$�LA�A�A�A�A�6�6�6�6�6�B������3�3�3����(���9:�3��'�'�'�'�&-�J�=�=�=�%)�t�H3�H3�H3�H3�T&�&�&�.�.�.�$�$�$�/3�]�]�]�]�]�~#+�t�q�#+�#+�#+�#+�#+�P+�+�+�1�1�1�1�(����*$�$�$�$�L3�3�3�2�2�2�"(�(�(�T?�?�?�B���6#�#�#�	2�	2�	2�	2�	2�	2�	2rBrc�6�eZdZ	d�Zd�Zd�Zd�Zd�ZexZZ	dS)rc�h�	t�td����dz	tzS)NrDr:)rPrQ�_urandom�	RECIP_BPFrhs r@r'zSystemRandom.randoms'��E����x��{�{�+�+�q�0�I�=�=rBc��	|dkrtd���|dzdz}t�t|����}||dz|z
z	S)Nrz#number of bits must be non-negativerDr�)rdrPrQr�)r>rz�numbytesr?s    r@r zSystemRandom.getrandbits sW��H��q�5�5��B�C�C�C���E�a�<���N�N�8�H�-�-�.�.���X��\�A�%�&�&rBc�"�	t|��Sr<)r�r�s  r@r%zSystemRandom.randbytes(s��&���{�{�rBc��	dSr<r`�r>�args�kwdss   r@r*zSystemRandom.seed.s
��F��trBc�"�	td���)Nz*System entropy source does not have state.)�NotImplementedErrorrs   r@�_notimplementedzSystemRandom._notimplemented2s��K�!�"N�O�O�OrBN)
r�r�r�r'r r%r*r	r!r+r`rBr@rrsm�������>�>�>�'�'�'�������P�P�P�*�)�H�x�x�xrBrc�^���ddlm}m}ddlm}|��}��fd�td|��D��}|��}||��}	|||	��}
t
|��}t|��}t||z
d�d|�d�j	����td|	|
||fz��dS)	Nr)�stdev�fmean)�perf_counterc���g|]}�����Sr`r`)rar�r�funcs  ��r@r�z#_test_generator.<locals>.<listcomp>as���2�2�2�A�D�D�$�K�2�2�2rBz.3fz sec, z times z"avg %g, stddev %g, min %g, max %g
)
�
statisticsrr�timer
r��min�max�printr�)
ryrrr�meanr
�t0�data�t1�xbarr�r�r�s
 ``          r@�_test_generatorr\s�����/�/�/�/�/�/�/�/�!�!�!�!�!�!�	����B�2�2�2�2�2���q�!1�!1�2�2�2�D�	����B��4��:�:�D��E�$����E�

�d�)�)�C��t�9�9�D�	�R�"�W�
9�
9�
9��
9�
9�$�-�
9�
9�:�:�:�	�
/�4���T�2J�
J�K�K�K�K�KrB��c���t|td��t|td��t|td��t|td��t|t
d��t|t
d��t|t
d��t|t
d��t|t
d��t|t
d��t|t
d	��t|t
d
��t|t
d��t|td��t|td��t|td
��dS)Nr`r�)g{�G�z�?r4)皙�����?r4)rr2)r�r4)g�������?r4)r4r4)r2r4)g4@r4)gi@r4)�@r)r�r4gUUUUUU�?)	rr'r#r"r/rrrr-)�Ns r@�_testr ms)���A�v�r�"�"�"��A�}�j�1�1�1��A�~�z�2�2�2��A��
�3�3�3��A�|�[�1�1�1��A�|�Z�0�0�0��A�|�Z�0�0�0��A�|�Z�0�0�0��A�|�Z�0�0�0��A�|�Z�0�0�0��A�|�Z�0�0�0��A�|�[�1�1�1��A�|�\�2�2�2��A�u�j�)�)�)��A�{�J�/�/�/��A�z�#8�9�9�9�9�9rB�fork)�after_in_child�__main__)r)Z�warningsrr}�mathrr�rr�rr�rr�rr�r	r�r
r�rr�rr�r
r�rr~rr��osrr��_collections_abcr�_Setrr��operatorrr��	itertoolsrr�rr�rr��_os�_randomrRr�ImportError�hashlib�__all__r�r�r�r�r�r�rr�_instr*r'r.r-r&rr(r)r,rr#r"rr/rrrr$r0r!r+r r%rr �hasattr�register_at_forkr�r`rBr@�<module>r3sG��)�^#�"�"�"�"�"�L�L�L�L�L�L�L�L�L�L�L�L�L�L�G�G�G�G�G�G�G�G�G�G�G�G�E�E�E�E�E�E�E�E�E�E�"�"�"�"�"�"�?�?�?�?�?�?�?�?�$�$�$�$�$�$�B�B�B�B�B�B�B�B�$�$�$�$�$�$���������*�)�)�)�)�)�)�)���*�*�*�)�)�)�)�)�)�)�)�*��������8�D�D��J�J����s���+�
��t�C�y�y���d�d�3�i�i��
���
�#��I�	���e
2�e
2�e
2�e
2�e
2�W�^�e
2�e
2�e
2�X"*�"*�"*�"*�"*�6�"*�"*�"*�X	������z��	���
�-��
�
�
�
�-��	����O�	�	���
�-��
�-���#�
��%������'���!��
�������#�
��%���>���>������O�	�L�L�L�":�:�:�:�,�7�3����4��C���
�3�3�3�3��z���	�E�G�G�G�G�G��s�A�A,�+A,

ZeroDay Forums Mini