File size: 5,837 Bytes
b53a39b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1af5124
 
60193bf
 
 
df4e1f0
 
 
 
 
 
 
 
 
 
60193bf
186b1fc
 
60193bf
 
 
 
 
 
 
186b1fc
d4eb473
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
---
annotations_creators: 
- crowdsourced
license: other
language_creators:
- crowdsourced
language:
- code
task_categories:
- text-generation
tags:
- code, kotlin, native Android development
size_categories:
- 100K<n<1M
source_datasets: []
pretty_name: iva-kotlin-codeint-raw
task_ids:
- language-modeling
---

# IVA Kotlin GitHub Code Dataset

## Dataset Description

This is the raw IVA Kotlin dataset extracted from GitHub. 
It contains uncurated Kotlin files gathered with the purpose to train a code generation model.

The dataset consists of 464215 kotlin code files from GitHub totaling ~361 MB of data. 
The dataset was created from the public GitHub dataset on Google BiqQuery.

### How to use it

To download the full dataset:

```python
from datasets import load_dataset
dataset = load_dataset('mvasiliniuc/iva-kotlin-codeint', split='train')
```

```python

from datasets import load_dataset
dataset = load_dataset('mvasiliniuc/iva-kotlin-codeint', split='train')
print(dataset[723])

#OUTPUT:
{
   "repo_name":"nemerosa/ontrack",
   "path":"ontrack-extension-notifications/src/main/java/net/nemerosa/ontrack/extension/notifications/webhooks/WebhookController.kt",
   "copies":"1",
   "size":"3248",
   "content":"...@RestController\n@RequestMapping(\"/extension/notifications/webhook\")\nclass WebhookController(\n    private val webhookAdminService: WebhookAdminService,\n    private val webhookExecutionService: ",
   "license":"mit"
}
```

## Data Structure

### Data Fields

|Field|Type|Description|
|---|---|---|
|repo_name|string|name of the GitHub repository|
|path|string|path of the file in GitHub repository|
|copies|string|number of occurrences in dataset|
|code|string|content of source file|
|size|string|size of the source file in bytes|
|license|string|license of GitHub repository|

### Instance

```json
{
   "repo_name":"nemerosa/ontrack",
   "path":"ontrack-extension-notifications/src/main/java/net/nemerosa/ontrack/extension/notifications/webhooks/WebhookController.kt",
   "copies":"1",
   "size":"3248",
   "content":"...@RestController\n@RequestMapping(\"/extension/notifications/webhook\")\nclass WebhookController(\n    private val webhookAdminService: WebhookAdminService,\n    private val webhookExecutionService: ",
   "license":"mit"
}
```

## Languages

The dataset contains only Kotlin files.

```json
{
    "Kotlin": [".kt"]
}
```

## Licenses

Each entry in the dataset contains the associated license. The following is a list of licenses involved and their occurrences.

```json
{
    "agpl-3.0": 9146,
    "apache-2.0": 272388,
    "artistic-2.0": 219,
    "bsd-2-clause": 896,
    "bsd-3-clause": 12328,
    "cc0-1.0": 411,
    "epl-1.0": 2111,
    "gpl-2.0": 11080,
    "gpl-3.0": 48911,
    "isc": 997,
    "lgpl-2.1": 297,
    "lgpl-3.0": 7749,
    "mit": 92540,
    "mpl-2.0": 3386,
    "unlicense": 1756
}
```

## Dataset Statistics

```json
{
    "Total size": "~361 MB",
    "Number of files": 464215,
    "Number of files under 500 bytes": 99845,
    "Average file size in bytes": 3252,
}
```

## Dataset Creation

The dataset was created using Google Query for Github: 
https://cloud.google.com/blog/topics/public-datasets/github-on-bigquery-analyze-all-the-open-source-code

The following steps were pursued for data
gathering:
1. Creation of a dataset and a table in Google Big Query Project.
2. Creation of a bucket in Google Cloud Storage.
3. Creation of a query in Google Big Query Project.
4. Running the query with the setting to output the results in the dataset and table
created at step one.
5. Exporting the resulting dataset into the bucket created in step 2. Export format of JSON with gzip compression.

The result of these steps leads to the following results:
* 2.7 TB Processed, 
* number of extracted rows/files was 464,215 
* total logical bytes  1.46 GB. 
* the result amounts to 7 json.gz files in a total of 361 MB.

The SQL Query used is:
```sql
SELECT
  f.repo_name, f.path, c.copies, c.size, c.content, l.license
FROM
 (select f.*, row_number() over (partition by id order by path desc) as seqnum from `bigquery-public-data.github_repos.files` AS f) f
JOIN
  `bigquery-public-data.github_repos.contents` AS c
ON
  f.id = c.id AND seqnum=1
JOIN
  `bigquery-public-data.github_repos.licenses` AS l
ON
  f.repo_name = l.repo_name
WHERE
  NOT c.binary AND ((f.path LIKE '%.kt') AND (c.size BETWEEN 0 AND 1048575))
```

## Data Splits
The dataset only contains a train split.

Using the curated version of this dataset, a split was made into multiple repositories:
* Clean Version: https://huggingface.co/datasets/mvasiliniuc/iva-kotlin-codeint-clean
* Clean Version Train: https://huggingface.co/datasets/mvasiliniuc/iva-kotlin-codeint-clean-train
* Clean Version Valid: https://huggingface.co/datasets/mvasiliniuc/iva-kotlin-codeint-clean-valid

# Considerations for Using the Data

The dataset comprises source code from various repositories, potentially containing harmful or biased code, 
along with sensitive information such as passwords or usernames.

# Additional Information

## Dataset Curators

[mircea.dev@icloud.com](mircea.dev@icloud.com)

## Licensing Information

* The license of this open-source dataset is: other.
* The dataset is gathered from open-source repositories on [GitHub using BigQuery](https://cloud.google.com/blog/topics/public-datasets/github-on-bigquery-analyze-all-the-open-source-code). 
* Find the license of each entry in the dataset in the corresponding license column.

## Citation Information

```json
@misc {mircea_vasiliniuc_2023,
	author       = { {Mircea Vasiliniuc} },
	title        = { iva-kotlin-codeint (Revision 1af5124) },
	year         = 2023,
	url          = { https://huggingface.co/datasets/mvasiliniuc/iva-kotlin-codeint },
	doi          = { 10.57967/hf/0779 },
	publisher    = { Hugging Face }
}
```