PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` ryMaZ>e3j?Z?e3j@Z@e3jAZAe3jBZBe3jCZCe3jDZDe3jEZEe3jFZFe3jGZGe3jHZHeId0kr{e2nd(S(1uRandom variable generators. integers -------- uniform within range sequences --------- pick random element pick 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. i(uwarn(u MethodTypeuBuiltinMethodType(uloguexpupiueuceil(usqrtuacosucosusin(uurandom(uSetuSequence(usha512uRandomuseedurandomuuniformurandintuchoiceusampleu randrangeushuffleu normalvariateulognormvariateu expovariateuvonmisesvariateu gammavariateu triangularugaussu betavariateu paretovariateuweibullvariateugetstateusetstateu getrandbitsu SystemRandomig?g@g@g?g@i5iNcs|EeZdZdZdZd7ddZd7dfddZfdd Zfd d Z d d Z ddZ ddZ d7de ddZddZe de>eeeddZddZd7ddZddZdd Zd!d"d7d#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Z d3d4Z!d5d6Z"S(8uRandomuRandom 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. icCs|j|d|_dS(ueInitialize an instance. Optional argument x controls seeding, as for Random.seed(). N(useeduNoneu gauss_next(uselfux((u+/opt/alt/python33/lib64/python3.3/random.pyu__init__Ts uRandom.__init__ic s|dkrbytjtdd}Wqbtk r^ddl}t|jd}YqbXn|dkrt|ttt frt|tr|j }n|t |j 7}tj|d}qnt j|d|_dS(uInitialize internal state from hashable object. None or no argument seeds from current time or from an operating system specific randomness source if available. For version 2 (the default), all of the bits are used if *a* is a str, bytes, or bytearray. For version 1, the hash() of *a* is used instead. If *a* is an int, all bits are used. i ubigiNii(uNoneuintu from_bytesu_urandomuNotImplementedErrorutimeu isinstanceustrubytesu bytearrayuencodeu_sha512udigestusuperuseedu gauss_next(uselfuauversionutime(u __class__(u+/opt/alt/python33/lib64/python3.3/random.pyuseed]s    u Random.seedcs|jtj|jfS(u9Return internal state; can be passed to setstate() later.(uVERSIONusuperugetstateu gauss_next(uself(u __class__(u+/opt/alt/python33/lib64/python3.3/random.pyugetstate{suRandom.getstatecs|d}|dkr;|\}}|_tj|n|dkr|\}}|_ytdd|D}Wn.tk r}zt|WYdd}~XnXtj|ntd||jfdS(u:Restore internal state from object returned by getstate().iiicss|]}|dVqdS(ii Nl((u.0ux((u+/opt/alt/python33/lib64/python3.3/random.pyu su"Random.setstate..Nu?state with version %s passed to Random.setstate() of version %s(u gauss_nextusuperusetstateutupleu ValueErroru TypeErroruVERSION(uselfustateuversionu internalstateue(u __class__(u+/opt/alt/python33/lib64/python3.3/random.pyusetstates   uRandom.setstatecCs |jS(N(ugetstate(uself((u+/opt/alt/python33/lib64/python3.3/random.pyu __getstate__suRandom.__getstate__cCs|j|dS(N(usetstate(uselfustate((u+/opt/alt/python33/lib64/python3.3/random.pyu __setstate__suRandom.__setstate__cCs|jf|jfS(N(u __class__ugetstate(uself((u+/opt/alt/python33/lib64/python3.3/random.pyu __reduce__suRandom.__reduce__ic Cs||}||kr'tdn|d kr[|dkrL|j|Stdn||}||krtdn||}|dkr|dkr||j|S|dkrtd|||fn||}||krtdn|dkr%||d|} n-|dkrF||d|} n td| dkrmtdn|||j| S( uChoose a random item from range(start, stop[, step]). This fixes the problem with randint() which includes the endpoint; in Python this is usually not what you want. u!non-integer arg 1 for randrange()iuempty range for randrange()u non-integer stop for randrange()iu'empty range for randrange() (%d,%d, %d)u non-integer step for randrange()uzero step for randrange()N(u ValueErroruNoneu _randbelow( uselfustartustopustepu_intuistartuistopuwidthuistepun((u+/opt/alt/python33/lib64/python3.3/random.pyu randranges4               uRandom.randrangecCs|j||dS(uJReturn random integer in range [a, b], including both end points. i(u randrange(uselfuaub((u+/opt/alt/python33/lib64/python3.3/random.pyurandintsuRandom.randintc Cs|j}||j|ks0|||krk|j}||} x| |krf||} qKW| S|j} ||krtd|| |S||} || |} | } x| | kr| } qW|| ||S(uCReturn a random int in the range [0,n). Raises ValueError if n==0.uUnderlying random() generator does not supply enough bits to choose from a population range this large. To remove the range limitation, add a getrandbits() method.(u getrandbitsurandomu bit_lengthu_warn( uselfunuintumaxsizeutypeuMethodu BuiltinMethodu getrandbitsukururandomuremulimit((u+/opt/alt/python33/lib64/python3.3/random.pyu _randbelows" '        uRandom._randbelowc CsBy|jt|}Wntk r9tdYnX||S(u2Choose a random element from a non-empty sequence.u$Cannot choose from an empty sequence(u _randbelowulenu ValueErroru IndexError(uselfusequi((u+/opt/alt/python33/lib64/python3.3/random.pyuchoices  u Random.choicecCs|dkrk|j}xttdt|D]3}||d}||||||<|| shuffle list x in place; return None. Optional arg random is a 0-argument function returning a random float in [0.0, 1.0); by default, the standard random.random. iN(uNoneu _randbelowureversedurangeulenuint(uselfuxurandomu randbelowuiuju_int((u+/opt/alt/python33/lib64/python3.3/random.pyushuffles  "$"uRandom.shufflec Cst|trt|}nt|ts<tdn|j}t|}d|koh|kns|tdnd g|}d}|dkr|dt t |dd7}n||kr%t |}xt |D]:}|||} || ||<|||d|| Population must be a sequence or set. For dicts, use list(d).iuSample larger than populationiiiiiN(u isinstanceu_Setutupleu _Sequenceu TypeErroru _randbelowulenu ValueErroruNoneu_ceilu_logulisturangeusetuadd( uselfu populationuku randbelowunuresultusetsizeupooluiujuselectedu selected_add((u+/opt/alt/python33/lib64/python3.3/random.pyusamples6    $      u Random.samplecCs||||jS(uHGet a random number in the range [a, b) or [a, b] depending on rounding.(urandom(uselfuaub((u+/opt/alt/python33/lib64/python3.3/random.pyuuniformPsuRandom.uniformgg?cCsx|j}|dkrdn||||}||kr`d|}d|}||}}n|||||dS(uTriangular 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 g?g?N(urandomuNone(uselfulowuhighumodeuuuc((u+/opt/alt/python33/lib64/python3.3/random.pyu triangularVs $   uRandom.triangularcCsh|j}xP|}d|}t|d|}||d}|t| kr Pq q |||S(u\Normal distribution. mu is the mean, and sigma is the standard deviation. g?g?g@(urandomu NV_MAGICCONSTu_log(uselfumuusigmaurandomuu1uu2uzuzz((u+/opt/alt/python33/lib64/python3.3/random.pyu normalvariateis   uRandom.normalvariatecCst|j||S(uLog 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. (u_expu normalvariate(uselfumuusigma((u+/opt/alt/python33/lib64/python3.3/random.pyulognormvariatesuRandom.lognormvariatecCstd|j |S(u^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. g?(u_logurandom(uselfulambd((u+/opt/alt/python33/lib64/python3.3/random.pyu expovariatesuRandom.expovariatecCs|j}|dkr t|Sd|}|td||}xe|}tt|}|||}|} | d||ks| d|t|krEPqEqEd|} | |d| |} |} | dkr|t| t} n|t| t} | S(uFCircular 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ư>g?g?(urandomuTWOPIu_sqrtu_cosu_piu_expu_acos(uselfumuukappaurandomusuruu1uzuduu2uqufuu3utheta((u+/opt/alt/python33/lib64/python3.3/random.pyuvonmisesvariates&      .   uRandom.vonmisesvariatecCs |dks|dkr'tdn|j}|dkrtd|d}|t}||}x|}d|kodknsqgnd|}t|d||} |t| } |||} ||| | } | td| dks| t| krg| |Sqgn|dkr_|} x| dkrO|} q7Wt|  |Sx|} t|t}|| }|dkr|d|} nt||| } |}|dkr|| |dkrPqqb|t| krbPqbqb| |SdS( uZGamma 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 gu*gammavariate: alpha and beta must be > 0.0g?g@gHz>gP?g@N(u ValueErrorurandomu_sqrtuLOG4u_logu_expu SG_MAGICCONSTu_e(uselfualphaubetaurandomuainvubbbucccuu1uu2uvuxuzuruuubup((u+/opt/alt/python33/lib64/python3.3/random.pyu gammavariatesJ      *        uRandom.gammavariatecCs|j}|j}d|_|dkrw|t}tdtd|}t||}t|||_n|||S(uGaussian 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. g@g?Ng(urandomu gauss_nextuNoneuTWOPIu_sqrtu_logu_cosu_sin(uselfumuusigmaurandomuzux2piug2rad((u+/opt/alt/python33/lib64/python3.3/random.pyugausss     u Random.gausscCs>|j|d}|dkr"dS|||j|dSdS(uBeta distribution. Conditions on the parameters are alpha > 0 and beta > 0. Returned values range between 0 and 1. g?igN(u gammavariate(uselfualphaubetauy((u+/opt/alt/python33/lib64/python3.3/random.pyu betavariateNs  uRandom.betavariatecCs d|j}d|d|S(u3Pareto distribution. alpha is the shape parameter.g?(urandom(uselfualphauu((u+/opt/alt/python33/lib64/python3.3/random.pyu paretovariate`suRandom.paretovariatecCs'd|j}|t| d|S(ufWeibull distribution. alpha is the scale parameter and beta is the shape parameter. g?(urandomu_log(uselfualphaubetauu((u+/opt/alt/python33/lib64/python3.3/random.pyuweibullvariateisuRandom.weibullvariateN(#u__name__u __module__u __qualname__u__doc__uVERSIONuNoneu__init__useedugetstateusetstateu __getstate__u __setstate__u __reduce__uintu randrangeurandintuBPFutypeu _MethodTypeu_BuiltinMethodTypeu _randbelowuchoiceushuffleusampleuuniformu triangularu normalvariateulognormvariateu expovariateuvonmisesvariateu gammavariateugaussu betavariateu paretovariateuweibullvariate(u __locals__((u __class__u+/opt/alt/python33/lib64/python3.3/random.pyuRandomDs6     ,    >    0 H 5  cBsT|EeZdZdZddZddZddZdd ZeZZ d S( u SystemRandomuAlternate 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). cCstjtddd?tS(u3Get the next random number in the range [0.0, 1.0).iubigi(uintu from_bytesu_urandomu RECIP_BPF(uself((u+/opt/alt/python33/lib64/python3.3/random.pyurandom~suSystemRandom.randomcCsr|dkrtdn|t|kr<tdn|dd}tjt|d}||d|?S(u:getrandbits(k) -> x. Generates an int with k random bits.iu(number of bits must be greater than zerou#number of bits should be an integeriiubig(u ValueErroruintu TypeErroru from_bytesu_urandom(uselfukunumbytesux((u+/opt/alt/python33/lib64/python3.3/random.pyu getrandbitss uSystemRandom.getrandbitscOsdS(u<Stub method. Not used for a system random number generator.N(uNone(uselfuargsukwds((u+/opt/alt/python33/lib64/python3.3/random.pyuseedsuSystemRandom.seedcOstddS(uAMethod should not be called for a system random number generator.u*System entropy source does not have state.N(uNotImplementedError(uselfuargsukwds((u+/opt/alt/python33/lib64/python3.3/random.pyu_notimplementedsuSystemRandom._notimplementedN( u__name__u __module__u __qualname__u__doc__urandomu getrandbitsuseedu_notimplementedugetstateusetstate(u __locals__((u+/opt/alt/python33/lib64/python3.3/random.pyu SystemRandomvs    cCsddl}t|d|jd}d}d}d }|j}xVt|D]H} ||} || 7}|| | }t| |}t| |}qPW|j} tt| |dddd||} t||| | } td | | ||fdS( Niutimesgg _Biusec,uendu u!avg %g, stddev %g, min %g, max %gg _(utimeuprintu__name__urangeuminumaxuroundu_sqrt(unufuncuargsutimeutotalusqsumusmallestulargestut0uiuxut1uavgustddev((u+/opt/alt/python33/lib64/python3.3/random.pyu_test_generators&       u_test_generatoricCst|tft|td t|td t|td t|tdt|tdt|tdt|tdt|tdt|tdt|tdt|tdt|tdt|tdt|tdt|tddS(Ngg?g{Gz?g?g@g?g?g4@gi@g@(gg?(gg?(gg?(g{Gz?g?(g?g?(g?g@(g?g?(g?g?(g?g?(g@g?(g4@g?(gi@g?(gg?(g@g@gUUUUUU?(gg?gUUUUUU?( u_test_generatorurandomu normalvariateulognormvariateuvonmisesvariateu gammavariateugaussu betavariateu triangular(uN((u+/opt/alt/python33/lib64/python3.3/random.pyu_tests u_testu__main__(Ju__doc__uwarningsuwarnu_warnutypesu MethodTypeu _MethodTypeuBuiltinMethodTypeu_BuiltinMethodTypeumathulogu_loguexpu_expupiu_piueu_euceilu_ceilusqrtu_sqrtuacosu_acosucosu_cosusinu_sinuosuurandomu_urandomucollections.abcuSetu_SetuSequenceu _Sequenceuhashlibusha512u_sha512u__all__u NV_MAGICCONSTuTWOPIuLOG4u SG_MAGICCONSTuBPFu RECIP_BPFu_randomuRandomu SystemRandomu_test_generatoru_testu_instuseedurandomuuniformu triangularurandintuchoiceu randrangeusampleushuffleu normalvariateulognormvariateu expovariateuvonmisesvariateu gammavariateugaussu betavariateu paretovariateuweibullvariateugetstateusetstateu getrandbitsu__name__(((u+/opt/alt/python33/lib64/python3.3/random.pyu%sd("         4!