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

Function _translate_glob

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

Translate a glob PATTERN to a regular expression.

(pat)

Source from the content-addressed store, hash-verified

648
649
650def _translate_glob(pat):
651 """Translate a glob PATTERN to a regular expression."""
652 translated_parts = []
653 for part in _iexplode_path(pat):
654 translated_parts.append(_translate_glob_part(part))
655 os_sep_class = '[%s]' % re.escape(SEPARATORS)
656 res = _join_translated(translated_parts, os_sep_class)
657 return '{res}\\Z(?ms)'.format(res=res)
658
659
660def _join_translated(translated_parts, os_sep_class):

Callers 1

_compile_patternFunction · 0.85

Calls 3

_iexplode_pathFunction · 0.85
_translate_glob_partFunction · 0.85
_join_translatedFunction · 0.85

Tested by

no test coverage detected