metadata
dataset_info:
features:
- name: function_name
dtype: string
- name: docstring
dtype: string
- name: masked_code
dtype: string
- name: implementation
dtype: string
- name: start_line
dtype: int32
- name: end_line
dtype: int32
- name: file_content
dtype: string
splits:
- name: train
num_bytes: 420616564
num_examples: 2760
download_size: 64655948
dataset_size: 420616564
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
Stack-Smol-Docstrings
This dataset contains Python functions extracted from the-stack-smol, filtered for high-quality docstrings and implementations. Each sample includes the function's docstring, implementation, and a masked version of the code where the function is replaced with a comment.
The dataset is designed for code completion tasks where a model needs to restore a function that has been replaced with a comment. The model is provided with:
- The full file context with the function replaced by a comment
- The docstring of the function
- The function name
The model's task is to generate code that replaces the comment with a proper implementation of the function based on the docstring and surrounding context.
Dataset Structure
Each sample contains:
function_name
: Name of the functiondocstring
: The function's docstringmasked_code
: The full file with the function replaced by a commentimplementation
: The original function implementationstart_line
: The starting line number of the function in the original fileend_line
: The ending line number of the function in the original filefile_content
: The full original file content
Quality Filtering
Functions are filtered based on:
- Docstring quality (length, structure, descriptiveness)
- Implementation quality (no SQL strings, reasonable number of variables, sufficient complexity)