File size: 2,612 Bytes
9124411
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b1dbcfb
 
9124411
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---

license: other
language:
- en
tags:
- code
- java
- code-search-net
- permissive
- function-documentation
pretty_name: CodeSearchNet Java (permissive licences only)
size_categories:
- 100K<n<1M
configs:
- config_name: default
  data_files:
  - split: train
    path: code_search_net_java.parquet
---


# CodeSearchNet Java — permissive licences only

Working copy (2026-12-05). Subset of
[`PiotrSty/code-search-net-java`](https://huggingface.co/datasets/PiotrSty/code-search-net-java)
keeping only repositories whose audited SPDX licence is permissive
(MIT, Apache-2.0, BSD-2/3-Clause, ISC, Zlib, WTFPL, Artistic-2.0).

- **334,367 rows**, **3,880 repositories**
- **299,132,516 characters**, **63,689,933 tokens**
  (tiktoken `cl100k_base`)
- parquet `163,300,781` bytes (zstd), 20 columns
- splits: train 303,622 · validation 12,828 · test 17,917
- removed **114,492** weak/strong-copyleft rows and
  **47,818** rows without a detected licence.

Full datasheet: [`datasheet.md`](./datasheet.md).

## Licences (rows)

| SPDX | rows | % |
|---|---:|---:|
| `Apache-2.0` | 264,874 | 79.2% |
| `MIT` | 52,732 | 15.8% |
| `BSD-3-Clause` | 10,322 | 3.1% |
| `BSD-2-Clause` | 5,480 | 1.6% |
| `ISC` | 772 | 0.2% |
| `Zlib` | 117 | 0.0% |
| `WTFPL` | 57 | 0.0% |
| `Artistic-2.0` | 13 | 0.0% |

## Schema

```

id, repo, path, func_name, url, split, language, docstring, code, text,

token_count, doc_chars, code_chars, license_basis, source, added,

record_sha256, license, license_class, license_source

```

`text` = docstring + `\n\n` + code. `id` is unique. `record_sha256` is the
canonical per-row SHA-256.

## Provenance and audit

- Upstream: official CodeSearchNet Java shards.
- Filters: code ≥ 20 chars, text ≥ 100 chars, exact-code dedup, open-licence
  filter, then `license_class == "permissive"`.
- Per-repo audit: GitHub REST `/repos/{owner}/{repo}/license` over 4,769
  repositories (2026-12-05); full table in `repo_licenses.jsonl`.

## Rights

- Every retained row has an audited permissive SPDX licence in `license`
  (`license_class == "permissive"`, `license_source` = GitHub licence URL).
- No copyleft rows (LGPL/EPL/GPL/AGPL) and no `NOASSERTION`/`unknown`.
- Permissive is not obligation-free: Apache-2.0 requires NOTICE/attribution and
  BSD/MIT require the copyright notice. This is not legal advice.

## Not checked

- Whether GitHub's LICENSE-file detection matches the repo's actual terms.
- Notice/attribution preservation for Apache-2.0/BSD rows.
- Cross-corpus dedup against other code corpora.