MCPcopy Create free account
hub / github.com/openai/plugins / write_tsv

Function write_tsv

plugins/ngs-analysis/scripts/run_fastq_assay_package.py:663–675  ·  view source on GitHub ↗
(path: Path, rows: list[dict[str, Any]], fieldnames: list[str] | None = None)

Source from the content-addressed store, hash-verified

661
662
663def write_tsv(path: Path, rows: list[dict[str, Any]], fieldnames: list[str] | None = None) -> None:
664 path.parent.mkdir(parents=True, exist_ok=True)
665 if fieldnames is None:
666 keys: list[str] = []
667 for row in rows:
668 for key in row:
669 if key not in keys:
670 keys.append(key)
671 fieldnames = keys
672 with path.open("w", newline="", encoding="utf-8") as handle:
673 writer = csv.DictWriter(handle, fieldnames=fieldnames, delimiter="\t")
674 writer.writeheader()
675 writer.writerows(rows)
676
677
678def path_has_synthetic_marker(path: Path | None) -> bool:

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected