File size: 1,692 Bytes
898cbea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28b4ca7
 
 
898cbea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: other
task_categories:
- text-generation
language:
- code
- en
pretty_name: Stack v2 Sparse Python Classes 36k
size_categories:
- 10K<n<100K
---

# Stack v2 Sparse Python Classes 36k

This is a 36,000-sample snapshot for Diffusion + Autoregressive hybrid code generation experiments.

## Source

The data is extracted from `bigcode/the-stack-v2-dedup`, Python subset. The extraction uses Stack v2 metadata as source of truth, groups candidates by `repo_name + revision_id`, fetches files with git partial fetch + sparse checkout, then applies AST-level class filters.

## Splits

- `train.jsonl`: 35,000
- `val.jsonl`: 500
- `test.jsonl`: 500
- `all.jsonl`: 36,000

## Record Format

Each JSONL row is one Python class sample. Important fields include:

- `prompt`: natural-language class implementation prompt
- `skeleton`: class/method signatures and docstrings with `<|body_i|>` slots
- `bodies`: list of method bodies without docstrings
- `bodies_text`: body slots wrapped by `<|body_start_i|>` and `<|end_body_i|>`
- `full_text`: skeleton plus body slots
- `solution`: reconstructed class code
- `source_repo`, `source_path`, `revision_id`, `blob_id`, `detected_licenses`: source metadata

## Filters

- 2 to 6 methods per class
- every method has a non-empty docstring
- every method body has 3 to 30 non-empty lines
- reconstructed class parses as Python AST
- tests/docs/examples/vendor/generated files are excluded by metadata/path filters
- simple ClassEval/HumanEval contamination filters are applied

Strict pyflakes is not used as a hard filter because isolated extracted classes often depend on module-level imports, constants, parent classes, or helper functions.