problem_id int64 1 113 | programming_language stringclasses 2
values | original_code stringlengths 0 29.4k | highlighted_code stringlengths 0 6.05k ⌀ | instruction stringlengths 5 5.17k | test_code stringlengths 553 29.5k | requirements stringlengths 18 122 ⌀ | conftest stringclasses 3
values | test_utils stringclasses 7
values | split stringclasses 1
value | package_json nullclasses 9
values | jest_setup nullclasses 9
values | babel_config nullclasses 5
values | other_files null | jest_dom_setup nullclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | python | import torch.nn as nn
import torch.nn.functional as F
class SimpleConvNet3(nn.Module):
def __init__(self):
super(SimpleConvNet3, self).__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=3, stride=1, padding=1)
self.conv2 = nn.Conv2d(in_channels=32, out_channels=64,... | class SimpleConvNet3(nn.Module):
def __init__(self):
super(SimpleConvNet3, self).__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=3, stride=1, padding=1)
self.conv2 = nn.Conv2d(in_channels=32, out_channels=64, kernel_size=3, stride=1, padding=1)
self.conv... | 3. Попробуйте добавить Dropout на слои своей сверточной сети, не используя BatchNorm. | # test_dropout_no_batchnorm.py
import pytest
import inspect
import torch.nn as nn
def find_model_class(module):
"""Locate the first nn.Module subclass in the implementation module."""
for _, obj in inspect.getmembers(module, inspect.isclass):
if issubclass(obj, nn.Module) and obj is not nn.Module:
... | pytest
pytest-mock
torch
numpy | import pytest
import os
import sys
import json
from typing import Dict, List, Optional, Any
# Import from local test_utils.py in the same directory
from test_utils import TestUtils, TestResultsManager
# Load all implementations in the current sandbox
implementations = TestUtils.load_all_implementations()
test_results... | import os
import sys
import glob
import re
import importlib.util
import traceback
import types
from typing import Dict, List, Optional, Any, Tuple
class TestUtils:
@staticmethod
def discover_implementation_files(directory: str = None) -> List[str]:
"""Find all implementation files in the current sandbo... | test | null | null | null | null | null |
2 | python | import streamlit as st
# Создаем две формы для ввода данных
# В первой форме значения сохраняются в словарь form1_dict напрямую
# Во второй форме значения сохраняются в session_state и затем копируются в form2_dict
form1_dict = {}
with st.form('form1'):
form1_dict['a'] = st.text_input('a')
form1_dict['b'] = s... | import streamlit as st
# Создаем две формы для ввода данных
# В первой форме значения сохраняются в словарь form1_dict напрямую
# Во второй форме значения сохраняются в session_state и затем копируются в form2_dict
form1_dict = {}
with st.form('form1'):
form1_dict['a'] = st.text_input('a')
form1_dict['b'] = s... | добавить print в конце, чтобы в консоли тоже выводился результат сабмита формы | import inspect
import re
from unittest.mock import patch, MagicMock
import sys
from io import StringIO
import pytest
def test_print_statements_existence(implementation):
"""Test if print statements have been added to the code."""
impl_name, module = implementation
# Get the source code of the module
... | pytest
pytest-mock
streamlit | import pytest
import os
import sys
import json
from typing import Dict, List, Optional, Any
# Import from local test_utils.py in the same directory
from test_utils import TestUtils, TestResultsManager
# Load all implementations in the current sandbox
implementations = TestUtils.load_all_implementations()
test_results... | import os
import sys
import glob
import re
import importlib.util
import traceback
import types
from typing import Dict, List, Optional, Any, Tuple
class TestUtils:
@staticmethod
def discover_implementation_files(directory: str = None) -> List[str]:
"""Find all implementation files in the current sandbo... | test | null | null | null | null | null |
3 | python | #function to converte string to date
| crate sume finction from A to B | import pytest
import inspect
import types
import sys
import os
import importlib.util
from typing import Any, Callable, List, Tuple, Dict, Union
def test_implementation_exists(implementation):
"""Test that the sum_from_a_to_b function exists in the implementation."""
impl_name, module = implementation
# Ch... | pytest
pytest-mock | import pytest
import os
import sys
import json
from typing import Dict, List, Optional, Any
# Import from local test_utils.py in the same directory
from test_utils import TestUtils, TestResultsManager
# Load all implementations in the current sandbox
implementations = TestUtils.load_all_implementations()
test_results... | import os
import sys
import glob
import re
import importlib.util
import traceback
import types
from typing import Dict, List, Optional, Any, Tuple
class TestUtils:
@staticmethod
def discover_implementation_files(directory: str = None) -> List[str]:
"""Find all implementation files in the current sandbo... | test | null | null | null | null | null | |
4 | python | # generate a half adder module of verilog by python
# verilog code
verilog_code = """
module half_adder(a, b, c, sum, carry);
input a, b;
output c, sum, carry;
assign c = a ^ b;
assign sum = a & b;
assign carry = a & b;
endmodule
"""
# verilog module name
module_name = "half_adder"
# verilog modu... | # verilog module body
module_body = """
input a, b;
output c, sum, carry;
assign c = a ^ b;
assign sum = a & b;
assign carry = a & b;
endmodule
""" | add more input signals | import re
import pytest
def test_input_ports_added(implementation):
"""Test that additional input ports have been added to the module_body."""
impl_name, module = implementation
# Skip test for implementations without module_body attribute
if not hasattr(module, 'module_body'):
pytest.skip... | pytest
pytest-mock | import pytest
import os
import sys
import json
from typing import Dict, List, Optional, Any
# Import from local test_utils.py in the same directory
from test_utils import TestUtils, TestResultsManager
# Load all implementations in the current sandbox
implementations = TestUtils.load_all_implementations()
test_results... | import os
import sys
import glob
import re
import importlib.util
import traceback
import types
from typing import Dict, List, Optional, Any, Tuple
class TestUtils:
@staticmethod
def discover_implementation_files(directory: str = None) -> List[str]:
"""Find all implementation files in the current sandbo... | test | null | null | null | null | null |
5 | python | def is_prime(n):
| def is_prime(n):
| add a function to check for primes | # test_is_prime.py
import pytest
import inspect
import random
def test_is_prime_exists(implementation):
"""Test that the is_prime function exists and is callable."""
impl_name, module = implementation
if not hasattr(module, "is_prime"):
pytest.skip(f"{impl_name} has no is_prime function")
asser... | pytest
pytest-mock | import pytest
import os
import sys
import json
from typing import Dict, List, Optional, Any
# Import from local test_utils.py in the same directory
from test_utils import TestUtils, TestResultsManager
# Load all implementations in the current sandbox
implementations = TestUtils.load_all_implementations()
test_results... | import os
import sys
import glob
import re
import importlib.util
import traceback
import types
from typing import Dict, List, Optional, Any, Tuple
class TestUtils:
@staticmethod
def discover_implementation_files(directory: str = None) -> List[str]:
"""Find all implementation files in the current sandbo... | test | null | null | null | null | null |
6 | python | create a flask app that shows the current date and time | import pytest
import re
import sys
import importlib
from flask.testing import FlaskClient
from datetime import datetime, timedelta
from unittest.mock import patch, MagicMock
from importlib import util
from contextlib import contextmanager
@contextmanager
def import_module_from_path(module_path):
"""Context manage... | flask
pytest
pytest-mock | import pytest
import os
import sys
import json
from typing import Dict, List, Optional, Any
# Import from local test_utils.py in the same directory
from test_utils import TestUtils, TestResultsManager
# Load all implementations in the current sandbox
implementations = TestUtils.load_all_implementations()
test_results... | import os
import sys
import glob
import re
import importlib.util
import traceback
import types
from typing import Dict, List, Optional, Any, Tuple
class TestUtils:
@staticmethod
def discover_implementation_files(directory: str = None) -> List[str]:
"""Find all implementation files in the current sandbo... | test | null | null | null | null | null | ||
7 | python | # Write binary search
| binary search on python | import inspect
import pytest
import random
import time
import sys
def test_binary_search_function_exists(implementation):
"""Test if binary_search function exists in the implementation."""
impl_name, module = implementation
if impl_name == "original_code":
pytest.skip(f"{impl_name}: binary_search ... | pytest
pytest-mock | import pytest
import os
import sys
import json
from typing import Dict, List, Optional, Any
# Import from local test_utils.py in the same directory
from test_utils import TestUtils, TestResultsManager
# Load all implementations in the current sandbox
implementations = TestUtils.load_all_implementations()
test_results... | import os
import sys
import glob
import re
import importlib.util
import traceback
import types
from typing import Dict, List, Optional, Any, Tuple
class TestUtils:
@staticmethod
def discover_implementation_files(directory: str = None) -> List[str]:
"""Find all implementation files in the current sandbo... | test | null | null | null | null | null | |
8 | python | # env: pyAI
import os
from openai import OpenAI
import json
def save_conversation(filename="conversation_history.json"):
with open(filename, "w") as f:
json.dump(conversation_history, f, ensure_ascii=False, indent=4)
def load_conversation(filename="conversation_history.json"):
try:
with open... | # env: pyAI
import os
from openai import OpenAI
import json
def save_conversation(filename="conversation_history.json"):
with open(filename, "w") as f:
json.dump(conversation_history, f, ensure_ascii=False, indent=4)
def load_conversation(filename="conversation_history.json"):
try:
with open... | 修复代码中的错误 | import pytest
import os
import json
import sys
import inspect
import re
from unittest.mock import patch, MagicMock, mock_open
from io import StringIO
@pytest.fixture
def capture_stdout():
"""Capture stdout for testing print statements"""
buffer = StringIO()
old_stdout = sys.stdout
sys.stdout = buffer
... | pytest
pytest-mock
openai | import pytest
import os
import sys
import json
from typing import Dict, List, Optional, Any
# Import from local test_utils.py in the same directory
from test_utils import TestUtils, TestResultsManager
# Load all implementations in the current sandbox
implementations = TestUtils.load_all_implementations()
test_results... | import os
import sys
import glob
import re
import importlib.util
import traceback
import types
from typing import Dict, List, Optional, Any, Tuple
class TestUtils:
@staticmethod
def discover_implementation_files(directory: str = None) -> List[str]:
"""Find all implementation files in the current sandbo... | test | null | null | null | null | null |
9 | python | "import os\nimport random\nimport torch\nimport numpy as np\nfrom sklearn.metrics.pairwise import co(...TRUNCATED) | "def visualize_results_grid(results_df):\n columns = [results_df.iloc[:, i] for i in range(len(re(...TRUNCATED) | make it work with 4 or more columns | "import pytest\nimport pandas as pd\nimport numpy as np\nimport inspect\nfrom unittest.mock import p(...TRUNCATED) | "pandas\nnumpy\nmatplotlib\npytest\npytest-mock\nseaborn\npillow\ntorch\ntorchvision\nscikit-learn\n(...TRUNCATED) | "import pytest\nimport os\nimport sys\nimport json\nfrom typing import Dict, List, Optional, Any\n\n(...TRUNCATED) | "import os\nimport sys\nimport glob\nimport re\nimport importlib.util\nimport traceback\nimport type(...TRUNCATED) | test | null | null | null | null | null |
10 | python | "def is_sum_of_four_squares(n):\n if n < 0:\n return False\n for a in range(int(n**0.5)(...TRUNCATED) | "def is_sum_of_four_squares(n):\n if n < 0:\n return False\n for a in range(int(n**0.5)(...TRUNCATED) | Números que podem ser expressos como a soma de quatro quadrados não nulos: | "import pytest\nimport io\nimport sys\nfrom unittest.mock import patch, MagicMock\nimport inspect\ni(...TRUNCATED) | pytest
pytest-mock | "import pytest\nimport os\nimport sys\nimport json\nfrom typing import Dict, List, Optional, Any\n\n(...TRUNCATED) | "import os\nimport sys\nimport glob\nimport re\nimport importlib.util\nimport traceback\nimport type(...TRUNCATED) | test | null | null | null | null | null |
End of preview. Expand in Data Studio
EditBench Dataset
This dataset contains code editing tasks extracted from the EditBench evaluation framework specifically designed for evaluating model performance on code editing tasks. It is provided as a test-only benchmark. Each sample includes:
Core Files (Python)
original_code.py: Starting code filehighlighted_code.py: Specific section of code to be modifiedinstruction.txt: User instructions for the tasktest_code.py: Tests that validate the implementation
Supporting Files (Python)
requirements.txt: Dependencies needed to run the codeconftest.py: Pytest configurationtest_utils.py: Utilities for testing
Core Files (JavaScript)
original_code.js: Starting code file (or .jsx)highlighted_code.js: Specific section of code to be modifiedinstruction.txt: User instructions for the tasktest_code: Tests that validate the implementation (from tests/*.test.js)package_json: NPM package configurationjest_setup: Jest testing setup (if applicable)babel_config: Babel configuration (if applicable)other_files: Additional files needed for the project
Dataset Statistics
- Total samples: 113
- Python samples: 104
- JavaScript samples: 9
- Expected samples: 113 (57 easy + 56 hard questions)
- Found samples: 113 / 113
Usage
This dataset is provided as a test-only benchmark and can be loaded directly with the Hugging Face Datasets library:
from datasets import load_dataset
# Note that this dataset only has a 'test' split
dataset = load_dataset("your-username/editbench", split="test")
Ethical Considerations and Limitations
- This dataset is provided exclusively for benchmark/evaluation purposes
- Models should NOT be trained on this dataset, as it is specifically designed to test model capabilities
- Hugging Face's Terms of Service prohibit using benchmark datasets for training
- We recommend implementing your model's training pipeline to explicitly exclude this dataset
Citation
If you use this dataset, please cite the original EditBench work.
@misc{chi2025editbench,
title = {EditBench: Evaluating LLM Abilities to Perform Real-World Code Edits},
author = {Wayne Chi and Valerie Chen and Ryan Shar and Aditya Mittal and Jenny Liang and Wei-Lin Chiang and Anastasios Nikolas Angelopoulos and Ion Stoica and Graham Neubig and Ameet Talwalkar and Chris Donahue},
year = {2025},
note = {arXiv preprint}
}
Usage Restrictions
This dataset is provided for research and evaluation purposes only. By using this dataset, you agree not to:
- Train models on it (it is a benchmark dataset)
- Scrape or incorporate it into pretraining data
- Use it for any purpose other than evaluation
- Downloads last month
- 10