SadikNawazAI's picture
Publish sadik-code-multiverse (SadikAI Multiverse)
57d6347 verified
|
Raw History Blame Contribute Delete
3.82 kB
---
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.