MCPcopy Index your code
hub / github.com/tensorflow/tfjs / Match

Function Match

tfjs-backend-wasm/tools/cpplint.py:657–664  ·  view source on GitHub ↗

Matches the string with the pattern, caching the compiled regexp.

(pattern, s)

Source from the content-addressed store, hash-verified

655
656
657def Match(pattern, s):
658 """Matches the string with the pattern, caching the compiled regexp."""
659 # The regexp compilation caching is inlined in both Match and Search for
660 # performance reasons; factoring it out into a separate function turns out
661 # to be noticeably expensive.
662 if pattern not in _regexp_compile_cache:
663 _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
664 return _regexp_compile_cache[pattern].match(s)
665
666
667def ReplaceAll(pattern, rep, s):

Callers 15

IsInAlphabeticalOrderMethod · 0.85
CheckMethod · 0.85
CleanseRawStringsFunction · 0.85
_CollapseStringsMethod · 0.85
CloseExpressionFunction · 0.85
GetIndentLevelFunction · 0.85
CheckForHeaderGuardFunction · 0.85
CheckEndMethod · 0.85
CheckEndMethod · 0.85

Calls 1

compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…