Datasets:
Download code/load_repo.py from open-index/open-github-issues: direct link, hf CLI and curl.
- Browser
- Download file 648 Bytes
-
https://huggingface.co/datasets/open-index/open-github-issues/resolve/main/code/load_repo.py
- Command line
-
hf download hf://datasets/open-index/open-github-issues/code/load_repo.py
-
curl -L -o load_repo.py https://huggingface.co/datasets/open-index/open-github-issues/resolve/main/code/load_repo.py
648 Bytes
| # /// script | |
| # requires-python = ">=3.11" | |
| # dependencies = ["datasets"] | |
| # /// | |
| """Load pull requests for a specific repo.""" | |
| from datasets import load_dataset | |
| ds = load_dataset( | |
| "open-index/open-github-issues", | |
| "pull_requests", | |
| data_files="data/pull_requests/facebook/react/0.parquet", | |
| ) | |
| df = ds["train"].to_pandas() | |
| print(f"Loaded {len(df)} pull requests") | |
| print(f"Merged: {df['merged'].sum()} ({df['merged'].mean()*100:.1f}%)") | |
| print(f"\nTop 10 by lines changed:") | |
| df["total_lines"] = df["additions"] + df["deletions"] | |
| print(df.nlargest(10, "total_lines")[["number", "additions", "deletions", "total_lines"]].to_string(index=False)) | |