Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

brain_re.py 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
  2. # For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
  3. import sys
  4. import astroid
  5. PY36 = sys.version_info >= (3, 6)
  6. if PY36:
  7. # Since Python 3.6 there is the RegexFlag enum
  8. # where every entry will be exposed via updating globals()
  9. def _re_transform():
  10. return astroid.parse('''
  11. import sre_compile
  12. ASCII = sre_compile.SRE_FLAG_ASCII
  13. IGNORECASE = sre_compile.SRE_FLAG_IGNORECASE
  14. LOCALE = sre_compile.SRE_FLAG_LOCALE
  15. UNICODE = sre_compile.SRE_FLAG_UNICODE
  16. MULTILINE = sre_compile.SRE_FLAG_MULTILINE
  17. DOTALL = sre_compile.SRE_FLAG_DOTALL
  18. VERBOSE = sre_compile.SRE_FLAG_VERBOSE
  19. A = ASCII
  20. I = IGNORECASE
  21. L = LOCALE
  22. U = UNICODE
  23. M = MULTILINE
  24. S = DOTALL
  25. X = VERBOSE
  26. TEMPLATE = sre_compile.SRE_FLAG_TEMPLATE
  27. T = TEMPLATE
  28. DEBUG = sre_compile.SRE_FLAG_DEBUG
  29. ''')
  30. astroid.register_module_extender(astroid.MANAGER, 're', _re_transform)