fork(1) download
  1.  
  2. _pattern_type = type(sre_compile.compile("", 0))
  3.  
  4. @functools.lru_cache(maxsize=500, typed=True)
  5. def _compile(pattern, flags):
  6. # internal: compile pattern
  7. if isinstance(pattern, _pattern_type):
  8. if flags:
  9. raise ValueError(
  10. "Cannot process flags argument with a compiled pattern")
  11. return pattern
  12. if not sre_compile.isstring(pattern):
  13. raise TypeError("first argument must be string or compiled pattern")
  14. return sre_compile.compile(pattern, flags)
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty