utils.py 296 B

1234567891011121314151617181920
  1. import random
  2. class utils:
  3. @staticmethod
  4. def random():
  5. return random.random()
  6. """
  7. provide "." access to dictionaries
  8. example: d = {'a':1}
  9. before: d['a'] => 1, d.a => error
  10. after: d['a'] = d.a
  11. """
  12. class _bunch:
  13. def __init__(self, **kwds):
  14. self.__dict__.update(kwds)