(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.
Initialize internal state from a seed.
Initialize internal state from a seed .
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)):
            if isinstance(a, str):
                a = a.encode()
            a = int.from_bytes(a + _sha512(a).digest(), 'big')

        elif not isinstance(a, (type(None), int, float, str, bytes, bytearray)):
            _warn('Seeding based on hashing is deprecated\n'
                  'since Python 3.9 and will be removed in a subsequent '
                  'version. The only \n'
                  'supported seed types are: None, '
                  'int, float, str, bytes, and bytearray.',
                  DeprecationWarning, 2)

        super().seed(a)
        self.gauss_next = None
def seed ( self , a = None , version = 2 ) : 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 ) ) : if isinstance ( a , str ) : a = a . encode ( ) a = int . from_bytes ( a + _sha512 ( a ) . digest ( ) , 'big' ) elif not isinstance ( a , ( type ( None ) , int , float , str , bytes , bytearray ) ) : _warn ( 'Seeding based on hashing is deprecated\n' 'since Python 3.9 and will be removed in a subsequent ' 'version. The only \n' 'supported seed types are: None, ' 'int, float, str, bytes, and bytearray.' , DeprecationWarning , 2 ) super ( ) . seed ( a ) self . gauss_next = None