MCPcopy Index your code
hub / github.com/idank/explainshell / sample_files

Function sample_files

tools/experiments/eval_size_routing.py:49–60  ·  view source on GitHub ↗
(
    root: str, n_per_bucket: int, seed: int
)

Source from the content-addressed store, hash-verified

47
48
49def sample_files(
50 root: str, n_per_bucket: int, seed: int
51) -> list[tuple[tuple[int, int], str]]:
52 by_bucket = collect_files(root)
53 rng = random.Random(seed)
54 out: list[tuple[tuple[int, int], str]] = []
55 for b in BUCKETS:
56 pool = by_bucket.get(b, [])
57 rng.shuffle(pool)
58 for p in pool[:n_per_bucket]:
59 out.append((b, p))
60 return out
61
62
63def opt_key(o: Option) -> tuple:

Callers 1

mainFunction · 0.85

Calls 1

collect_filesFunction · 0.85

Tested by

no test coverage detected