MCPcopy Index your code
hub / github.com/microsoft/SandDance / _compile_pattern

Function _compile_pattern

python/jupyter-widget/setupbase.py:621–630  ·  view source on GitHub ↗

Translate and compile a glob pattern to a regular expression matcher.

(pat, ignore_case=True)

Source from the content-addressed store, hash-verified

619
620
621def _compile_pattern(pat, ignore_case=True):
622 """Translate and compile a glob pattern to a regular expression matcher."""
623 if isinstance(pat, bytes):
624 pat_str = pat.decode('ISO-8859-1')
625 res_str = _translate_glob(pat_str)
626 res = res_str.encode('ISO-8859-1')
627 else:
628 res = _translate_glob(pat)
629 flags = re.IGNORECASE if ignore_case else 0
630 return re.compile(res, flags=flags).match
631
632
633def _iexplode_path(path):

Callers 1

_get_filesFunction · 0.85

Calls 1

_translate_globFunction · 0.85

Tested by

no test coverage detected