/snap/core18/2999/usr/lib/python3.6/__pycache__
NameSizeModeActions
abc.cpython-36.pyc75150644editdlrm
aifc.cpython-36.pyc259430644editdlrm
antigravity.cpython-36.pyc7790644editdlrm
argparse.cpython-36.pyc604560644editdlrm
ast.cpython-36.pyc117040644editdlrm
asynchat.cpython-36.pyc68150644editdlrm
asyncore.cpython-36.pyc158380644editdlrm
base64.cpython-36.pyc170590644editdlrm
bdb.cpython-36.pyc170330644editdlrm
binhex.cpython-36.pyc120860644editdlrm
bisect.cpython-36.pyc26760644editdlrm
bz2.cpython-36.pyc112820644editdlrm
calendar.cpython-36.pyc258820644editdlrm
cgi.cpython-36.pyc284160644editdlrm
cgitb.cpython-36.pyc100800644editdlrm
chunk.cpython-36.pyc49000644editdlrm
cmd.cpython-36.pyc125750644editdlrm
code.cpython-36.pyc98360644editdlrm
codecs.cpython-36.pyc339000644editdlrm
codeop.cpython-36.pyc62700644editdlrm
colorsys.cpython-36.pyc33110644editdlrm
compileall.cpython-36.pyc82780644editdlrm
configparser.cpython-36.pyc452440644editdlrm
contextlib.cpython-36.pyc111580644editdlrm
copy.cpython-36.pyc70790644editdlrm
copyreg.cpython-36.pyc42440644editdlrm
cProfile.cpython-36.pyc42940644editdlrm
crypt.cpython-36.pyc22420644editdlrm
csv.cpython-36.pyc118550644editdlrm
datetime.cpython-36.pyc545110644editdlrm
decimal.cpython-36.pyc3510644editdlrm
difflib.cpython-36.pyc596420644editdlrm
dis.cpython-36.pyc141810644editdlrm
doctest.cpython-36.pyc755890644editdlrm
dummy_threading.cpython-36.pyc11020644editdlrm
enum.cpython-36.pyc234530644editdlrm
filecmp.cpython-36.pyc83050644editdlrm
fileinput.cpython-36.pyc131520644editdlrm
fnmatch.cpython-36.pyc28740644editdlrm
formatter.cpython-36.pyc175790644editdlrm
fractions.cpython-36.pyc184260644editdlrm
ftplib.cpython-36.pyc283570644editdlrm
functools.cpython-36.pyc240620644editdlrm
genericpath.cpython-36.pyc37260644editdlrm
getopt.cpython-36.pyc62170644editdlrm
getpass.cpython-36.pyc41770644editdlrm
gettext.cpython-36.pyc143060644editdlrm
glob.cpython-36.pyc42590644editdlrm
gzip.cpython-36.pyc162260644editdlrm
hashlib.cpython-36.pyc66920644editdlrm
heapq.cpython-36.pyc142920644editdlrm
hmac.cpython-36.pyc48360644editdlrm
imaplib.cpython-36.pyc421380644editdlrm
imghdr.cpython-36.pyc41500644editdlrm
imp.cpython-36.pyc96960644editdlrm
inspect.cpython-36.pyc797390644editdlrm
io.cpython-36.pyc33870644editdlrm
ipaddress.cpython-36.pyc623860644editdlrm
keyword.cpython-36.pyc17650644editdlrm
linecache.cpython-36.pyc37780644editdlrm
locale.cpython-36.pyc340300644editdlrm
lzma.cpython-36.pyc119920644editdlrm
macpath.cpython-36.pyc56410644editdlrm
macurl2path.cpython-36.pyc18670644editdlrm
mailbox.cpython-36.pyc637520644editdlrm
mailcap.cpython-36.pyc72090644editdlrm
mimetypes.cpython-36.pyc155530644editdlrm
modulefinder.cpython-36.pyc153660644editdlrm
netrc.cpython-36.pyc38360644editdlrm
nntplib.cpython-36.pyc337800644editdlrm
ntpath.cpython-36.pyc131900644editdlrm
nturl2path.cpython-36.pyc14990644editdlrm
numbers.cpython-36.pyc121420644editdlrm
opcode.cpython-36.pyc54130644editdlrm
operator.cpython-36.pyc139130644editdlrm
optparse.cpython-36.pyc480540644editdlrm
os.cpython-36.pyc296280644editdlrm
pathlib.cpython-36.pyc420070644editdlrm
pdb.cpython-36.pyc460940644editdlrm
pickle.cpython-36.pyc426910644editdlrm
pickletools.cpython-36.pyc660200644editdlrm
pipes.cpython-36.pyc78080644editdlrm
pkgutil.cpython-36.pyc162610644editdlrm
platform.cpython-36.pyc291970644editdlrm
plistlib.cpython-36.pyc280550644editdlrm
poplib.cpython-36.pyc133290644editdlrm
posixpath.cpython-36.pyc104560644editdlrm
pprint.cpython-36.pyc158240644editdlrm
profile.cpython-36.pyc139010644editdlrm
pstats.cpython-36.pyc218570644editdlrm
pty.cpython-36.pyc38610644editdlrm
pyclbr.cpython-36.pyc83650644editdlrm
pydoc.cpython-36.pyc837750644editdlrm
py_compile.cpython-36.pyc65440644editdlrm
queue.cpython-36.pyc87550644editdlrm
quopri.cpython-36.pyc57730644editdlrm
random.cpython-36.pyc193300644editdlrm
re.cpython-36.pyc140580644editdlrm
reprlib.cpython-36.pyc54000644editdlrm
rlcompleter.cpython-36.pyc57800644editdlrm
runpy.cpython-36.pyc79820644editdlrm
sched.cpython-36.pyc65640644editdlrm
secrets.cpython-36.pyc21620644editdlrm
selectors.cpython-36.pyc176970644editdlrm
shelve.cpython-36.pyc94580644editdlrm
shlex.cpython-36.pyc69700644editdlrm
shutil.cpython-36.pyc307040644editdlrm
signal.cpython-36.pyc25150644editdlrm
site.cpython-36.pyc165600644editdlrm
sitecustomize.cpython-36.pyc2120644editdlrm
smtpd.cpython-36.pyc266830644editdlrm
smtplib.cpython-36.pyc353400644editdlrm
sndhdr.cpython-36.pyc69130644editdlrm
socket.cpython-36.pyc220130644editdlrm
socketserver.cpython-36.pyc242500644editdlrm
sre_compile.cpython-36.pyc102780644editdlrm
sre_constants.cpython-36.pyc59720644editdlrm
sre_parse.cpython-36.pyc203580644editdlrm
ssl.cpython-36.pyc369390644editdlrm
stat.cpython-36.pyc38510644editdlrm
statistics.cpython-36.pyc181740644editdlrm
string.cpython-36.pyc79640644editdlrm
stringprep.cpython-36.pyc100300644editdlrm
struct.cpython-36.pyc3120644editdlrm
subprocess.cpython-36.pyc354850644editdlrm
sunau.cpython-36.pyc169380644editdlrm
symbol.cpython-36.pyc25170644editdlrm
symtable.cpython-36.pyc104280644editdlrm
sysconfig.cpython-36.pyc159160644editdlrm
tabnanny.cpython-36.pyc69750644editdlrm
tarfile.cpython-36.pyc630850644editdlrm
telnetlib.cpython-36.pyc180970644editdlrm
tempfile.cpython-36.pyc253090644editdlrm
textwrap.cpython-36.pyc136840644editdlrm
this.cpython-36.pyc12650644editdlrm
threading.cpython-36.pyc372340644editdlrm
timeit.cpython-36.pyc116030644editdlrm
token.cpython-36.pyc33200644editdlrm
tokenize.cpython-36.pyc186470644editdlrm
trace.cpython-36.pyc194950644editdlrm
traceback.cpython-36.pyc196460644editdlrm
tracemalloc.cpython-36.pyc172290644editdlrm
tty.cpython-36.pyc10720644editdlrm
turtle.cpython-36.pyc1317510644editdlrm
types.cpython-36.pyc82010644editdlrm
typing.cpython-36.pyc733060644editdlrm
uu.cpython-36.pyc34980644editdlrm
uuid.cpython-36.pyc209180644editdlrm
warnings.cpython-36.pyc132580644editdlrm
wave.cpython-36.pyc178850644editdlrm
weakref.cpython-36.pyc191430644editdlrm
webbrowser.cpython-36.pyc157970644editdlrm
xdrlib.cpython-36.pyc83020644editdlrm
zipapp.cpython-36.pyc55340644editdlrm
zipfile.cpython-36.pyc497280644editdlrm
_bootlocale.cpython-36.pyc9800644editdlrm
_collections_abc.cpython-36.pyc287970644editdlrm
_compat_pickle.cpython-36.pyc65660644editdlrm
_compression.cpython-36.pyc41040644editdlrm
_dummy_thread.cpython-36.pyc48510644editdlrm
_markupbase.cpython-36.pyc79910644editdlrm
_osx_support.cpython-36.pyc96840644editdlrm
_pydecimal.cpython-36.pyc1634020644editdlrm
_pyio.cpython-36.pyc713860644editdlrm
_sitebuiltins.cpython-36.pyc34350644editdlrm
_strptime.cpython-36.pyc159630644editdlrm
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc187790644editdlrm
_threading_local.cpython-36.pyc64250644editdlrm
_weakrefset.cpython-36.pyc78280644editdlrm
__future__.cpython-36.pyc41670644editdlrm
__phello__.foo.cpython-36.pyc1190644editdlrm
Edit: /snap/core18/2999/usr/lib/python3.6/__pycache__/random.cpython-36.pyc (19330B)
3 Nqi2k@sdZddlmZddlmZmZddl m Z m Z mZmZmZddl mZmZmZmZddlmZddlm Z!m"Z#ddl$m%Z&dd l'Z(dd l)Z*d d d d ddddddddddddddddddd d!gZ+d"e d2ed$Z,d$eZ-e d%Z.d&e d'Z/d(Z0d)e0 Z1dd l2Z2Gd*d d e2j3Z3Gd+d!d!e3Z4d,d-Z5d3d/d0Z6e3Z7e7j8Z8e7j9Z9e7j:Z:e7j;Z;e7jZ>e7j?Z?e7j@Z@e7jAZAe7jBZBe7jCZCe7jDZDe7jEZEe7jFZFe7jGZGe7jHZHe7jIZIe7jJZJe7jKZKe7jLZLe7jMZMeNd1kre6d S)4aRandom variable generators. 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) MethodTypeBuiltinMethodType)logexppieceil)sqrtacoscossin)urandom)SetSequence)sha512NRandomseedrandomuniformrandintchoicesample randrangeshuffle normalvariatelognormvariate expovariatevonmisesvariate gammavariate triangulargauss betavariate paretovariateweibullvariategetstatesetstate getrandbitschoices SystemRandomg?g@g@g?g@5cseZdZdZdZd;ddZd<fdd Zfd d Zfd d Zd dZ ddZ ddZ dde fddZ ddZe de>eeefddZddZd=ddZddZd>ddd d!d"Zd#d$Zd?d'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"Z#S)@raRandom 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|j|d|_dS)zeInitialize an instance. Optional argument x controls seeding, as for Random.seed(). N)r gauss_next)selfxr1/usr/lib/python3.6/random.py__init__Ws zRandom.__init__r,cs|dkrt|ttfrt|tr*|jdn|}|rBt|dd>nd}x"tt|D]}d||Ad@}qRW|t|N}|d krd n|}|dkrt|tttfrt|tr|j}|t |j 7}t j |d}t j|d |_d S) aInitialize internal state from hashable object. 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. zlatin-1riCBlr,bigN) isinstancestrbytesdecodeordmaplen bytearrayencode_sha512Zdigestint from_bytessuperrr.)r/aversionr0c) __class__r1r2r`s    z Random.seedcs|jtj|jfS)z9Return internal state; can be passed to setstate() later.)VERSIONrEr%r.)r/)rIr1r2r%szRandom.getstatecs|d}|dkr*|\}}|_tj|nt|dkr|\}}|_ytdd|D}Wn(tk r|}z t|WYdd}~XnXtj|ntd||jfdS)z:Restore internal state from object returned by getstate().rr-r,css|]}|dVqdS)r, Nlr1).0r0r1r1r2 sz"Random.setstate..Nz?state with version %s passed to Random.setstate() of version %s)r.rEr&tuple ValueError TypeErrorrJ)r/staterGZ internalstater)rIr1r2r&s  zRandom.setstatecCs|jS)N)r%)r/r1r1r2 __getstate__szRandom.__getstate__cCs|j|dS)N)r&)r/rQr1r1r2 __setstate__szRandom.__setstate__cCs|jf|jfS)N)rIr%)r/r1r1r2 __reduce__szRandom.__reduce__r4c Cs||}||krtd|dkr:|dkr2|j|Std||}||krRtd||}|dkrx|dkrx||j|S|dkrtd|||f||}||krtd|dkr||d|} n"|dkr||d|} ntd | dkrtd|||j| S) zChoose 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. z!non-integer arg 1 for randrange()Nrzempty range for randrange()z non-integer stop for randrange()r4z'empty range for randrange() (%d,%d, %d)z non-integer step for randrange()zzero step for randrange())rO _randbelow) r/startstopstep_intZistartZistopwidthZistepnr1r1r2rs4  zRandom.randrangecCs|j||dS)zJReturn random integer in range [a, b], including both end points. r4)r)r/rFbr1r1r2rszRandom.randintc Cs|j}|j}|||ks$|||krN|j} || } x| |krH|| } q6W| S||krltd|||S|dkr|td||} || |} |} x| | kr|} qW|| ||S)zCReturn a random int in the range [0,n). Raises ValueError if n==0.zUnderlying random() generator does not supply enough bits to choose from a population range this large. To remove the range limitation, add a getrandbits() method.rzBoundary cannot be zero)rr' bit_length_warnrO) r/r[rCmaxsizetypeZMethodZ BuiltinMethodrr'krZremlimitr1r1r2rUs&     zRandom._randbelowc Cs:y|jt|}Wntk r0tddYnX||S)z2Choose a random element from a non-empty sequence.z$Cannot choose from an empty sequenceN)rUr?rO IndexError)r/seqir1r1r2rs z Random.choicecCs|dkrR|j}xttdt|D]*}||d}||||||<||<q"WnLt}xFttdt|D]0}|||d}||||||<||<qjWdS)zShuffle list x in place, and return None. Optional argument random is a 0-argument function returning a random float in [0.0, 1.0); if it is the default None, the standard random.random will be used. Nr4)rUreversedranger?rC)r/r0r randbelowrfjrYr1r1r2rs   zRandom.shufflec Cs(t|trt|}t|ts$td|j}t|}d|koD|knsRtddg|}d}|dkr|dtt |dd7}||krt |}xt |D]0}|||} || ||<|||d || <qWnRt } | j } xDt |D]8}||} x| | kr ||} qW| | || ||<qW|S) a=Chooses k unique random elements from a population sequence or set. 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. To choose a sample in a range of integers, use range as an argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) z>Population must be a sequence or set. For dicts, use list(d).rz,Sample larger than population or is negativeNr*r-r4)r9_SetrN _SequencerPrUr?rO_ceil_loglistrhsetadd) r/ populationrarir[resultZsetsizeZpoolrfrjZselectedZ selected_addr1r1r2rs6       z Random.sample) cum_weightsracs|jdkrN|dkr>ttfddt|DSttj|n|dk r^tdttkrvtdt j dtdfddt|DS) zReturn 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. Ncsg|]}qSr1r1)rLrf)rYrtrtotalr1r2 csz"Random.choices..z2Cannot specify both weights and cumulative weightsz3The number of weights does not match the populationr4cs$g|]}dqS)rr1)rLrf)bisectrvhirtrrwr1r2rxlsr7) rrCr?rhrq _itertools accumulaterPrO_bisectry)r/rtZweightsrvrar1)rYryrvrzrtrrwr2r(Ws  zRandom.choicescCs||||jS)zHGet a random number in the range [a, b) or [a, b] depending on rounding.)r)r/rFr\r1r1r2rsszRandom.uniform?c Csx|j}y |dkrdn||||}Wntk r<|SX||kr`d|}d|}||}}|||||dS)zTriangular 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 Ng?g?)rZeroDivisionError)r/ZlowZhighmodeurHr1r1r2r ys   zRandom.triangularcCsT|j}x@|}d|}t|d|}||d}|t| krPqW|||S)z\Normal distribution. mu is the mean, and sigma is the standard deviation. g?g?g@)r NV_MAGICCONSTrp)r/musigmaru1u2zZzzr1r1r2rs   zRandom.normalvariatecCst|j||S)zLog 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/rrr1r1r2rszRandom.lognormvariatecCstd|j |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. g?)rpr)r/Zlambdr1r1r2rszRandom.expovariatecCs|j}|dkrt|Sd|}|td||}xN|}tt|}|||}|} | d||ks~| d|t|kr6Pq6Wd|} | |d| |} |} | dkr|t| t} n|t| t} | S)aFCircular 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?)rTWOPI_sqrt_cos_pir_acos)r/rZkapparsrbrrdrqfZu3Zthetar1r1r2rs&   $zRandom.vonmisesvariatecCs|dks|dkrtd|j}|dkrtd|d}|t}||}x|}d|ko`dknshqHd|}t|d||} |t| } |||} ||| | } | td| dks| t| krH| |SqHWn|dkr|} x| dkr|} qWt|  |Sx|} t|t}|| }|dkrD|d|} nt||| } |}|dkr||| |dkrPn|t| krPqW| |SdS) aZGamma 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 gz*gammavariate: alpha and beta must be > 0.0g?g@gHz>gP?g@N)rOrrLOG4rpr SG_MAGICCONST_e)r/alphabetarZainvZbbbZcccrrvr0rrbrr\pr1r1r2rsJ          zRandom.gammavariatecCs`|j}|j}d|_|dkrT|t}tdtd|}t||}t|||_|||S)zGaussian 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@g?g)rr.rrrpr_sin)r/rrrrZx2piZg2radr1r1r2r!?s  z Random.gausscCs0|j|d}|dkrdS|||j|dSdS)zBeta distribution. Conditions on the parameters are alpha > 0 and beta > 0. Returned values range between 0 and 1. g?rgN)r)r/rryr1r1r2r"ts zRandom.betavariatecCsd|j}d|d|S)z3Pareto distribution. alpha is the shape parameter.g?)r)r/rrr1r1r2r#s zRandom.paretovariatecCs"d|j}|t| d|S)zfWeibull distribution. alpha is the scale parameter and beta is the shape parameter. g?)rrp)r/rrrr1r1r2r$s zRandom.weibullvariate)N)Nr,)N)N)r~rN)$__name__ __module__ __qualname____doc__rJr3rr%r&rRrSrTrCrrBPFr` _MethodType_BuiltinMethodTyperUrrrr(rr rrrrrr!r"r#r$ __classcell__r1r1)rIr2rGs8    ,  :  0H5 c@s8eZdZdZddZddZddZdd ZeZZ d S) r)zAlternate 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)z3Get the next random number in the range [0.0, 1.0).r5r6r-)rCrD_urandom RECIP_BPF)r/r1r1r2rszSystemRandom.randomcCsP|dkrtd|t|kr$td|dd}tjt|d}||d|?S)z:getrandbits(k) -> x. Generates an int with k random bits.rz(number of bits must be greater than zeroz#number of bits should be an integerr5r6)rOrCrPrDr)r/raZnumbytesr0r1r1r2r's  zSystemRandom.getrandbitscOsdS)z&sn     Y!