(root: str)
| 32 | |
| 33 | |
| 34 | def 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 | |
| 49 | def sample_files( |