MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / parse_pattern

Function parse_pattern

subprojects/llama.cpp/scripts/compare-logprobs.py:193–202  ·  view source on GitHub ↗
(pattern: str)

Source from the content-addressed store, hash-verified

191
192
193def parse_pattern(pattern: str) -> list[tuple[bool, int]]:
194 parts = pattern.split(",")
195 result = []
196 for i, part in enumerate(parts):
197 n = int(part)
198 if i % 2 == 0:
199 result.append((True, n)) # get n words
200 else:
201 result.append((False, n)) # skip n words
202 return result
203
204
205def parse_args() -> argparse.Namespace:

Callers 1

mainFunction · 0.85

Calls 2

splitMethod · 0.65
appendMethod · 0.65

Tested by

no test coverage detected