# GitHub Code Clean

- **ID:** 1168
- **Kind:** dataset
- **URL:** https://huggingface.co/datasets/codeparrot/github-code-clean
- **Authors:** codeparrot
- **Published:** 2022
- **Source:** huggingface
- **Access:** Free
- **License:** Apache-2.0 (HF card YAML) for the packaging/script. Per-file content licenses are the 15 repo licenses in the license column (script DatasetInfo.license: 'Multiple: see the license field of each sample'). Copyleft GPL/AGPL/LGPL files are included if you load all-all.
- **License family:** Permissive (auto-classified)
- **Topics:** source-code pre-training; 30 programming languages; permissively licensed GitHub files
- **Added:** 2026-08-14
- **Verified:** 2026-08-14
- **Page:** https://papers.projxon.ai/entries/1168

## Summary

Filtered GitHub code pretrain (avg line length, alphanumeric fraction, autogen drop) as a cleaner sibling of codeparrot/github-code

## From the source (fetched 2026-10-03)

- **Repository:** codeparrot/github-code-clean (Hugging Face)
- **Created:** Jun 29, 2022 (Hugging Face)
- **Last updated:** Jul 5, 2022 (Hugging Face)
- **Downloads (last month):** 29,717 (Hugging Face)
- **Likes:** 144 (Hugging Face)
- **Size:** 10M to 100M rows (Hugging Face)
- **Modalities:** text (Hugging Face)

## Dataset profile

- **Scale:** Card/parent 115M files / ~1TB text / parent source-size sum 873 GB. Clean README: 3.39M files removed (2.94%) → remaining ≈111.6M. github-code-clean.py 880 parquet shards data/train-00000-of-00880.parquet … train-00879 (listed train-00000 355.1 MB … train-00009 357.5 MB; train-00879 359.9 MB) → ~314 GB LFS parquet estimate (880×~357 MB; not summed). size_categories 10M<n<100M. Hub/datasets-server all-all train 614.0K / 10 parquet / 1.7 GB is a partial convert (477 failed parquet jobs) — do not catalog 614K as n. usedStorage Unknown. Hub overview 1.2M downloads / 142 likes at check. gated=false.
- **Format:** parquet under data/train-*-of-00880.parquet (880 shards). Columns: code, repo_name, path, language, license, size. Hub configs are language-license products (default all-all; e.g. Python-all, all-mit). Loading script github-code-clean.py (trust_remote_code).
- **Type:** Pretraining corpus / filtered GitHub source files
- **License:** Apache-2.0 (HF card YAML) for the packaging/script. Per-file content licenses are the 15 repo licenses in the license column (script DatasetInfo.license: 'Multiple: see the license field of each sample'). Copyleft GPL/AGPL/LGPL files are included if you load all-all.
- **Cost:** Free
- **Languages:** Source-code (card language tag absent; parent language:code). 30 languages in github-code-clean.py _LANG_TO_EXTENSION (card/description says 32 — catalog script 30). Parent file-count table (approx; clean drops 2.94% Unknown-uniform): Java 19,548,190 / 107.70 GB; C 14,143,113 / 183.83 GB; JavaScript 11,839,883 / 87.82 GB; HTML 11,178,557 / 118.12 GB; PHP 11,177,610 / 61.41 GB; Markdown 8,464,626 / 23.09 GB; C++ 7,380,520 / 87.73 GB; Python 7,226,626 / 52.03 GB; C# 6,811,652 / 36.83 GB; Ruby 4,473,331 / 10.95 GB; Go 2,265,436 / 19.28 GB; TypeScript 1,940,406 / 24.59 GB; CSS 1,734,406 / 22.67 GB; Shell 1,385,648 / 3.01 GB; then Scala–Julia <1M each. Natural-language comments follow each file. No LID table.
- **Modality:** Text-only (source code + markup). No images.
- **Domain:** source-code pre-training; 30 programming languages; permissively licensed GitHub files
- **Time period:** Parent codeparrot/github-code v1.1 BigQuery query executed 2022-03-16 18:23:39 UTC+1 (v1.0 was 2022-02-14). HF createdAt 2022-06-29; lastModified 2022-07-05. One-shot GitHub-on-BigQuery dump plus extra clean filters, not a live scrape.
- **Purpose:** Filtered GitHub code pretrain (avg line length, alphanumeric fraction, autogen drop) as a cleaner sibling of codeparrot/github-code
- **Used for:** CodeParrot / early code-LM pretrain. Hub overview 1.2M downloads / 142 likes at check. Distinct from already-cataloged github-code-2025 (2025 nick007x dump) and from Hub-gated bigcode/the-stack — this is the public BigQuery GitHub dump, not The Stack.
- **Authors:** Hugging Face CodeParrot (loading-script copyright HuggingFace Datasets Authors). File authors are GitHub repo contributors as of the Mar 2022 BigQuery snapshot. License field is the origin repo license (15 OSS licenses), not a single dataset author.
- **Bias:** Permissive-license GitHub only (15 licenses: mit/apache-2.0/gpl-3.0/gpl-2.0/bsd-3-clause/agpl-3.0/lgpl-3.0/lgpl-2.1/bsd-2-clause/cc0-1.0/epl-1.0/mpl-2.0/unlicense/isc/artistic-2.0). Java/C/JS/HTML/PHP dominate file count; C dominates bytes. Markdown/HTML/CSS are markup not compilers. Vendored node_modules still present after the 'clean' filters (preview). Distinct from already-cataloged github-code-2025 / OpenCoder FineWeb Code Corpus / SwallowCode-v2. Do not treat this as a request for gated bigcode/the-stack.
- **Text quality:** Parent dropped lines >1000 chars and exact whitespace-ignoring dups. Clean adds avg line length <100, alphanumeric fraction >0.25, and autogen keyword drop (3.39M files). all-all preview row 0 is a 2,730-byte ES6 Set polyfill nested ~8 node_modules deep in a GPL-2.0 WordPress theme (Socratacom/socrata-europe …/es6-set/polyfill.js) — residual vendored JS the clean filters did not drop. Row 1 is a 266-byte ISC JS class (mshick/velvet core/classes/data.js). Residual: secrets/PII possible (parent card); 2022 snapshot; datasets-server partial 614K is not a quality sample of 111M.
- **Sample size:** Single train split. Default config all-all is the full remaining ~111.6M. Language configs (Python-all, Java-all, …) and license configs (all-mit, all-apache-2.0, …) are filters — not extra n. No val/test. Do not concat with already-cataloged github-code-2025 / OpenCoder FineWeb Code Corpus. Do not add codeparrot/github-code as extra n.
- **Long context:** Mixed (whole files; parent dropped lines >1000 chars; clean avg line <100). Exact token histogram Unknown. Parent 873 GB / 115M ≈ ~7.6 KB/file if both figures hold.
- **Intermediate steps:** Yes (BigQuery GitHub-on-BigQuery files by extension; drop long lines + exact dups; clean: avg line <100, alnum>0.25, autogen keywords). Parent query.sql / github_preprocessing.py live on codeparrot/github-code.
- **Idea quality:** High
- **Novelty:** High (public ~111.6M-file / ~1TB 2022 GitHub code dump vs already-cataloged github-code-2025; Stack remains gated)
- **Text conversion:** Ready parquet; load_dataset('codeparrot/github-code-clean', split='train', streaming=True) uses default all-all. ~314 GB — streaming required. Language/license filters are Hub configs, not extra n. datasets-server 501/partial 614K — do not wait on viewer. Parent codeparrot/github-code is the un-cleaned 115M — do not concat as extra n.
- **Collection method:** Download
- **Static:** Unknown (HF lastModified 2022-07-05; BigQuery window Mar 2022; one-shot).
- **Processed:** Unknown

## Links

- Dataset: https://huggingface.co/datasets/codeparrot/github-code-clean
- Related: https://huggingface.co/datasets/codeparrot/github-code-clean
- Related: https://huggingface.co/datasets/codeparrot/github-code
- Related: https://cloud.google.com/blog/topics/public-datasets/github-on-bigquery-analyze-all-the-open-source-code/
- Related: https://huggingface.co/datasets/nick007x/github-code-2025

## Research notes

- Dump-adjacent public corpus (not in data-source-dump.jsonl). gated=false; public; CuratorBote listed README (340 B), github-code-clean.py (880 shards), and data/train-00000…train-00879 parquet. Catalog remaining ≈111.6M after 3.39M clean drop / parent 115M / ~1TB, not datasets-server partial 614.0K. Cite CodeParrot github-code-clean + parent github-code (BigQuery 2022-03-16). Not in papers_local.csv. Not on the Aug 13 live Datasets sheet export. Substituted ahead of Hub-gated bigcode/the-stack / bigcode/the-stack-v2 / nvidia/Nemotron-Pretraining-Code-v1; skipped HuggingFaceTB/stack-edu (metadata-only; needs gated Stack v2) and Convence/Rust-Coder (too small). Already-cataloged github-code-2025 is a later nick007x dump — do not sum as extra n.

## Related entries

- Related: [GitHub Code 2025](https://papers.projxon.ai/entries/101) (dataset, #101)

## Similar entries

- [UltraData-Code (OpenBMB L0–L3 tiered code pretrain: L2 algorithmic + L3 synthesis)](https://papers.projxon.ai/entries/1035) (dataset, #1035)
- [github-top-code](https://papers.projxon.ai/entries/229) (dataset, #229)
- [Generalization Dynamics of LM Pre-training ("Discovering Mode-Hopping")](https://papers.projxon.ai/entries/820) (paper, #820)
- [Cross-Benchmark Transfer from RL on Agentic Coding Tasks](https://papers.projxon.ai/entries/1245) (paper, #1245)
- [No Second Run: Does RSI Stop at Frontier Pre-training?](https://papers.projxon.ai/entries/1584) (paper, #1584)
- [BigO(Bench): Can LLMs Generate Code with Controlled Time and Space Complexity?](https://papers.projxon.ai/entries/777) (paper, #777)
