MCPcopy Create free account
hub / github.com/idank/explainshell / collect_files

Function collect_files

tools/experiments/eval_size_routing.py:34–46  ·  view source on GitHub ↗
(root: str)

Source from the content-addressed store, hash-verified

32
33
34def collect_files(root: str) -> list[tuple[tuple[int, int], str]]:
35 by_bucket: dict[tuple[int, int], list[str]] = defaultdict(list)
36 for dp, _, files in os.walk(root):
37 for f in files:
38 if not f.endswith(".gz"):
39 continue
40 p = os.path.join(dp, f)
41 sz = os.path.getsize(p)
42 for lo, hi in BUCKETS:
43 if lo < sz <= hi:
44 by_bucket[(lo, hi)].append(p)
45 break
46 return by_bucket
47
48
49def sample_files(

Callers 1

sample_filesFunction · 0.85

Calls 1

walkMethod · 0.80

Tested by

no test coverage detected