ffho.py 451 B

123456789101112131415161718192021222324
  1. import re
  2. def re_replace (pattern, replacement, string):
  3. return re.sub (pattern, replacement, string)
  4. def re_search (pattern, string, flags = 0):
  5. return re.search (pattern, string, flags)
  6. def is_bool (value):
  7. return type (value) == bool
  8. def any_item_in_list (items, list):
  9. return len(set(items).intersection(set(list))) != 0
  10. def cmp (x, y):
  11. """
  12. Most generic comparator
  13. """
  14. if x < y:
  15. return -1
  16. elif x == y:
  17. return 0
  18. else:
  19. return 1