MCPcopy Index your code
hub / github.com/python/cpython / _compile_pattern

Function _compile_pattern

Lib/fnmatch.py:43–50  ·  view source on GitHub ↗
(pat)

Source from the content-addressed store, hash-verified

41
42@functools.lru_cache(maxsize=32768, typed=True)
43def _compile_pattern(pat):
44 if isinstance(pat, bytes):
45 pat_str = str(pat, 'ISO-8859-1')
46 res_str = translate(pat_str)
47 res = bytes(res_str, 'ISO-8859-1')
48 else:
49 res = translate(pat)
50 return re.compile(res).match
51
52
53def filter(names, pat):

Callers 3

filterFunction · 0.70
filterfalseFunction · 0.70
fnmatchcaseFunction · 0.70

Calls 3

strFunction · 0.85
translateFunction · 0.70
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…