live CˆÐÏ „€Ó?οÑ?÷Ca ´iüzã@südZddlmZddlmZmZm Z m Z m ZddlmZmZmZmZddlmZmZddlmZddlmZ m!Z"ddl#m$Z%m&Z'dd l(m(Z)dd lZ*dd l+Z+zdd l,m-Z,Wne.yÊdd l/m-Z,Yn0gd ¢Z0d edƒedƒZ1edƒZ2dedƒZ3dZ4de4 Z5Gdd„de+j6ƒZ6Gdd„de6ƒZ7e6ƒZ8e8j9Z9e8j:Z:e8j;Z;e8jZ>e8j?Z?e8j@Z@e8jAZAe8jBZBe8jCZCe8jDZDe8jEZEe8jFZFe8jGZGe8jHZHe8jIZIe8jJZJe8jKZKe8jLZLe8jMZMe8jNZNe8jOZOdd„ZPd!dd„ZQeRe*dƒ�rèe*jSe8j9d�eTd k�røeQƒd S)"aù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 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)Úurandom)ÚSetÚSequence)Ú 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écs*eZdZdZdZdBdd„ZdC‡fdd„ Z‡fd d „Z‡fd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z de>fdd„Ze Zdd„ZdDdd„Zdd„Zd d!„ZdEd"d#„Zdd$œd%d&„ZdFddd'œd(d)„Zd*d+„ZdGd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd8d9„Zd:d;„Zdd?„Z!d@dA„Z"‡Z#S)Hraã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. éNcCs| |¡d|_dS)zeInitialize an instance. Optional argument x controls seeding, as for Random.seed(). N)r'Ú gauss_next)ÚselfÚx©r9ú/usr/lib64/python3.9/random.pyÚ__init__us zRandom.__init__r4cs|dkr„t|ttfƒr„t|tƒr*| d¡n|}|rBt|dƒd>nd}tt|ƒD]}d||Ad@}qP|t|ƒN}|dkr~dn|}nj|d krÈt|tttfƒrÈt|tƒr®| ¡}t   |t |ƒ  ¡d ¡}n&t|t d ƒt ttttfƒsîtd td ƒtƒ |¡d |_d S) 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.