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

Function write_csv

experiments/drift/build_drift_adaptation_experiment.py:483–493  ·  view source on GitHub ↗
(path: Path, rows: Sequence[Dict[str, Any]])

Source from the content-addressed store, hash-verified

481
482
483def write_csv(path: Path, rows: Sequence[Dict[str, Any]]) -> None:
484 path.parent.mkdir(parents=True, exist_ok=True)
485 if not rows:
486 path.write_text("", encoding="utf-8")
487 return
488 fields = list(rows[0].keys())
489 with path.open("w", encoding="utf-8", newline="") as handle:
490 writer = csv.DictWriter(handle, fieldnames=fields)
491 writer.writeheader()
492 for row in rows:
493 writer.writerow(row)
494
495
496def write_markdown(path: Path, rows: Sequence[Dict[str, Any]], context: Dict[str, Any]) -> None:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected