MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / write_jsonl

Function write_jsonl

experiments/benchmark/prepare_hf_benchmark_package.py:26–33  ·  view source on GitHub ↗
(path: Path, rows)

Source from the content-addressed store, hash-verified

24
25
26def write_jsonl(path: Path, rows) -> int:
27 path.parent.mkdir(parents=True, exist_ok=True)
28 count = 0
29 with path.open("w", encoding="utf-8") as handle:
30 for row in rows:
31 handle.write(json.dumps(row, ensure_ascii=False, separators=(",", ":")) + "\n")
32 count += 1
33 return count
34
35
36def copy_if_exists(src: Path, dst: Path) -> None:

Callers 1

prepareFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected