MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / capture

Method capture

examples/server/server.py:4510–4512  ·  view source on GitHub ↗
(match: re.Match[str])

Source from the content-addressed store, hash-verified

4508 strings: List[str] = []
4509
4510 def capture(match: re.Match[str]) -> str:
4511 strings.append(match.group(1))
4512 return f"\x00{len(strings) - 1}\x00"
4513
4514 stripped = text.strip()
4515 if stripped.startswith("[") and stripped.endswith("]"):

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected