Dataset Viewer
Auto-converted to Parquet Duplicate
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": "You are given a list of file names and a corresponding list of file types. Your task is to create a function that classifies the files into two categories: regular files and WebAssembly files. The function should return a dictionary with two keys: 'regular_files' and 'wasm_file...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_files(['file1.txt', 'file2.wasm', 'file3.txt', 'file4.wasm'], ['text', 'wasm', 'text', 'wasm']) == {'regular_files': ['file1.txt', 'file3.txt'], 'wasm_files': ['file2.wasm', 'file4.wasm']}\", \"assert classify_files(['index.html', 'script.js', 'modu...
{ "split": "train", "index": 0, "acecode_id": "oss_6038", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with assigning tasks to team members in a round-robin fashion. Write a function `assign_tasks(tasks: List[str], team_members: List[str]) -> Dict[str, str]` that takes two lists as input: a list of tasks and a list of team members. The function should return a dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assign_tasks(['Task1', 'Task2', 'Task3'], ['Alice', 'Bob']) == {'Task1': 'Alice', 'Task2': 'Bob', 'Task3': 'Alice'}\", \"assert assign_tasks(['Task1', 'Task2'], ['Alice', 'Bob', 'Charlie']) == {'Task1': 'Alice', 'Task2': 'Bob'}\", \"assert assign_tasks(['Tas...
{ "split": "train", "index": 1, "acecode_id": "oss_35116", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. Write a function `calculate_average_score(scores: List[int]) -> float` that calculates the average score of the game, excluding the highest and lowest scores. The function should return the average score rounde...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([10, 20, 30, 40, 50]) == 30.0\", \"assert calculate_average_score([1, 2, 3, 4, 5, 6]) == 3.5\", \"assert calculate_average_score([100, 90, 80, 70, 60]) == 80.0\", \"assert calculate_average_score([5, 5, 5, 5, 5]) == 5.0\", \"assert ca...
{ "split": "train", "index": 2, "acecode_id": "oss_25526", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that calculates the anniversary date of an album release. The function should take two parameters: the release date of the album in the format 'YYYY-MM-DD' and an integer representing the number of years after the release date. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert anniversary_date('2000-02-29', 4) == '2004-02-29'\", \"assert anniversary_date('2022-01-01', 0) == '2022-01-01'\", \"assert anniversary_date('2021-11-30', 2) == '2023-11-30'\", \"assert anniversary_date('2020-04-31', 1) == 'Invalid date'\", \"assert annivers...
{ "split": "train", "index": 3, "acecode_id": "oss_22889", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to generate a network routing command based on a given static IP address, next hop, shell type, IP family, interface, and VRF. The function should follow these rules: \n- If the static IP is not provided, return an error message 'Provide ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_route_command('device1', '192.168.1.1', '192.168.1.254', 'vtysh', 'ipv4', None, None) == 'ip route 192.168.1.1 192.168.1.254'\", \"assert generate_route_command('device1', '2001:db8::1', None, 'vtysh', 'ipv6', None, None) == 'ipv6 route 2001:db8::1'...
{ "split": "train", "index": 4, "acecode_id": "bigcode_python_fns_21932", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string representing the contents of a file and returns the string with trailing whitespace characters (including spaces, tabs, and newlines) removed. Implement a function `remove_trailing_whitespace(content: str) -> str` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_trailing_whitespace('Hello, World! ') == 'Hello, World!'\", \"assert remove_trailing_whitespace('Python is great!\\\\n\\\\t\\\\t') == 'Python is great!'\", \"assert remove_trailing_whitespace(' Leading spaces ') == ' Leading spaces'\", \"assert ...
{ "split": "train", "index": 5, "acecode_id": "bigcode_python_fns_32855", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function that accepts two lists and returns the indices of all elements from the second list that are found in the first list. The elements in the first list are all unique and unordered. The second list may have repetitions, and the result should reflect ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_indices([2, 9, 3, 1, 5, 7], [1, 7, 5, 5, 1]) == [3, 5, 4, 4, 3]\", \"assert get_indices([10, 20, 30], [10, 40, 30]) == [0, 2]\", \"assert get_indices([5, 3, 1, 4, 2], [2, 3, 3, 1]) == [4, 1, 1, 2]\", \"assert get_indices([1], [1]) == [0]\", \"assert get_...
{ "split": "train", "index": 6, "acecode_id": "evol_13031", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a memoization technique for a function that filters IP addresses based on a given filter ID. Your goal is to create a function `memoize_filter_ip(filter_ip, ip_filter_id)` that memoizes the results of the `filter_ip` function based on the `ip_fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert memoize_filter_ip(lambda x: ['192.168.1.1', '192.168.1.2'], 1) == ['192.168.1.1', '192.168.1.2']\", \"assert memoize_filter_ip(lambda x: ['10.0.0.1'], 2) == ['10.0.0.1']\", \"assert memoize_filter_ip(lambda x: ['172.16.0.1', '172.16.0.2'], 3) == ['172.16.0.1...
{ "split": "train", "index": 7, "acecode_id": "oss_1486", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of floating-point numbers, implement a function `max_divergence(series1, series2)` that calculates the maximum absolute difference between any pair of elements from the two lists. The function should return this maximum difference as a float.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_divergence([-1, -2, -3], [1, 2, 3]) == 6.0\", \"assert max_divergence([0], [0]) == 0.0\", \"assert max_divergence([5], [10]) == 5.0\", \"assert max_divergence([1.2, 3.4], [5.6, 7.8]) == 6.6\", \"assert max_divergence([-5.5, -2.2], [2.2, 5.5]) == 11.0\", ...
{ "split": "train", "index": 8, "acecode_id": "evol_180", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that returns a list of the longest words in the string along with their starting and ending indices in the original string. The function should handle special characters and punctuation marks appropriately, ignoring them when determining wor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_longest_words('Hello, world!') == [('Hello', 0, 4), ('world', 7, 11)]\", \"assert find_longest_words('') == []\", \"assert find_longest_words('Single') == [('Single', 0, 5)]\", \"assert find_longest_words('I love programming, especially Python!') == [('...
{ "split": "train", "index": 9, "acecode_id": "evol_25054", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a brewery with its name and type. Your task is to write a function that filters this list based on a specified brewery type and returns a new list containing only the breweries of that type. Each brewery dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_breweries_by_type([{'name': 'Brewery A', 'brewery_type': 'micro'}, {'name': 'Brewery B', 'brewery_type': 'macro'}], 'micro') == [{'name': 'Brewery A', 'brewery_type': 'micro'}]\", \"assert filter_breweries_by_type([{'name': 'Brewery C', 'brewery_type'...
{ "split": "train", "index": 10, "acecode_id": "oss_8857", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a series of scientific experiment runs. Each run can store its results, start and end times, and start and end temperatures. You need to implement a function called `manage_experiment_runs` that accepts a list of tuples representing runs, where each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_experiment_runs([([1.0, 2.0, 3.0], 0, 3, 111, 222), ([4.0, 5.0], 0, 2, 100, 200)]) == (True, [2.0, 4.5])\", \"assert manage_experiment_runs([([1.0, 2.0, 3.0], 0, 3, 111, 222), ([], 0, 2, 100, 200)]) == (False, [2.0, 0])\", \"assert manage_experiment_r...
{ "split": "train", "index": 11, "acecode_id": "oss_13029", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a dictionary that can contain nested dictionaries and integer values. Your task is to implement the function `calculate_sum_no_red` that calculates the sum of all integer values in the dictionary, excluding any occurrences of the string \"red\". The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_no_red({'a': 'red', 'b': 'red'}) == 0\", \"assert calculate_sum_no_red({}) == 0\", \"assert calculate_sum_no_red({'a': 3, 'b': 4}) == 7\", \"assert calculate_sum_no_red({'a': 1, 'b': {'c': 3, 'd': 4}}) == 8\", \"assert calculate_sum_no_red({'a'...
{ "split": "train", "index": 12, "acecode_id": "oss_26356", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_unique_numbers` that returns a list of integers that appear exactly once in the input list. The order of the unique numbers in the output list should be the same as their first appearance in the input list. The input list can con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_numbers([1, 2, 2, 3, 4, 3, 5]) == [1, 4, 5]\", \"assert find_unique_numbers([5, 5, 5, 3, 2, 1, 2, 1]) == [3]\", \"assert find_unique_numbers([]) == []\", \"assert find_unique_numbers([10, 20, 10, 30, 20, 40]) == [30, 40]\", \"assert find_unique_n...
{ "split": "train", "index": 13, "acecode_id": "bigcode_python_fns_47103", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a Python function that takes a string as input and returns a dictionary where the keys are the unique characters in the string and the values are their corresponding frequencies. The function should count all characters, including letters, numbers, whitespace, and punct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unicode_characters('hello') == {'h': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert count_unicode_characters('abcabc') == {'a': 2, 'b': 2, 'c': 2}\", \"assert count_unicode_characters('12345') == {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1}\", \"assert count_unico...
{ "split": "train", "index": 14, "acecode_id": "evol_30102", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that parses a string representing a configuration file in a simple key-value pair format. Each line contains a key and its corresponding value separated by an equal sign (`=`). Your task is to implement a function `parse_config(config...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_config('username=john_doe\\\\npassword=p@ssw0rd\\\\nserver=example.com\\\\nport=8080') == {'username': 'john_doe', 'password': 'p@ssw0rd', 'server': 'example.com', 'port': '8080'}\", \"assert parse_config('key1=value1\\\\nkey2=value2') == {'key1': 'val...
{ "split": "train", "index": 15, "acecode_id": "oss_10655", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists - one containing names of individuals and the other containing their respective dates of birth, implement a function that constructs a hash map linking each individual's name to their latest date of birth. The function should also accept a date as an input and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert link_birthdays(['Alice', 'Bob', 'Alice'], ['1990-01-01', '1991-01-01', '1995-01-01'], '1995-01-01') == {'Alice': '1995-01-01', 'Bob': '1991-01-01', 'birthdays_on_date': ['Alice']}\", \"assert link_birthdays(['Charlie', 'David', 'Charlie', 'Eve'], ['2000-02-0...
{ "split": "train", "index": 16, "acecode_id": "evol_15905", "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 integers from the original list, preserving the order in which they first appeared. Write a function `unique_integers(arr: List[int]) -> List[int]` that a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 3, 1]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert unique_integers([1, 1, 1, 1, 1]) == [1]\"...
{ "split": "train", "index": 17, "acecode_id": "bigcode_python_fns_13477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings representing different types of switches and returns a list of formatted strings. Each formatted string should indicate that a specific switch has been set up. The input list contains the following switch type...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_switches(['FullyScreenSaver', 'FullyMaintenanceMode', 'FullyKioskLock', 'FullyKioskMotionDetection']) == ['Setup completed for FullyScreenSaver switch.', 'Setup completed for FullyMaintenanceMode switch.', 'Setup completed for FullyKioskLock switch.', ...
{ "split": "train", "index": 18, "acecode_id": "bigcode_python_fns_3998", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating unique usernames by combining first and last names. Implement a function that takes two lists of strings, one representing first names and the other representing last names, and returns a list of unique usernames. Each username is created by conca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_usernames(['Alice', 'Bob', 'Alice'], ['Smith', 'Jones', 'Smith']) == ['alice_smith', 'bob_jones', 'alice_smith1']\", \"assert generate_usernames(['John'], ['Doe']) == ['john_doe']\", \"assert generate_usernames(['Emma', 'Olivia', 'Emma'], ['Watson',...
{ "split": "train", "index": 19, "acecode_id": "oss_9270", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns the description of a building's accessibility feature based on the selected circulation type. The function should take a single string argument representing the circulation type and return its corresponding description. The a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_description('unknown_type') == 'Circulation type not found'\", \"assert get_description('unknown_type') == 'Circulation type not found'\", \"assert get_description('random_type') == 'Circulation type not found'\", \"assert get_description('unknown_circul...
{ "split": "train", "index": 20, "acecode_id": "oss_17560", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts a given datetime from one time zone to another. The function should take in a datetime string in the format 'YYYY-MM-DD HH:MM:SS', a source time zone string, and a target time zone string. It should return the converted ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_datetime('2023-01-01 10:00:00', 'US/Pacific', 'US/Eastern') == '2023-01-01 13:00:00'\", \"assert convert_datetime('2023-06-15 12:00:00', 'US/Eastern', 'Europe/London') == '2023-06-15 17:00:00'\", \"assert convert_datetime('2023-03-01 09:00:00', 'Asia...
{ "split": "train", "index": 21, "acecode_id": "oss_19135", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `retrieve_first_n_items(lst: List[int], n: int) -> List[int]` that retrieves the first n items from the list. The list must contain at least n+2 elements, and n must be a positive integer. If the input conditions are not met, return an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_first_n_items([10, 20, 30, 40, 50, 60, 70], 3) == [10, 20, 30]\", \"assert retrieve_first_n_items([1, 2, 3, 4, 5, 6, 7], 2) == [1, 2]\", \"assert retrieve_first_n_items([100, 200, 300, 400, 500], 1) == [100]\", \"assert retrieve_first_n_items([5, 10...
{ "split": "train", "index": 22, "acecode_id": "evol_29249", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples where each tuple contains an image represented as a 2D list of integers (grayscale pixel values from 0 to 255), a mask image also represented as a 2D list of integers, and a dictionary of scene parameters with various attributes. Your task is to i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_images([([[0, 0], [0, 0]], [[255, 255], [255, 255]], {'param1': 1}), ([[255, 255], [255, 255]], [[0, 0], [0, 0]], {'param2': 2})]) == [(0.0, 255.0, {'param1': 1}), (255.0, 0.0, {'param2': 2})]\", \"assert process_images([([[128, 64], [32, 16]], [[255...
{ "split": "train", "index": 23, "acecode_id": "bigcode_python_fns_19985", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the insertion of Pokémon data into a database. The function will take a list of Pokémon entries, each represented by a dictionary containing the Pokémon's name, type, latitude, and longitude. The function should return a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_pokemon_data([]) == []\", \"assert insert_pokemon_data([{'name': 'Bulbasaur', 'type': 'Grass', 'latitude': 34.0522, 'longitude': -118.2437}, {'name': 'Charmander', 'type': 'Fire', 'latitude': 51.5074, 'longitude': -0.1278}]) == ['Inserted Bulbasaur of...
{ "split": "train", "index": 24, "acecode_id": "oss_35102", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function that calculates the product of all unique keys in a given dictionary after converting the keys from decimal strings to integers. The dictionary may contain random decimal string keys and any associated values. Your function should handle the conversion and mult...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_product({'1.25': 'a', '2.89': 'b', '3.72': 'c'}) == 6\", \"assert calculate_product({'10.0': 'a', '20.0': 'b', '30.5': 'c'}) == 6000\", \"assert calculate_product({'0.1': 'a', '0.2': 'b'}) == 0\", \"assert calculate_product({'1.0': 'a', '1.0': 'b',...
{ "split": "train", "index": 25, "acecode_id": "evol_30568", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that takes two parameters: the list of integers and an integer representing the number of bins. The function should return a histogram represented as a list of integers, where each integer indicates the count of numbers falling int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert histogram([1, 2, 1, 3, 4], 2) == [3, 2]\", \"assert histogram([10, 20, 30, 40, 50], 5) == [1, 1, 1, 1, 1]\", \"assert histogram([-10, -20, -30, -40, -50], 5) == [1, 1, 1, 1, 1]\", \"assert histogram([1, 2, 3], 3) == [1, 1, 1]\", \"assert histogram([], 3) == ...
{ "split": "train", "index": 26, "acecode_id": "bigcode_python_fns_39427", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a 1D list of integers, write a function `reshape_array(arr: List[int], shape: Tuple[int]) -> List[List[int]]` that reshapes the 1D list into a 2D list based on the provided shape. If the total number of elements in the list does not match the total number of elements in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reshape_array([1, 2, 3, 4], (2, 2)) == [[1, 2], [3, 4]]\", \"assert reshape_array([1, 2, 3, 4], (4, 1)) == [[1], [2], [3], [4]]\", \"assert reshape_array([1, 2, 3], (1, 3)) == [[1, 2, 3]]\", \"assert reshape_array([], (0, 0)) == []\", \"assert reshape_array(...
{ "split": "train", "index": 27, "acecode_id": "bigcode_python_fns_34546", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of equal length, `x` and `y`, where each element represents a numerical value, implement a function `subtract_compositions(x: List[float], y: List[float]) -> List[float]` that returns a new array where each element is the result of subtracting the corresponding...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtract_compositions([5, 10, 15], [1, 2, 3]) == [4, 8, 12]\", \"assert subtract_compositions([1, 2, 3], [1, 1, 1]) == [0, 1, 2]\", \"assert subtract_compositions([0, 0, 0], [1, 2, 3]) == [-1, -2, -3]\", \"assert subtract_compositions([10, 20], [5, 15]) == [...
{ "split": "train", "index": 28, "acecode_id": "bigcode_python_fns_31459", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a dictionary of HTTP headers as input and returns a formatted string representing the headers in a specific format. The input dictionary will contain the header names as keys and their corresponding values as values. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_headers({'User-Agent': 'Mozilla/5.0', 'Accept': 'text/html'}) == 'User-Agent: Mozilla/5.0\\\\nAccept: text/html'\", \"assert format_headers({'Content-Type': 'application/json', 'Authorization': 'Bearer token'}) == 'Content-Type: application/json\\\\nA...
{ "split": "train", "index": 29, "acecode_id": "oss_26184", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a questionnaire in JSON format. Your task is to implement a function that checks whether the given string is a valid representation of a 'Questionnaire'. A valid 'Questionnaire' must start with '{', must end with '}', and must contain the key...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_questionnaire('{\\\"resourceType\\\": \\\"Questionnaire\\\"}') == True\", \"assert is_valid_questionnaire('{\\\"resourceType\\\": \\\"Survey\\\"}') == False\", \"assert is_valid_questionnaire('{\\\"resourceType\\\": \\\"Questionnaire\\\", \\\"items\...
{ "split": "train", "index": 30, "acecode_id": "bigcode_python_fns_23981", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers and a specific integer value, implement a function that returns a list of the indices where the integer value occurs in the list. Write a function `locate_number(lst: List[int], number: int) -> List[int]` that takes in a list of integers `lst` and an in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert locate_number([1, 2, 3, 2, 4, 2, 5, 2, 3, 2, 1], 2) == [1, 3, 5, 7, 9]\", \"assert locate_number([1, 1, 1, 1, 1], 1) == [0, 1, 2, 3, 4]\", \"assert locate_number([0, 2, 0, 2, 0, 2], 2) == [1, 3, 5]\", \"assert locate_number([5, 4, 4, 3, 4, 2, 1], 4) == [1, 2...
{ "split": "train", "index": 31, "acecode_id": "evol_21714", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a configuration dictionary that contains details for preparing datasets for training and validation in a machine learning context. Your task is to implement a function `prepare_datasets(config: Dict[str, Any]) -> Tuple[Trainer, Dataset, Dataset]` that takes in a c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prepare_datasets({'train_dataset_name': 'train_set', 'validate_dataset_name': 'val_set', 'database_json': 'db.json', 'trainer': 'trainer_config', 'batch_size': 32}) == ('trainer_config', 'train_set', 'val_set')\", \"assert prepare_datasets({'train_dataset_na...
{ "split": "train", "index": 32, "acecode_id": "bigcode_python_fns_2716", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of requests and logs error messages for failed transfers. The function should take in a list of request dictionaries, each containing 'request_id', 'scope', 'RSE', and 'transfer' keys. If a request's 'transfer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_requests([{'request_id': 1, 'scope': 'user1', 'RSE': 'site1', 'transfer': None}]) == None\", \"assert process_requests([{'request_id': 2, 'scope': 'user2', 'RSE': 'site2', 'transfer': None}, {'request_id': 3, 'scope': 'user3', 'RSE': 'site3', 'transf...
{ "split": "train", "index": 33, "acecode_id": "oss_24387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `match_keywords(text: str) -> List[str]` that takes a string `text` as input and returns a list of all occurrences of the keywords 'start', 'end', and 'here' found in the text. The keywords should be matched case-insensitively, and the order of occurrence i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match_keywords('start your coding journey here and it will eventually end.') == ['start', 'here', 'end']\", \"assert match_keywords('Start coding now! Here we go. End of the line.') == ['Start', 'Here', 'End']\", \"assert match_keywords('Nothing to see here....
{ "split": "train", "index": 34, "acecode_id": "evol_374", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `has_visible_entities` that takes a list of entities as input and checks if there are any visible entities in the list. An entity is defined by its name (a string) and a visibility status (a boolean). The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_visible_entities([('A', True), ('B', False), ('C', True)]) == True\", \"assert has_visible_entities([('A', False), ('B', False), ('C', False)]) == False\", \"assert has_visible_entities([('X', True)]) == True\", \"assert has_visible_entities([('Y', False...
{ "split": "train", "index": 35, "acecode_id": "oss_25989", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `process_text_input(text: str) -> str` that takes a string input and returns a message indicating that the input was received. The message should be in the format 'Received the message: {text}'.\nPlease reason step by step, then write a self-contained Python s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_text_input('Hello, World!') == 'Received the message: Hello, World!'\", \"assert process_text_input('Test input') == 'Received the message: Test input'\", \"assert process_text_input('') == 'Received the message: '\", \"assert process_text_input('123...
{ "split": "train", "index": 36, "acecode_id": "evol_28178", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a class hierarchy where the base class has a method that prints a message, and the derived class must implement an abstract method that returns a specific message. The base class should have a method `base_method()` that prints 'Base Class Method'. The derived class s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert DerivedClass().abstract_method() == 'Derived Class Implementation'\", \"assert isinstance(DerivedClass(), BaseClass)\", \"assert DerivedClass().abstract_method() == 'Derived Class Implementation'\", \"assert isinstance(DerivedClass(), object)\", \"assert Der...
{ "split": "train", "index": 37, "acecode_id": "evol_12515", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function called `create_transaction` that takes the following parameters: `patient_name` (str), `services` (str), `cost` (float), `payment_method` (str), and `status` (str). This function should return a dictionary representing a transaction with the provided detail...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_transaction('John Doe', 'Consultation', 150.0, 'Credit Card', 'Completed') == {'patient_name': 'John Doe', 'services': 'Consultation', 'cost': 150.0, 'payment_method': 'Credit Card', 'status': 'Completed'}\", \"assert create_transaction('Jane Smith', ...
{ "split": "train", "index": 38, "acecode_id": "evol_20152", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that sets the logging verbosity level for a console and syslog handler in a logging configuration dictionary. The function should take an integer parameter `verbosity`, which represents the desired logging level. The logging configuration ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_console_logging(logging.DEBUG) == None\", \"assert setup_console_logging(logging.INFO) == None\", \"assert settings['LOGGING']['handlers']['console']['level'] == logging.INFO\", \"assert settings['LOGGING']['handlers']['syslog']['level'] == logging.INF...
{ "split": "train", "index": 39, "acecode_id": "bigcode_python_fns_4018", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You need to implement a function `execute_command(command: str) -> List[str]` that takes a string command as input and simulates the execution of that command. The function should return a list of strings, where each string represents a line of output generated by the command. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_command('echo Hello World') == ['Hello World']\", \"assert execute_command('ls') == ['file1.txt', 'file2.txt', 'directory1']\", \"assert execute_command('pwd') == ['/home/user']\", \"assert execute_command('unknown command') == ['Command not found']\...
{ "split": "train", "index": 40, "acecode_id": "bigcode_python_fns_20177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with constructing a file path from a given batch identifier and plate identifier. Write a Python function `get_data_file_path(batch, plate)` that takes in two parameters: `batch`, a string representing the batch identifier in the format 'YYYY_MM_DD_BatchX' (e.g.,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_data_file_path('2020_07_02_Batch8', '218360') == 'data/2020_07_02_Batch8/218360_data.csv'\", \"assert get_data_file_path('2021_08_15_Batch5', '123456') == 'data/2021_08_15_Batch5/123456_data.csv'\", \"assert get_data_file_path('2019_11_11_Batch1', '98765...
{ "split": "train", "index": 41, "acecode_id": "oss_20397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, which may contain duplicates. Your task is to implement a function `unique_sorted_elements(input_list)` that takes this list as input and returns a new list containing only the unique elements from the input list, sorted in ascending order. For...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted_elements([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == [1, 2, 3, 4, 5, 6, 9]\", \"assert unique_sorted_elements([1, 1, 1, 1]) == [1]\", \"assert unique_sorted_elements([]) == []\", \"assert unique_sorted_elements([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\"...
{ "split": "train", "index": 42, "acecode_id": "oss_1401", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple data encoding utility in Python. Your utility should provide a function to encode boolean values and another function to encode strings into bytes using specific encoding rules. The encoding rules are defined by the following constants:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_data(True, 'hello') == (b'\\\\x01', b'hello')\", \"assert encode_data(False, 'world') == (b'\\\\x00', b'world')\", \"assert encode_data(True, '') == (b'\\\\x01', b'')\", \"assert encode_data(False, '') == (b'\\\\x00', b'')\", \"assert encode_data(True...
{ "split": "train", "index": 43, "acecode_id": "oss_4755", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates API command responses for specific fields. The function should take a command response as input and check for the following criteria: 1) The response must contain the fields 'Err' and 'Mountpoint'. 2) The 'Err' field mu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_api_response({'Err': 'Something went wrong.', 'Mountpoint': '/x/'}) == True\", \"assert validate_api_response({'Err': '', 'Mountpoint': '/valid/path'}) == True\", \"assert validate_api_response({'Err': 'Error', 'Mountpoint': '/'}) == True\", \"asser...
{ "split": "train", "index": 44, "acecode_id": "bigcode_python_fns_40147", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of numbers, implement a function `calculate_cosine(nums: List[float], double: bool) -> List[float]` that computes the cosine of each number in the list. If the boolean flag `double` is set to True, return the cosine of each number. If `double` is False, return twic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cosine([0, 0, 0], True) == [1.0, 1.0, 1.0]\", \"assert calculate_cosine([0, 0, 0], False) == [2.0, 2.0, 2.0]\", \"assert calculate_cosine([-1, -2], True) == [0.5403023058681398, -0.4161468365471424]\", \"assert calculate_cosine([-1, -2], False) == ...
{ "split": "train", "index": 45, "acecode_id": "oss_31240", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that removes all elements from the list that are located at indices representing prime numbers. The indices are 1-based. For example, if the list is [4, 7, 10, 11, 14], the elements at prime indices (2 and 3) would be removed, resu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_prime_index_elements([1, 2, 3, 4, 5]) == [1, 4]\", \"assert remove_prime_index_elements([3, 5, 7, 11, 13]) == [3, 11]\", \"assert remove_prime_index_elements([1]) == [1]\", \"assert remove_prime_index_elements([]) == []\", \"assert remove_prime_index_...
{ "split": "train", "index": 46, "acecode_id": "evol_3414", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that sets the configuration for a serial port. This function takes a string input representing the name or path of the serial port. The function should store this value in a global variable and return a confirmation message indicating tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_serial_port('COM3') == 'Serial port set to COM3'\", \"assert set_serial_port('/dev/ttyUSB0') == 'Serial port set to /dev/ttyUSB0'\", \"assert set_serial_port('COM1') == 'Serial port set to COM1'\", \"assert set_serial_port('/dev/ttyS0') == 'Serial port s...
{ "split": "train", "index": 47, "acecode_id": "bigcode_python_fns_11053", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `say_hello_to(name: str) -> str` that takes a string `name` as input and returns a greeting message in the format 'Hello, {name}!'. The input `name` will be a non-empty string containing only letters. For example, if the input is 'Alice', the function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert say_hello_to('Alice') == 'Hello, Alice!'\", \"assert say_hello_to('Bob') == 'Hello, Bob!'\", \"assert say_hello_to('Charlie') == 'Hello, Charlie!'\", \"assert say_hello_to('David') == 'Hello, David!'\", \"assert say_hello_to('Eve') == 'Hello, Eve!'\", \"asse...
{ "split": "train", "index": 48, "acecode_id": "bigcode_python_fns_40976", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string of text, write a function that performs the following operations: \n\n1) Convert all uppercase characters to lowercase. \n2) Replace all punctuation in the given text (consider punctuation to be any of the following characters: . , ! ? : ; ') with a specific char...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert preprocess_text('Hello, World!', '*') == 'hello* world*'\", \"assert preprocess_text('How are you?', '#') == 'how are you#'\", \"assert preprocess_text('Python: A great language.', '-') == 'python- a great language-'\", \"assert preprocess_text('This is a te...
{ "split": "train", "index": 49, "acecode_id": "evol_32729", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts unique strings enclosed within backticks from a given text content. Your function should take two parameters: a string `text_content` which contains the text to be processed, and a list of strings `ignored_strings` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_help_strings('Here is a `help1`, and here is another `help2`.', ['help1']) == ['help2']\", \"assert extract_help_strings('No help strings here.', ['help1']) == []\", \"assert extract_help_strings('`help3` is a unique string. Also, `help4` is another....
{ "split": "train", "index": 50, "acecode_id": "oss_16145", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function `cumulative_sum(array)` that returns a new array containing the cumulative sum of the elements in the input array. The cumulative sum at each index is the sum of all previous elements in the array up to that index. For example, f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_sum([1, 2, 3, 4]) == [1, 3, 6, 10]\", \"assert cumulative_sum([0, 0, 0]) == [0, 0, 0]\", \"assert cumulative_sum([-1, -2, -3]) == [-1, -3, -6]\", \"assert cumulative_sum([5]) == [5]\", \"assert cumulative_sum([]) == []\", \"assert cumulative_sum([...
{ "split": "train", "index": 51, "acecode_id": "evol_33601", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of non-negative integers. Implement a function that sorts the list in ascending order using the radix sort algorithm. The function should handle the sorting for numbers with varying digits. The input list can be of any length, and it is guaranteed to contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert radix_sort([170, 45, 75, 90, 802, 24, 2, 66]) == [2, 24, 45, 66, 75, 90, 170, 802]\", \"assert radix_sort([3, 6, 1, 8, 4, 3, 7]) == [1, 3, 3, 4, 6, 7, 8]\", \"assert radix_sort([10, 1, 100, 1000]) == [1, 10, 100, 1000]\", \"assert radix_sort([0, 0, 0, 0]) ==...
{ "split": "train", "index": 52, "acecode_id": "bigcode_python_fns_18481", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with resizing an image to a target width and height by either cropping or padding it. Given a 3D tensor representing an image and two integers representing the target width and height, implement a function that resizes the image according to the following rules: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resize_image([[[1, 1, 1]]], 2, 2) == [[[1, 1, 1], [0, 0, 0]], [[0, 0, 0], [0, 0, 0]]]\", \"assert resize_image([[[1]]], 1, 1) == [[[1]]]\", \"assert resize_image([[[1, 1, 1], [1, 1, 1]]], 1, 1) == [[[1, 1, 1]]]\", \"assert resize_image([[[1]]], 2, 1) == [[[1...
{ "split": "train", "index": 53, "acecode_id": "bigcode_python_fns_22637", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function `parse_error_log` that takes a string containing log data as input and returns a list of dictionaries, where each dictionary represents the extracted details for a single error entry. The log data contains structured error messages...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_error_log('######################## Result Starts Here ###############################\\\\nDevice id: /dev/nvidia0\\\\nTimestamp: Mar 29 19:41:54 2017\\\\nerr=00000027\\\\nsev=1\\\\nExerciser Name: hxenvidia\\\\nSerial No: Not Available\\\\n###########...
{ "split": "train", "index": 54, "acecode_id": "oss_17704", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `generate_output_config(base_config_path: str, seed: int, shot: int) -> Tuple[str, dict]`. This function takes in a string `base_config_path` representing the file path of a base configuration, an integer `seed` which is used to gener...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_output_config('configs/base_1shot_config.yaml', 42, 5) == ('output/seed42/output_config.yaml', {'shot': 5, 'seed': 42, 'dataset_mode': 'all'})\", \"assert generate_output_config('configs/base_1shot_novel_config.yaml', 1, 3) == ('output/seed1/output_...
{ "split": "train", "index": 55, "acecode_id": "bigcode_python_fns_8893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of students in a classroom. Your task is to implement a function that returns the average height of the students rounded to two decimal places. If the list is empty, return 0.00. \n\nFunction signature: `def average_heig...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_height([150, 160, 170, 180]) == 165.00\", \"assert average_height([200, 210, 220]) == 210.00\", \"assert average_height([50, 60, 70, 80, 90]) == 70.00\", \"assert average_height([100, 100, 100, 100]) == 100.00\", \"assert average_height([250]) == 250...
{ "split": "train", "index": 56, "acecode_id": "bigcode_python_fns_3965", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a data structure representing a collection of known protobuf model IDs, implement a function `list_known_protobufs()`. This function should return a list of all the known protobuf model IDs present in the data structure. The data structure is a dictionary where the keys a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_known_protobufs({'model1': {}, 'model2': {}, 'model3': {}}) == ['model1', 'model2', 'model3']\", \"assert list_known_protobufs({'A': {}, 'B': {}, 'C': {}}) == ['A', 'B', 'C']\", \"assert list_known_protobufs({'foo': {}, 'bar': {}}) == ['foo', 'bar']\", ...
{ "split": "train", "index": 57, "acecode_id": "bigcode_python_fns_31433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string containing a list of words separated by spaces. Write a function `count_words(sentence: str) -> int` that returns the number of unique words in the sentence. Words are considered unique regardless of their case (e.g., 'Word' and 'word' are considered the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_words('Hello, world! Hello.') == 2\", \"assert count_words('') == 0\", \"assert count_words('Hello hello HELLO') == 1\", \"assert count_words('123 123 123 456') == 2\", \"assert count_words('Pneumonoultramicroscopicsilicovolcanoconiosis') == 1\", \"ass...
{ "split": "train", "index": 58, "acecode_id": "bigcode_python_fns_39990", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a list of decimal numbers based on a specific pattern. The pattern is defined as follows: each decimal number in the list must have exactly 3 digits after the decimal point and must be within the range of -100.0 to 100....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_decimal_list([12.345, -67.890, 100.000, 0.123]) == False\", \"assert validate_decimal_list([-100.001, 50.500, 0.000]) == False\", \"assert validate_decimal_list([99.999, -99.999, 0.001, 0.010]) == False\", \"assert validate_decimal_list([-50.123, 50...
{ "split": "train", "index": 59, "acecode_id": "oss_24215", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple image classification model training process. Your function should take in the number of classes in a dataset, the number of epochs for training, and the batch size. The function should return a string summarizi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_model_training(2, 10, 32) == 'Training a model with 2 classes for 10 epochs with a batch size of 32.'\", \"assert simulate_model_training(5, 20, 16) == 'Training a model with 5 classes for 20 epochs with a batch size of 16.'\", \"assert simulate_mod...
{ "split": "train", "index": 60, "acecode_id": "oss_20703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes incoming messages and logs warnings for certain conditions based on the message header. The function `process_message(header, pkt)` takes a `header` object and a `pkt` object as input. Perform the following actions: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_message({'id': 2}, 'data') == ['No handler for message id 2']\", \"assert process_message({'id': 5}, 'data') == ['No handler for message id 5']\", \"assert process_message({'id': 6}, 'data') == ['No handler for message id 6']\", \"assert process_mess...
{ "split": "train", "index": 61, "acecode_id": "oss_7804", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing package requirements. Your task is to implement a function that filters out any packages related to cryptography and appends a fallback package if a specific requirement is met. The fallback package should be provided as an input par...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_crypto_packages(['numpy', 'pandas', 'pycrypto'], 'fallback') == ['numpy', 'pandas', 'fallback']\", \"assert filter_crypto_packages(['cryptography', 'requests'], 'fallback') == ['requests', 'fallback']\", \"assert filter_crypto_packages(['scipy', 'cryp...
{ "split": "train", "index": 62, "acecode_id": "bigcode_python_fns_29792", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a file path. Write a function `is_executable_file(file_path: str) -> bool` that checks if the file at the given path is an executable file. An executable file is defined as one that is not a directory and has the executable permission. For si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_executable_file('/usr/bin/python.exe') == True\", \"assert is_executable_file('/usr/local/bin/script.sh') == True\", \"assert is_executable_file('/home/user/document.txt') == False\", \"assert is_executable_file('/etc/config') == False\", \"assert is_exec...
{ "split": "train", "index": 63, "acecode_id": "bigcode_python_fns_41412", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings and a list of characters, implement a function that returns a new list containing only the strings that start with any of the characters from the second list. The comparison should be case-insensitive. Write a function named `filter_strings` that takes i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_strings(['Apple', 'banana', 'Apricot', 'cherry'], ['A']) == ['Apple', 'Apricot']\", \"assert filter_strings(['dog', 'cat', 'deer', 'elephant'], ['d', 'e']) == ['dog', 'deer', 'elephant']\", \"assert filter_strings(['Zebra', 'antelope', 'Giraffe'], ['z...
{ "split": "train", "index": 64, "acecode_id": "evol_11620", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a rule in a logic programming language (similar to Datalog). Your task is to implement a function that counts the number of rules in the given list and returns this count. The list may contain rules that are empty or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_rules(['rule1', 'rule2', 'rule3']) == 3\", \"assert count_rules(['', ' ', 'rule4']) == 1\", \"assert count_rules(['rule5', '']) == 1\", \"assert count_rules(['', ' ', '']) == 0\", \"assert count_rules(['rule6', 'rule7', ' ', 'rule8']) == 3\", \"asse...
{ "split": "train", "index": 65, "acecode_id": "bigcode_python_fns_27902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings representing file paths, and returns a list of strings where each string is a command to stop a Docker Compose service for the given file path. The command format should be 'cd <file_path> && docker-compose st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_docker_compose_commands(['path/to/service1', 'path/to/service2']) == ['cd path/to/service1 && docker-compose stop', 'cd path/to/service2 && docker-compose stop']\", \"assert generate_docker_compose_commands(['serviceA', 'serviceB', 'serviceC']) == [...
{ "split": "train", "index": 66, "acecode_id": "bigcode_python_fns_15031", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `greet_person(name: str, msg: str) -> str` that takes a person's name and a greeting message as input and returns a formatted greeting string. The output should be 'Hello, {name}. {msg}' where {name} is the name of the person and {msg} is the greeting messa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet_person('Jane', 'Nice to meet you.') == 'Hello, Jane. Nice to meet you.'\", \"assert greet_person('John', 'How are you?') == 'Hello, John. How are you?'\", \"assert greet_person('Alice', 'Welcome to the party!') == 'Hello, Alice. Welcome to the party!'\...
{ "split": "train", "index": 67, "acecode_id": "evol_3853", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simplified version of a Transformer encoder-decoder layer. The function takes in the following parameters: depth of embedding (d_model), depth of the feed-forward layer (d_ff), number of attention heads (n_heads), dro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_transformer_layer(512, 2048, 8, 0.1, 1, 'train', 'relu') == ('decoder_activations', 'mask', 'encoder')\", \"assert simulate_transformer_layer(256, 1024, 4, 0.2, 2, 'eval', 'gelu') == ('decoder_activations', 'mask', 'encoder')\", \"assert simulate_tr...
{ "split": "train", "index": 68, "acecode_id": "bigcode_python_fns_6427", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to filter out non-alphanumeric strings from a given list. The function should take a list of strings as input and return a new list containing only the strings that have at least one alphanumeric character (a-z, A-Z, 0-9). Implement t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_list(['!@#$', ' ', 'abc123', 'def']) == ['abc123', 'def']\", \"assert clean_list(['', ' ', ' ', '']) == []\", \"assert clean_list(['hello', 'world!', '1234', '']) == ['hello', 'world!', '1234']\", \"assert clean_list(['', 'test123', '456', '!!!']) ==...
{ "split": "train", "index": 69, "acecode_id": "oss_19145", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of items, each represented by a string and a corresponding quantity. Your task is to transform this list into a new list where each item appears as many times as its quantity indicates. Implement a function `expand_items(items: List[Tuple[str, int]]) -> Lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert expand_items([('apple', 2), ('banana', 3)]) == ['apple', 'apple', 'banana', 'banana', 'banana']\", \"assert expand_items([('orange', 1), ('grape', 0), ('kiwi', 4)]) == ['orange', 'kiwi', 'kiwi', 'kiwi', 'kiwi']\", \"assert expand_items([]) == []\", \"assert ...
{ "split": "train", "index": 70, "acecode_id": "bigcode_python_fns_31351", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings that represent the names of custom fields in a project. Each custom field is represented by a string, and you need to determine if a specific custom field exists in the list for a given project key. Write a function `field_exists(project_key: str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert field_exists('PROJECT_KEY_1', ['RallyItem', 'RallyID', 'Bug'], 'RallyItem') == True\", \"assert field_exists('PROJECT_KEY_1', ['RallyItem', 'RallyID', 'Bug'], 'RallyURL') == False\", \"assert field_exists('PROJECT_KEY_2', ['Feature', 'Epic', 'Task'], 'Epic')...
{ "split": "train", "index": 71, "acecode_id": "bigcode_python_fns_23537", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the sum of all odd integers between two given positive integers 'l' and 'r' (inclusive), and also computes the sum of the squares of these odd integers. The function should return both the total sum of the odd integers and the total sum of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert odd_numbers_aggregate(1, 10) == (25, 165)\", \"assert odd_numbers_aggregate(3, 3) == (3, 9)\", \"assert odd_numbers_aggregate(1, 1) == (1, 1)\", \"assert odd_numbers_aggregate(10, 10) == (0, 0)\", \"assert odd_numbers_aggregate(21, 21) == (21, 441)\", \"asse...
{ "split": "train", "index": 72, "acecode_id": "evol_21953", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given the dimensions of a trapezoid, which include base1, base2, and height. These dimensions can be any real number within the range of 1 to 10^5. Your task is to implement a function that calculates the area of the trapezoid using the formula: Area = ((base1 + base2) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert area_trapezoid(5, 10, 2) == 15.0\", \"assert area_trapezoid(1.5, 3.5, 4) == 10.0\", \"assert area_trapezoid(100000, 100000, 100000) == 10000000000.0\", \"assert area_trapezoid(3, 7, 5) == 25.0\", \"assert area_trapezoid(10, 10, 10) == 100.0\", \"assert area_...
{ "split": "train", "index": 73, "acecode_id": "evol_9807", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are building a chatbot that provides users with a home menu. Implement a function `edit_home_menu_message` that takes a string input 'current_message' and returns a new string that includes a welcome message followed by the provided 'current_message'. The welcome message sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert edit_home_menu_message('Welcome to the bot!') == 'I am your Terra Node Bot. \\ud83e\\udd16\\\\nClick *MY NODES* to get information about the Terra Nodes you monitor! Welcome to the bot!'\", \"assert edit_home_menu_message('Please check your nodes.') == 'I am...
{ "split": "train", "index": 74, "acecode_id": "bigcode_python_fns_12926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a random number generator that can generate integers within a specified range. Write a function `generate_random_coordinates` that takes three parameters: a random number generator `rand`, and two integers `width` and `height`. The function should return a tuple c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_coordinates(rand, 5, 5) in [(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (4, 0), (4, 1), (4, 2), (4, 3), (4, 4)]\", \"assert ge...
{ "split": "train", "index": 75, "acecode_id": "bigcode_python_fns_6117", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given an integer x representing a time value and an integer dt representing a time shift in the same units, write a function `shift_time(x: int, dt: int) -> int` that returns the time value after shifting it to the left by the amount specified by dt. The left shift is performed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shift_time(10, 3) == 7\", \"assert shift_time(5, 0) == 5\", \"assert shift_time(0, 5) == -5\", \"assert shift_time(-3, 2) == -5\", \"assert shift_time(-10, -5) == -5\", \"assert shift_time(100, 10) == 90\", \"assert shift_time(-50, 20) == -70\", \"assert shi...
{ "split": "train", "index": 76, "acecode_id": "bigcode_python_fns_12781", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers, denoted as `nums`. Your task is to perform exactly one operation where you can replace one element `nums[i]` with the square of that element, `nums[i] * nums[i]`. After performing this operation, you need to find the maximum possible sum of a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum_after_one_operation([0, 0, 0]) == 0\", \"assert max_subarray_sum_after_one_operation([1]) == 1\", \"assert max_subarray_sum_after_one_operation([6]) == 36\", \"assert max_subarray_sum_after_one_operation([2, 2, 2]) == 12\", \"assert max_suba...
{ "split": "train", "index": 77, "acecode_id": "evol_3066", "num_tests": 5 }
End of preview. Expand in Data Studio

AceCode-87K train / held-out test split (verl format)

The exact train and test data used for the binary-reward code RL runs on Qwen3-1.7B-Base (GRPO / MaxRL) in max-rl.

Source: TIGER-Lab/AceCode-87K (AceCoder, arXiv:2502.01718), which ships a single train split: function-level Python problems, each with GPT-4o-mini-synthesized assert test cases.

file split rows data_source
train.parquet train 85,847 acecode
eval.parquet test (held-out) 1,000 acecode_eval

Train and test share no AceCode id (overlap 0). Per-split counts are in stats.json.

How the split was made

preprocess_acecode_data.py (included) on the full 87,149 rows:

  1. shuffle with seed 42;
  2. keep only assert ... test strings; drop rows with < 3 tests, empty questions, or a duplicate question (302 rows dropped); keep at most 16 tests per prompt;
  3. drop prompts longer than 3,072 tokens under the Qwen3-1.7B-Base chat template (0 dropped);
  4. the last 1,000 surviving rows are the test split, the rest are train.

Schema (verl RL parquet)

  • prompt: chat messages, one user turn = the AceCode question + the suffix "\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
  • ability: "code"
  • reward_model: {"style": "rule", "ground_truth": "{\"tests\": [\"assert ...\", ...]}"}
  • extra_info: split, index, acecode_id, num_tests

Reward

Strictly binary: take the last ```python block of the response, append all assert tests, run in a fresh python -I subprocess (10 s wall / CPU limit, 4 GiB address space). Score 1.0 iff the process exits 0, else 0.0 (no code block → 0.0). Validated 60/60 against AceCode-87K's own pass_rate ∈ {0, 1} inference labels.

Evaluation in the runs: 4 samples per test prompt (T=0.6, top-p 0.95), reporting mean@4 and best@4.

Downloads last month
12

Paper for max-rl/acecode87k