MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS / find_re

Method find_re

models/tokenization_moss.py:355–357  ·  view source on GitHub ↗
(string, pattern, start_pos)

Source from the content-addressed store, hash-verified

353
354 def truncate(self, completion, truncate_before_pattern):
355 def find_re(string, pattern, start_pos):
356 m = pattern.search(string, start_pos)
357 return m.start() if m else -1
358
359 terminals = [re.compile(pattern, re.MULTILINE) for pattern in truncate_before_pattern]
360

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected