Mercurial > p > roundup > code
comparison roundup/anypy/random_.py @ 7228:07ce4e4110f5
flake8 fixes: whitespace, remove unused imports
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 18 Mar 2023 14:16:31 -0400 |
| parents | adf54478cdaf |
| children | f002747b6773 |
comparison
equal
deleted
inserted
replaced
| 7227:1e004afe87bb | 7228:07ce4e4110f5 |
|---|---|
| 18 is_weak = False | 18 is_weak = False |
| 19 else: | 19 else: |
| 20 # don't completely throw away the existing state, but add some | 20 # don't completely throw away the existing state, but add some |
| 21 # more random state to the existing state | 21 # more random state to the existing state |
| 22 def seed(v=None): | 22 def seed(v=None): |
| 23 import os, time | 23 import os |
| 24 import time | |
| 24 _r.seed((_r.getstate(), | 25 _r.seed((_r.getstate(), |
| 25 v, | 26 v, |
| 26 hasattr(os, 'getpid') and os.getpid(), | 27 hasattr(os, 'getpid') and os.getpid(), |
| 27 time.time())) | 28 time.time())) |
| 28 | 29 |
