OwlCyberSecurity - MANAGER
Edit File: random.cpython-312.pyc
� ������h�������������������������^����d�Z�ddlmZ�ddlmZmZm Z mZm Z�ddlmZmZmZmZ�ddlmZmZmZ�ddlmZmZ m!Z"�ddl#m$Z%�ddl&m'Z(�dd l)m*Z+�dd l,m-Z.m/Z0�ddl1m1Z2�ddl#Z3ddl4Z4 �dd l5m6Z7�g�d�Z:d�ed�������z���ed�������z��Z;�ed�������Z<d�ed�������z���Z=dZ>de>�z��Z?dZ@�G�d��de4j��������������������������ZA�G�d��deA�������ZB�eA��������ZCeCj�������������������ZDeCj�������������������ZEeCj�������������������ZFeCj�������������������ZGeCj�������������������ZHeCj�������������������ZIeCj�������������������ZJeCj�������������������ZKeCj�������������������ZLeCj�������������������ZMeCj�������������������ZNeCj�������������������ZOeCj�������������������ZPeCj�������������������ZQeCj�������������������ZReCj�������������������ZSeCj�������������������ZTeCj�������������������ZUeCj�������������������ZVeCj�������������������ZWeCj�������������������ZXeCj�������������������ZYeCj�������������������ZZeCj�������������������Z[d��Z\d!d�Z]�e^e3d�������r�e3j�������������������eCj����������������������������e`d k(��r�e]���������yy#�e8$�r �dd l9m6Z7�Y����w�xY�w)"aE��Random variable generators. bytes ----- uniform bytes (values between 0 and 255) integers -------- uniform within range sequences --------- pick random element pick random sample pick weighted random sample generate random permutation distributions on the real line: ------------------------------ uniform triangular normal (Gaussian) lognormal negative exponential gamma beta pareto Weibull distributions on the circle (angles 0 to 2pi) --------------------------------------------- circular uniform von Mises discrete distributions ---------------------- binomial General notes on the underlying Mersenne Twister core generator: * The period is 2**19937-1. * It is one of the most extensively tested generators in existence. * The random() method is implemented in C, executes in a single Python step, and is, therefore, threadsafe. �����)�warn)�log�exp�pi�e�ceil)�sqrt�acos�cos�sin)�tau�floor�isfinite)�lgamma�fabs�log2)�urandom)�Sequence)�index)� accumulate�repeat)�bisectN)�sha512)�Random�SystemRandom�betavariate�binomialvariate�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��������������������������e�Zd�ZdZdZd$d�Zd%��fd� Z��fd�Z��fd�Zd��Z d ��Z d ��Zd��Zd��Z d ez��fd�Ze Zd��Zdefd�Zd��Zd��Zd��Zdd�d�Zd$dd d�d�Zd��Zd&d�Zd'd�Zd'd�Zd��Zd(d�Zd��Zd��Z d ��Z!d!��Z"d"��Z#d)d#�Z$��xZ%S�)*r���a���Random number generator base class used by bound module functions. Used to instantiate instances of Random to get generators that don't share state. Class Random can also be subclassed if you want to use a different basic generator of your own devising: in that case, override the following methods: random(), seed(), getstate(), and setstate(). Optionally, implement a getrandbits() method so that randrange() can cover arbitrarily large ranges. ����Nc������������������4�����|�j������������������|��������d|�_��������y)zeInitialize an instance. Optional argument x controls seeding, as for Random.seed(). N)r-���� gauss_next)�self�xs��� �-/opt/alt/python312/lib64/python3.12/random.py�__init__zRandom.__init__~���s������� � � �!���������c����������� ������������|dk(��r�t��������|t��������t��������f�������rpt��������|t���������������r|j������������������d�������n|}|rt ��������|d����������dz��nd}t��������t��������|�������D�] ��}d|z��|z��dz��}��|t ��������|�������z��}|dk(��rdn|}n�|d k(��rkt��������|t��������t��������t��������f�������rPt��������|t���������������r|j��������������������������}t��������j������������������|t��������|�������j��������������������������z����������}n:t��������|t��������d �������t��������t��������t��������t��������t��������f�������st��������d��������t ���������|��E��|��������d |�_��������y )a\��Initialize internal state from a seed. The only supported seed types are None, int, float, str, bytes, and bytearray. None or no argument seeds from current time or from an operating system specific randomness source if available. If *a* is an int, all bits are used. For version 2 (the default), all of the bits are used if *a* is a str, bytes, or bytearray. For version 1 (provided for reproducing random sequences from older versions of Python), the algorithm for str and bytes generates a narrower range of seeds. r;���zlatin-1r�������iCB�l��������������r:���NzOThe 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�versionrA����c� __class__s��� �rB���r-���zRandom.seed����s������$��a�<�J�q�3��,�7�'1�!�U�';�����#��A�"#��A�a�D� �Q���A���a�[����k�Q�&�*<�<���!� ��Q��K�A��2�g��1�A� ��\�j��S�%��,C�D��!�S�!��H�H�J�����q�7�1�:�#4�#4�#6�6�7�A��A��T� �C���U�I�N�O���E��F�� F�� ���Q����rD���c������������������N������|�j�������������������t���������|�� ����������|�j������������������fS�)z9Return internal state; can be passed to setstate() later.)�VERSIONrY���r$���r?���)r@���r]���s��� �rB���r$���zRandom.getstate����s ��������|�|�U�W�-�/����@�@rD���c�����������������������|d���}|dk(��r|\��}}|�_���������t���������|�� ��|��������y|dk(��r.|\��}}|�_��������� �t��������d��|D����������������}t���������|�� ��|��������yt ��������d|�d|�j����������������������������#�t��������$�r}t ��������|�d}~ww�xY�w)z:Restore internal state from object returned by getstate().r���r=���r:���c��������������3����&���K����|�] ��}|d�z�������y�w)l��������N��)�.0rA���s��� rB���� <genexpr>z"Random.setstate.<locals>.<genexpr>����s���������%K�]��a�7�m�]�s����Nzstate with version z( passed to Random.setstate() of version )r?���rY���r.����tuple� ValueErrorrX���r_���)r@����stater[���� internalstater���r]���s��� �rB���r.���zRandom.setstate����s����������(���a�<�6;�3�G�]�D�O��G��]�+� ��\�6;�3�G�]�D�O� '� %�%K�]�%K� K� �� �G��]�+��%�t�|�|�5��6�� 6�� ��� '��Q�&�� '�s����A5��5 B �>B�B c������������������"�����|�j��������������������������S��N)r$����r@���s��� rB����__getstate__zRandom.__getstate__����s�������}�}��rD���c������������������&�����|�j������������������|��������y�rj���)r.���)r@���rg���s��� rB����__setstate__zRandom.__setstate__����s������� � �e�rD���c������������������<�����|�j�������������������d|�j��������������������������fS�)Nrb���)r]���r$���rk���s��� rB���� __reduce__zRandom.__reduce__����s�������~�~�r�4�=�=�?�2�2rD���c�����������������������|�j�������������������D�]T��}d|j������������������v�r�yd|j������������������v�r|�j������������������|�_���������yd|j������������������v�s�C|�j������������������|�_���������y�y)a��Control how subclasses generate random integers. The algorithm a subclass can use depends on the random() and/or getrandbits() implementation available to it and determines whether it can generate random integers from arbitrarily large ranges. � _randbelowr#���r*���N)�__mro__�__dict__�_randbelow_with_getrandbitsrr����_randbelow_without_getrandbits)�cls�kwargsr\���s��� rB����__init_subclass__zRandom.__init_subclass__����sY����������A��q�z�z�)���� � �*�!$�!@�!@�����1�:�:�%�!$�!C�!C�����rD���c������������������t�����|�j�������������������}|j��������������������������}�||�������}||k\��r�||�������}||k\��r�|S�)z;Return a random int in the range [0,n). Defined for n > 0.)r#���� bit_length)r@����nr#����k�rs��� rB���ru���z"Random._randbelow_with_getrandbits����sA��������&�&�� �L�L�N����N���1�f��A��A���1�f��rD���r;���c������������������������|�j�������������������}||k\��rt��������d��������t���������|��������|z���������S�||z��}||z ��|z��}�|��������}||k\��r �|��������}||k\��r� t��������||z���������|z��S�)z�Return a random int in the range [0,n). Defined for n > 0. The implementation does not use getrandbits, but only random. z�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@���r|����maxsizer*����rem�limitr~���s��� rB���rv���z%Random._randbelow_without_getrandbits����s�������������<���N�� O���&�(�Q�,�'�'���k���3��'�)���H���5�j���A���5�j��a�'�k�"�Q�&�&rD���c������������������J�����|�j������������������|dz���������j������������������|d�������S�)�Generate n random bytes.�����little)r#����to_bytes�r@���r|���s��� rB���r(���zRandom.randbytes��s$����������A��&�/�/��8�<�<rD���c����������� ������������t��������|�������}|�4|t��������urt��������d��������|dkD��r|�j������������������|�������S�t ��������d��������t��������|�������}||z ��}t��������|�������}|dk(��r+|dkD��r||�j������������������|�������z���S�t ��������d|��d|��d���������|dkD��r||z���dz ��|z��}n|dk��r||z���dz���|z��}nt ��������d��������|dk��rt ��������d|��d|��d|��d���������|||�j������������������|�������z��z���S�) z�Choose a random item from range(stop) or range(start, stop[, step]). Roughly equivalent to ``choice(range(start, stop, step))`` but supports arbitrarily large ranges and is optimized for common cases. z Missing a non-None stop argumentr���zempty range for randrange()r;���zempty range in randrange(z, �)zzero step for randrange())�_index�_ONErX���rr���rf���) r@����start�stop�step�istart�istop�width�istepr|���s ��� rB���r+���zRandom.randrange#��s'�����������<���4��� B�C�C���z����v�.�.��:�;�;���t��������t����A�:��q�y������ 6�6�6��8���r�$��q�I�J�J���1�9�����"�u�,�A� �Q�Y�����"�u�,�A��8�9�9���6��8���r�$��r�$��q�Q�R�R������� 2�2�2�2rD���c������������������,�����|�j������������������||dz����������S�)zJReturn random integer in range [a, b], including both end points. r;���)r+����r@���rZ����bs��� rB���r)���zRandom.randintL��s��������~�~�a��1��%�%rD���c������������������h�����t��������|�������st��������d��������||�j������������������t��������|�����������������S�)z2Choose a random element from a non-empty sequence.z$Cannot choose from an empty sequence)rO���� IndexErrorrr���)r@����seqs��� rB���r���z Random.choiceU��s/������ ��3�x��C�D�D��4�?�?�3�s�8�,�-�-rD���c�����������������������|�j�������������������}t��������t��������dt��������|���������������������D�]��}�||dz����������}||���||���c||<���||<���� �y)z)Shuffle list x in place, and return None.r;���N)rr����reversed�rangerO���)r@���rA���� randbelow�i�js��� rB���r/���zRandom.shuffle^��sP��������O�O� ��%��3�q�6�*�+�A��!�a�%� �A��1��q��t�J�A�a�D�!�A�$��,rD���)�countsc���������������������t��������|t���������������st��������d��������t��������|�������}|��t ��������t��������|��������������}t��������|�������|k7��rt ��������d��������|r|j��������������������������nd}t��������|t���������������st��������d��������|dk��rt ��������d��������|�j������������������t��������|�������|��������}t��������}|D�� cg�c]��} |�||| �������������c} S�|�j������������������} d|cxk��r|k��st ��������d���������t ��������d��������dg|z��}d }|d kD��r|dt��������t��������|dz��d��������������z��z ��}||k��r>t ��������|�������} t��������|�������D�]#��}�| ||z ���������}| |���||<���| ||z ��d z �����| |<����%�|S�t����������������}|j ������������������}t��������|�������D�]+��}�| |�������}||v�r �| |�������}||v�r� �||��������||���||<����-�|S�c�c} w�)af��Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) zAPopulation must be a sequence. For dicts or sets, use sorted(d).Nz2The number of counts does not match the populationr���zCounts must be integerszCounts must be non-negative)r}���z,Sample larger than population or is negative��������r4���r=���r;���)rI���� _SequencerX���rO����list�_accumulaterf����poprR���r,���r�����_bisectrr����_ceil�_log�set�add)r@���� populationr}���r����r|���� cum_counts�total� selectionsr����sr�����result�setsize�poolr����r�����selected�selected_adds��� rB���r,���z Random.sampleg��s������j��*�i�0���@��A�� A�� �O�����k�&�1�2�J��:��!�#� �!U�V�V�(2�J�N�N�$��E��e�S�)�� 9�:�:��q�y� �!>�?�?����U�5�\�Q��7�J��F�?I�J�z�!�J�v�j�!�4�5�z�J�J��O�O� ��A�{��{��K�L�L����K�L�L���!������q�5��q�E�$�q�1�u�a�.�1�1�1�G���<��� �#�D��1�X���a�!�e�$�� ��G��q� ��q�1�u�q�y�/��Q������ ���u�H�#�<�<�L��1�X���a�L���8�m�!�!��A���8�m��Q��&�q�M��q� ����� ��3�Ks����;F>)�cum_weightsr}���c���������� �������\����|�j�������������������}t��������|�������}|�N|�6t��������}|dz ��}t��������d|�������D��cg�c]��}|�|�|��������|z���������������c}S� �t ��������t��������|��������������}n |�t ��������d��������t��������|�������|k7��rt��������d��������|d���dz���} | dk��rt��������d��������t��������| �������st��������d��������t��������} |d z ��}t��������d|�������D��cg�c]��}|�| |�|��������| z��d |�������������c}S�c�c}w�#�t��������$�r#�t��������|t���������������s��|}t ��������d|���������d�w�xY�wc�c}w�)z�Return a k sized list of population elements chosen with replacement. If the relative weights or cumulative weights are not specified, the selections are made with equal probability. N���������z4The number of choices must be a keyword argument: k=z2Cannot specify both weights and cumulative weightsz3The number of weights does not match the populationrG���z*Total of weights must be greater than zerozTotal of weights must be finiter;���r���)r*���rO���r�����_repeatr����r����rX���rI���rR���rf���� _isfiniter����)r@���r�����weightsr����r}���r*���r|���r���r����r����r����his��� rB���r���zRandom.choices���sf����������� �O���������S���AH��q�AQ�R�AQ�A� �5���A��#6�7�AQ�R�R� �"�;�w�#7�8���� ��P�Q�Q��{��q� ��R�S�S��B��#�%���C�<��I�J�J�����>�?�?��� ��U�� ��q�)�+�)�A���6�+�v�x�%�/?��B�G�H�)�+�� +��+�S����� �!�'�3�/�����K���M���� ��$+s����C5�C:��D)�:,D&c������������������4�����|||z ��|�j��������������������������z��z���S�)z�Get a random number in the range [a, b) or [a, b] depending on rounding. The mean (expected value) and variance of the random variable are: E[X] = (a + b) / 2 Var[X] = (b - a) ** 2 / 12 �r*���r����s��� rB���r1���zRandom.uniform���s��������A��E�T�[�[�]�*�*�*rD���c�����������������������|�j��������������������������} �|�dn ||z ��||z ��z��}||kD��rd|z ��}d|z ��}||}}|||z ��t��������||z���������z��z���S�#�t��������$�r�|cY�S�w�xY�w)a���Triangular distribution. Continuous distribution bounded by given lower and upper limits, and having a given mode value in-between. http://en.wikipedia.org/wiki/Triangular_distribution The mean (expected value) and variance of the random variable are: E[X] = (low + high + mode) / 3 Var[X] = (low**2 + high**2 + mode**2 - low*high - low*mode - high*mode) / 18 ��������?r7���)r*����ZeroDivisionError�_sqrt)r@����low�high�mode�ur\���s��� rB���r0���zRandom.triangular���s�������� �K�K�M�� ��|��$��*����)D�A�� �q�5��a��A��a��A��c��C��d�S�j�E�!�a�%�L�0�0�0�� �!�� ��J� �s����A��A�Ac�����������������������|�j�������������������} ��|��������}d�|��������z ��}t��������|dz ��z��|z��}||z��dz��}|t��������|��������k��rn�9|||z��z���S�)z\Normal distribution. mu is the mean, and sigma is the standard deviation. r7���r����r6���)r*���� NV_MAGICCONSTr����)r@����mu�sigmar*����u1�u2�z�zzs��� rB���r&���zRandom.normalvariate��sg��������������B��v�x��B���c��*�R�/�A��Q����B��d�2�h�Y��� ����A��I�~�rD���c������������������������|�j�������������������}|�j������������������}d|�_��������|�N�|��������t��������z��}t��������dt ��������d�|��������z ���������z���������}t��������|�������|z��}t ��������|�������|z��|�_��������|||z��z���S�)z�Gaussian distribution. mu is the mean, and sigma is the standard deviation. This is slightly faster than the normalvariate() function. Not thread-safe without a lock around calls. Ng��������r7���)r*���r?����TWOPIr����r�����_cos�_sin)r@���r����r����r*���r�����x2pi�g2rads��� rB���r"���zRandom.gauss'��st������6������O�O������9��8�e�#�D��$��c�F�H�n�!5�5�6�E��T� �U�"�A�"�4�j�5�0�D�O��A��I�~�rD���c������������������8�����t��������|�j������������������||��������������S�)z�Log normal distribution. If you take the natural logarithm of this distribution, you'll get a normal distribution with mean mu and standard deviation sigma. mu can have any value, and sigma must be greater than zero. )�_expr&���)r@���r����r����s��� rB���r%���zRandom.lognormvariateM��s��������D�&�&�r�5�1�2�2rD���c������������������B�����t��������d|�j��������������������������z ����������|z��S�)a���Exponential distribution. lambd is 1.0 divided by the desired mean. It should be nonzero. (The parameter would be called "lambda", but that is a reserved word in Python.) Returned values range from 0 to positive infinity if lambd is positive, and from negative infinity to 0 if lambd is negative. The mean (expected value) and variance of the random variable are: E[X] = 1 / lambd Var[X] = 1 / lambd ** 2 r7���)r����r*���)r@����lambds��� rB���r ���zRandom.expovariateW��s"������$��S�4�;�;�=�(�)�)�E�1�1rD���c����������������������|�j�������������������}|dk��rt���������|��������z��S�d|z��}|t��������d||z��z����������z���} ��|��������}t��������t��������|z���������}|||z���z��}�|��������} | d||z��z ��k��s| d|z ��t��������|�������z��k��rn�Id|z��} | |z���d| |z��z���z��}�|��������}|dkD��r|t ��������|�������z���t��������z��} | S�|t ��������|�������z ��t��������z��} | S�)aF��Circular data distribution. mu is the mean angle, expressed in radians between 0 and 2*pi, and kappa is the concentration parameter, which must be greater than or equal to zero. If kappa is equal to zero, this distribution reduces to a uniform random angle over the range 0 to 2*pi. g���ư>r����r7���)r*���r����r����r�����_pir�����_acos)r@���r�����kappar*���r����r~���r����r�����dr�����q�f�u3�thetas��� rB���r2���zRandom.vonmisesvariatek��s������� ������D�=��6�8�#�#��%�K�� ��c�A��E�k�"�"�����B��S�2�X��A��Q��U��A���B��C�!�a�%�K��2�#��'�T�!�W�)<�#<����� �!�G�� ��U�s�Q��U�{�#�� �X�� ��8��%��(�]�e�+�E������%��(�]�e�+�E��rD���c����������������������|dk��s|dk��rt��������d��������|�j������������������}|dkD��r�t��������d|z��dz ���������}|t��������z ��}||z���} ��|��������}d|cxk��rdk��sn��d�|��������z ��}t ��������|d|z ��z���������|z��} |t��������| �������z��} ||z��|z��}||| z��z���| z ��}|t��������z���d|z��z ��dk\��s|t ��������|�������k\��r| |z��S��z|dk(��rt ��������d�|��������z ����������|z��S� ��|��������} t��������|z���t��������z��}|| z��}|dk��r |d|z��z��} nt ��������||z ��|z����������} �|��������}|dkD��r|| |dz ��z��k��r �| |z��S�|t��������| ��������k��r �| |z��S��o)a���Gamma distribution. Not the gamma function! Conditions on the parameters are alpha > 0 and beta > 0. The probability distribution function is: x ** (alpha - 1) * math.exp(-x / beta) pdf(x) = -------------------------------------- math.gamma(alpha) * beta ** alpha The mean (expected value) and variance of the random variable are: E[X] = alpha * beta Var[X] = alpha * beta ** 2 r����z*gammavariate: alpha and beta must be > 0.0r7���r5���gH�����z>g�P���?r8���)rf���r*���r�����LOG4r����r����� SG_MAGICCONST�_e)r@����alpha�betar*����ainv�bbb�cccr����r�����vrA���r����r~���r����r�����ps��� rB���r!���zRandom.gammavariate���s������(��C�<�4�3�;��I�J�J������3�;����u��s�*�+�D��$�,�C��$�,�C���X���b�,�9�,���6�8�^����s�R�x��)�D�0���D��G�O����G�b�L���#��'�M�A�%���}�$�s�Q�w�.�#�5��d�1�g���t�8�O�����c�\���v�x��(�(�4�/�/� ���H���%�Z�2�%����E����8��c�E�k�*�A��q�1�u��o�.�.�A��X���s�7��Q�5�3�;�/�/����t�8�O���4���8�^���t�8�O��rD���c������������������\�����|�j������������������|d�������}|r|||�j������������������|d�������z���z��S�y)aQ��Beta distribution. Conditions on the parameters are alpha > 0 and beta > 0. Returned values range between 0 and 1. The mean (expected value) and variance of the random variable are: E[X] = alpha / (alpha + beta) Var[X] = alpha * beta / ((alpha + beta)**2 * (alpha + beta + 1)) r7���r����)r!���)r@���r����r�����ys��� rB���r���zRandom.betavariate���s9������6� ���e�S�)�����D�-�-�d�C�8�8�9�9�rD���c������������������8�����d|�j��������������������������z ��}|d|z��z��S�)z3Pareto distribution. alpha is the shape parameter.r7���g�������r����)r@���r����r����s��� rB���r'���zRandom.paretovariate���s#������� �$�+�+�-����T�E�\�"�"rD���c������������������R�����d|�j��������������������������z ��}|t��������|��������d|z��z��z��S�)zfWeibull distribution. alpha is the scale parameter and beta is the shape parameter. r7���)r*���r����)r@���r����r����r����s��� rB���r3���zRandom.weibullvariate��s.������� �$�+�+�-�����a���c�D�j�1�1�1rD���c����������������������|dk��rt��������d��������|dk��s|dk\��r|dk(��ry|dk(��r|S�t��������d��������|�j������������������}|dk(��rt���������|��������|k���������S�|dkD��r||�j������������������|d|z ���������z ��S�||z��dk��rFdx}}t ��������d|z ���������}|s|S� �|t��������t ���������|���������������|z���������dz���z ��}||kD��r|S�|dz ��}�/||z��dk\��r|dk��sJ��d }t ��������||z��d|z ��z���������}dd|z��z���} d d| z��z���d|z��z���} ||z��dz���}dd| z��z ��} ��|��������}|dz��}dt��������|�������z ��} t��������d| z��| z��| z���|z��|z����������}|dk��s||kD��r�@�|��������}| dk\��r||k��r|S�|sOdd| z��z���|z��}t��������|d|z ��z���������}t��������|dz���|z���������}t��������|dz����������t��������||z ��dz����������z���}d }|| | | z��z��| z���z��z��}t��������|�������t��������|dz����������z ��t��������||z ��dz����������z ��|z ��z��z���k��r|S���)a���Binomial random variable. Gives the number of successes for *n* independent trials with the probability of success in each trial being *p*: sum(random() < p for i in range(n)) Returns an integer in the range: 0 <= X <= n The mean (expected value) and variance of the random variable are: E[X] = n * p Var[x] = n * p * (1 - p) r���zn must be non-negativer����r7���z&p must be in the range 0.0 <= p <= 1.0r;���r����g������$@TFgffffff�?g= ףp=@gE���JY��ga��+e�?�{�G�z�?gq= ףp�?g������@r5���g�Q���?g�p= ף@gffffff@) rf���r*���r����r����_log2r����r�����_fabsr�����_lgamma)r@���r|���r����r*���rA���r����r\����setup_complete�spqr����rZ����vrr�����usr}���r����r�����lpq�m�hs��� rB���r���zRandom.binomialvariate��s������"� �q�5��5�6�6���8�q�C�x��C�x���C�x����E�F�F������ ��6��&�(�Q�,�'�'�� �s�7��t�+�+�A�s�Q�w�7�7�7��q�5�4�<���I�A���c�A�g��A������V�E�&�(�O�a�/�0�1�4�4���q�5��H��Q��� �����s�d�{�q�C�x�'�'����A��E�S�1�W�%�&���4�#�:����f�q�j� �4�!�8�+�� ��E�C�K�� �C�!�G�^�����A� ��H�A��u�Q�x��B���a��"��q�(�A�-��1�2�A��1�u��A������A��T�z�a�2�g��� �"���a���3�.���1��a��=�)���A��E�Q�;�'���A��E�N�W�Q��U�Q�Y�%7�7��!%�� ��!�r�B�w�-�!�+�,�,�A��A�w�!�g�a�!�e�n�,�w�q�1�u�q�y�/A�A�Q��U�c�M�Q�Q���5�rD���rj���)Nr:���)r����r7���N�r����r7���)r7���)r;���r����)&�__name__� __module__�__qualname__�__doc__r_���rC���r-���r$���r.���rl���rn���rp���ry���ru����BPFrv���rr���r(���r����r+���r)���r���r/���r,���r���r1���r0���r&���r"���r%���r ���r2���r!���r���r'���r3���r���� __classcell__)r]���s���@rB���r���r���n���s�����������G��$�LA�6�B��3��(��9:�3���'�&�-�J�=��%)�t��'3�R&�.�$��/3��]�~#+�t�q��#+�P +�1�2�*$�L3�2�((�TC�J�@#� 2�VrD���r���c��������������������6�����e�Zd�ZdZd��Zd��Zd��Zd��Zd��ZexZ Z y)r���z�Alternate random number generator using sources provided by the operating system (such as /dev/urandom on Unix or CryptGenRandom on Windows). Not available on all systems (see os.urandom() for details). c������������������R�����t���������j������������������t��������d��������������dz ��t��������z��S�)z7Get the next random number in the range 0.0 <= X < 1.0.rF���r=���)rR���rS����_urandom� RECIP_BPFrk���s��� rB���r*���zSystemRandom.randomu��s���������x��{�+�q�0�I�=�=rD���c�����������������������|dk��rt��������d��������|dz���dz��}t��������j������������������t��������|��������������}||dz��|z ��z ��S�)z:getrandbits(k) -> x. Generates an int with k random bits.r���z#number of bits must be non-negativerF���r����)rf���rR���rS���r ��)r@���r}����numbytesrA���s��� rB���r#���zSystemRandom.getrandbitsy��sI�������q�5��B�C�C���E�a�<���N�N�8�H�-�.���X��\�A�%�&�&rD���c�����������������������t��������|�������S�)r����)r ��r����s��� rB���r(���zSystemRandom.randbytes���s���������{�rD���c������������������������y)z<Stub method. Not used for a system random number generator.Nrb����r@����args�kwdss��� rB���r-���zSystemRandom.seed���s������rD���c�����������������������t��������d��������)zAMethod should not be called for a system random number generator.z*System entropy source does not have state.)�NotImplementedErrorr��s��� rB����_notimplementedzSystemRandom._notimplemented���s������!�"N�O�OrD���N)r��r��r��r��r*���r#���r(���r-���r��r$���r.���rb���rD���rB���r���r���l��s-�������>�'���P��*�)�H�xrD���r���c������������������6����ddl�m}m}�ddlm}��|��������}t��������d�|��������D��cg�c]��}�||���� �}}�|��������} �||�������} �||| �������}t ��������|�������}t��������|�������} t��������| |z ��d�d|���d|j��������������������|����������t��������d| ||| fz����������y�c�c}w�)Nr���)�stdev�fmean)�perf_counterz.3fz sec, z times z"avg %g, stddev %g, min %g, max %g ) � statisticsr��r���timer��r�����min�max�printr��)r|����funcr��r���meanr���t0r�����data�t1�xbarr����r����r����s��� rB����_test_generatorr$�����s�������/�!� ��B�!(��q�!1�2�!1�A�D�$�K�!1�D�2� ��B���:�D��$���E� �d�)�C��t�9�D� �R�"�W�S�M���s�'�$�-�-���� A�B� � /�4���T�2J� J�K���3s����Bc������������������h����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��������|�t��������d ��������t��������|�t��������d ��������t��������|�t��������d��������t��������|�t��������d��������t��������|�t��������d ��������t��������|�t��������d��������t��������|�t��������d��������t��������|�t��������d��������y�)Nrb���r���)����g333333�?)�d���g�������?)r����r7���)皙�����?r7���)r(��r5���)r����r7���)g�������?r7���)r7���r7���)r5���r7���)g������4@r7���)g������i@r7���)�������@r)��)r����r7���gUUUUUU�?) r$��r*���r&���r%���r2���r���r!���r"���r���r0���)�Ns��� rB����_testr+�����s��������A�v�r�"��A�}�j�1��A�~�z�2��A�� �3��A�� �3��A���4��A�|�[�1��A�|�Z�0��A�|�Z�0��A�|�Z�0��A�|�Z�0��A�|�Z�0��A�|�Z�0��A�|�[�1��A�|�\�2��A�u�j�)��A�{�J�/��A�z�#8�9rD����fork)�after_in_child�__main__)i'��)ar���warningsr���r�����mathr���r����r���r����r���r����r���r����r���r����r ���r����r ���r����r���r����r���r����r ���r����r���r����r���r����r���r����r���r����r���r�����osr���r ���_collections_abcr���r�����operatorr���r����� itertoolsr���r����r���r����r���r�����_os�_random�_sha2r���rT����ImportError�hashlib�__all__r����r����r����r��r ��r����r���r����_instr-���r*���r1���r0���r)���r���r+���r,���r/���r���r&���r%���r ���r2���r!���r"���r���r���r'���r3���r$���r.���r#���r(���r$��r+���hasattr�register_at_forkr��rb���rD���rB����<module>r>�����s�����.�h�#��L��L��G��G��E��E��@��@��"��2��$��B��$�����*�'� ��:��D��J���s��+� ��C�y���d�3�i�� ��� �#��I� ���w�W�^�^��w�|"*�6��"*�X� ����z�z�� ���� �-�-�� � � � � �-�-�� �����O�O� � ���� �-�-�� �-�-���#�#� ��%�%�������'�'���!�!�� ���������'�'���#�#� ��%�%���>�>���>�>�������O�O� �L�":�0��3����C���� � �3���z�� �G����}���*�)�)�*�s���� H��H,�+H,