Dataset Viewer
Auto-converted to Parquet Duplicate
data_source
string
prompt
list
ability
string
reward_model
dict
extra_info
dict
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a Python class named `Book` to manage book details. The class should have the following attributes:\n- `title`: ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", 1949).describe() == \\\"1984 by George Orwell, published in 1949\\\"\\n \\n assert Book(\\\"To Kill a Mockingbird\\\", \\\"Harper Lee\\\", 1960).describe() == \\\"To Kill ...
{ "split": "train", "index": "0", "task_id": "L0/train/0", "reference_solution": "class Book:\n def __init__(self, title, author, publication_year):\n self.title = title\n self.author = author\n self.publication_year = publication_year\n \n def describe(self):\n return f\"{s...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Movie` class in Python. The class should have the following specifications:\n\n- **Attributes:**\n - `title`...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert str(Movie(\\\"Inception\\\", 2010, \\\"Sci-Fi\\\")) == \\\"Title: Inception, Year: 2010, Genre: Sci-Fi\\\"\\n \\n assert str(Movie(\\\"The Matrix\\\", 1999, \\\"Action\\\")) == \\\"Title: The Matrix, Year: 1999, G...
{ "split": "train", "index": "1", "task_id": "L0/train/1", "reference_solution": "class Movie:\n def __init__(self, title: str, year: int, genre: str):\n self.title = title\n self.year = year\n self.genre = genre\n \n def __str__(self):\n return f\"Title: {self.title}, Year:...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a Python class `Book` with the following specifications:\n\n- **Attributes:**\n - `title`: A string representing the title of the book...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"The Great Gatsby\\\", \\\"F. Scott Fitzgerald\\\", 1925, \\\"9780743273565\\\").get_book_info() == \\\"Title: The Great Gatsby, Author: F. Scott Fitzgerald, Year Published: 1925, ISBN: 9780743273565\\\"\\n \...
{ "split": "train", "index": "2", "task_id": "L0/train/2", "reference_solution": "class Book:\n def __init__(self, title, author, year_published, isbn):\n self.title = title\n self.author = author\n self.year_published = year_published\n self.isbn = isbn\n \n def get_book_in...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Rectangle` class in Python. The class should support the following functionalities:\n\n- **Initialization**: ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Rectangle(5, 10).area() == 50\\n \\n assert Rectangle(5, 10).perimeter() == 30\\n \\n assert Rectangle(0, 0).area() == 0\\n \\n assert Rectangle(0, 0).perimeter() == 0\\n \\n assert Rectangle(7, ...
{ "split": "train", "index": "3", "task_id": "L0/train/3", "reference_solution": "class Rectangle:\n def __init__(self, width, height):\n self.width = width\n self.height = height\n \n def area(self):\n return self.width * self.height\n \n def perimeter(self):\n return...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Book` class in Python. The class should have the following attributes: `title`, `author`, and `publication_ye...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", 1949).get_details() == \\\"Title: 1984, Author: George Orwell, Year: 1949\\\"\\n \\n assert Book(\\\"To Kill a Mockingbird\\\", \\\"Harper Lee\\\", 1960).get_details() == ...
{ "split": "train", "index": "4", "task_id": "L0/train/4", "reference_solution": "class Book:\n def __init__(self, title, author, publication_year):\n self.title = title\n self.author = author\n self.publication_year = publication_year\n \n def get_details(self):\n return f\...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Rectangle` class in Python. The class should support the following functionalities:\n\n- **Initialization**: ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Rectangle(3, 4).area() == 12\\n \\n assert Rectangle(5, 5).perimeter() == 20\\n \\n assert str(Rectangle(2, 3)) == \\\"Rectangle(width=2, height=3)\\\"\\n \\n assert Rectangle(0, 0).area() == 0\\n \...
{ "split": "train", "index": "5", "task_id": "L0/train/5", "reference_solution": "class Rectangle:\n def __init__(self, width, height):\n self.width = width\n self.height = height\n \n def area(self):\n return self.width * self.height\n \n def perimeter(self):\n return...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a Python class `Person` with the following specifications:\n\n- **Attributes:**\n - `first_name`: A string representing the first name...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Person(\\\"John\\\", \\\"Doe\\\", 25, \\\"john.doe@example.com\\\").get_full_name() == \\\"John Doe\\\"\\n \\n assert Person(\\\"Jane\\\", \\\"Smith\\\", 17, \\\"jane.smith@example.com\\\").is_adult() == False\\n ...
{ "split": "train", "index": "6", "task_id": "L0/train/6", "reference_solution": "class Person:\n def __init__(self, first_name, last_name, age, email):\n self.first_name = first_name\n self.last_name = last_name\n self.age = age\n self.email = email\n \n def get_full_name(s...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Rectangle` class in Python. The class should have an initializer to set the width and height of the rectangle...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Rectangle(3, 4).area() == 12\\n \\n assert Rectangle(5, 5).perimeter() == 20\\n \\n assert Rectangle(0, 0).area() == 0\\n \\n assert Rectangle(10, 2).perimeter() == 24\\n \\n assert Rectangle(7, ...
{ "split": "train", "index": "7", "task_id": "L0/train/7", "reference_solution": "class Rectangle:\n def __init__(self, width, height):\n self.width = width\n self.height = height\n \n def area(self):\n return self.width * self.height\n \n def perimeter(self):\n return...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a class `FinancialTransaction` for a financial application. This class should encapsulate the details of a finan...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert FinancialTransaction(100, '2023-10-01', 'Salary').is_debit() == False\\n \\n assert FinancialTransaction(-50, '2023-10-02', 'Groceries').is_debit() == True\\n \\n assert FinancialTransaction(0, '2023-10-03',...
{ "split": "train", "index": "8", "task_id": "L0/train/8", "reference_solution": "class FinancialTransaction:\n def __init__(self, amount, date, description):\n self.amount = amount\n self.date = date\n self.description = description\n \n def is_debit(self):\n return self.am...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a Python class `Car` with the following specifications:\n- The class should have an initializer that accepts three parameters: `make`, ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert toyota_camry.make == \\\"Toyota\\\"\\n \\n assert toyota_camry.model == \\\"Camry\\\"\\n \\n assert toyota_camry.year == 2021\\n \\n assert honda_accord.make == \\\"Honda\\\"\\n \\n assert honda_...
{ "split": "train", "index": "9", "task_id": "L0/train/9", "reference_solution": "class Car:\n def __init__(self, make, model, year):\n self.make = make\n self.model = model\n self.year = year\n \n def display_info(self):\n print(f\"Make: {self.make}, Model: {self.model}, Ye...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a Python class `Movie` with the following attributes and methods:\n\n- **Attributes:**\n - `title`: A string representing the title of...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Movie(\\\"Inception\\\", 2010, \\\"Sci-Fi\\\", 148, 8.8).title == \\\"Inception\\\"\\n \\n assert Movie(\\\"Inception\\\", 2010, \\\"Sci-Fi\\\", 148, 8.8).release_year == 2010\\n \\n assert Movie(\\\"Incepti...
{ "split": "train", "index": "10", "task_id": "L0/train/10", "reference_solution": "class Movie:\n def __init__(self, title, release_year, genre, duration, imdb_rating):\n self.title = title\n self.release_year = release_year\n self.genre = genre\n self.duration = duration\n ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Rectangle` class with the following requirements:\n\n- The class should have two attributes: `length` and `wi...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Rectangle(4, 5).area() == 20\\n \\n assert Rectangle(4, 5).perimeter() == 18\\n \\n assert Rectangle(4, 5).isSquare() == False\\n \\n assert Rectangle(6, 6).area() == 36\\n \\n assert Rectangle(6...
{ "split": "train", "index": "11", "task_id": "L0/train/11", "reference_solution": "class Rectangle:\n def __init__(self, length, width):\n self.length = length\n self.width = width\n \n def area(self):\n return self.length * self.width\n \n def perimeter(self):\n retu...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a Python class `Car` that simulates a simple car object. The class should have the following attributes and methods:\n\n- **Attributes:...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert str(Car(\\\"Toyota\\\", \\\"Corolla\\\", 2020, 15000)) == \\\"Car(make='Toyota', model='Corolla', year=2020, mileage=15000)\\\"\\n \\n assert str(Car(\\\"Honda\\\", \\\"Civic\\\", 2018, 20000)) == \\\"Car(make='Ho...
{ "split": "train", "index": "12", "task_id": "L0/train/12", "reference_solution": "class Car:\n def __init__(self, make, model, year, mileage):\n self.make = make\n self.model = model\n self.year = year\n self.mileage = mileage\n \n def drive(self, distance):\n self....
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Book` class in Python. The class should have the following attributes:\n- `title`: a string representing the ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert str(Book(\\\"1984\\\", \\\"George Orwell\\\", 1949)) == \\\"'1984' by George Orwell, published in 1949\\\"\\n \\n assert str(Book(\\\"To Kill a Mockingbird\\\", \\\"Harper Lee\\\", 1960)) == \\\"'To Kill a Mocking...
{ "split": "train", "index": "13", "task_id": "L0/train/13", "reference_solution": "class Book:\n def __init__(self, title, author, year):\n self.title = title\n self.author = author\n self.year = year\n \n def __str__(self):\n return f\"'{self.title}' by {self.author}, publ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Rectangle` class in Python. The class should have the following specifications:\n\n- **Attributes:**\n - `wi...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Rectangle(3, 4).area() == 12\\n \\n assert Rectangle(5, 5).perimeter() == 20\\n \\n assert Rectangle(0, 0).area() == 0\\n \\n assert Rectangle(10, 2).perimeter() == 24\\n \\n assert Rectangle(7, ...
{ "split": "train", "index": "14", "task_id": "L0/train/14", "reference_solution": "class Rectangle:\n def __init__(self, width, height):\n self.width = width\n self.height = height\n \n def area(self):\n return self.width * self.height\n \n def perimeter(self):\n retu...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a Python class named `Employee` to manage employee records. The class should have the following attributes: `emp...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Employee(123, 'John Doe', 'Finance', 50000).display_info() == None\\n \\n assert Employee(456, 'Jane Smith', 'IT', 60000).display_info() == None\\n \\n assert Employee(789, 'Alice Johnson', 'HR', 55000).disp...
{ "split": "train", "index": "15", "task_id": "L0/train/15", "reference_solution": "class Employee:\n def __init__(self, employee_id, name, department, salary):\n self.employee_id = employee_id\n self.name = name\n self.department = department\n self.salary = salary\n \n def...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with developing a function to analyze weather data for a competitive programming challenge. Given a list of dictionaries, where ea...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert filter_weather_data([{'date': '2023-01-01', 'temperature': 25, 'humidity': 80, 'wind_speed': 10}, {'date': '2023-01-02', 'temperature': 35, 'humidity': 70, 'wind_speed': 15}], lambda report: report['temperature'] > 30) ...
{ "split": "train", "index": "16", "task_id": "L0/train/16", "reference_solution": "def filter_weather_data(weather_data, condition):\n return [report for report in weather_data if condition(report)]" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a `BankAccount` class with the following specifications:\n\n- **Attributes:**\n - `owner`: A string representing the owner's name.\n ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert BankAccount(\\\"John\\\", 100.0).get_balance() == 100.0\\n \\n assert BankAccount(\\\"Alice\\\", 0.0).get_balance() == 0.0\\n \\n assert str(BankAccount(\\\"Bob\\\", 250.0)) == \\\"Account owner: Bob, Balanc...
{ "split": "train", "index": "17", "task_id": "L0/train/17", "reference_solution": "class BankAccount:\n def __init__(self, owner: str, balance: float):\n self.owner = owner\n self.balance = balance\n \n def deposit(self, amount: float) -> None:\n if amount <= 0:\n raise...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with simulating a dice roll in a game. Write a function `roll_dice` that returns a random integer between 1 and 6, inclusive, simu...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert 1 <= roll_dice() <= 6\\n \\n assert 1 <= roll_dice() <= 6\\n \\n assert 1 <= roll_dice() <= 6\\n \\n assert 1 <= roll_dice() <= 6\\n \\n assert 1 <= roll_dice() <= 6\\n \\n assert 1 <= roll...
{ "split": "train", "index": "18", "task_id": "L0/train/18", "reference_solution": "import random\n\ndef roll_dice():\n return random.randint(1, 6)" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Given a list of integers, your task is to implement a function that removes all duplicate elements from the list while preserving the order of th...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert remove_duplicates([1, 2, 3, 2, 1]) == [1, 2, 3]\\n \\n assert remove_duplicates([4, 5, 6, 4, 7, 5]) == [4, 5, 6, 7]\\n \\n assert remove_duplicates([10, 10, 10, 10]) == [10]\\n \\n assert remove_duplic...
{ "split": "train", "index": "19", "task_id": "L0/train/19", "reference_solution": "def remove_duplicates(input_list):\n seen = set()\n result = []\n for num in input_list:\n if num not in seen:\n seen.add(num)\n result.append(num)\n return result" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Circle` class in Python. The class should support the following functionalities:\n\n1. **Initialization**: Th...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Circle(1).area() == math.pi\\n \\n assert Circle(0).area() == 0\\n \\n assert Circle(2.5).area() == math.pi * 2.5 ** 2\\n \\n assert Circle(1).circumference() == 2 * math.pi\\n \\n assert Circle(...
{ "split": "train", "index": "20", "task_id": "L0/train/20", "reference_solution": "import math\n\nclass Circle:\n def __init__(self, radius):\n self.radius = radius\n \n def area(self):\n return math.pi * (self.radius ** 2)\n \n def circumference(self):\n return 2 * math.pi ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a list of integers. Your task is to implement a function `find_max_in_list` that returns the maximum value in the list. You are not...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert find_max_in_list([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == 9\\n \\n assert find_max_in_list([10, 20, 30, 40, 50]) == 50\\n \\n assert find_max_in_list([-10, -20, -30, -40, -50]) == -10\\n \\n assert find_m...
{ "split": "train", "index": "21", "task_id": "L0/train/21", "reference_solution": "def find_max_in_list(nums):\n if not nums:\n return None\n max_val = nums[0]\n for num in nums[1:]:\n if num > max_val:\n max_val = num\n return max_val" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a class `Circle` with the following specifications:\n\n- **Attributes:**\n - `radius`: A float representing the radius of the circle.\...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Circle(1).area() == math.pi\\n \\n assert Circle(0).area() == 0\\n \\n assert Circle(2).circumference() == 4 * math.pi\\n \\n assert Circle(1.5).area() == math.pi * (1.5 ** 2)\\n \\n assert Circl...
{ "split": "train", "index": "22", "task_id": "L0/train/22", "reference_solution": "import math\n\nclass Circle:\n def __init__(self, radius):\n self.radius = radius\n \n def area(self):\n return math.pi * (self.radius ** 2)\n \n def circumference(self):\n return 2 * math.pi ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a string `text` representing a sentence. Your task is to implement a function `reverse_sentence` that returns the sentence with the...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert reverse_sentence(\\\"Hello world this is a test\\\") == \\\"test a is this world Hello\\\"\\n \\n assert reverse_sentence(\\\"Python is fun\\\") == \\\"fun is Python\\\"\\n \\n assert reverse_sentence(\\\"Op...
{ "split": "train", "index": "23", "task_id": "L0/train/23", "reference_solution": "def reverse_sentence(text):\n words = text.split()\n reversed_words = words[::-1]\n return \" \".join(reversed_words)" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a Python class named `Employee` to manage employee data. The class should have the following attributes and meth...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Employee(\\\"John\\\", \\\"Doe\\\", 123).get_full_name() == \\\"John Doe\\\"\\n \\n assert Employee(\\\"Jane\\\", \\\"Smith\\\", 456).get_employee_info() == \\\"Employee ID: 456, Full Name: Jane Smith\\\"\\n \\...
{ "split": "train", "index": "24", "task_id": "L0/train/24", "reference_solution": "class Employee:\n def __init__(self, first_name, last_name, employee_id):\n self.first_name = first_name\n self.last_name = last_name\n self.employee_id = employee_id\n \n def get_full_name(self):\n...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with creating a Python class named `Book` to manage book information. The class should have the following functionalities:\n- An i...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", \\\"9780451524935\\\").get_details() == \\\"Title: 1984, Author: George Orwell, ISBN: 9780451524935\\\"\\n \\n assert Book(\\\"To Kill a Mockingbird\\\", \\\"Harper Lee\\\...
{ "split": "train", "index": "25", "task_id": "L0/train/25", "reference_solution": "class Book:\n def __init__(self, title, author, isbn):\n self.title = title\n self.author = author\n self.isbn = isbn\n \n def get_details(self):\n return f\"Title: {self.title}, Author: {sel...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a list of integers. Your task is to implement a function named `remove_duplicates` that processes this list and returns a new list ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert remove_duplicates([1, 2, 3, 4, 5, 1, 2, 6, 7, 8, 3, 4]) == [1, 2, 3, 4, 5, 6, 7, 8]\\n \\n assert remove_duplicates([10, 20, 20, 10, 30]) == [10, 20, 30]\\n \\n assert remove_duplicates([1, 1, 1, 1, 1]) == [...
{ "split": "train", "index": "26", "task_id": "L0/train/26", "reference_solution": "def remove_duplicates(input_list):\n seen = set()\n unique_list = []\n for num in input_list:\n if num not in seen:\n seen.add(num)\n unique_list.append(num)\n return unique_list" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Rectangle` class in Python. The class should have two attributes, `width` and `height`, and two methods: `are...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Rectangle(3, 4).area() == 12\\n \\n assert Rectangle(5, 5).area() == 25\\n \\n assert Rectangle(0, 10).area() == 0\\n \\n assert Rectangle(7, 2).perimeter() == 18\\n \\n assert Rectangle(10, 10)....
{ "split": "train", "index": "27", "task_id": "L0/train/27", "reference_solution": "class Rectangle:\n def __init__(self, width, height):\n self.width = width\n self.height = height\n \n def area(self):\n return self.width * self.height\n \n def perimeter(self):\n retu...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Book` class to manage book details and perform operations related to discounts. The class should have the fol...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", \\\"1234567890\\\", 9.99, 1949).get_summary() == \\\"Title: 1984, Author: George Orwell, Published: 1949\\\"\\n \\n assert Book(\\\"To Kill a Mockingbird\\\", \\\"Harper L...
{ "split": "train", "index": "28", "task_id": "L0/train/28", "reference_solution": "class Book:\n def __init__(self, title, author, isbn, price, publication_year):\n self.title = title\n self.author = author\n self.isbn = isbn\n self.price = price\n self.publication_year = ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a list of integers `numbers`. Your task is to determine whether there are any duplicate elements in the list. If duplicates are fou...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert has_duplicates([1, 2, 3, 4, 5, 1]) == True\\n \\n assert has_duplicates([1, 2, 3, 4, 5]) == False\\n \\n assert has_duplicates([]) == False\\n \\n assert has_duplicates([1, 1, 1, 1, 1]) == True\\n \...
{ "split": "train", "index": "29", "task_id": "L0/train/29", "reference_solution": "def has_duplicates(numbers):\n return len(numbers) != len(set(numbers))" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a string `s`. Your task is to implement a function `reverse_string(s: str) -> str` that returns the reversed version of the string ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert reverse_string(\\\"hello\\\") == \\\"olleh\\\"\\n \\n assert reverse_string(\\\"Python\\\") == \\\"nohtyP\\\"\\n \\n assert reverse_string(\\\"\\\") == \\\"\\\"\\n \\n assert reverse_string(\\\"a\\\") ...
{ "split": "train", "index": "30", "task_id": "L0/train/30", "reference_solution": "def reverse_string(s: str) -> str:\n return s[::-1]" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a recursive function named `calculate_factorial` that computes the factorial of a given non-negative integer `n`...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert calculate_factorial(0) == 1\\n \\n assert calculate_factorial(1) == 1\\n \\n assert calculate_factorial(5) == 120\\n \\n assert calculate_factorial(3) == 6\\n \\n assert calculate_factorial(10) =...
{ "split": "train", "index": "31", "task_id": "L0/train/31", "reference_solution": "def calculate_factorial(n):\n if n == 0:\n return 1\n else:\n return n * calculate_factorial(n - 1)" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a Python class `Book` with the following specifications:\n- The class should have an initializer that accepts three parameters: `title`...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", 1949).get_info() == \\\"Title: 1984, Author: George Orwell, Publication Year: 1949\\\"\\n \\n assert Book(\\\"To Kill a Mockingbird\\\", \\\"Harper Lee\\\", 1960).get_info...
{ "split": "train", "index": "32", "task_id": "L0/train/32", "reference_solution": "class Book:\n def __init__(self, title, author, publication_year):\n self.title = title\n self.author = author\n self.publication_year = publication_year\n \n def get_info(self):\n return f\"...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Book` class to manage book information. The class should support the following functionalities:\n\n- **Constr...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"The Great Gatsby\\\", \\\"F. Scott Fitzgerald\\\", 180).summary() == \\\"Title: The Great Gatsby, Author: F. Scott Fitzgerald, Pages: 180\\\"\\n \\n assert Book(\\\"The Great Gatsby\\\", \\\"F. Scott Fitz...
{ "split": "train", "index": "33", "task_id": "L0/train/33", "reference_solution": "class Book:\n def __init__(self, title, author, pages):\n self.title = title\n self.author = author\n self.pages = pages\n \n def summary(self):\n return f\"Title: {self.title}, Author: {...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Book` class in Python. The class should have the following specifications:\n\n- **Attributes:**\n - `title`:...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", \\\"9780451524935\\\", 1949).get_details() == \\\"Title: 1984, Author: George Orwell, ISBN: 9780451524935, Publication Year: 1949\\\"\\n \\n assert Book(\\\"To Kill a Mock...
{ "split": "train", "index": "34", "task_id": "L0/train/34", "reference_solution": "class Book:\n def __init__(self, title, author, isbn, publication_year):\n self.title = title\n self.author = author\n self.isbn = isbn\n self.publication_year = publication_year\n \n def get...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a Python class named `Car` that encapsulates the properties of a car. The class should have the following attrib...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert str(Car(\\\"Toyota\\\", \\\"Corolla\\\", 2020)) == \\\"Toyota Corolla 2020\\\"\\n \\n assert str(Car(\\\"Honda\\\", \\\"Civic\\\", 2018)) == \\\"Honda Civic 2018\\\"\\n \\n assert str(Car(\\\"Ford\\\", \\\"M...
{ "split": "train", "index": "35", "task_id": "L0/train/35", "reference_solution": "class Car:\n def __init__(self, make, model, year):\n self.make = make\n self.model = model\n self.year = year\n \n def __str__(self):\n return f\"{self.make} {self.model} {self.year}\"" ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a dictionary `grades` where each key is a string representing a subject and each value is an integer representing the grade in that...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert calculate_average_grade({\\\"Math\\\": 85, \\\"Science\\\": 92, \\\"History\\\": 78}) == 85.0\\n \\n assert calculate_average_grade({\\\"Math\\\": 100, \\\"Science\\\": 100, \\\"History\\\": 100}) == 100.0\\n \...
{ "split": "train", "index": "36", "task_id": "L0/train/36", "reference_solution": "def calculate_average_grade(grades):\n if not grades:\n return None\n total = sum(grades.values())\n average = total / len(grades)\n return float(average)" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a class `Car` with the following specifications:\n\n- **Attributes:**\n - `make`: A string representing the make of the car.\n - `mod...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Car(\\\"Toyota\\\", \\\"Corolla\\\", 2020).make == \\\"Toyota\\\"\\n \\n assert Car(\\\"Toyota\\\", \\\"Corolla\\\", 2020).model == \\\"Corolla\\\"\\n \\n assert Car(\\\"Toyota\\\", \\\"Corolla\\\", 2020).ye...
{ "split": "train", "index": "37", "task_id": "L0/train/37", "reference_solution": "class Car:\n def __init__(self, make, model, year):\n self.make = make\n self.model = model\n self.year = year\n self.speed = 0\n \n def accelerate(self, amount):\n self.speed += amoun...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a list of integers. Your task is to implement a function `calculate_average(numbers)` that computes the average of the numbers in t...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert calculate_average([10, 20, 30, 40, 50]) == 30.0\\n \\n assert calculate_average([1, 2, 3, 4, 5]) == 3.0\\n \\n assert calculate_average([100, 200, 300]) == 200.0\\n \\n assert calculate_average([-10, -...
{ "split": "train", "index": "38", "task_id": "L0/train/38", "reference_solution": "def calculate_average(numbers):\n if len(numbers) == 0:\n return None\n return sum(numbers) / len(numbers)" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Book` class in Python. The class should have the following attributes: `title`, `author`, and `year`. Impleme...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", 1949).get_info() == \\\"Title: 1984, Author: George Orwell, Year: 1949\\\"\\n \\n assert Book(\\\"To Kill a Mockingbird\\\", \\\"Harper Lee\\\", 1960).get_info() == \\\"Ti...
{ "split": "train", "index": "39", "task_id": "L0/train/39", "reference_solution": "class Book:\n def __init__(self, title, author, year):\n self.title = title\n self.author = author\n self.year = year\n \n def get_info(self):\n return f\"Title: {self.title}, Author: {se...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a class `Circle` that models a circle with a given radius. The class should include the following methods:\n\n- `__init__(self, radius)...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Circle(1).area() == math.pi\\n \\n assert Circle(0).area() == 0\\n \\n assert Circle(2).circumference() == 4 * math.pi\\n \\n assert Circle(1.5).area() == math.pi * 2.25\\n \\n assert Circle(10)....
{ "split": "train", "index": "40", "task_id": "L0/train/40", "reference_solution": "import math\n\nclass Circle:\n def __init__(self, radius):\n self.radius = radius\n \n def area(self):\n return math.pi * self.radius ** 2\n \n def circumference(self):\n return 2 * math.pi * ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Rectangle` class in Python. The class should have two attributes, `width` and `height`, which are initialized...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Rectangle(3, 4).area() == 12\\n \\n assert Rectangle(3, 4).perimeter() == 14\\n \\n assert Rectangle(0, 0).area() == 0\\n \\n assert Rectangle(0, 0).perimeter() == 0\\n \\n assert Rectangle(5, 5)...
{ "split": "train", "index": "41", "task_id": "L0/train/41", "reference_solution": "class Rectangle:\n def __init__(self, width, height):\n self.width = width\n self.height = height\n \n def area(self):\n return self.width * self.height\n \n def perimeter(self):\n ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a Python class `Employee` to manage employee records. The class should support the following operations:\n\n1. *...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Employee(\\\"John Doe\\\", 123, \\\"HR\\\").get_employee_details() == \\\"Employee Name: John Doe, ID: 123, Department: HR\\\"\\n \\n assert Employee(\\\"Jane Smith\\\", 456, \\\"Engineering\\\").get_employee_deta...
{ "split": "train", "index": "42", "task_id": "L0/train/42", "reference_solution": "class Employee:\n def __init__(self, name, employee_id, department):\n self.name = name\n self.employee_id = employee_id\n self.department = department\n \n def update_department(self, new_departmen...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given two lists of integers. Your task is to implement a function `find_common_elements` that returns a sorted list of unique integers th...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert find_common_elements([1, 2, 3], [2, 3, 4]) == [2, 3]\\n \\n assert find_common_elements([5, 6, 7], [8, 9, 10]) == []\\n \\n assert find_common_elements([1, 1, 2, 2], [2, 2, 3, 3]) == [2]\\n \\n assert ...
{ "split": "train", "index": "43", "task_id": "L0/train/43", "reference_solution": "def find_common_elements(list1, list2):\n return sorted(set(list1) & set(list2))" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a list of integers. Your task is to implement a function `sort_and_filter_list(input_list)` that processes the list by first removi...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert sort_and_filter_list([-10, 5, -3, 8, 0, -1]) == [0, 5, 8]\\n \\n assert sort_and_filter_list([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\\n \\n assert sort_and_filter_list([-1, -2, -3, -4, -5]) == []\\n \\n as...
{ "split": "train", "index": "44", "task_id": "L0/train/44", "reference_solution": "def sort_and_filter_list(input_list):\n return sorted([x for x in input_list if x >= 0])" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Book` class in Python. The class should have the following attributes:\n- `title`: A string representing the ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", 1949).get_details() == \\\"Title: 1984, Author: George Orwell, Year: 1949\\\"\\n \\n assert Book(\\\"To Kill a Mockingbird\\\", \\\"Harper Lee\\\", 1960).get_details() == ...
{ "split": "train", "index": "45", "task_id": "L0/train/45", "reference_solution": "class Book:\n def __init__(self, title, author, year):\n self.title = title\n self.author = author\n self.year = year\n \n def get_details(self):\n return f\"Title: {self.title}, Author: {sel...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a Python class `Counter` with the following specifications:\n\n- The class should have an initializer that accepts an optional paramete...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Counter().get_count() == 0\\n \\n assert Counter(5).get_count() == 5\\n \\n assert Counter(-3).get_count() == -3\\n \\n c = Counter(); c.increment(); assert c.get_count() == 1\\n \\n c = Counter(...
{ "split": "train", "index": "46", "task_id": "L0/train/46", "reference_solution": "class Counter:\n def __init__(self, initial_count=0):\n self.count = initial_count\n \n def increment(self):\n self.count += 1\n \n def decrement(self):\n self.count -= 1\n \n ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a list of integers. Your task is to compute the cumulative sum of the list. The cumulative sum at each position is the sum of the c...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert cumulative_sum([1, 2, 3, 4]) == [1, 3, 6, 10]\\n \\n assert cumulative_sum([0, 0, 0, 0]) == [0, 0, 0, 0]\\n \\n assert cumulative_sum([10, 20, 30]) == [10, 30, 60]\\n \\n assert cumulative_sum([-1, -2,...
{ "split": "train", "index": "47", "task_id": "L0/train/47", "reference_solution": "def cumulative_sum(nums):\n total = 0\n result = []\n for num in nums:\n total += num\n result.append(total)\n return result" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a Python class named `Employee` to manage employee data. The class should store the following attributes for eac...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Employee(\\\"John Doe\\\", 123, \\\"HR\\\", 50000).get_name() == \\\"John Doe\\\"\\n \\n assert Employee(\\\"Jane Smith\\\", 456, \\\"Engineering\\\", 75000).get_id() == 456\\n \\n assert Employee(\\\"Alice ...
{ "split": "train", "index": "48", "task_id": "L0/train/48", "reference_solution": "class Employee:\n def __init__(self, name, id, department, salary):\n self._name = name\n self._id = id\n self._department = department\n self._salary = salary\n \n def get_name(self):\n ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a Python class named `Person` with the following specifications:\n- The class should have three attributes: `name`, `age`, and `email`....
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Person(\\\"Alice\\\", 25, \\\"alice@example.com\\\").get_details() == \\\"Name: Alice, Age: 25, Email: alice@example.com\\\"\\n \\n assert Person(\\\"Bob\\\", 40, \\\"bob@example.com\\\").get_details() == \\\"Name...
{ "split": "train", "index": "49", "task_id": "L0/train/49", "reference_solution": "class Person:\n def __init__(self, name, age, email):\n self.name = name\n self.age = age\n self.email = email\n \n def get_details(self):\n return f\"Name: {self.name}, Age: {self.age}, Emai...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with processing a dataset of customer reviews and their corresponding ratings. Each review is represented as a string, and each ra...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert classify_reviews([(\\\"Great product!\\\", 5)]) == [(\\\"Great product!\\\", \\\"positive\\\")]\\n \\n assert classify_reviews([(\\\"Not bad, but could be better.\\\", 3)]) == [(\\\"Not bad, but could be better.\\...
{ "split": "train", "index": "50", "task_id": "L0/train/50", "reference_solution": "def classify_reviews(reviews):\n result = []\n for review, rating in reviews:\n if rating >= 4:\n result.append((review, \"positive\"))\n elif rating <= 2:\n result.append((review, \"neg...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a dictionary and a key. Your task is to implement a function that returns the value associated with the key if it exists in the dic...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert get_value_from_dict({'a': 1, 'b': 2}, 'a', 0) == 1\\n \\n assert get_value_from_dict({'a': 1, 'b': 2}, 'c', 0) == 0\\n \\n assert get_value_from_dict({}, 'a', 'default') == 'default'\\n \\n assert get_...
{ "split": "train", "index": "51", "task_id": "L0/train/51", "reference_solution": "def get_value_from_dict(d, key, default):\n return d.get(key, default)" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a function `generate_random_sentence(nouns, verbs, adjectives)` that constructs a random sentence by selecting o...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert generate_random_sentence([\\\"cat\\\"], [\\\"jumps\\\"], [\\\"happy\\\"]) == \\\"The happy cat jumps.\\\"\\n \\n assert generate_random_sentence([\\\"dog\\\"], [\\\"runs\\\"], [\\\"lazy\\\"]) == \\\"The lazy dog r...
{ "split": "train", "index": "52", "task_id": "L0/train/52", "reference_solution": "import random\n\ndef generate_random_sentence(nouns, verbs, adjectives):\n adjective = random.choice(adjectives)\n noun = random.choice(nouns)\n verb = random.choice(verbs)\n return f\"The {adjective} {noun} {verb}.\...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: Implement a Python class `Car` with the following specifications:\n\n- The class should have an initializer `__init__` that takes four parameters...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Car(\\\"Toyota\\\", \\\"Corolla\\\", 2020, 15000).make == \\\"Toyota\\\"\\n \\n assert Car(\\\"Toyota\\\", \\\"Corolla\\\", 2020, 15000).model == \\\"Corolla\\\"\\n \\n assert Car(\\\"Toyota\\\", \\\"Corolla...
{ "split": "train", "index": "53", "task_id": "L0/train/53", "reference_solution": "class Car:\n def __init__(self, make, model, year, mileage):\n self.make = make\n self.model = model\n self.year = year\n self.mileage = mileage\n \n def update_mileage(self, new_mileage)...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a function `generate_fibonacci_sequence` that generates the first `n` numbers of the Fibonacci sequence. The Fib...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert generate_fibonacci_sequence(1) == [0]\\n \\n assert generate_fibonacci_sequence(2) == [0, 1]\\n \\n assert generate_fibonacci_sequence(3) == [0, 1, 1]\\n \\n assert generate_fibonacci_sequence(5) == [0...
{ "split": "train", "index": "54", "task_id": "L0/train/54", "reference_solution": "def generate_fibonacci_sequence(n):\n fib = []\n a, b = 0, 1\n for _ in range(n):\n fib.append(a)\n a, b = b, a + b\n return fib" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a temperature value and its scale. Your task is to write a function `convert_temperature` that converts the temperature from Celsiu...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert convert_temperature(0, \\\"C\\\") == 32.0\\n \\n assert convert_temperature(100, \\\"C\\\") == 212.0\\n \\n assert convert_temperature(32, \\\"F\\\") == 0.0\\n \\n assert convert_temperature(212, \\\"F...
{ "split": "train", "index": "55", "task_id": "L0/train/55", "reference_solution": "def convert_temperature(temp, scale):\n if scale == \"C\":\n return (temp * 9/5) + 32\n elif scale == \"F\":\n return (temp - 32) * 5/9\n else:\n raise ValueError(\"Scale must be 'C' or 'F'\")" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a JSON object represented as a dictionary where each key is a username and each value is a list of integers representing scores. Yo...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert merge_scores({\\\"alice\\\": [10, 20, 30], \\\"bob\\\": [5, 15, 25]}) == {\\\"alice\\\": 60, \\\"bob\\\": 45}\\n \\n assert merge_scores({\\\"charlie\\\": [10, 10, 10], \\\"dave\\\": [20, 20, 20, 20]}) == {\\\"cha...
{ "split": "train", "index": "56", "task_id": "L0/train/56", "reference_solution": "def merge_scores(data):\n result = {}\n for username, scores in data.items():\n total = sum(scores)\n result[username] = total\n return result" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Book` class in Python. The class should support the following functionalities:\n\n1. **Initialization**: The ...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", \\\"9780451524935\\\", 1949).get_details() == \\\"Title: 1984, Author: George Orwell, ISBN: 9780451524935, Publication Year: 1949\\\"\\n \\n assert Book(\\\"To Kill a Mock...
{ "split": "train", "index": "57", "task_id": "L0/train/57", "reference_solution": "class Book:\n def __init__(self, title, author, isbn, publication_year):\n self.title = title\n self.author = author\n self.isbn = isbn\n self.publication_year = publication_year\n \n def get...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a `Book` class in Python. The class should encapsulate the properties of a book, including its title, author, an...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert Book(\\\"1984\\\", \\\"George Orwell\\\", \\\"9780451524935\\\").get_details() == \\\"Title: 1984, Author: George Orwell, ISBN: 9780451524935\\\"\\n \\n assert Book(\\\"To Kill a Mockingbird\\\", \\\"Harper Lee\\\...
{ "split": "train", "index": "58", "task_id": "L0/train/58", "reference_solution": "class Book:\n def __init__(self, title, author, isbn):\n self._title = title\n self._author = author\n self._isbn = isbn\n \n def get_details(self):\n return f\"Title: {self._title}, Author: ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a dictionary `data` containing the keys `'name'`, `'age'`, and `'email'`. Your task is to implement a function `generate_email` tha...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert generate_email({\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30, \\\"email\\\": \\\"alice@example.com\\\"}) == \\\"Hello Alice, you are 30 years old. Your email address is alice@example.com.\\\"\\n \\n assert generat...
{ "split": "train", "index": "59", "task_id": "L0/train/59", "reference_solution": "def generate_email(data):\n return f\"Hello {data['name']}, you are {data['age']} years old. Your email address is {data['email']}.\"" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a sequence of movement commands for a character on an infinite 2D grid. The character starts at the origin (0, 0). The commands can...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert final_position(['up', 'right', 'down', 'down', 'left']) == (0, -1)\\n \\n assert final_position(['up', 'up', 'up']) == (0, 3)\\n \\n assert final_position(['down', 'down', 'down']) == (0, -3)\\n \\n as...
{ "split": "train", "index": "60", "task_id": "L0/train/60", "reference_solution": "def final_position(commands):\n x = 0\n y = 0\n for command in commands:\n if command == 'up':\n y += 1\n elif command == 'down':\n y -= 1\n elif command == 'left':\n ...
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are given a dictionary `data` where each key is a string representing a category and each value is a list of integers representing values wit...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert sum_values({'fruits': [10, 20, 30], 'vegetables': [5, 15, 25]}) == 105\\n \\n assert sum_values({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]}) == 45\\n \\n assert sum_values({'single': [42]}) == 42\\n ...
{ "split": "train", "index": "61", "task_id": "L0/train/61", "reference_solution": "def sum_values(data):\n return sum(sum(lst) for lst in data.values())" }
humaneval
[ { "role": "user", "content": "You are an expert Python programmer. Write a solution to the following task and return it in a single ```python code block.\n\nTask: You are tasked with implementing a function `generate_random_matrix` that constructs an `n x n` matrix filled with random integers within a given...
code
{ "style": "rule", "ground_truth": "{\"functional\": \"def check(candidate):\\n \\n assert len(generate_random_matrix(3, 1, 10)) == 3\\n \\n assert all(len(row) == 3 for row in generate_random_matrix(3, 1, 10))\\n \\n assert all(1 <= num <= 10 for row in generate_random_matrix(3, 1, 10) for num in...
{ "split": "train", "index": "62", "task_id": "L0/train/62", "reference_solution": "import random\n\ndef generate_random_matrix(n, min_val, max_val):\n return [[random.randint(min_val, max_val) for _ in range(n)] for _ in range(n)]" }
End of preview. Expand in Data Studio

ORL training data

The training prompts and references of the paper runs of On-Policy Residual Learning (ORL), in the parquet format the training recipes read (data_source, prompt, ability, reward_model, extra_info).

[Paper] [Project Page] [Code] [Models]

File Rows Used by SHA-256
code_l0-20260828/train.parquet 819 QwenDLM + ORL 81096d39e59a40ed4001503dfcacf25dc45c5f3c84600afa198b4e0b11e781da
gsm8k-math-code_l0-mix-20260909/train.parquet 2457 LLaDA-2.1-mini + ORL, DiffusionGemma + ORL 751547ba1a3faa3729c9f7db00b22b984127f4d837097906e927363fd1a81fae
gsm8k-math-code_l0-mix-20260909/train_from450.parquet 2007 not read by the release (see below) 0b5e249243e4d5abd1cdd688c1e9a5ce2fd0fde34e5a6f6cc39954e242c49d72
code_he_clean_rebuild/val.parquet 164 validation file of the QwenDLM and LLaDA-2.1-mini recipes (loaded, never evaluated during training) 9d32c5091435ed0de674853eee4ba3010b4a2390837f9bce75a92a0ef1698878

SHA256SUMS lists the same hashes. Download into the directory that the training commands call $DATA:

hf download yifanyu/ORL-training-data --repo-type dataset --local-dir $DATA
(cd $DATA && sha256sum -c SHA256SUMS)

Contents

  • Code (code_l0-20260828): 819 Python problems with test cases derived from the training split of nvidia/OpenCodeInstruct. Their data_source is humaneval because that value routes them to the code reward; they are not HumanEval problems.
  • Mixture (gsm8k-math-code_l0-mix-20260909/train.parquet): 819 problems each from the training splits of openai/gsm8k and DigitalLearningGmbH/MATH-lighteval and 819 code problems in the one-visible-assert prompt format, shuffled with seed 20260725. The data order is fixed: the recipes read it without shuffling.
  • train_from450.parquet: rows 450 onward of the mixture, with which the paper's LLaDA-2.1-mini run was relaunched from its step-450 checkpoint. The release trains in one launch on train.parquet, which reaches the same rows in the same order.
  • Validation (code_he_clean_rebuild/val.parquet): the 164 problems of HumanEval.

Licenses

The code problems derive from OpenCodeInstruct (CC BY 4.0); GSM8K, MATH-lighteval and HumanEval are MIT-licensed.

Citation

@misc{yu2026orl,
  title         = {On-Policy Residual Learning for Diffusion Language Models},
  author        = {Yu, Yifan and Jian, Yuqing and Li, Jisen and Hu, Yuezhou and Zhang, Tianyi and Wu, Xiaoxia and
                   Zhu, Rui-Jie and Wang, Junxiong and Zhou, Zhongzhu and Lai, Fan and Zou, James and Xu, Chenfeng},
  year          = {2026},
  eprint        = {2610.20687},
  archivePrefix = {arXiv},
  primaryClass  = {cs.LG},
  url           = {https://arxiv.org/abs/2610.20687}
}
Downloads last month
45

Collection including yifanyu/ORL-training-data

Paper for yifanyu/ORL-training-data