Guest User

Untitled

a guest
Jun 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. None or no argument seeds from current time or from an operating
  2. system specific randomness source if available.
  3.  
  4. if a is None:
  5. try:
  6. a = long(_hexlify(_urandom(16)), 16)
  7. except NotImplementedError:
  8. import time
  9. a = long(time.time() * 256) # use fractional seconds
  10.  
  11. random = self.random
  12. u = random()
  13. while u <= 1e-7:
  14. u = random()
  15. return -_log(u)/lambd
Add Comment
Please, Sign In to add comment