RefineCode (OpenCoder)
RefineCode is the code pretraining corpus assembled for OpenCoder, an open effort to publish not just model weights but the full recipe behind a competitive code language model. The corpus reported in the OpenCoder paper covers roughly 960 billion tokens across around 607 programming languages, drawn from raw source code plus a further body of code-related tokens recalled from web data. Its selling point is reproducibility: the pipeline applies over 130 language-specific filtering rules with tuned weightings, and the authors document each step so others can rebuild or adapt the corpus rather than trust an opaque blob.
Access has an important catch. The Hugging Face release (RefineCode-code-corpus-meta) currently publishes metadata only, chiefly the repository name and file path for each item, covering roughly the half of the corpus that overlaps The Stack v2. The maintainers cite legal considerations for not shipping the complete source code directly. In practice you download the metadata as Parquet and then fetch the referenced files yourself to reconstruct the training set, following the OpenCoder cookbook.
For RAG or AI work this is best treated as a recipe and an index rather than a ready-to-embed dataset. It suits teams pretraining or fine-tuning code models, or anyone who wants a documented, filtered alternative to raw crawls for building a code knowledge base. The main watch-outs are the assembly step (you must gather the actual files) and licensing: the metadata dataset is released under MIT, but the underlying source files carry their own, heterogeneous open-source licences that you are responsible for honouring. If you need the code contents in one download, The Stack v2 (BigCode) is the obvious companion, and for developer Q and A the Stack Exchange data dumps complement code corpora well.
Related sources
DevDocs
An open-source aggregator that pulls API documentation for major programming languages, frameworks, and tools into one searchable place. A tidy RAG source when you want up-to-date developer reference material without scraping dozens of separate documentation sites yourself.
GitHub Public Repositories (GH Archive / GHTorrent)
Two projects that capture public GitHub activity for analysis. GH Archive records the public GitHub event timeline as downloadable hourly archives, and GHTorrent offers a queryable mirror of GitHub metadata. Together they help you mine code, issues, pull requests, and documentation at scale.
Software Heritage
A non-profit universal archive built specifically for software source code, preserving not just files but their full development history. Over 27 billion unique source files collected from public repositories, each identified by a cryptographic hash. The upstream source for The Stack v2.
Stack Exchange Data Dump
Periodic XML dumps of every site in the Stack Exchange network, including Stack Overflow. Each dump holds questions, answers, comments, votes, and user profiles. One of the richest question-and-answer datasets you can freely download, and a natural fit for building technical support and developer RAG systems.