MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / fallback_sample

Function fallback_sample

benchmarks/run_benchmarks.py:373–383  ·  view source on GitHub ↗

If token-savior didn't run, derive a symbol-ish sample from .py basenames.

(root: Path)

Source from the content-addressed store, hash-verified

371
372
373def fallback_sample(root: Path) -> list[str]:
374 """If token-savior didn't run, derive a symbol-ish sample from .py basenames."""
375 cands: list[str] = []
376 for dirpath, _, files in os.walk(root):
377 for f in files:
378 if f.endswith(".py") and not f.startswith("_"):
379 cands.append(f[:-3])
380 if not cands:
381 return []
382 rng = random.Random(RANDOM_SEED)
383 return rng.sample(cands, min(NUM_QUERY_SAMPLES, len(cands)))
384
385
386# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected