---
dataset_info:
- config_name: C#
features:
- name: id
dtype: int64
- name: file_name
dtype: string
- name: file_path
dtype: string
- name: content
dtype: string
- name: size
dtype: int64
- name: language
dtype: string
- name: extension
dtype: string
- name: total_lines
dtype: int64
- name: avg_line_length
dtype: float64
- name: max_line_length
dtype: int64
- name: alphanum_fraction
dtype: float64
- name: repo_name
dtype: string
- name: repo_stars
dtype: int64
- name: repo_forks
dtype: int64
- name: repo_open_issues
dtype: int64
- name: repo_license
dtype: string
- name: repo_extraction_date
dtype: string
- name: exact_duplicates_stackv2
dtype: bool
- name: exact_duplicates_stackv1
dtype: bool
- name: exact_duplicates_redpajama
dtype: bool
- name: exact_duplicates_githubcode
dtype: bool
- name: near_duplicates_stackv2
dtype: bool
- name: near_duplicates_stackv1
dtype: bool
- name: near_duplicates_redpajama
dtype: bool
- name: near_duplicates_githubcode
dtype: bool
splits:
- name: train
num_bytes: 22811926779.002216
num_examples: 3257456
download_size: 5021635791
dataset_size: 22811926779.002216
- config_name: C++
features:
- name: id
dtype: int64
- name: file_name
dtype: string
- name: file_path
dtype: string
- name: content
dtype: string
- name: size
dtype: int64
- name: language
dtype: string
- name: extension
dtype: string
- name: total_lines
dtype: int64
- name: avg_line_length
dtype: float64
- name: max_line_length
dtype: int64
- name: alphanum_fraction
dtype: float64
- name: repo_name
dtype: string
- name: repo_stars
dtype: int64
- name: repo_forks
dtype: int64
- name: repo_open_issues
dtype: int64
- name: repo_license
dtype: string
- name: repo_extraction_date
dtype: string
- name: sha
dtype: string
- name: exact_duplicates_stackv2
dtype: bool
- name: exact_duplicates_stackv1
dtype: bool
- name: exact_duplicates_redpajama
dtype: bool
- name: exact_duplicates_githubcode
dtype: bool
- name: near_duplicates_stackv2
dtype: bool
- name: near_duplicates_stackv1
dtype: bool
- name: near_duplicates_redpajama
dtype: bool
- name: near_duplicates_githubcode
dtype: bool
splits:
- name: train
num_bytes: 58162667698
num_examples: 4811620
download_size: 17132883733
dataset_size: 58162667698
- config_name: Go
features:
- name: id
dtype: int64
- name: file_name
dtype: string
- name: file_path
dtype: string
- name: content
dtype: string
- name: size
dtype: int64
- name: language
dtype: string
- name: extension
dtype: string
- name: total_lines
dtype: int64
- name: avg_line_length
dtype: float64
- name: max_line_length
dtype: int64
- name: alphanum_fraction
dtype: float64
- name: repo_name
dtype: string
- name: repo_stars
dtype: int64
- name: repo_forks
dtype: int64
- name: repo_open_issues
dtype: int64
- name: repo_license
dtype: string
- name: repo_extraction_date
dtype: string
- name: exact_duplicates_stackv2
dtype: bool
- name: exact_duplicates_stackv1
dtype: bool
- name: exact_duplicates_redpajama
dtype: bool
- name: near_duplicates_stackv2
dtype: bool
- name: near_duplicates_githubcode
dtype: bool
- name: near_duplicates_stackv1
dtype: bool
- name: near_duplicates_redpajama
dtype: bool
- name: exact_duplicates_githubcode
dtype: bool
splits:
- name: train
num_bytes: 25708034963.017513
num_examples: 2328529
download_size: 7615513273
dataset_size: 25708034963.017513
- config_name: JavaScript
features:
- name: id
dtype: int64
- name: file_name
dtype: string
- name: file_path
dtype: string
- name: content
dtype: string
- name: size
dtype: int64
- name: language
dtype: string
- name: extension
dtype: string
- name: total_lines
dtype: int64
- name: avg_line_length
dtype: float64
- name: max_line_length
dtype: int64
- name: alphanum_fraction
dtype: float64
- name: repo_name
dtype: string
- name: repo_stars
dtype: int64
- name: repo_forks
dtype: int64
- name: repo_open_issues
dtype: int64
- name: repo_license
dtype: string
- name: repo_extraction_date
dtype: string
- name: sha
dtype: string
- name: exact_duplicates_stackv2
dtype: bool
- name: exact_duplicates_stackv1
dtype: bool
- name: exact_duplicates_redpajama
dtype: bool
- name: exact_duplicates_githubcode
dtype: bool
- name: near_duplicates_stackv2
dtype: bool
- name: near_duplicates_redpajama
dtype: bool
- name: near_duplicates_stackv1
dtype: bool
- name: near_duplicates_githubcode
dtype: bool
splits:
- name: train
num_bytes: 88089008097
num_examples: 3393747
download_size: 29083527124
dataset_size: 88089008097
- config_name: Mathematica
features:
- name: id
dtype: int64
- name: file_name
dtype: string
- name: file_path
dtype: string
- name: content
dtype: string
- name: size
dtype: int64
- name: language
dtype: string
- name: extension
dtype: string
- name: total_lines
dtype: int64
- name: avg_line_length
dtype: float64
- name: max_line_length
dtype: int64
- name: alphanum_fraction
dtype: float64
- name: repo_name
dtype: string
- name: repo_stars
dtype: int64
- name: repo_forks
dtype: int64
- name: repo_open_issues
dtype: int64
- name: repo_license
dtype: string
- name: repo_extraction_date
dtype: string
- name: exact_duplicates_stackv2
dtype: bool
- name: exact_duplicates_stackv1
dtype: bool
- name: exact_duplicates_redpajama
dtype: bool
- name: near_duplicates_stackv2
dtype: bool
- name: near_duplicates_stackv1
dtype: bool
- name: near_duplicates_redpajama
dtype: bool
splits:
- name: train
num_bytes: 1726622636.5769868
num_examples: 21208
download_size: 2517493011
dataset_size: 1726622636.5769868
- config_name: PHP
features:
- name: id
dtype: int64
- name: file_name
dtype: string
- name: file_path
dtype: string
- name: content
dtype: string
- name: size
dtype: int64
- name: language
dtype: string
- name: extension
dtype: string
- name: total_lines
dtype: int64
- name: avg_line_length
dtype: float64
- name: max_line_length
dtype: int64
- name: alphanum_fraction
dtype: float64
- name: repo_name
dtype: string
- name: repo_stars
dtype: int64
- name: repo_forks
dtype: int64
- name: repo_open_issues
dtype: int64
- name: repo_license
dtype: string
- name: repo_extraction_date
dtype: string
- name: exact_duplicates_stackv2
dtype: bool
- name: exact_duplicates_stackv1
dtype: bool
- name: exact_duplicates_redpajama
dtype: bool
- name: exact_duplicates_githubcode
dtype: bool
- name: near_duplicates_stackv2
dtype: bool
- name: near_duplicates_stackv1
dtype: bool
- name: near_duplicates_redpajama
dtype: bool
- name: near_duplicates_githubcode
dtype: bool
splits:
- name: train
num_bytes: 24815902335.091496
num_examples: 3310243
download_size: 7216387029
dataset_size: 24815902335.091496
- config_name: Python
features:
- name: id
dtype: int64
- name: file_name
dtype: string
- name: file_path
dtype: string
- name: content
dtype: string
- name: size
dtype: int64
- name: language
dtype: string
- name: extension
dtype: string
- name: total_lines
dtype: int64
- name: avg_line_length
dtype: float64
- name: max_line_length
dtype: int64
- name: alphanum_fraction
dtype: float64
- name: repo_name
dtype: string
- name: repo_stars
dtype: int64
- name: repo_forks
dtype: int64
- name: repo_open_issues
dtype: int64
- name: repo_license
dtype: string
- name: repo_extraction_date
dtype: string
- name: exact_duplicates_stackv2
dtype: bool
- name: exact_duplicates_redpajama
dtype: bool
- name: exact_duplicates_stackv1
dtype: bool
- name: near_duplicates_stackv2
dtype: bool
- name: near_duplicates_stackv1
dtype: bool
- name: near_duplicates_redpajama
dtype: bool
- name: near_duplicates_codeparrot
dtype: bool
- name: near_duplicates_githubcode
dtype: bool
- name: exact_duplicates_githubcode
dtype: bool
- name: exact_duplicates_codeparrot
dtype: bool
splits:
- name: train
num_bytes: 22624459269.102272
num_examples: 1595919
download_size: 5020460397
dataset_size: 22624459269.102272
configs:
- config_name: C#
data_files:
- split: train
path: data/C#/train-*
- config_name: C++
data_files:
- split: train
path: data/C++/train-*
- config_name: Go
data_files:
- split: train
path: data/Go/train-*
- config_name: JavaScript
data_files:
- split: train
path: data/JavaScript/train-*
- config_name: Mathematica
data_files:
- split: train
path: data/Mathematica/train-*
- config_name: PHP
data_files:
- split: train
path: data/PHP/train-*
- config_name: Python
data_files:
- split: train
path: data/Python/train-*
---
# DISCLAIMER
This represents only a subset of the final dataset (taking into account the new HuggingFace LFS storage limits). The complete dataset will be released following the camera-ready submission of our paper.
# The Heap Dataset
We develop **The Heap**, a new contamination-free multilingual code dataset comprising 57 languages, which facilitates LLM evaluation reproducibility. The reproduction packge can be found [here](https://anonymous.4open.science/r/heap-forge/README.md).
# Is your code in The Heap?
An opt-out mechanism will be provided for the final release of the dataset.
# Collection
We collect up to **50,000** public repositories using the [GitHub API](https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28), focusing on *license type*, *star count*, and *creation date*. Repositories with non-permissive licenses are prioritized to reduce contamination, as public code datasets we deduplicate against primarily focus on permissive or no-license repositories. We select repositories created before **August 2024** in decreasing order of their star counts. To handle GitHub rate limits, we use timeouts and pagination during the scraping process.
### Copyleft licenses included in the The Heap
| **License** | **Family** |
| :--------: | :-------: |
| CECILL-1.0, CECILL-1.1, CECILL-2.0,
CECILL-2.1, CECILL-C, EPL-1.0, EPL-2.0,
LGPL-2.1, LGPL-3.0, MS-RL, MPL-2.0 | Weak Copyleft |
| GPL-2.0, GPL-3.0 | Strong Copyleft |
| AGPL-3.0, EUPL-1.1, EUPL-1.2, OSL-3.0 | Network Copyleft |
The features we extract for each repository are illustrated in the example below.
```json
{
"id": 126178683,
"full_name": "halo-dev/halo",
"html_url": "https://github.com/halo-dev/halo",
"stargazers_count": 29115,
"forks_count": 8985,
"watchers_count": 29115,
"open_issues_count": 278,
"language": "Java",
"created_at": "2018-03-21T12:56:52Z",
"pushed_at": "2023-10-28T16:29:39Z",
"license": {
"key": "gpl-3.0",
"name": "GNU General Public License v3.0",
"spdx_id": "GPL-3.0",
"url": "https://api.github.com/licenses/gpl-3.0",
"node_id": "MDc6TGljZW5zZTk="
},
"retrieval_date": "10/30/2023, 3:24:57 PM (Europe/Amsterdam)"
}
```
### Repository Fields
- **id**: unique id of the repo
- **full_name**: complete name of the repo
- **html_url**: URL to the repo
- **stargazers_count**: number of stars of the repo
- **forks_count**: number of forks of the repo
- **watchers_count**: number of watchers of the repo
- **open_issues_count**: number of open issues of the repo at the extraction time
- **language**: main language of the repo
- **created_at**: creation date of the repo
- **pushed_at**: date of the most recent push to the repo until the extraction date
- **license**: license type of the repo
- **retrieval_date**: date when the repo was scraped from GitHub
We start by retrieving repositories with more than **900** stars using **two-month tumbling windows**. If we hit the **1000** repository limit per window (for a personal GitHub account), we shorten the
search space to a **one-month window** and restart the iteration. Otherwise, the window advances by two months. Once the entire timeframe (until **August 2024**) is covered, we reduce the star search space: between **900** and **100** stars, we decrease the interval by **50** (e.g. search between [900, 850]), between **100** and **10** stars, we decrease the interval by **10**, and for the last **10** stars, we decrease by **1**. Since most repositories fall within the **0-100 star range** (e.g. Figure 1 showcases the distribution of repositories with up to **500** stars for Java), using the **creation date** and **star count** filters helps us avoid API limits and scrape more data by narrowing the search space.
The creation date window can be reduced even further (week or day level), in order to extract more data. We remove any potential duplicated repositories obtained due to the pagination process. Lastly, we extract all the files corresponding to each language. We extend the programming languages extension list used for [The Stack](https://gist.github.com/ppisarczyk/43962d06686722d26d176fad46879d41) with 4 languages: EJS, Raku, Starlark, and WebAssembly.
Figure 1: Distribution of scraped repositories with at most 500 stars for Java