MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / write_category_exports

Function write_category_exports

tools/commitlist.py:603–623  ·  view source on GitHub ↗
(
    export_dir: Path, rows: list[CommitRow]
)

Source from the content-addressed store, hash-verified

601
602
603def write_category_exports(
604 export_dir: Path, rows: list[CommitRow]
605) -> list[Path]:
606 export_dir.mkdir(parents=True, exist_ok=True)
607 written_files: list[Path] = []
608 categories = ordered_values((row.category for row in rows), PR_CATEGORIES)
609 for category in categories:
610 category_rows = [row for row in rows if row.category == category]
611 if not category_rows:
612 continue
613 category_name = category_output_name(category)
614 category_dir = export_dir / category_name
615 markdown_path = category_dir / f'result_{category_name}.md'
616 csv_path = category_dir / f'result_{category_name}.csv'
617 markdown_path.parent.mkdir(parents=True, exist_ok=True)
618 markdown_path.write_text(
619 render_category_markdown(category, category_rows)
620 )
621 write_csv(csv_path, category_rows)
622 written_files.extend([markdown_path, csv_path])
623 return written_files
624
625
626def parse_args() -> argparse.Namespace:

Callers 1

mainFunction · 0.85

Calls 5

ordered_valuesFunction · 0.85
category_output_nameFunction · 0.85
render_category_markdownFunction · 0.85
write_csvFunction · 0.85
extendMethod · 0.45

Tested by

no test coverage detected