python (3.12.0)
ˑe; ^ 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
l5m6Z5 g dZ9d ed z ed z Z: ed Z;d ed z Z<dZ=de= z Z>dZ? G d de4j Z@ G d de@ ZA e@ ZBeBj ZCeBj ZDeBj ZEeBj ZFeBj ZGeBj ZHeBj ZIeBj ZJeBj ZKeBj ZLeBj ZMeBj ZNeBj ZOeBj ZPeBj ZQeBj ZReBj ZSeBj ZTeBj ZUeBj ZVeBj ZWeBj ZXeBj ZYeBj ZZd Z[d!dZ\ e]e3d r e3j eBj e_d k( r e\ yy# e7$ r
dd
l8m6Z5 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)logexppieceil)sqrtacoscossin)taufloorisfinite)lgammafabslog2)urandom)Sequence)index)
accumulaterepeat)bisectN)sha512)RandomSystemRandombetavariatebinomialvariatechoicechoicesexpovariategammavariategaussgetrandbitsgetstatelognormvariate
normalvariate
paretovariate randbytesrandintrandom randrangesampleseedsetstateshuffle
triangularuniformvonmisesvariateweibullvariate g @ @ ? @5 c e Zd ZdZdZd$dZd% fd Z fdZ fdZd Z d Z
d
Zd Zd Z
d
ez fdZe
Zd ZdefdZd Zd Zd ZdddZd$dd
ddZd Zd&dZd'dZd'dZd Zd(dZd Zd Z d Z!d! Z"d"