update namespace
Browse files29 unmodified lines303132333334353610 unmodified lines47484950505152539 unmodified lines63646566666768696 unmodified lines767778797980818291 unmodified lines17417517617717717817918032 unmodified lines2132142152162172162172182192204 unmodified lines22522622722822822923023129 unmodified lines```pythonfrom datasets import load_dataset
ds = load_dataset("lvwerra/github-code", streaming=True, split="train")ds = load_dataset("codeparrot/github-code", streaming=True, split="train")print(next(iter(ds)))
#OUTPUT:10 unmodified linesYou can see that besides the code, repo name, and path also the programming language, license, and the size of the file are part of the dataset. You can also filter the dataset for any subset of the 30 included languages (see the full list below) in the dataset. Just pass the list of languages as a list. E.g. if your dream is to build a Codex model for Dockerfiles use the following configuration:
```pythonds = load_dataset("lvwerra/github-code", streaming=True, split="train", languages=["Dockerfile"])ds = load_dataset("codeparrot/github-code", streaming=True, split="train", languages=["Dockerfile"])print(next(iter(ds))["code"])
#OUTPUT:9 unmodified linesWe also have access to the license of the origin repo of a file so we can filter for licenses in the same way we filtered for languages: ```pythonds = load_dataset("lvwerra/github-code", streaming=True, split="train", licenses=["mit", "isc"])ds = load_dataset("codeparrot/github-code", streaming=True, split="train", licenses=["mit", "isc"])
licenses = []for element in iter(ds).take(10_000):6 unmodified lines
Naturally, you can also download the full dataset. Note that this will download ~300GB compressed text data and the uncompressed dataset will take up ~1TB of storage:```pythonds = load_dataset("lvwerra/github-code", split="train")ds = load_dataset("codeparrot/github-code", split="train")```
## Data Structure91 unmodified lines
The dataset contains 115M files and the sum of all the source code file sizes is 873 GB (note that the size of the dataset is larger due to the extra fields). A breakdown per language is given in the plot and table below:

| | Language |File Count| Size (GB)||---:|:-------------|---------:|-------:|32 unmodified lines## Dataset Creation
The dataset was created in two steps:1. Files of with the extensions given in the list above were retrieved from the GitHub dataset on BigQuery (full query [here](https://huggingface.co/datasets/lvwerra/github-code/blob/main/query.sql)). The query was executed on _Mar 16, 2022, 6:23:39 PM UTC+1_.2. Files with lines longer than 1000 characters and duplicates (exact duplicates ignoring whitespaces) were dropped (full preprocessing script [here](https://huggingface.co/datasets/lvwerra/github-code/blob/main/github_preprocessing.py)).1. Files of with the extensions given in the list above were retrieved from the GitHub dataset on BigQuery (full query [here](https://huggingface.co/datasets/codeparrot/github-code/blob/main/query.sql)). The query was executed on _Mar 16, 2022, 6:23:39 PM UTC+1_.2. Files with lines longer than 1000 characters and duplicates (exact duplicates ignoring whitespaces) were dropped (full preprocessing script [here](https://huggingface.co/datasets/codeparrot/github-code/blob/main/github_preprocessing.py)).
## Considerations for Using the Data
4 unmodified linesYou can load any older version of the dataset with the `revision` argument:
```Pythonds = load_dataset("lvwerra/github-code", revision="v1.0")ds = load_dataset("codeparrot/github-code", revision="v1.0")```
### v1.0README.md+8-8