class_docstr: 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.
class_docstr_tok: ["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","."]
docstr: 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.
docstr_tok: ["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","."]
code: def seed(self, a=None, version=2):
      """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.
  
      """
  
      if version == 1 and isinstance(a, (str, bytes)):
          a = a.decode("latin-1") if isinstance(a, bytes) else a
          x = ord(a[0]) << 7 if a else 0
          for c in map(ord, a):
              x = ((1000003 * x) ^ c) & 0xFFFFFFFFFFFFFFFF
          x ^= len(a)
          a = -2 if x == -1 else x
  
      elif version == 2 and isinstance(a, (str, bytes, bytearray)):
          global _sha512
          if _sha512 is None:
              try:
                  # hashlib is pretty heavy to load, try lean internal
                  # module first
                  from _sha2 import sha512 as _sha512
              except ImportError:
                  # fallback to official implementation
                  from hashlib import sha512 as _sha512
  
          if isinstance(a, str):
              a = a.encode()
          a = int.from_bytes(a + _sha512(a).digest())
  
      elif not isinstance(
          a, (type(None), int, float, str, bytes, bytearray)
      ):
          raise TypeError(
              "The only supported seed types are:\n"
              "None, int, float, str, bytes, and bytearray."
          )
  
      super().seed(a)
      self.gauss_next = None
  
imports: from math import log, exp, pi, e, ceil
  from math import sqrt, acos, cos, sin
  from math import tau, floor, isfinite
  from math import lgamma, fabs, log2
  from os import urandom
  from _collections_abc import Sequence
  from operator import index
  from itertools import accumulate, repeat
  from bisect import bisect
  import os
  import _random
label_desc: Use image node_id 2 for calling the Random obj's underlying member method code with example usage: obj.seed(a, version) without return types