MCPcopy Create free account
hub / github.com/Tencent/hpc-ops / write_csv

Function write_csv

benchmark/sampler/benchmark_sampler.py:423–429  ·  view source on GitHub ↗
(path: str, rows: list[dict])

Source from the content-addressed store, hash-verified

421
422
423def write_csv(path: str, rows: list[dict]) -> None:
424 if not path or not rows:
425 return
426 with Path(path).open("w", newline="") as f:
427 writer = csv.DictWriter(f, fieldnames=list(rows[0].keys()))
428 writer.writeheader()
429 writer.writerows(rows)
430
431
432def write_jsonl(path: str, rows: list[dict]) -> None:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected