data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Write a function that computes the nth Fibonacci number efficiently without using any recursive functions or loops such as for, while, etc. The function should store previously computed Fibonacci numbers to allow for O(1) time retrieval of Fibonacci numbers that have been calcu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 73400,
"acecode_id": "evol_5411",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple stack data structure using a list. The stack should support the following operations:\n1. `push(item)`: Add an item to the top of the stack.\n2. `pop()`: Remove and return the item at the top of the stack.\n3. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stack_operations([('push', 1), ('push', 2), ('pop', None)]) == [2]\", \"assert stack_operations([('push', 10), ('push', 20), ('peek', None)]) == [20]\", \"assert stack_operations([('push', 5), ('is_empty', None)]) == [False]\", \"assert stack_operations([('p... | {
"split": "train",
"index": 73401,
"acecode_id": "oss_21908",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified decision tree learning algorithm. Your function should take a list of examples, a list of attributes, a list of parent examples, and an importance function. The function should determine the best attribute ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decision_tree_learning([], ['color', 'size'], [], lambda a, e: 0) is None\", \"assert decision_tree_learning([{'classification': 'A'}, {'classification': 'A'}], ['color', 'size'], [], lambda a, e: 0) == 'A'\", \"assert decision_tree_learning([{'classificatio... | {
"split": "train",
"index": 73402,
"acecode_id": "bigcode_python_fns_49471",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing data from a LiDAR sensor. The dictionary has the following structure: \n{\n 'lidarmsg': {\n 'range_max': <int>,\n 'header': {\n 'stamp': {\n 'secs': <int>\n }\n },\n 'ranges': [<float>, <float>, ...]\n }\n}\n\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_lidar_data({'lidarmsg': {'range_max': 100, 'header': {'stamp': {'secs': 1627689643}}, 'ranges': [2.5, 3.0, 2.8, 3.5, 2.9]}}) == None\", \"assert process_lidar_data({'lidarmsg': {'range_max': 50, 'header': {'stamp': {'secs': 1627689644}}, 'ranges': [1... | {
"split": "train",
"index": 73403,
"acecode_id": "oss_31160",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `validate_address(ip: str) -> bool` that validates a given string representing an IP address. The function should return `True` if the input string is a valid IPv4 or IPv6 address, and `False` otherwise. An IPv4 address consists of four decimal numbers (0-255) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_address('192.168.1.1') == True\", \"assert validate_address('255.255.255.255') == True\", \"assert validate_address('0.0.0.0') == True\", \"assert validate_address('256.100.50.25') == False\", \"assert validate_address('192.168.1.256') == False\", \... | {
"split": "train",
"index": 73404,
"acecode_id": "evol_13575",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a deployment automation system that involves handling a stack of resources. Write a function `run_dependencies_deployment_loop(stack, action, initialize=False)` that simulates a deployment loop for the stack's dependencies. Your function should hand... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_dependencies_deployment_loop({'output_map': MockOutputMap(), 'status': ''}, 'deploy', True) is None\", \"assert run_dependencies_deployment_loop({'output_map': MockOutputMap(), 'status': ''}, 'deploy', False) is None\", \"assert run_dependencies_deployme... | {
"split": "train",
"index": 73405,
"acecode_id": "oss_9987",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D array called `phaseogram` that represents a phaseogram with dimensions NxM. You are also provided with two arrays: `phase_bins` (with M + 1 elements) and `time_bins` (with N + 1 elements). Your task is to implement a function that checks if the `phaseogram` a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_phaseogram([[1, 2, 3], [4, 5, 6]], [0, 1, 2, 3], [0, 1, 2]) == True\", \"assert check_phaseogram([[1]], [0, 1], [0, 1]) == True\", \"assert check_phaseogram([[1, 2], [3, 4]], [0, 1], [0, 1]) == False\", \"assert check_phaseogram([[1, 2]], [0, 1, 2], [0... | {
"split": "train",
"index": 73406,
"acecode_id": "bigcode_python_fns_13679",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to create a block in a blockchain. A blockchain consists of blocks, each containing a list of transactions and a reference to the previous block. Each block has a hash size and a challenge level associated with it. The hash size repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_block(None, ['Alice sends 10 BTC to Bob']) == (64, 6)\", \"assert create_block(None, ['Alice sends 10 BTC to Bob', 'Bob sends 5 BTC to Carol']) == (64, 7)\", \"assert create_block('block1', ['Transaction 1', 'Transaction 2']) == (64, 7)\", \"assert cr... | {
"split": "train",
"index": 73407,
"acecode_id": "oss_17096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, implement a function `split_string_randomly(s: str) -> List[str]` that divides the string into a random number of distinct parts, where the number of parts is randomly chosen to be between 2 and 5. The size of these parts should also be randomly determined, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_string_randomly('ProgrammingIsFun') != split_string_randomly('ProgrammingIsFun')\", \"assert len(split_string_randomly('HelloWorld')) >= 2\", \"assert len(split_string_randomly('HelloWorld')) <= 5\", \"assert len(split_string_randomly('abcdefg')) >= 2\... | {
"split": "train",
"index": 73408,
"acecode_id": "evol_4904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two integers, a and b, as input and returns their sum. For example, given a = 5 and b = 7, the function should return 12.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add(0, 0) == 0\", \"assert add(1, 1) == 2\", \"assert add(2, 3) == 5\", \"assert add(10, 5) == 15\", \"assert add(-1, 1) == 0\", \"assert add(-5, -5) == -10\", \"assert add(100, 200) == 300\", \"assert add(50, 50) == 100\", \"assert add(8, 3) == 11\", \"asse... | {
"split": "train",
"index": 73409,
"acecode_id": "evol_877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains messages formatted as 'Value a={a} b={b}', where {a} and {b} are alphanumeric values. Write a function `extract_values(message: str) -> Dict[str, str]` that extracts the values of 'a' and 'b' from the message. The function should return a di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_values('Value a=1 b=23a') == {'a': '1', 'b': '23a'}\", \"assert extract_values('Value a=abc123 b=xyz') == {'a': 'abc123', 'b': 'xyz'}\", \"assert extract_values('Value a= a=1 b=23a') == {'a': '1', 'b': '23a'}\", \"assert extract_values('Value a=hello... | {
"split": "train",
"index": 73410,
"acecode_id": "bigcode_python_fns_26767",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing a sequence of numbers, implement a function that returns the maximum sum of a contiguous subarray of the given list. The function should handle any list size, including empty lists. If the list is empty, return 0.\nPlease reason step by ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([]) == 0\", \"assert max_subarray_sum([-1, -2, -3]) == -1\", \"assert max_subarray_sum([1, 2, 3]) == 6\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_su... | {
"split": "train",
"index": 73411,
"acecode_id": "bigcode_python_fns_8969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of module names represented as strings, write a function `unload_modules(name: str, module_list: List[str]) -> List[str]` that returns a new list of module names that do not start with the specified substring `name`. This function should filter out all module names... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unload_modules('xyz', ['xyzmodule', 'module1', 'xyztest', 'testmodule']) == ['module1', 'testmodule']\", \"assert unload_modules('test', ['test1', 'test2', 'example', 'testing', 'sample']) == ['example', 'sample']\", \"assert unload_modules('mod', ['module1'... | {
"split": "train",
"index": 73412,
"acecode_id": "bigcode_python_fns_35914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a multi-line string as input and replaces all occurrences of the phrase 'an apple a day keeps the doctor away' with 'a healthy lifestyle keeps diseases at bay'. The function should be case-insensitive and should also handle punctuation and tra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_phrases('an apple a day keeps the doctor away') == ('a healthy lifestyle keeps diseases at bay', 1)\", \"assert replace_phrases('AN APPLE A DAY KEEPS THE DOCTOR AWAY') == ('a healthy lifestyle keeps diseases at bay', 1)\", \"assert replace_phrases('T... | {
"split": "train",
"index": 73413,
"acecode_id": "evol_7346",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `control_access(num_users: int, max_active: int) -> List[int]` that simulates the access of users to a shared resource. The function takes two parameters: `num_users`, the total number of users trying to access the resource, and `max_active`, the maximum nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert control_access(10, 5) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert control_access(5, 3) == [0, 1, 2, 3, 4]\", \"assert control_access(0, 5) == []\", \"assert control_access(10, 10) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert control_access(7, 2) == [0, 1,... | {
"split": "train",
"index": 73414,
"acecode_id": "evol_6286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `recursive_sum(n)` that computes the sum of all positive integers from `1` to `n` using recursion. The function should take a single integer parameter `n` (where n >= 0) and return the computed sum. If n is 0, the function should return 0.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_sum(0) == 0\", \"assert recursive_sum(1) == 1\", \"assert recursive_sum(2) == 3\", \"assert recursive_sum(3) == 6\", \"assert recursive_sum(4) == 10\", \"assert recursive_sum(5) == 15\", \"assert recursive_sum(6) == 21\", \"assert recursive_sum(7) ... | {
"split": "train",
"index": 73415,
"acecode_id": "evol_16408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a messaging system in Python. The system should allow messages to be sent between users. You need to define a class `Message` that can store a sender, a receiver, and a channel for the message. Implement the following methods in the `Message` cl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (m := Message('Email')).set_sender('Alice') or m.get_sender() == 'Alice'\", \"assert (m := Message('Email')).set_receiver('Bob') or m.get_receiver() == 'Bob'\", \"assert (m := Message('SMS')).set_sender('Charlie') or m.get_sender() == 'Charlie'\", \"assert (... | {
"split": "train",
"index": 73416,
"acecode_id": "oss_1439",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a file name that needs to be deleted from a storage system. Write a function `delete_files(file_names: List[str], show_progress: bool) -> str` that takes in the following arguments: \n1. `file_names` (List[str]): A l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_files(['file1.txt', 'file2.txt', 'file3.txt'], True) == 'Deleting 3 files'\", \"assert delete_files(['doc1.pdf', 'doc2.pdf'], False) == 'Files deletion in progress'\", \"assert delete_files([], True) == 'Deleting 0 files'\", \"assert delete_files(['im... | {
"split": "train",
"index": 73417,
"acecode_id": "bigcode_python_fns_25377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of session data for different guilds, where each session data is represented as a dictionary containing the keys 'channel', 'webhook', and 'voice_channel'. The task is to implement a function that deletes the session data for a specified guild. If the sessi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_session([{'channel': 1, 'webhook': 10, 'voice_channel': 100}], 1) == 'Session for guild 1 deleted successfully.'\", \"assert delete_session([], 1) == 'Session does not exist.'\", \"assert delete_session([{'channel': 1, 'webhook': 10, 'voice_channel': ... | {
"split": "train",
"index": 73418,
"acecode_id": "bigcode_python_fns_4898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of course run identifiers. Each course run identifier is a unique string that consists of a prefix 'CR' followed by a sequential integer starting from 1 up to a specified number of course runs. Your function should t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_course_runs(3) == ['CR1', 'CR2', 'CR3']\", \"assert generate_course_runs(0) == []\", \"assert generate_course_runs(1) == ['CR1']\", \"assert generate_course_runs(5) == ['CR1', 'CR2', 'CR3', 'CR4', 'CR5']\", \"assert generate_course_runs(10) == ['CR1... | {
"split": "train",
"index": 73419,
"acecode_id": "bigcode_python_fns_29568",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a maximum absolute value `max_abs`, implement a function `numeric_float(max_abs: float) -> List[float]` that generates a list of numeric (non-infinite, non-NaN) floating-point numbers within the range [-max_abs, max_abs]. The function should return a list of 10 random flo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(numeric_float(1e3)) == 10\", \"assert all(-1e3 <= num <= 1e3 for num in numeric_float(1e3))\", \"assert len(numeric_float(5.0)) == 10\", \"assert all(-5.0 <= num <= 5.0 for num in numeric_float(5.0))\", \"assert len(numeric_float(10.5)) == 10\", \"assert... | {
"split": "train",
"index": 73420,
"acecode_id": "bigcode_python_fns_32413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_primes(start: int, end: int) -> List[int]` that returns a list of prime integers positioned between the given `start` and `end` values, excluding both `start` and `end`. The function should only consider integers greater than 1. For example, for `start = ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes(10, 20) == [11, 13, 17, 19]\", \"assert find_primes(11, 20) == [13, 17, 19]\", \"assert find_primes(1, 10) == [2, 3, 5, 7]\", \"assert find_primes(20, 30) == [23, 29]\", \"assert find_primes(15, 25) == [17, 19, 23]\", \"assert find_primes(0, 5) =... | {
"split": "train",
"index": 73421,
"acecode_id": "evol_17461",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to process and validate a list of options for a configuration file. The function should take in a list of options, each represented as a string, and ensure that they are correctly formatted and do not conflict with any existing option... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_options({'formatted_option1': 'prefix1formatted_option1;'}, ('arg1', 'arg2'), 'prefix', ['formatted_option2']) == True\", \"assert process_options({}, ('arg1',), 'test_prefix', ['option1']) == True\", \"assert process_options({'option1': 'test_prefix... | {
"split": "train",
"index": 73422,
"acecode_id": "oss_815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `message_manager` that simulates a messaging system for a worker process. The function should have the following behavior: it should return a message indicating when the worker process starts, simulate sending a message, simulate rece... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert message_manager('Worker process started.', True) == ('Worker process started.', 'Message sent.', 'Messages received.', True)\", \"assert message_manager('Ready to work!', True) == ('Ready to work!', 'Message sent.', 'Messages received.', True)\", \"assert me... | {
"split": "train",
"index": 73423,
"acecode_id": "oss_24370",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, your task is to implement a function `generate_histogram(data: List[int]) -> str` that takes a list of integers as input and returns a textual representation of the histogram. The histogram should display the frequency of each integer using asterisks (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_histogram([3, 5, 3, 7]) == '3: **\\\\n5: *\\\\n7: *\\\\n'\", \"assert generate_histogram([1, 1, 2, 2, 2, 3]) == '1: **\\\\n2: ***\\\\n3: *\\\\n'\", \"assert generate_histogram([4]) == '4: *\\\\n'\", \"assert generate_histogram([10, 10, 10, 5, 5]) ==... | {
"split": "train",
"index": 73424,
"acecode_id": "oss_28324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function that sorts a list containing both numeric values (integers and floats) and string values in ascending order. The function should return two separate lists: one containing all the numeric values sorted in ascending order and the other containing all the stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_sort_list_mixed_types([3, 1, 2, 'apple', 'banana']) == ([1, 2, 3], ['apple', 'banana'])\", \"assert custom_sort_list_mixed_types([3.5, 1.2, 2.8, 'cat', 'dog']) == ([1.2, 2.8, 3.5], ['cat', 'dog'])\", \"assert custom_sort_list_mixed_types(['zebra', 'ap... | {
"split": "train",
"index": 73425,
"acecode_id": "evol_33420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of track objects where each track object has a property 'value' representing the quality of the track. Write a function `filter_tracks(decoded_tracks, p_min)` that takes this list of track objects and a minimum threshold `p_min` as input and returns a filte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_tracks([], 10) == []\", \"assert filter_tracks([{'value': 10}], 10) == [{'value': 10}]\", \"assert filter_tracks([{'value': 5}, {'value': 10}], 6) == [{'value': 10}]\", \"assert filter_tracks([{'value': 10}, {'value': 20}, {'value': 30}], 15) == [{'va... | {
"split": "train",
"index": 73426,
"acecode_id": "oss_1251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the available sizes of items in a store and a list of desired items, where each desired item is represented as a tuple containing its size and price. Your task is to write a function that calculates the total cost to purchase all th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost([1, 2, 3, 4, 5], [(2, 10), (4, 20), (6, 30)]) == 30\", \"assert calculate_total_cost([1, 1, 2, 2, 3], [(1, 5), (2, 10), (3, 15)]) == 30\", \"assert calculate_total_cost([5, 6, 7], [(4, 10), (5, 20), (6, 30)]) == 50\", \"assert calculate_... | {
"split": "train",
"index": 73427,
"acecode_id": "oss_22354",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the minimum number of moves a Knight can take to reach a target position (x, y) on an n x n chessboard, starting from the position (0, 0). The function should return the minimum number of moves required to reach the target position, or -1 if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minStepToReachTarget((0, 0), (1, 2), 8) == 1\", \"assert minStepToReachTarget((0, 0), (2, 1), 8) == 1\", \"assert minStepToReachTarget((0, 0), (3, 3), 8) == 2\", \"assert minStepToReachTarget((0, 0), (7, 7), 8) == 6\", \"assert minStepToReachTarget((0, 0), (... | {
"split": "train",
"index": 73428,
"acecode_id": "evol_33740",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts the name of a package from a given string representation of a setup.py file content. The setup.py file is a common file used in Python projects to define the metadata about the project such as its name, version, depen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_package_name(\\\"from setuptools import setup\\\\n\\\\nsetup(\\\\n name='bdo',\\\\n version='1.0',\\\\n description='Example package for problem creation',\\\\n author='Your Name',\\\\n author_email='your@email.com',\\\\n packages=[... | {
"split": "train",
"index": 73429,
"acecode_id": "oss_35862",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the age of a news article in days based on its publication date and the current date. The function will take the following parameters: \n- date (string): The publication date of the news article in the format 'YYYY-MM-DD'.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_age_in_days('2023-10-10') == 0\", \"assert calculate_age_in_days('2023-10-09') == 1\", \"assert calculate_age_in_days('2023-10-01') == 9\", \"assert calculate_age_in_days('2023-09-30') == 10\", \"assert calculate_age_in_days('2019-10-10') == 1461\"... | {
"split": "train",
"index": 73430,
"acecode_id": "oss_25298",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `filter_and_sort_books(book_dict, min_values)` that accepts a dictionary where each key is a book title and each value is a tuple containing the following parameters: (book_price, book_rating, book_pages, book_publication_year, book_sold_copies, book_review... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort_books({'Book A': (10.0, 4.5, 300, 2020, 1500, 200, 'Author A', 'Fiction')}, (5.0, 4.0, 100, 2015, 1000, 50)) == [('Book A', (10.0, 4.5, 300, 2020, 1500, 200, 'Author A', 'Fiction'))]\", \"assert filter_and_sort_books({'Book A': (10.0, 4.5, 30... | {
"split": "train",
"index": 73431,
"acecode_id": "evol_11629",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of products, where each product is represented as a dictionary containing 'name', 'price', and 'stock' fields. Your function should return a list of strings that represent the stock status of each product. The stock stat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stock_status([{'name': 'Product A', 'price': 10.0, 'stock': 5}]) == ['In stock']\", \"assert stock_status([{'name': 'Product B', 'price': 15.0, 'stock': 0}]) == ['Out of stock']\", \"assert stock_status([{'name': 'Product C', 'price': 20.0, 'stock': 3}, {'na... | {
"split": "train",
"index": 73432,
"acecode_id": "oss_13940",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple authentication function. Write a function named `authenticate_user` that takes two parameters: a string `username` and a string `password`. The function should return True if the username and password match the following valid pairs: ('test... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('test_user', 'password123') == True\", \"assert authenticate_user('admin', 'admin123') == True\", \"assert authenticate_user('test_user', 'wrong_password') == False\", \"assert authenticate_user('wrong_user', 'password123') == False\", \"as... | {
"split": "train",
"index": 73433,
"acecode_id": "oss_16750",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_occurrences(arr: List[int], target: int) -> List[int]` that takes in a list of integers `arr` and an integer `target`. The function should return a list of indices where `target` appears in `arr`. If `target` does not exist in `arr`, return an empty list.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_occurrences([1, 2, 3, 4, 5], 3) == [2]\", \"assert find_occurrences([1, 2, 3, 2, 4, 2, 5], 2) == [1, 3, 5]\", \"assert find_occurrences([7, 8, 9, 10], 11) == []\", \"assert find_occurrences([1, 1, 1], 1) == [0, 1, 2]\", \"assert find_occurrences([], 0) ... | {
"split": "train",
"index": 73434,
"acecode_id": "evol_28870",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves specific indices from a dataset based on a set of filtering conditions. Each filtering condition is represented as a tuple with three elements: (column_name, operator, value). Your function should take a list of these f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_filtered_indices([{'column1': 15, 'column2': 'value'}, {'column1': 5, 'column2': 'value'}, {'column1': 20, 'column2': 'other'}], [('column1', '>', 10)]) == [0, 2]\", \"assert get_filtered_indices([{'column1': 15, 'column2': 'value'}, {'column1': 5, 'colu... | {
"split": "train",
"index": 73435,
"acecode_id": "oss_23831",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that analyzes a given list of problems and their associated solutions. The function should take in two parameters: a list of problem names and a list of lists where each inner list contains the names of solutions for the corresponding pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_problems(['Problem1', 'Problem2', 'Problem3'], [['sol1', 'sol2'], ['sol1'], []]) == ({'Problem1': 2, 'Problem2': 1}, {1: 1, 2: 1})\", \"assert analyze_problems(['A', 'B'], [[], []]) == ({}, {})\", \"assert analyze_problems(['P1', 'P2', 'P3'], [['s1']... | {
"split": "train",
"index": 73436,
"acecode_id": "bigcode_python_fns_39860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a Python dictionary as input and returns its JSON representation as a string. The function should handle any valid dictionary input and convert it to a JSON string using the built-in json module.\nPlease reason step by step, then write a self-contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert json.dumps({'name': 'Alice', 'age': 30}) == '{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}'\", \"assert json.dumps({'city': 'New York', 'country': 'USA'}) == '{\\\"city\\\": \\\"New York\\\", \\\"country\\\": \\\"USA\\\"}'\", \"assert json.dumps({'is_studen... | {
"split": "train",
"index": 73437,
"acecode_id": "evol_82",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of an endpoint response based on a given status code. The function `simulate_endpoint_response(status_code: int) -> Dict[str, Any]` should take an integer status code as input and return a dictionary with two k... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_endpoint_response(200) == {'response': 'test', 'status': 200}\", \"assert simulate_endpoint_response(404) == {'response': 'test', 'status': 404}\", \"assert simulate_endpoint_response(500) == {'response': 'test', 'status': 500}\", \"assert simulate_... | {
"split": "train",
"index": 73438,
"acecode_id": "bigcode_python_fns_3995",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `validate_choice(choices, user_input, default_key=None, normalizer=None)` that validates a user's input against a list of choices. The `choices` parameter is a list of 2-tuples, where each tuple contains a string (the key) and its ass... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_choice([('apple', 1), ('banana', 2)], 'apple') == 1\", \"assert validate_choice([('apple', 1), ('banana', 2)], 'banana') == 2\", \"assert validate_choice([('apple', 1), ('banana', 2)], 'ap') == 1\", \"assert validate_choice([('apple', 1), ('banana',... | {
"split": "train",
"index": 73439,
"acecode_id": "bigcode_python_fns_8127",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the heights of a series of bars in a histogram, write a function `largestRectangleArea(heights: List[int]) -> int` that computes the area of the largest rectangle that can be formed within the histogram. The rectangle must be bounded by the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largestRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert largestRectangleArea([1, 1, 1, 1]) == 4\", \"assert largestRectangleArea([5, 2, 1, 6, 2, 3]) == 6\", \"assert largestRectangleArea([1, 3, 2, 5, 4]) == 8\", \"assert largestRectangleArea([0, 1, 0, 1, ... | {
"split": "train",
"index": 73440,
"acecode_id": "bigcode_python_fns_10258",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that prepares a mini-batch of data from two lists of tuples: positive and negative samples. Each tuple contains an identifier and a value. The function takes in three parameters: a list of positive samples, a list of negative samples, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mini_batch([('a', 0), ('b', 1), ('c', 2)], [('d', 0), ('e', 1), ('f', 2)], 1) == []\", \"assert mini_batch([('a', 0), ('b', 1), ('c', 2)], [('d', 20), ('e', 21)], 4) == []\", \"assert mini_batch([('a', 0), ('b', 2), ('c', 4)], [('d', 1), ('e', 3), ('f', 5)],... | {
"split": "train",
"index": 73441,
"acecode_id": "bigcode_python_fns_33761",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a `ModelManager` class that manages machine learning models and their trainers. Your task is to implement the `get_trainer` method within this class. The `get_trainer` method should take two parameters: a `model` (a string representing the name of the model) and `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ModelManager().get_trainer('LinearRegression', {'learning_rate': 0.01}) is not None\", \"assert isinstance(ModelManager().get_trainer('DecisionTree', {'max_depth': 5}), Trainer)\", \"assert ModelManager().get_trainer('RandomForest', {'n_estimators': 100}) is... | {
"split": "train",
"index": 73442,
"acecode_id": "oss_29723",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `hex_to_rgb(hex_color: str) -> Union[Tuple[int, int, int], str]` that checks if a given string is a valid hexadecimal color code and converts it into its RGB equivalent. The input can be in shorthand (3-digit) or full form (6-digit) hexadecimal color codes.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_rgb('#fff') == (255, 255, 255)\", \"assert hex_to_rgb('#000') == (0, 0, 0)\", \"assert hex_to_rgb('#123456') == (18, 52, 86)\", \"assert hex_to_rgb('#abc') == (170, 187, 204)\", \"assert hex_to_rgb('#ffffff') == (255, 255, 255)\", \"assert hex_to_rgb(... | {
"split": "train",
"index": 73443,
"acecode_id": "evol_17983",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple account validation function for a web application. The function should take four parameters: `form_data`, `account_id`, `current_participants_account_ids`, and `redirect_url`. The `form_data` is an object that has a method `is_valid()` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_account(form_data_valid, 1, [2, 3], 'http://example.com') == True\", \"assert validate_account(form_data_invalid, 1, [2, 3], 'http://example.com') == False\", \"assert validate_account(form_data_valid, 4, [2, 3], 'http://example.com') == False\", \"... | {
"split": "train",
"index": 73444,
"acecode_id": "oss_29657",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of sentences, implement a function that performs part-of-speech tagging on each word in the sentences. Your function should return a list of strings where each string contains the original word followed by its part-of-speech tag, separated by a slash. The part-of-s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pos_tagging(['I love programming'], {'I': 'PRON', 'love': 'VERB', 'programming': 'NOUN'}) == ['I/PRON', 'love/VERB', 'programming/NOUN']\", \"assert pos_tagging(['Python is great'], {'Python': 'NOUN', 'is': 'VERB', 'great': 'ADJ'}) == ['Python/NOUN', 'is/VER... | {
"split": "train",
"index": 73445,
"acecode_id": "oss_32757",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of numbers as input and returns a new list containing only the even numbers from the original list. Implement the function `filter_even_numbers(numbers: List[int]) -> List[int]` where `numbers` is a list of integers. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([-2, -3, -4, -5])... | {
"split": "train",
"index": 73446,
"acecode_id": "oss_14406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `export_format(args: Dict[str, bool]) -> str` that determines the type of export based on the provided arguments. The function takes a dictionary `args` where the keys can be 'deb', 'docs', or 'iso'. If 'deb' is `True`, the function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert export_format({'deb': True, 'docs': False, 'iso': False}) == 'Exporting in debug format'\", \"assert export_format({'deb': False, 'docs': True, 'iso': False}) == 'Exporting documentation'\", \"assert export_format({'deb': False, 'docs': False, 'iso': True}) ... | {
"split": "train",
"index": 73447,
"acecode_id": "bigcode_python_fns_31957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of configuration dictionaries, where each configuration has a 'key', 'type', and 'id'. Your task is to sort these configurations based on the following criteria: first by 'key' alphabetically (case insensitive), then by 'type' in the order of 'global', 'pac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_configs([{'key': 'network', 'type': 'node', 'id': 'A1'}, {'key': 'network', 'type': 'global', 'id': 'G1'}, {'key': 'storage', 'type': 'package', 'id': 'P3'}, {'key': 'storage', 'type': 'node', 'id': 'A2'}, {'key': 'network', 'type': 'package', 'id': 'P1... | {
"split": "train",
"index": 73448,
"acecode_id": "bigcode_python_fns_3575",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a bubble sort algorithm to rearrange a list of integers in ascending order. The function should modify the input list in place and return it. You do not need to print the intermediate steps of the sorting process. The input list can contain both positive and negative ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([3, 1, 4, 1, 5]) == [1, 1, 3, 4, 5]\", \"assert bubble_sort([10, -1, 2, 0]) == [-1, 0, 2, 10]\", \"assert bubble_sort([5]) == [5]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([-5, -1, -3, -2]) == [-5, -3, -2, -1]\", \"assert bubble_s... | {
"split": "train",
"index": 73449,
"acecode_id": "evol_20140",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists representing a square matrix of integers. Your task is to implement a function that checks if the given matrix is a magic square or not. A magic square is defined as a square matrix in which the sum of each row, each column, and both main diagonals... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_magic_square([[1]]) == True\", \"assert is_magic_square([[4, 9, 2], [3, 5, 7], [8, 1, 6]]) == True\", \"assert is_magic_square([[2, 7, 6], [9, 5, 1], [4, 3, 8]]) == True\", \"assert is_magic_square([[8, 1, 6], [3, 5, 7], [4, 9, 2]]) == True\", \"assert is... | {
"split": "train",
"index": 73450,
"acecode_id": "oss_37353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sum_primes_in_fibo(n: int) -> int` that calculates the sum of the prime numbers in the Fibonacci series up to the nth term. The Fibonacci series starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should effi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_primes_in_fibo(0) == 0\", \"assert sum_primes_in_fibo(1) == 0\", \"assert sum_primes_in_fibo(4) == 2\", \"assert sum_primes_in_fibo(5) == 5\", \"assert sum_primes_in_fibo(7) == 10\"]}"
} | {
"split": "train",
"index": 73451,
"acecode_id": "evol_7124",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to determine the status of a student based on their average grade. Write a function `student_status(name: str, average_grade: float) -> str` that takes in two parameters: the student's name (a string) and their average grade (a float). Ba... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert student_status('Alice', 8.5) == 'Approved'\", \"assert student_status('Bob', 6.5) == 'In recovery'\", \"assert student_status('Charlie', 4.0) == 'Failed'\", \"assert student_status('David', 7.0) == 'Approved'\", \"assert student_status('Eve', 5.5) == 'In rec... | {
"split": "train",
"index": 73452,
"acecode_id": "oss_27814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given layout represented as a nested structure of Python dictionaries and lists. Your goal is to extract the class names of all the `dbc.Row` components within the layout and return them as a list. The layout may c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_row_class_names({'children': [{'type': 'dbc.Row', 'props': {'className': 'row-class-1'}, 'children': []}]}) == ['row-class-1']\", \"assert extract_row_class_names({'children': [{'type': 'html.Div', 'children': []}, {'type': 'dbc.Row', 'props': {'clas... | {
"split": "train",
"index": 73453,
"acecode_id": "oss_37485",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that returns a portion of recent items from a given list. The function should take a list of items and an optional float parameter representing the recent portion to be considered (default is 0.2). The function should return the most ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_recent_items(['a', 'b', 'c', 'd'], 0.25) == ['d']\", \"assert get_recent_items([10, 20, 30], 1.0) == [10, 20, 30]\", \"assert get_recent_items([1, 2, 3, 4, 5], 1.5) == [1, 2, 3, 4, 5]\", \"assert get_recent_items([1], 0.2) == [1]\", \"assert get_recent_i... | {
"split": "train",
"index": 73454,
"acecode_id": "oss_27840",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function called 'make_a_pile' that takes three parameters: a non-zero positive integer 'n', a 'pattern' which can be either 'odd' or 'even', and an optional 'offset' (defaulting to 0). The function should return a list representing a series of stone piles, where eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_a_pile(3, 'odd') == [3, 5, 7]\", \"assert make_a_pile(5, 'odd') == [5, 7, 9, 11, 13]\", \"assert make_a_pile(1, 'odd') == [1]\", \"assert make_a_pile(1, 'even') == [1]\", \"assert make_a_pile(2, 'odd') == [2, 4]\", \"assert make_a_pile(2, 'even') == [2,... | {
"split": "train",
"index": 73455,
"acecode_id": "evol_35289",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Develop the Python function titled \"multiply_three_numbers\" that takes three distinct integer inputs, a, b, and c. The function should multiply these three integers together using a multistep computational process without utilizing in-built methods, and output the resulting p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_three_numbers(2, 3, 4) == 24\", \"assert multiply_three_numbers(-2, -3, -4) == -24\", \"assert multiply_three_numbers(0, 5, 10) == 0\", \"assert multiply_three_numbers(1, 1, 1) == 1\", \"assert multiply_three_numbers(-5, 6, 0) == 0\", \"assert multi... | {
"split": "train",
"index": 73456,
"acecode_id": "evol_13637",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `prime_numbers(n)` that takes a positive integer n and returns a list of all prime numbers between 2 and n, inclusive. If n is not a positive integer, the function should return the error message 'Error: The input must be a positive integer'. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_numbers(10) == [2, 3, 5, 7]\", \"assert prime_numbers(0) == 'Error: The input must be a positive integer'\", \"assert prime_numbers(-5) == 'Error: The input must be a positive integer'\", \"assert prime_numbers(25) == [2, 3, 5, 7, 11, 13, 17, 19, 23]\"... | {
"split": "train",
"index": 73457,
"acecode_id": "evol_29314",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that calculates the sum of all integers from 0 to n-1, where n is a non-negative integer provided as input. The function should take a single integer parameter n and return the computed sum. For example, if n is 5, the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_integers(0) == 0\", \"assert sum_of_integers(1) == 0\", \"assert sum_of_integers(2) == 1\", \"assert sum_of_integers(3) == 3\", \"assert sum_of_integers(4) == 6\", \"assert sum_of_integers(5) == 10\", \"assert sum_of_integers(10) == 45\", \"assert sum... | {
"split": "train",
"index": 73458,
"acecode_id": "bigcode_python_fns_1776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating unique identifiers for messaging purposes. Implement a function called `generate_unique_identifier` that returns a unique identifier in the form of a UUID (Universally Unique Identifier) as a string. If the generation of the identifier fails, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_identifier() is not None\", \"assert isinstance(generate_unique_identifier(), str)\", \"assert len(generate_unique_identifier()) == 36\", \"assert generate_unique_identifier().count('-') == 4\", \"assert generate_unique_identifier() != genera... | {
"split": "train",
"index": 73459,
"acecode_id": "oss_11100",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple banking system. The function should take a list of operations, where each operation is represented as a tuple. Each tuple contains a string indicating the operation type ('deposit' or 'withdraw') and an integer rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert banking_system_operations([('withdraw', 100), ('deposit', 200), ('deposit', 50)]) == (250, 2)\", \"assert banking_system_operations([('deposit', 0), ('withdraw', 0)]) == (0, 2)\", \"assert banking_system_operations([('withdraw', 10)]) == (0, 0)\", \"assert b... | {
"split": "train",
"index": 73460,
"acecode_id": "oss_4062",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of time intervals represented as pairs of integers, where each pair consists of a start time and an end time. Your task is to implement a function that determines the maximum start time and the minimum end time across all given intervals. If there is only o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_start_end([(1, 5), (2, 6), (3, 4)]) == (3, 4)\", \"assert get_start_end([(1, 3)]) == (1, 3)\", \"assert get_start_end([(0, 10), (5, 15), (10, 20)]) == (10, 10)\", \"assert get_start_end([(2, 3), (1, 2), (4, 5)]) == (4, 2)\", \"assert get_start_end([(7, 9... | {
"split": "train",
"index": 73461,
"acecode_id": "bigcode_python_fns_18420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `encode_decode_text(content: str, encoding: str, decode: bool) -> str` that takes a string `content`, a string `encoding` representing the encoding type, and a boolean `decode`. If `decode` is False, the function should encode the `content` using the specified ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_decode_text('Hello, World!', 'utf-8', False) == b'Hello, World!'\", \"assert encode_decode_text(b'Hello, World!', 'utf-8', True) == 'Hello, World!'\", \"assert encode_decode_text('Hello, World!', 'ascii', False) == b'Hello, World!'\", \"assert encode_... | {
"split": "train",
"index": 73462,
"acecode_id": "oss_17980",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given two lists of dictionaries, `images` and `images_originals`, each representing transformed and original items respectively, write a function `visualize_images(images: List[Dict], images_originals: List[Dict], max_images: int = 5) -> List[str]` that generates a list of titl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert visualize_images([{ 'id': 1 }], [{ 'id': 1 }], 5) == ['image 0']\", \"assert visualize_images([{ 'id': 1 }, { 'id': 2 }, { 'id': 3 }], [{ 'id': 1 }, { 'id': 2 }, { 'id': 3 }], 5) == ['image 0', 'image 1', 'image 2']\", \"assert visualize_images([{ 'id': 1 },... | {
"split": "train",
"index": 73463,
"acecode_id": "bigcode_python_fns_8511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the status of a job based on its ID, location, and project. The job statuses are defined as follows: 'RUNNING', 'COMPLETED', 'FAILED', and 'PENDING'. Your function should accept a job ID (a string), a location (a string), ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_job_status('job1', 'us-east1', 'projectX') == 'RUNNING'\", \"assert get_job_status('job2', 'us-central1', 'projectY') == 'COMPLETED'\", \"assert get_job_status('job2', 'us-east1', 'projectY') == 'PENDING'\", \"assert get_job_status('job3', 'us-central1',... | {
"split": "train",
"index": 73464,
"acecode_id": "bigcode_python_fns_16820",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of sets representing bond pairs and two sets representing two molecules, determine if any of the bond pairs can be formed by the atoms in the two molecules. The function should return True if at least one bond pair can be formed, and False otherwise. The input is s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_form_bond([{1, 2}, {3, 4}], {5}, {6}) == False\", \"assert can_form_bond([{1, 2}, {3, 4}], {1, 3}, {2, 4}) == False\", \"assert can_form_bond([{1, 2}, {3, 4}], {5}, {2}) == False\", \"assert can_form_bond([{1, 2}, {3, 4}, {5, 6}], {2}, {4}) == False\", \... | {
"split": "train",
"index": 73465,
"acecode_id": "bigcode_python_fns_2295",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sorts a list of tuples based on the summation of their elements. Each tuple may have varying lengths. Implement a function `sort_tuples_by_sum(tuples_list)` that takes a list of tuples and returns a new list of those tuples sorte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_tuples_by_sum([(1, 2), (2, 1), (3,)]) == [(1, 2), (2, 1), (3,)]\", \"assert sort_tuples_by_sum([(0,), (1,), (-1,)]) == [(-1,), (0,), (1,)]\", \"assert sort_tuples_by_sum([(1, 1), (2,), (1, 1, 1)]) == [(1, 1), (2,), (1, 1, 1)]\", \"assert sort_tuples_by_... | {
"split": "train",
"index": 73466,
"acecode_id": "evol_33721",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a mathematical expression represented as a string and a dictionary of variable values. Your task is to evaluate the expression using the provided variable values and return the result. The expression may contain basic arithmetic operators (+, -, *, /) and variable... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('a + b', {'a': 2, 'b': 3}) == 5\", \"assert evaluate_expression('c - d', {'c': 10, 'd': 5}) == 5\", \"assert evaluate_expression('a * b + c', {'a': 2, 'b': 3, 'c': 4}) == 10\", \"assert evaluate_expression('x - y', {'x': 10, 'y': 10}) == ... | {
"split": "train",
"index": 73467,
"acecode_id": "bigcode_python_fns_9311",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of image profiles, each represented as a dictionary with a 'type' key, implement a function that generates a list of HTML option elements for a select dropdown. Each option should display the image profile type and have a corresponding value that is a 1-based index... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_dropdown([{'type': 'Profile1'}, {'type': 'Profile2'}, {'type': 'Profile3'}]) == '<select><option value=\\\"1\\\">Profile1</option><option value=\\\"2\\\">Profile2</option><option value=\\\"3\\\">Profile3</option></select>'\", \"assert generate_dropd... | {
"split": "train",
"index": 73468,
"acecode_id": "bigcode_python_fns_34567",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_win(board: List[List[str]]) -> bool` that determines if a player has won in a game of Tic-Tac-Toe. The board is represented as a 3x3 list of lists containing 'X', 'O', or ' ' (a space for an empty cell). The function should return True if there is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_win([['X', 'X', 'X'], [' ', 'O', ' '], [' ', ' ', 'O']]) == True\", \"assert check_win([['O', ' ', ' '], ['O', 'O', 'O'], ['X', ' ', 'X']]) == True\", \"assert check_win([['X', 'O', 'X'], ['O', 'X', 'O'], [' ', ' ', 'X']]) == True\", \"assert check_win... | {
"split": "train",
"index": 73469,
"acecode_id": "evol_10655",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a dashboard by its title from a predefined list of dashboards. The function should take a string `title` as input and return the first dashboard object that matches the title. If no dashboard matches the title, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dashboard('Sales Report') == {'title': 'Sales Report', 'content': 'Q1 Sales Data'}\", \"assert get_dashboard('Marketing Strategy') == {'title': 'Marketing Strategy', 'content': '2023 Marketing Plan'}\", \"assert get_dashboard('Sales Report') == {'title':... | {
"split": "train",
"index": 73470,
"acecode_id": "bigcode_python_fns_35202",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given two integers N (1 <= N <= 9) and K (1 <= K <= N!), write a function that returns the K-th permutation sequence of the numbers from 1 to N as a string. The permutation sequence is defined as all possible arrangements of the numbers from 1 to N, and K is 1-based indexing. F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Solution1().getPermutation(1, 1) == '1'\", \"assert Solution1().getPermutation(2, 1) == '12'\", \"assert Solution1().getPermutation(2, 2) == '21'\", \"assert Solution1().getPermutation(3, 1) == '123'\", \"assert Solution1().getPermutation(3, 2) == '132'\", \... | {
"split": "train",
"index": 73471,
"acecode_id": "oss_3545",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the supreme network rank of a set of metropolises connected by highways. Given an integer `n` representing the number of metropolises and an array `highways` where each element `highways[i] = [ai, bi]` indicates a two-way highway connecting metro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countNetworkRank(4, [[0,1],[0,3],[1,2],[1,3]]) == 4\", \"assert countNetworkRank(5, [[0,1],[0,3],[1,2],[1,3],[2,3],[2,4]]) == 5\", \"assert countNetworkRank(8, [[0,1],[1,2],[2,3],[2,4],[5,6],[5,7]]) == 5\", \"assert countNetworkRank(3, [[0,1],[1,2]]) == 2\",... | {
"split": "train",
"index": 73472,
"acecode_id": "evol_32527",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of words based on specific criteria. Implement a function `intricate_string_processing(lst, nested_lst=False, reverse_length=False, reverse_alpha=False)` that processes the input list of words. Each word must meet the following conditions t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intricate_string_processing(['noon', 'racecar', 'apple']) == ['noon', 'racecar']\", \"assert intricate_string_processing(['a', 'aa', 'aaa']) == ['a', 'aa', 'aaa']\", \"assert intricate_string_processing(['madam', 'noon', 'hello'], reverse_length=True) == ['m... | {
"split": "train",
"index": 73473,
"acecode_id": "evol_11185",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a shell command to run a specified program with given command line arguments. The function should take in the program name, a list of command line arguments, and the names of files for standard input, standard output, and s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_shell_command('my_program', ['arg1', 'arg2'], 'input.txt', 'output.txt', 'error.txt') == '/usr/bin/time -o output.txt.time my_program arg1 arg2 1> output.txt 2> error.txt'\", \"assert generate_shell_command('script.sh', ['--option', 'value'], 'input... | {
"split": "train",
"index": 73474,
"acecode_id": "bigcode_python_fns_9034",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the postfix tokens of an arithmetic expression, build and return the binary expression tree that represents this expression. Postfix notation is a notation for writing arithmetic expressions in which the operands (numbers) appear before their operators. For example, the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_tree([\\\"3\\\",\\\"4\\\",\\\"+\\\",\\\"2\\\",\\\"*\\\",\\\"7\\\",\\\"/\\\"]).evaluate() == 2\", \"assert build_tree([\\\"4\\\",\\\"5\\\",\\\"7\\\",\\\"2\\\",\\\"+\\\",\\\"-\\\",\\\"*\\\"]).evaluate() == -16\", \"assert build_tree([\\\"4\\\",\\\"2\\\",... | {
"split": "train",
"index": 73475,
"acecode_id": "evol_36169",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given an integer m representing the photocount number and a dictionary model, which contains two keys: 'T' and 'PEST'. The value of 'T' is a 2D list (or matrix) where T[i][j] represents the transition probability from state i to state j, and 'PEST' is a list of probabil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_photocount_statistics({'T': [[0.1, 0.2], [0.3, 0.4]], 'PEST': [0.5, 0.5]}, 1) == 0.35\", \"assert calculate_photocount_statistics({'T': [[0.0, 0.0], [0.0, 0.0]], 'PEST': [1.0, 1.0]}, 0) == 0.0\", \"assert calculate_photocount_statistics({'T': [[0.5... | {
"split": "train",
"index": 73476,
"acecode_id": "bigcode_python_fns_16002",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a double-ended queue (deque) using the QuickSort algorithm. The function should take a deque of integers as input and return a new deque containing the sorted elements. Ensure that the implementation is efficient and well-documented.\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quick_sort_deque(deque([10, 7, 8, 9, 1, 5])) == deque([1, 5, 7, 8, 9, 10])\", \"assert quick_sort_deque(deque([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5])) == deque([1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9])\", \"assert quick_sort_deque(deque([2, 2, 2, 2, 2])) == deque([2, 2,... | {
"split": "train",
"index": 73477,
"acecode_id": "evol_10989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing bond orders of a molecule, write a function that determines whether each bond is aromatic or not. A bond is considered aromatic if its bond order is equal to 4. Your function should return a list of boolean values where each value correspon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_aromatic_bonds([4, 1, 2, 4, 3]) == [True, False, False, True, False]\", \"assert is_aromatic_bonds([1, 2, 3, 4]) == [False, False, False, True]\", \"assert is_aromatic_bonds([4, 4, 4, 4]) == [True, True, True, True]\", \"assert is_aromatic_bonds([0, 0, 0,... | {
"split": "train",
"index": 73478,
"acecode_id": "bigcode_python_fns_33635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string in `snake_case`, convert it to `camelCase`. A `snake_case` string is a string that contains lowercase letters, numbers, and underscores, where words are separated by underscores. Your task is to implement a function that takes a `snake_case` string as input and r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_camel_case('') == ''\", \"assert to_camel_case('singleword') == 'singleword'\", \"assert to_camel_case('two_words') == 'twoWords'\", \"assert to_camel_case('multiple_words_in_a_string') == 'multipleWordsInAString'\", \"assert to_camel_case('alreadyCamelCa... | {
"split": "train",
"index": 73479,
"acecode_id": "bigcode_python_fns_43500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of students in a class. Your task is to create a dictionary that maps each student's score to their grade based on the following criteria: A score of 90 or above is graded as 'A', a score between 80 and 89 is graded as 'B... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_grade_dict([85, 91, 72, 60, 45]) == {85: 'B', 91: 'A', 72: 'C', 60: 'D', 45: 'F'}\", \"assert generate_grade_dict([90, 88, 75, 62, 59]) == {90: 'A', 88: 'B', 75: 'C', 62: 'D', 59: 'F'}\", \"assert generate_grade_dict([100, 95, 89]) == {100: 'A', 95:... | {
"split": "train",
"index": 73480,
"acecode_id": "oss_21841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two points in a 2D Cartesian coordinate system represented as tuples (x1, y1) and (x2, y2). Implement a function that calculates the Euclidean distance between these two points. The Euclidean distance is defined as the square root of the sum of the squares of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert euclidean_distance((0, 0), (3, 4)) == 5.0\", \"assert euclidean_distance((1, 1), (1, 1)) == 0.0\", \"assert euclidean_distance((1, 2), (4, 6)) == 5.0\", \"assert euclidean_distance((2, 3), (5, 7)) == 5.0\", \"assert euclidean_distance((-3, -4), (3, 4)) == 10... | {
"split": "train",
"index": 73481,
"acecode_id": "bigcode_python_fns_706",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of employee records and returns a dictionary that summarizes the total number of employees, the average age of employees, and the number of employees in each department. Each employee record is represented as a dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summarize_employees([]) == {'total_employees': 0, 'average_age': 0.0, 'department_count': {}}\", \"assert summarize_employees([{'name': 'Alice', 'age': 30, 'department': 'HR'}]) == {'total_employees': 1, 'average_age': 30.0, 'department_count': {'HR': 1}}\",... | {
"split": "train",
"index": 73482,
"acecode_id": "oss_2316",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing keys in a key-value store. Your task is to implement a function that deletes all keys from the list that match a specific pattern. The pattern for matching keys is 'LIMITER*', where '*' represents any sequence of characters. Write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cleanup_keys(['LIMITER1', 'KEY2', 'LIMITER3']) == ['KEY2']\", \"assert cleanup_keys(['LIMITER', 'LIMITER123', 'OTHERKEY']) == ['OTHERKEY']\", \"assert cleanup_keys(['NOTLIMITER1', 'LIMITERXYZ', 'LIMITER']) == ['NOTLIMITER1']\", \"assert cleanup_keys(['KEY1',... | {
"split": "train",
"index": 73483,
"acecode_id": "oss_35028",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a set of requirements for a software application. Each requirement is represented as a key-value pair, where the key is the name of the requirement and the value is a boolean indicating whether the requirement is required or not. Write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_required_requirements({'feature1': True, 'feature2': False, 'feature3': True, 'feature4': True}) == ['feature1', 'feature3', 'feature4']\", \"assert get_required_requirements({'featureA': False, 'featureB': False}) == []\", \"assert get_required_requirem... | {
"split": "train",
"index": 73484,
"acecode_id": "oss_37635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a payment for a given bill. The function takes in a sender's name and a dictionary of keyword arguments that includes an 'InvId' representing the bill ID. If the bill with that ID exists and its status is 'unpaid', the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert payment_successful('Alice', InvId=1) == 120\", \"assert payment_successful('Bob', InvId=2) == 50\", \"assert payment_successful('Frank', InvId=6) == None\", \"assert payment_successful('Grace', InvId=7) == None\", \"assert payment_successful('Leo', InvId=12)... | {
"split": "train",
"index": 73485,
"acecode_id": "bigcode_python_fns_5981",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers as input and returns the sum of all the integers in the list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_integers([1, 2, 3, 4, 5]) == 15\", \"assert sum_of_integers([-1, -2, -3, -4, -5]) == -15\", \"assert sum_of_integers([0, 0, 0, 0]) == 0\", \"assert sum_of_integers([10, 20, 30]) == 60\", \"assert sum_of_integers([1]) == 1\", \"assert sum_of_integers([... | {
"split": "train",
"index": 73486,
"acecode_id": "evol_30223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of events related to software packages. Each event is represented as a dictionary containing 'package_name', 'architecture', and 'action'. Your goal is to filter these events based on a specific architecture and return a list of package nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_events_by_architecture([], 'x86') == []\", \"assert filter_events_by_architecture([{'package_name': 'pkg1', 'architecture': 'x86', 'action': 'install'}], 'x86') == ['pkg1']\", \"assert filter_events_by_architecture([{'package_name': 'pkg1', 'architect... | {
"split": "train",
"index": 73487,
"acecode_id": "bigcode_python_fns_27174",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages properties and their values in a dictionary format. The function should take the name, label, group, and an optional update handler function for a boolean property and return a dictionary representing the boolean property... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_boolean_property('is_visible', 'Visible', 'Display', None) == {'name': 'is_visible', 'label': 'Visible', 'group': 'Display', 'updateHandler': None}\", \"assert add_boolean_property('is_logged_in', 'User Login Status', 'Authentication', None) == {'name': ... | {
"split": "train",
"index": 73488,
"acecode_id": "oss_6423",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function that merges two alphanumeric strings by combining their characters one by one. If the strings are of different lengths, append the remaining characters from the longer string at the end. The function should take two strings as input and return the merged string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_strings('123', 'abcde') == '1a2b3cde'\", \"assert merge_strings('', 'abc') == 'abc'\", \"assert merge_strings('abc', '') == 'abc'\", \"assert merge_strings('a', 'b') == 'ab'\", \"assert merge_strings('aaa', 'bbb') == 'ababab'\", \"assert merge_strings(... | {
"split": "train",
"index": 73489,
"acecode_id": "evol_24378",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to manage pizza orders. The function should accept a string of desired pizza toppings, separated by commas, and return a list of messages indicating which toppings will be added to the pizza based on the available toppings: mushrooms, pep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_pizza_orders('mushrooms, pepperoni') == ['Adding mushrooms.', 'Adding pepperoni.', 'Finished making your pizza!']\", \"assert manage_pizza_orders('extra cheese') == ['Adding extra cheese.', 'Finished making your pizza!']\", \"assert manage_pizza_order... | {
"split": "train",
"index": 73490,
"acecode_id": "oss_14733",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a block of Python code. Your task is to write a function that processes this code by removing comments (single line comments starting with '#') and multiline strings enclosed by triple quotes (\"\"\" or '''). After processing, you need to ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_code(\\\"\\\"\\\"print('Hello World') # This is a comment\\\\n# Another comment\\\\nprint('Goodbye')\\\"\\\"\\\") == \\\"print('Hello World'); print('Goodbye')\\\"\", \"assert process_code(\\\"\\\"\\\"# This entire line is a comment\\\\n# Another co... | {
"split": "train",
"index": 73491,
"acecode_id": "oss_14696",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique elements from the original list, while preserving the order of their first appearance. Write a Python function that accomplishes this task.\n\nFunction Si... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert unique_elements([4, 5, 4, 6, 7, 5]) == [4, 5, 6, 7]\", \"assert unique_elements([1, 1, 1, 1]) == [1]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10, 20, 10, 30, 20]) == [10, 20,... | {
"split": "train",
"index": 73492,
"acecode_id": "oss_3400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a list of file paths based on a given list of file names and their types. The file names may contain special characters and spaces, which need to be normalized. Your function should take a list of tuples as input, where each tuple contains a filen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_file_paths([('My_File Name.js', 'js')]) == ['vendor/assets/javascripts/My_File Name.js.js']\", \"assert generate_file_paths([('A B C.js', 'js')]) == ['vendor/assets/javascripts/A B C.js.js']\", \"assert generate_file_paths([('File@Name.js', 'js')]) ... | {
"split": "train",
"index": 73493,
"acecode_id": "oss_14927",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, where each inner list contains three integers. Write a Python function called `find_zero_sum_triples(nums)` that takes a list of lists `nums` as input and returns a list of boolean values indicating whether each triple sums to zero. For example, g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_zero_sum_triples([[1, 2, 3], [-1, -2, -3], [0, 0, 0]]) == [False, False, True]\", \"assert find_zero_sum_triples([[10, -10, 0], [5, 5, -10], [-1, 1, 0]]) == [True, True, True]\", \"assert find_zero_sum_triples([[-1, 1, 0], [2, 2, -4], [4, -4, 0]]) == [T... | {
"split": "train",
"index": 73494,
"acecode_id": "oss_16339",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_scholar_details(name: str, university: str, study_level: str, gpa: float) -> str` that takes in a scholar's name, the university they are currently enrolled in, their present level of study, and their Grade Point Average (GPA). The function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_scholar_details('Alice Smith', 'Stanford University', 'Undergraduate', 3.5) == 'Name: Alice Smith, University: Stanford University, Study Level: Undergraduate, GPA: 3.5'\", \"assert get_scholar_details('Bob Johnson', 'MIT', 'Graduate', 3.9) == 'Name: Bob... | {
"split": "train",
"index": 73495,
"acecode_id": "evol_22389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an altitude value and a string representing the unit of measurement ('km' for kilometers or 'hPa' for hectopascals), return the index of the nearest altitude from a predefined list of altitudes. The predefined altitude lists are as follows: For 'km', the altitudes are [0,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_nearest_altitude_index(5, 'km') == 1\", \"assert find_nearest_altitude_index(12, 'km') == 2\", \"assert find_nearest_altitude_index(25, 'km') == 5\", \"assert find_nearest_altitude_index(30, 'km') == 5\", \"assert find_nearest_altitude_index(500, 'hPa')... | {
"split": "train",
"index": 73496,
"acecode_id": "bigcode_python_fns_30841",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a set of council file entries based on the given field labels and their corresponding values. You are provided with a mapping of field labels to database fields. Your goal is to create a function that takes a list of tuples, where each tuple consi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_entries([('21-0001', 'Label1', ' Value1 '), ('21-0001', 'Label2', 'Value2'), ('21-0002', 'Label1', 'Value3'), ('21-0002', 'Label4', 'Value4')]) == {'21-0001': {'Field1': 'Value1', 'Field2': 'Value2'}, '21-0002': {'Field1': 'Value3'}}\", \"assert pr... | {
"split": "train",
"index": 73497,
"acecode_id": "bigcode_python_fns_17154",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_divisible_by_four(low: int, high: int) -> int` that calculates the sum of all integers between `low` and `high`, inclusive, that are evenly divisible by 4. The function should take two parameters: `low` and `high`, which represent the range. Return the cal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_divisible_by_four(1, 10) == 12\", \"assert sum_divisible_by_four(-10, 10) == 0\", \"assert sum_divisible_by_four(150, 150) == 0\", \"assert sum_divisible_by_four(1, 1) == 0\", \"assert sum_divisible_by_four(4, 4) == 4\", \"assert sum_divisible_by_four(-2... | {
"split": "train",
"index": 73498,
"acecode_id": "evol_23986",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a tuple consisting of a string and an integer, where the string represents the name of a layer (e.g., 'weights') and the integer represents the index of the layer (0-based). Write a function `nice_layer_name(weight_key: Tuple[str, int]) -> str` that returns a form... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nice_layer_name(('weights', 0)) == 'Layer 1 weights'\", \"assert nice_layer_name(('biases', 1)) == 'Layer 2 biases'\", \"assert nice_layer_name(('activations', 4)) == 'Layer 5 activations'\", \"assert nice_layer_name(('layers', 10)) == 'Layer 11 layers'\", \... | {
"split": "train",
"index": 73499,
"acecode_id": "bigcode_python_fns_49413",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.