File size: 3,817 Bytes
57d6347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
pretty_name: SadikAI Code Multiverse
license: mit
language:
- en
task_categories:
- text-generation
tags:
- code
- python
- code-completion
- code-generation
- code-explanation
- sadik-ai
- multiverse
size_categories:
- n<1K
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train.jsonl
  - split: validation
    path: data/validation.jsonl
---

# SadikAI Code Multiverse

**305 Python code examples** extracted from the SadikAI project, a small
from-scratch language-model and chat-app codebase. Three task types:

| task | rows | what it asks |
|---|---:|---|
| `code_completion` | 211 | finish a function from a prefix that ends on a statement boundary |
| `code_explanation` | 47 | explain a function in plain English, using its docstring |
| `code_generation` | 47 | write a function from its docstring and signature |

The code is the author's own MIT-licensed work, not scraped from GitHub. Every
function was parsed with Python's `ast` module before inclusion.

## Files

```text
data/
  train.jsonl        278 rows
  validation.jsonl    27 rows
```

The split is **by source file**, not by row. Validation files are
`code_helper.py`, `demo_multilingual.py`, `fetch_datasets.py`, and
`memory_store.py`, so functions from the same file do not appear in both
splits.

Each row has:

| field | meaning |
|---|---|
| `task` | `code_completion`, `code_explanation`, or `code_generation` |
| `language` | always `python` |
| `instruction` | the prompt, with code in a fenced block where needed |
| `response` | the target continuation, explanation, or full function |
| `source_file` | path inside the SadikAI project |
| `function_name` | function or method name |
| `class_name` | class name for methods, otherwise `null` |
| `line_start`, `line_end` | source line range in the original file |
| `license` | `mit` |
| `source` | `SadikAI project` |

## Load it

```python
from datasets import load_dataset

ds = load_dataset(
    "json",
    data_files={
        "train": "data/train.jsonl",
        "validation": "data/validation.jsonl",
    },
)
print(ds)
print(ds["train"][0])
```

## Example

```json
{
  "task": "code_explanation",
  "instruction": "Explain what this Python function does.\n\n```python\ndef add(a, b):\n    return a + b\n```",
  "response": "Return the sum of a and b.",
  "source_file": "example.py",
  "function_name": "add",
  "class_name": null,
  "license": "mit"
}
```

## How it was built

1. Parse every `.py` file in the project, skipping virtualenvs, training runs,
   datasets, and release archives.
2. Keep top-level functions and class methods; skip nested functions to avoid
   duplicate snippets.
3. Drop very short, very long, and duplicate functions.
4. For completion rows, split at a real statement boundary near the middle of
   the function, never inside a string or expression.
5. For explanation and generation rows, use the function's own docstring.
6. Redact project/home paths and scan every snippet for token-like secrets.

## Licensing

The source code is MIT-licensed:

> MIT License, Copyright (c) 2026 Sadik (SadikAI)

The dataset packaging and metadata are also MIT. See `LICENSE`. The code does
not include the SadikAI training corpus or any private chat data.

## Limitations

- One small codebase, so the style and vocabulary are narrow.
- Auto-extracted examples: some completion prefixes are unusual, and not every
  function has tests.
- The validation split is small (27 rows) and file-level, not a full benchmark.
- Docstring-based generation targets are only as clear as the original
  docstrings.
- **Do not report this as a HumanEval/MBPP-style benchmark result.** It is a
  small, project-specific training and evaluation set.

## Credits

Created by **Sadik Nawaz** (SadikAI) from the SadikAI project source code.