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 tasked with implementing a function that updates the status of a task based on certain conditions. The function `update_task_status` takes two parameters: a string `current_status` which can be either 'ONGOING' or 'COMPLETED', and a boolean `is_completed`. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_task_status('ONGOING', True) == 'COMPLETED'\", \"assert update_task_status('COMPLETED', False) == 'ONGOING'\", \"assert update_task_status('ONGOING', False) == 'ONGOING'\", \"assert update_task_status('COMPLETED', True) == 'COMPLETED'\", \"assert upda... | {
"split": "train",
"index": 66200,
"acecode_id": "oss_5557",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of word embeddings. Each embedding consists of a word followed by its vector representation. Write a function `process_embeddings(embeddings: List[str]) -> Tuple[Dict[str, int], List[List[str]]]` that takes a list of strings as input, where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_embeddings(['cat 0.1 0.2 0.3', 'dog 0.4 0.5 0.6']) == ({'C_PAD': 0, 'C_UNK': 1, 'cat': 2, 'dog': 3}, [['0.1', '0.2', '0.3'], ['0.4', '0.5', '0.6']])\", \"assert process_embeddings(['apple 1.0 1.1 1.2']) == ({'C_PAD': 0, 'C_UNK': 1, 'apple': 2}, [['1.... | {
"split": "train",
"index": 66201,
"acecode_id": "bigcode_python_fns_7609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that initializes a multi-layer perceptron (MLP) with dense layers based on a given configuration. The function `initialize_mlp(sizes: List[int], scope: str = 'mlp-baseline', summary_labels: Tuple[str, ...] = ())` will take in the foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_mlp([10, 20]) == [{'layer_name': 'dense_1', 'size': 10, 'activation_function': 'relu'}, {'layer_name': 'dense_2', 'size': 20, 'activation_function': 'relu'}]\", \"assert initialize_mlp([5]) == [{'layer_name': 'dense_1', 'size': 5, 'activation_func... | {
"split": "train",
"index": 66202,
"acecode_id": "oss_34112",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional array (list of lists), write a function `invert(arr)` that inverts the order of the elements in the array. The function should reverse the order of the rows and also reverse the elements within each row. Do not use any predefined or built-in methods, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert invert([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[9, 8, 7], [6, 5, 4], [3, 2, 1]]\", \"assert invert([[1]]) == [[1]]\", \"assert invert([[1, 2], [3, 4]]) == [[4, 3], [2, 1]]\", \"assert invert([[1, 2, 3], [0, 0, 0]]) == [[0, 0, 0], [3, 2, 1]]\", \"assert invert... | {
"split": "train",
"index": 66203,
"acecode_id": "evol_22225",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that computes the number of elephants in a zoo based on the following conditions: The zoo has a total number of animals, and the number of zebras is a specific number more than thrice the number of elephants. Your task is to implement a function `elepha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert elephants_in_zoo(400, 80) == 80\", \"assert elephants_in_zoo(500, 100) == 100\", \"assert elephants_in_zoo(450, 90) == 90\", \"assert elephants_in_zoo(600, 120) == 120\", \"assert elephants_in_zoo(700, 140) == 140\", \"assert elephants_in_zoo(800, 160) == 16... | {
"split": "train",
"index": 66204,
"acecode_id": "evol_5804",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dataset represented as a list of non-negative integers. The function should be able to perform two operations based on the type of dataset specified: 'volume' or 'block'. If the dataset type is 'volume', the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dataset('volume', [1, 2, 3, 4]) == 10\", \"assert process_dataset('volume', [0, 0, 0]) == 0\", \"assert process_dataset('volume', [5, 5, 5, 5, 5]) == 25\", \"assert process_dataset('volume', [1]) == 1\", \"assert process_dataset('volume', []) == 0\",... | {
"split": "train",
"index": 66205,
"acecode_id": "oss_23041",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of file information and generates a report containing details about each file. The function should take a list of tuples, where each tuple contains the file name (string), file size (integer), and file extensi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_file_report([('example_file.txt', 1024, 'txt'), ('another_file.jpg', 2048, 'jpg')]) == 'File Report:\\\\n----------------\\\\nFile Name: example_file.txt\\\\nFile Size: 1024 bytes\\\\nFile Extension: txt\\\\n\\\\nFile Name: another_file.jpg\\\\nFile... | {
"split": "train",
"index": 66206,
"acecode_id": "oss_26254",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representation of a Z-matrix, write a function `harvest_zmat(zmat: str) -> Tuple[int, int, str]` that extracts the number of atoms, the charge, and the multiplicity from the Z-matrix. The Z-matrix format includes a comment line followed by lines containing atomic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert harvest_zmat('Comment line\\\\nH 0.0 0.0 0.0\\\\nO 0.0 0.0 0.96\\\\nCHARGE = 0\\\\nMULTIPLICITY = 1') == (2, 0, 1)\", \"assert harvest_zmat('Comment line\\\\nH 0.0 0.0 0.0\\\\nO 0.0 0.0 0.96\\\\nCHARGE = -1\\\\nMULTIPLICITY = 2') == (2, -1, 2)\", \"assert ha... | {
"split": "train",
"index": 66207,
"acecode_id": "bigcode_python_fns_26869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts an amount in Bitcoin to Ethereum based on the current conversion rate of 1 Bitcoin = 12.85 Ethereum. The function should take a single parameter representing the amount in Bitcoin and return the equivalent amount in Ethereum.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_btc_to_eth(0) == 0.0\", \"assert convert_btc_to_eth(1) == 12.85\", \"assert convert_btc_to_eth(2) == 25.7\", \"assert convert_btc_to_eth(0.5) == 6.425\", \"assert convert_btc_to_eth(10) == 128.5\", \"assert convert_btc_to_eth(3.75) == 48.1875\", \"as... | {
"split": "train",
"index": 66208,
"acecode_id": "evol_32431",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `interpolate_values(arr)` that takes the list `arr` and returns a dictionary with the following keys: 'max_value', 'min_value', and 'average_value'. 'max_value' should be the maximum integer in the list, 'min_value' should be the minim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpolate_values([1, 2, 3, 4, 5]) == {'max_value': 5, 'min_value': 1, 'average_value': 3.0}\", \"assert interpolate_values([-1, -2, -3, -4, -5]) == {'max_value': -1, 'min_value': -5, 'average_value': -3.0}\", \"assert interpolate_values([10, 20, 30]) == {'... | {
"split": "train",
"index": 66209,
"acecode_id": "bigcode_python_fns_28743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a source of function tags where tags are separated by a hyphen ('-'). Write a function `get_function_tags(source: str) -> List[str]` that takes in the string `source` and returns a list of function tags. If the input string is empty, contains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_function_tags('func1-func2-func3') == ['func1', 'func2', 'func3']\", \"assert get_function_tags('') == []\", \"assert get_function_tags('--') == []\", \"assert get_function_tags(None) == []\", \"assert get_function_tags('funcA-funcB') == ['funcA', 'funcB... | {
"split": "train",
"index": 66210,
"acecode_id": "bigcode_python_fns_43827",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of observations represented as strings, and you need to predict the next action based on certain rules. The possible actions are 'n', 's', 'e', and 'w'. Implement a function `predict_next_action(observations: List[str]) -> List[str]` that takes a list of ob... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_next_action(['only a wall', 'nothing at all']) == ['n', 'n']\", \"assert predict_next_action(['moving north', 'moving nowhere']) == ['n', 'n']\", \"assert predict_next_action(['n', 's', 'e', 'w']) == ['n', 's', 'e', 'w']\", \"assert predict_next_acti... | {
"split": "train",
"index": 66211,
"acecode_id": "bigcode_python_fns_22330",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of dictionaries and a list of keys. The function should return a new list of dictionaries, where each dictionary contains only the specified keys from the original dictionaries. If a specified key is not present in a dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_dicts([{'a': 1, 'b': 2}, {'a': 3, 'c': 4}], ['a']) == [{'a': 1}, {'a': 3}]\", \"assert filter_dicts([{'x': 10, 'y': 20}, {'x': 30, 'z': 40}], ['x', 'y']) == [{'x': 10, 'y': 20}, {'x': 30}]\", \"assert filter_dicts([{'name': 'Alice', 'age': 30}, {'name... | {
"split": "train",
"index": 66212,
"acecode_id": "bigcode_python_fns_5746",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a secure password for a user account based on a given username. The password must meet the following criteria: \n- The password length should be at least 12 characters. \n- The password should contain a mix of uppercase let... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_password('user123')) >= 12\", \"assert any(c.isupper() for c in generate_password('user123'))\", \"assert any(c.islower() for c in generate_password('user123'))\", \"assert any(c.isdigit() for c in generate_password('user123'))\", \"assert any(c... | {
"split": "train",
"index": 66213,
"acecode_id": "oss_34666",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, where each inner list contains personal contact information details. Your task is to write a function that returns the first inner list from the given list. The input list will always contain at least one inner list. Implement the function `get_fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_first_contact_info([['John Doe', 'john@example.com', '123-456-7890'], ['Jane Smith', 'jane@example.com', '987-654-3210']]) == ['John Doe', 'john@example.com', '123-456-7890']\", \"assert get_first_contact_info([['Alice', 'alice@example.com'], ['Bob', 'bo... | {
"split": "train",
"index": 66214,
"acecode_id": "bigcode_python_fns_27497",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a variable number of dictionaries as input. Your task is to merge these dictionaries into a single dictionary. The dictionaries should be merged in the order they are provided, with later dictionaries overwriting the values of earlier ones when they have the same ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_dicts({'a': 1}, {'b': 2}) == {'a': 1, 'b': 2}\", \"assert merge_dicts({'a': 1}, {'a': 2}) == {'a': 2}\", \"assert merge_dicts({'a': 1}, {'b': 2}, {'c': 3}) == {'a': 1, 'b': 2, 'c': 3}\", \"assert merge_dicts({'x': 1}, {'x': 2, 'y': 3}, {'y': 4}) == {'x... | {
"split": "train",
"index": 66215,
"acecode_id": "bigcode_python_fns_46919",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of numbers, implement a function `median(arr)` that calculates the median of the array after filtering out any inappropriate inputs (such as strings, NaNs, etc.). The function should raise a ValueError when it encounters an inappropriate input. The median is defi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([1, 2, 3]) == 2\", \"assert median([1, 3, 2]) == 2\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([5, 3, 2, 4, 1]) == 3\", \"assert median([1.5, 2.5, 3.5]) == 2.5\", \"assert median([]) == None\", \"assert median([1, 2, 3, 4, 5, 6, 7]) == ... | {
"split": "train",
"index": 66216,
"acecode_id": "evol_7901",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of waiting for a file descriptor event and then switching back to the current execution context when the event occurs. Your function should be called `wait_for_event`. It takes two parameters: \n1. `conn`: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wait_for_event(5, True) == 'Read event on fd: 5'\", \"assert wait_for_event(0, True) == 'Read event on fd: 0'\", \"assert wait_for_event(1, False) == 'Write event on fd: 1'\", \"assert wait_for_event(0, True) == 'Read event on fd: 0'\", \"assert wait_for_eve... | {
"split": "train",
"index": 66217,
"acecode_id": "oss_3119",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating-point numbers. Your task is to implement a function `calculate_variation` that computes the variation of the list, defined as the difference between the maximum and minimum values in the list. If the list is empty, the function should return 0. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_variation([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == 8\", \"assert calculate_variation([10, 20, 30, 40, 50]) == 40\", \"assert calculate_variation([5, 5, 5, 5, 5]) == 0\", \"assert calculate_variation([-1, -2, -3, -4]) == 3\", \"assert calculate_variati... | {
"split": "train",
"index": 66218,
"acecode_id": "oss_15815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the configuration type based on a given service name. The function should accept a string representing the service name and return a string indicating the corresponding configuration type. The mapping is as follows: 'H... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config_type('HDFS') == 'hdfs-site'\", \"assert get_config_type('MAPREDUCE') == 'mapred-site'\", \"assert get_config_type('HBASE') == 'hbase-site'\", \"assert get_config_type('OOZIE') == 'oozie-site'\", \"assert get_config_type('HIVE') == 'hive-site'\", \... | {
"split": "train",
"index": 66219,
"acecode_id": "bigcode_python_fns_45903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary and a key, and generates a string representation of an assignment operation based on the value associated with the key in the dictionary. The input dictionary can contain one of the following keys: 'function', 'var... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_assignment_string('my_dict', 'my_key', {'function': 'my_function'}, 2) == ' my_dict[\\\"my_key\\\"] = my_function'\", \"assert generate_assignment_string('my_dict', 'my_key', {'variable': 'my_variable'}, 1) == ' my_dict[\\\"my_key\\\"] = my_variabl... | {
"split": "train",
"index": 66220,
"acecode_id": "bigcode_python_fns_378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 2D positions represented as tuples (x, y), calculate the radius of gyration of the group of positions. The radius of gyration is defined as the square root of the average of the squared distances of each position from the center of mass of the group. You need to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(radius_of_gyration([(0, 0), (0, 1), (1, 0), (1, 1)]) - 0.7071) < 0.0001\", \"assert abs(radius_of_gyration([(0, 0), (0, 0), (0, 0)]) - 0.0) < 0.0001\", \"assert abs(radius_of_gyration([(1, 1), (1, 1)]) - 0.0) < 0.0001\", \"assert abs(radius_of_gyration([... | {
"split": "train",
"index": 66221,
"acecode_id": "bigcode_python_fns_15862",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You need to parse a given HTML string and obtain a list of tags along with their attributes, nesting levels, and the text content inside each tag. Implement a function `parse_html(html_string: str) -> List[Tuple[int, str, Optional[str], str]]` that takes a single parameter `htm... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_html('<div><p>Hello</p></div>') == [(0, 'div', None, ''), (1, 'p', None, 'Hello')]\", \"assert parse_html('<div id=\\\"main\\\"><h1>Title</h1></div>') == [(0, 'div', 'id=\\\"main\\\"', ''), (1, 'h1', None, 'Title')]\", \"assert parse_html('<div><span c... | {
"split": "train",
"index": 66222,
"acecode_id": "evol_13529",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the retrieval of connected devices in a system. Implement a function called `get_connected_devices` that returns a list of strings representing the names of the connected devices. The function should return a list with name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_connected_devices(0) == []\", \"assert get_connected_devices(1) == ['Device1']\", \"assert get_connected_devices(2) == ['Device1', 'Device2']\", \"assert get_connected_devices(3) == ['Device1', 'Device2', 'Device3']\", \"assert get_connected_devices(4) =... | {
"split": "train",
"index": 66223,
"acecode_id": "bigcode_python_fns_2951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a settings menu for a graphical user interface. The function should take in a dictionary that represents the available actions and a list of actions to be added to the settings menu. The function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_settings_menu({'ACTION_settingsdialog': 'Open Settings'}, ['ACTION_settingsdialog']) == ['Open Settings']\", \"assert create_settings_menu({'ACTION_settingsdialog': 'Open Settings', 'ACTION_other': 'Other Action'}, ['ACTION_settingsdialog', 'ACTION_ot... | {
"split": "train",
"index": 66224,
"acecode_id": "bigcode_python_fns_37720",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a variable number of arguments and returns a list of unique variables passed to it, sorted in ascending order. Your function should be able to handle any type of argument, but only the arguments that are of type integer should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_sorted_integers(1, 2, 3) == [1, 2, 3]\", \"assert unique_sorted_integers(3, 2, 1) == [1, 2, 3]\", \"assert unique_sorted_integers(1, 1, 1) == [1]\", \"assert unique_sorted_integers(-1, -2, -3) == []\", \"assert unique_sorted_integers(0, 0, 0) == [0]\"... | {
"split": "train",
"index": 66225,
"acecode_id": "bigcode_python_fns_18930",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_evens` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function should take a single parameter, a list of integers, and must not use any external libraries.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 21, 32, 43, 54]) == 96\", \"assert sum_of_evens([-2, -4, -6, -8]) == -20\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([0, 0, 0]) == 0\"... | {
"split": "train",
"index": 66226,
"acecode_id": "bigcode_python_fns_23338",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns the sum of all even numbers in that list. The input list can contain both positive and negative integers, as well as zero. If there are no even numbers in the list, the function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([0]) == 0\", \"assert sum_of_evens([-1, 0, 1]) == 0\", \"assert su... | {
"split": "train",
"index": 66227,
"acecode_id": "oss_26425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the number of seconds between two timestamps. The timestamps will be provided as strings in the format 'YYYY-MM-DD HH:MM:SS'. Your function should return the absolute difference in seconds between the two timestamps. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert seconds_between_timestamps('2023-10-01 12:00:00', '2023-10-01 12:00:00') == 0\", \"assert seconds_between_timestamps('2023-10-01 12:00:00', '2023-10-01 12:05:00') == 300\", \"assert seconds_between_timestamps('2023-10-01 12:05:00', '2023-10-01 12:00:00') == ... | {
"split": "train",
"index": 66228,
"acecode_id": "oss_31821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a machine ID and a string representing a comment. Your task is to create a function `generate_unrestrict_request(machine_id: str, comment: str) -> dict` that simulates the creation of a request to enable execution of any application on the ma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unrestrict_request('machine001', 'Enable all applications') == {'MachineID': 'machine001', 'Comment': 'Enable all applications'}\", \"assert generate_unrestrict_request('machine002', 'Allow testing apps') == {'MachineID': 'machine002', 'Comment': 'A... | {
"split": "train",
"index": 66229,
"acecode_id": "bigcode_python_fns_17977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function to validate user registration details using a given username, email, password, and confirm password. The function should: \n\n- Check if the username is between 5 to 20 characters. \n- Validate that the email follows the format of a standard email address. \n-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_registration(username='abc', email='angelina@example.com', password='abc12345#', confirm_password='abc12345#') == 'Username should have between 5 and 20 characters.'\", \"assert validate_registration(username='angelina', email='angelina@example.com'... | {
"split": "train",
"index": 66230,
"acecode_id": "evol_11784",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Design a function that calculates the minimum number of rotations of a specified degree necessary to reach a certain angle from the initial position on a circular path. The function should handle cases where the rotation degree does not evenly divide the target angle. Return th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_rotations(90, 360) == 4\", \"assert min_rotations(45, 180) == 4\", \"assert min_rotations(30, 90) == 3\", \"assert min_rotations(60, 0) == 0\", \"assert min_rotations(0, 180) == 'Rotation angle cannot be zero'\", \"assert min_rotations(180, 180) == 1\", ... | {
"split": "train",
"index": 66231,
"acecode_id": "evol_13669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the construction of a ZX-diagram based on a specified backend. The function should accept an optional parameter `backend` which determines the type of graph to create. If `backend` is not provided, it defaults to 'simpl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_zx_diagram() == 'GraphS'\", \"assert create_zx_diagram('simple') == 'GraphS'\", \"assert create_zx_diagram('graph_tool') == 'GraphGT'\", \"assert create_zx_diagram('igraph') == 'GraphIG'\", \"assert create_zx_diagram('graph_tool') == 'GraphGT'\", \"as... | {
"split": "train",
"index": 66232,
"acecode_id": "bigcode_python_fns_14665",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to extract the pressure value from a tuple that represents weather data. The tuple contains three elements: the first element represents temperature, the second element represents pressure, and the third element represents humidity. Y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_pressure((30.0, 1013.25, 50.0)) == 1013.25\", \"assert get_pressure((25.5, 1005.0, 45.0)) == 1005.0\", \"assert get_pressure((15.0, 980.5, 70.0)) == 980.5\", \"assert get_pressure((22.0, 1010.0, 60.0)) == 1010.0\", \"assert get_pressure((18.5, 995.75, 55... | {
"split": "train",
"index": 66233,
"acecode_id": "oss_17799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of hours worked by employees in a week. Write a function `calculate_overtime(hours: List[int]) -> int` that calculates the total number of overtime hours worked by all employees. Overtime is defined as any hours worked be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_overtime([40]) == 0\", \"assert calculate_overtime([41]) == 1\", \"assert calculate_overtime([40, 41]) == 1\", \"assert calculate_overtime([50, 30, 20]) == 10\", \"assert calculate_overtime([0, 0, 0]) == 0\", \"assert calculate_overtime([80, 70]) =... | {
"split": "train",
"index": 66234,
"acecode_id": "bigcode_python_fns_48759",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers as input and returns a new list containing only the unique elements from the original list, while preserving the order of their first appearance. Additionally, return the total number of duplicate elements that were removed. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 1, 1, 1, 1]) == ([1], 4)\", \"assert remove_duplicates([]) == ([], 0)\", \"assert remove_duplicates([10, 20, 10, 30, 20, 40]) == ([10, 20, 30, 40], 2)\", \"assert remove_duplicates([1, 2, 3, 4]) == ([1, 2, 3, 4], 0)\", \"assert remove_d... | {
"split": "train",
"index": 66235,
"acecode_id": "evol_5556",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing an XML-like tag, write a function that modifies the tag to be self-closing if a specified condition is met. If the condition is true, transform any non-self-closing tags (e.g. <tag></tag>) into self-closing tags (e.g. <tag/>). If the condition is fal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_tag('<div></div>', 'false') == '<div></div>'\", \"assert modify_tag('<br></br>', 'false') == '<br></br>'\", \"assert modify_tag('<img></img>', 'false') == '<img></img>'\", \"assert modify_tag('<input></input>', 'false') == '<input></input>'\", \"asser... | {
"split": "train",
"index": 66236,
"acecode_id": "bigcode_python_fns_41286",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the index of an item in a list. If the item is found, return a tuple containing the index and the square of the index. If the item is not found, return (-1, -1).\nPlease reason step by step, then write a self-contained Python solution. Give your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_index([1, 2, 3, 4], 3) == (2, 4)\", \"assert find_index([10, 20, 30, 40], 20) == (1, 1)\", \"assert find_index(['a', 'b', 'c'], 'b') == (1, 1)\", \"assert find_index([5, 10, 15], 5) == (0, 0)\", \"assert find_index([], 1) == (-1, -1)\", \"assert find_in... | {
"split": "train",
"index": 66237,
"acecode_id": "evol_17566",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing image package manifests based on specified assembly rules. Write a function `process_image_manifests` that takes in a list of image manifests, where each manifest is represented as a dictionary containing the image's name and its attributes, and a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_image_manifests([{'name': 'image1', 'attributes': {'size': 'large', 'color': 'blue'}}, {'name': 'image2', 'attributes': {'size': 'small', 'color': 'red'}}], {'allowed_images': ['image1', 'image2'], 'valid_attributes': {'size': 'large', 'color': 'blue... | {
"split": "train",
"index": 66238,
"acecode_id": "oss_5448",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of student scores in a class. Write a Python function `find_highest_lowest_score` that takes a list of integers representing the scores of students and returns a tuple containing the highest score, its position in the list, the lowest score, and its positio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_highest_lowest_score([85, 92, 78, 90, 88]) == (92, 1, 78, 2)\", \"assert find_highest_lowest_score([100, 90, 90, 80, 70]) == (100, 0, 70, 4)\", \"assert find_highest_lowest_score([0, 0, 0, 0]) == (0, 0, 0, 0)\", \"assert find_highest_lowest_score([50]) ... | {
"split": "train",
"index": 66239,
"acecode_id": "oss_13283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a checkpoint saver for a machine learning model. This function takes in six parameters: `save_folder` (a string representing the directory to save checkpoints), `filename` (a string for the name of the checkpoint file), `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_checkpoint_saver('model_checkpoints', 'checkpoint.h5', 'model_v1', 'latest_checkpoint.h5', True, '10m') == {'folder': 'model_checkpoints', 'filename': 'checkpoint.h5', 'artifact_name': 'model_v1', 'latest_filename': 'latest_checkpoint.h5', 'overwr... | {
"split": "train",
"index": 66240,
"acecode_id": "oss_2434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a sequence of hexadecimal values, and your task is to convert each hexadecimal value into its corresponding RGB color representation. Each hexadecimal value is a string of 6 characters, formatted as '#RRGGBB'. Your function should return a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_hex_to_rgb('#FF5733,#33FF57,#3357FF') == [(255, 87, 51), (51, 255, 87), (51, 87, 255)]\", \"assert convert_hex_to_rgb('#000000,#FFFFFF') == [(0, 0, 0), (255, 255, 255)]\", \"assert convert_hex_to_rgb('#ABCDEF,#123456,#ZZZZZZ') == [(171, 205, 239), (1... | {
"split": "train",
"index": 66241,
"acecode_id": "bigcode_python_fns_37006",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user roles represented as strings and a user's nickname (also represented as a string). Write a function `get_user_info(nickname: str, roles: List[str]) -> List[str]` that returns a list of strings. The first element of the list should be the nickname if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_info('JohnDoe', ['@everyone', 'Admin', 'Moderator']) == ['JohnDoe', 'Admin', 'Moderator']\", \"assert get_user_info('', ['@everyone']) == ['No Nickname']\", \"assert get_user_info('Alice', []) == ['Alice']\", \"assert get_user_info('Bob', ['@everyon... | {
"split": "train",
"index": 66242,
"acecode_id": "bigcode_python_fns_20369",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are designing a simple memory game for children. The game involves managing a list of integer scores. Write a Python function called `shuffle_and_initialize` that takes a single parameter: a list of integers called `sums`. The function should perform the following tasks: 1.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shuffle_and_initialize([1, 2, 3])['current_sum'] == 0\", \"assert 'sums' in shuffle_and_initialize([4, 5, 6])\", \"assert len(shuffle_and_initialize([10, 20, 30, 40])['sums']) == 4\", \"assert shuffle_and_initialize([1])['sums'] == [1]\", \"assert shuffle_an... | {
"split": "train",
"index": 66243,
"acecode_id": "oss_16878",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a message to be displayed on the screen. The function `format_message(typ: str, name: str, msg: str) -> str` should take three strings as input: `typ`, `name`, and `msg`. The `typ` represents the type of message (e.g., 'info'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_message('info', 'System', 'Operation completed successfully') == '[info] System: Operation completed successfully'\", \"assert format_message('warning', 'Disk', 'Space is running low') == '[warning] Disk: Space is running low'\", \"assert format_messa... | {
"split": "train",
"index": 66244,
"acecode_id": "bigcode_python_fns_32857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a string containing nodes represented by individual characters. Each node can be rendered into a string based on a given dictionary of arguments. Your function should take a string `s` and an optional dictionary `args`,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_string('abc', {'a': '1', 'b': '2'}) == ['1', '2', 'c']\", \"assert render_string('xyz', {'x': 'X'}) == ['X', 'y', 'z']\", \"assert render_string('', {'a': '1'}) == []\", \"assert render_string('test', {'t': 'T'}) == ['T', 'e', 's', 'T']\", \"assert re... | {
"split": "train",
"index": 66245,
"acecode_id": "bigcode_python_fns_10017",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and reformats it by removing all spaces, converting all characters to lowercase, and sorting the characters in alphabetical order. The function should return the reformatted string.\nPlease reason step by step, then write a self-con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reformat_string('Hello World') == 'dehllloorw', 'Test Case 2 Failed'\", \"assert reformat_string('Leetcode') == 'cdeeelot', 'Test Case 3 Failed'\", \"assert reformat_string(' Spaces ') == 'acepss', 'Test Case 4 Failed'\", \"assert reformat_string(' ') =... | {
"split": "train",
"index": 66246,
"acecode_id": "evol_17948",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a backfill algorithm for a 2D grid. The algorithm should fill in any empty cells in the grid with a specified value, propagating the value to adjacent cells until it encounters a non-empty cell. The grid is represented as a list of lists, where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert backfill_grid([[0, 0], [0, 0]], 0, 0, 7) == [[7, 7], [7, 7]]\", \"assert backfill_grid([[1, 1], [1, 0]], 1, 1, 3) == [[1, 1], [1, 3]]\", \"assert backfill_grid([[0, 1, 0], [0, 0, 0], [1, 0, 1]], 1, 1, 5) == [[5, 1, 5], [5, 5, 5], [1, 5, 1]]\", \"assert backf... | {
"split": "train",
"index": 66247,
"acecode_id": "oss_7434",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes incoming chat messages formatted as 'username~message_content'. Your goal is to convert these messages into a standardized format for logging. Specifically, you need to implement a function called `format_message` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_message('alice~Hello, world!') == '[alice] Hello, world!'\", \"assert format_message('bob~How are you?') == '[bob] How are you?'\", \"assert format_message('charlie~Goodbye!') == '[charlie] Goodbye!'\", \"assert format_message('dave~This is a test mes... | {
"split": "train",
"index": 66248,
"acecode_id": "oss_7393",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python class to represent a graph node. The graph node class should have the following properties: a unique identifier for the node (id) and additional data associated with the node (data). Additionally, you need to implement a function that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_nodes_as_csv_rows([]) == []\", \"assert get_nodes_as_csv_rows([Node(1, ['data1']), Node(2, ['data2'])]) == [[1, 'data1'], [2, 'data2']]\", \"assert get_nodes_as_csv_rows([Node(3, ['data3', 'moredata']), Node(4, ['data4'])]) == [[3, 'data3', 'moredata'], ... | {
"split": "train",
"index": 66249,
"acecode_id": "oss_16531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to find all modes (the numbers that appear most frequently) in a list of integers. If there are multiple modes, return them in a sorted list. The input list will contain at least one number and can contain up to 1,000,000 numbers. The numbers will be within the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_modes([2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5]) == [4, 5]\", \"assert find_modes([1, 1, 2, 2]) == [1, 2]\", \"assert find_modes([1]) == [1]\", \"assert find_modes([3, 3, 3, 1, 1, 2, 2]) == [3]\", \"assert find_modes([-1, -1, 0, 0, 0, 1, 1]) == [0]\", \"a... | {
"split": "train",
"index": 66250,
"acecode_id": "evol_30717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a geographic item which includes various properties of that item. Your task is to implement a function that updates the 'geometry' key in this dictionary with a new geometry string provided as input. The function should return the updated... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_geometry({'name': 'Park', 'type': 'Polygon', 'geometry': 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'}, 'BUFFERED_POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))') == {'name': 'Park', 'type': 'Polygon', 'geometry': 'BUFFERED_POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))'}\", \"asser... | {
"split": "train",
"index": 66251,
"acecode_id": "oss_15963",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that evaluates a mathematical expression given as a string. The expression can contain integers, floating-point numbers, and the basic arithmetic operations: addition (+), subtraction (-), multiplication (*), and division (/). The exp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate('3 + 4 * 2 / (1 - 5)') == 1.0\", \"assert calculate('10 + 2 * 6') == 22.0\", \"assert calculate('100 * 2 + 12') == 212.0\", \"assert calculate('100 * (2 + 12)') == 1400.0\", \"assert calculate('100 * (2 + 12) / 14') == 100.0\", \"assert calculate('... | {
"split": "train",
"index": 66252,
"acecode_id": "oss_7588",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree, implement a function that performs a level-order traversal and returns the values of the nodes as a list. The binary tree is represented by a Node class with properties 'val', 'left', and 'right'. If the tree is empty (i.e., the root is None), return an emp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert level_order_traversal(None) == []\", \"assert level_order_traversal(Node(1)) == [1]\", \"assert level_order_traversal(Node(1, Node(2), Node(3))) == [1, 2, 3]\", \"assert level_order_traversal(Node(1, Node(2, Node(4), Node(5)), Node(3))) == [1, 2, 3, 4, 5]\",... | {
"split": "train",
"index": 66253,
"acecode_id": "evol_23788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `product_of_primes(numbers: List[int]) -> int` that calculates the product of all the prime numbers within the given list of integers. If there are no prime numbers in the list, the function should return 1. You must use a while loop to iterate through the list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_primes([3, 5, 7, 10, 13]) == 1365\", \"assert product_of_primes([4, 6, 8, 10]) == 1\", \"assert product_of_primes([2, 3, 5, 7]) == 210\", \"assert product_of_primes([1, 4, 6, 8, 9]) == 1\", \"assert product_of_primes([11, 13, 17]) == 2431\", \"ass... | {
"split": "train",
"index": 66254,
"acecode_id": "evol_35688",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an N x N grid where each cell grid[i][j] represents the elevation at that point (i,j). Some cells contain obstacles that cannot be traversed. As rain begins to fall, the water level rises over time. At time t, you can swim from one cell to another if both cells ha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swimInWater([[0, 2], [1, 3]], [(1, 0)]) == 3\", \"assert swimInWater([[0]], []) == 0\", \"assert swimInWater([[0, 4], [3, 2]], [(1, 0)]) == 4\", \"assert swimInWater([[0, 1], [2, 3]], []) == 3\", \"assert swimInWater([[0, 1], [1, 0]], [(0, 1)]) == 1\", \"ass... | {
"split": "train",
"index": 66255,
"acecode_id": "evol_15056",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that takes two parameters, num1 and num2. The function should return the sum of the two integers. If either of the inputs is not an integer, the function should return an appropriate error message stating that both inputs must be integers. Please imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_two_numbers(1, 2) == 3\", \"assert add_two_numbers(-1, 1) == 0\", \"assert add_two_numbers(0, 0) == 0\", \"assert add_two_numbers(100, 200) == 300\", \"assert add_two_numbers(-5, -5) == -10\", \"assert add_two_numbers(10, -10) == 0\", \"assert add_two_nu... | {
"split": "train",
"index": 66256,
"acecode_id": "evol_32630",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_pattern(string: str, pattern: str) -> int` that counts the occurrences of a specified pattern in a given string. The count should be case sensitive and should only consider non-overlapping instances of the pattern. For example, in the string 'This is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_pattern('Case Sensitivity Matters. case sensitivity matters.', 'case') == 1\", \"assert count_pattern('Pattern matching is fun. Pattern matching is not always easy.', 'Pattern') == 2\", \"assert count_pattern('Count the number of occurrences of the wor... | {
"split": "train",
"index": 66257,
"acecode_id": "evol_34274",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two square matrices of size n x n, where n is a positive integer. Your task is to implement a function that multiplies these two matrices and returns the resulting matrix. The multiplication of two matrices A (of size m x n) and B (of size n x p) results in a new ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert matrix_multiply([[1]], [[1]]) == [[1]]\", \"assert matrix_multiply([[1, 2]], [[3], [4]]) == [[11]]\", \"assert matrix_multiply([[1, 0], [0, 1]], [[5, 5], [5, 5]]) == [[5,... | {
"split": "train",
"index": 66258,
"acecode_id": "bigcode_python_fns_36386",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of results from an optimization algorithm and returns a list of dictionaries representing the logged results in a CSV format. Each dictionary should contain the keys from the first result in the list, and the val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_results([]) == []\", \"assert log_results([{'iteration': 1, 'score': 10}, {'iteration': 2, 'score': 20}]) == [{'iteration': 1, 'score': 10}, {'iteration': 2, 'score': 20}]\", \"assert log_results([{'iteration': 1, 'score': 5}, {'iteration': 2, 'score': 1... | {
"split": "train",
"index": 66259,
"acecode_id": "oss_15421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s, implement a function `is_happy(s)` that determines if the string is 'happy'. A string is considered happy if it meets the following criteria: 1) It has a length of at least 3 characters. 2) It does not contain any consecutive repeating characters. 3) Each char... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_happy('abcde') == False\", \"assert is_happy('aabbcc') == False\", \"assert is_happy('aabbccdde') == False\", \"assert is_happy('aaabbb') == False\", \"assert is_happy('abc') == False\", \"assert is_happy('aabbccddd') == False\", \"assert is_happy('ababab... | {
"split": "train",
"index": 66260,
"acecode_id": "evol_22290",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, denoted as `nums`, and a positive integer `k`, write a function `canPartitionKSubsets(nums: List[int], k: int) -> bool` that determines whether it's possible to partition the list into `k` non-empty subsets, each having an identical sum. The constraint... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canPartitionKSubsets([4, 3, 2, 3, 5, 2, 1], 4) == True\", \"assert canPartitionKSubsets([1, 1, 1, 1], 4) == True\", \"assert canPartitionKSubsets([1, 2, 3, 4], 2) == True\", \"assert canPartitionKSubsets([3, 3, 3, 3], 4) == True\", \"assert canPartitionKSubs... | {
"split": "train",
"index": 66261,
"acecode_id": "evol_25067",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer representing the maximum number of square tiles, write a function that calculates the number of unique square laminae configurations that can be created using these tiles. A square lamina is defined as a square structure that contains a smaller square v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_laminae(1) == 0\", \"assert count_unique_laminae(4) == 0\", \"assert count_unique_laminae(12) == 1\", \"assert count_unique_laminae(32) == 5\", \"assert count_unique_laminae(100) == 24\"]}"
} | {
"split": "train",
"index": 66262,
"acecode_id": "evol_14785",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `unusual_addition(lst)` that accepts a list of strings, where each string consists solely of numerical digits. The function should return a list of strings where, for each input string, it replaces '1' with the count of odd digits and 'e' with the count of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unusual_addition(['1234567']) == ['the number of odd elements are 4 of the string 3 of the input.']\", \"assert unusual_addition(['3', '1111111']) == ['the number of odd elements are 1 of the string 0 of the input.', 'the number of odd elements are 7 of the ... | {
"split": "train",
"index": 66263,
"acecode_id": "evol_3803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with aligning two groups of sentences based on their character lengths. Write a function `align_sentences(sx: List[str], sy: List[str]) -> List[Tuple[str, str]]` that takes two lists of sentences, `sx` and `sy`, as input and returns a list of tuples. Each tuple s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert align_sentences([\\\"One\\\", \\\"Two\\\", \\\"Three\\\"], [\\\"A\\\", \\\"B\\\", \\\"C\\\"]) == []\", \"assert align_sentences([\\\"Short\\\", \\\"Medium length\\\", \\\"Longer sentence\\\"], [\\\"Tiny\\\", \\\"Short\\\", \\\"Medium length\\\"]) == [(\\\"Sh... | {
"split": "train",
"index": 66264,
"acecode_id": "bigcode_python_fns_9987",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing amounts of money that need to be refunded. Implement a function `calculate_total_refund(amounts: List[int]) -> int` that calculates the total amount to be refunded. The function should return the sum of all the amounts in the list. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_refund([100, 200, 300]) == 600\", \"assert calculate_total_refund([-100, -200, -300]) == -600\", \"assert calculate_total_refund([100, -50, 50]) == 100\", \"assert calculate_total_refund([]) == 0\", \"assert calculate_total_refund([0, 0, 0]) ... | {
"split": "train",
"index": 66265,
"acecode_id": "bigcode_python_fns_7623",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the list of video IDs from a specific playlist. The function takes a string representing the playlist ID and returns a list of video IDs. Each video ID is a unique string. Your function should handle cases where the playlis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_video_ids_from_playlist('PL123456') == ['vid1', 'vid2', 'vid3']\", \"assert get_video_ids_from_playlist('PL654321') == ['vidA', 'vidB']\", \"assert get_video_ids_from_playlist('PL000000') == []\", \"assert get_video_ids_from_playlist('PL333333') == []\",... | {
"split": "train",
"index": 66266,
"acecode_id": "bigcode_python_fns_22631",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates saving player scores to a file. The function should take a list of player objects as input. Each player object has a method `add_score(score)` that modifies the player's score. The function should ensure that each player ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_scores([Player(), Player()]) == ['[-1]', '[-1]']\", \"assert save_scores([Player(), Player()]) == ['[-1]', '[-1]']\", \"assert save_scores([Player()]) == ['[-1]']\", \"assert save_scores([Player(), Player()]) == ['[-1]', '[-1]']\", \"assert save_scores(... | {
"split": "train",
"index": 66267,
"acecode_id": "bigcode_python_fns_2406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibfib(n: int) -> int` that calculates the Fibonacci-like sequence defined as follows: for n > 2, fibfib(n) = fibfib(n-1) + fibfib(n-2) + fibfib(n-3); for n < 0, fibfib(n) = fibfib(n+3) - fibfib(n+2) - fibfib(n+1); with initial conditions fibfib(0) = 0, fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibfib(0) == 0\", \"assert fibfib(1) == 0\", \"assert fibfib(2) == 1\", \"assert fibfib(3) == 1\", \"assert fibfib(4) == 2\", \"assert fibfib(5) == 4\", \"assert fibfib(6) == 7\", \"assert fibfib(7) == 13\", \"assert fibfib(8) == 24\", \"assert fibfib(9) == ... | {
"split": "train",
"index": 66268,
"acecode_id": "evol_1858",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of file extensions represented as strings, write a function that sorts these extensions in a case-insensitive alphabetical order and returns the sorted list. Each file extension should be returned as a string in the sorted order. For example, given the input list [... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted_extensions(['.py', '.txt', '.jpg', '.html', '.css']) == ['.css', '.html', '.jpg', '.py', '.txt']\", \"assert sorted_extensions(['.PDF', '.doc', '.txt', '.jpg', '.png']) == ['.doc', '.jpg', '.PDF', '.png', '.txt']\", \"assert sorted_extensions(['.zip',... | {
"split": "train",
"index": 66269,
"acecode_id": "oss_12568",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a file transfer operation should be retried based on the type of exception that occurred. The function should accept an exception 'e' and a boolean parameter 'skip_404'. The behavior is defined as follows: If '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_retry_transfer(ConnectionError(), False) == True\", \"assert should_retry_transfer(Timeout(), False) == True\", \"assert should_retry_transfer(ChunkedEncodingError(), False) == True\", \"assert should_retry_transfer(Timeout(), True) == True\", \"asser... | {
"split": "train",
"index": 66270,
"acecode_id": "bigcode_python_fns_4645",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given two lists of numerical values, `y_true` and `y_pred`, implement a function `mean_absolute_error(y_true: List[float], y_pred: List[float]) -> float` that calculates the mean absolute error (MAE) between the true values and the predicted values. The mean absolute error is d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mean_absolute_error([1, 2, 3], [1.5, 2.5, 3.5]) == 0.5\", \"assert mean_absolute_error([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert mean_absolute_error([1, 2, 3], [1, 2, 3]) == 0.0\", \"assert mean_absolute_error([1, -1, 2], [1, 1, 2]) == 0.6666666666666666\", \... | {
"split": "train",
"index": 66271,
"acecode_id": "bigcode_python_fns_14362",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, where each integer represents a digit (0-9). Your task is to implement a function that takes this list and returns the total count of unique integers that can be formed using all the digits in the list without leading zeros. A unique integer is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_integers([1, 2, 3]) == 6\", \"assert count_unique_integers([1, 1, 2]) == 3\", \"assert count_unique_integers([9, 9, 9]) == 1\", \"assert count_unique_integers([2, 2, 2]) == 1\", \"assert count_unique_integers([1, 2, 2]) == 3\", \"assert count_un... | {
"split": "train",
"index": 66272,
"acecode_id": "bigcode_python_fns_47596",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a citation string that contains metadata information following a specific format. Each line in the citation string starts with a metadata tag followed by its corresponding value. The recognized metadata tags are author (%A), journal (%J), volume (%V), issue (%N), ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_citation('''%A Author One\\n%A Author Two\\n%J Journal Name\\n%V 10\\n%N 2\\n%P 100-200\\n%D 2020\\n%I Publisher Name\\ndoi: \\\"10.0000/example1\\\"''') == {'author': ['Author One', 'Author Two'], 'journal': 'Journal Name', 'volume': '10', 'issue': '2... | {
"split": "train",
"index": 66273,
"acecode_id": "oss_18550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing the name of a Linux distribution. Your task is to determine the appropriate packages that are required to be installed based on the distribution name. Specifically, if the distribution is 'amzn' or 'fedora', the required package is 'tigervnc-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert required_packages('amzn') == ['tigervnc-server']\", \"assert required_packages('fedora') == ['tigervnc-server']\", \"assert required_packages('debian') == ['tigervnc-standalone-server', 'tigervnc-common']\", \"assert required_packages('kali') == ['tigervnc-s... | {
"split": "train",
"index": 66274,
"acecode_id": "bigcode_python_fns_30995",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a data structure that can either be a list of integers or a dictionary where keys are strings and values are integers. Your task is to implement a function that converts the input data structure into a pretty formatted string representation in YAML format. The str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_data({'a': 1, 'b': 2}) == 'a: 1\\\\nb: 2\\\\n'\", \"assert format_data(['apple', 'banana', 'cherry']) == '- apple\\\\n- banana\\\\n- cherry\\\\n'\", \"assert format_data({'z': 3, 'a': 1}) == 'z: 3\\\\na: 1\\\\n'\", \"assert format_data({'key1': 100, '... | {
"split": "train",
"index": 66275,
"acecode_id": "bigcode_python_fns_22113",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_long_words(text: str) -> Dict[str, int]` that takes a string `text` as input and returns a dictionary where the keys are words that are longer than six letters and the values are the number of occurrences of those words in the input text. The words shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_long_words('Hello world, this is a test. Testing dictionary comprehension in Python.') == {'testing': 1, 'dictionary': 1, 'comprehension': 1}\", \"assert count_long_words('A quick brown fox jumps over the lazy dog.') == {}\", \"assert count_long_words(... | {
"split": "train",
"index": 66276,
"acecode_id": "evol_3155",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a dictionary representing the response of an activation requirements service. The function should accept the following parameters: 'activated' (a boolean indicating if the service is activated), 'expires_in' (an integer rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_response() == {'activated': True, 'expires_in': 0, 'oauth_server': None, 'DATA': [], 'auto_activation_supported': True}\", \"assert make_response(activated=False) == {'activated': False, 'expires_in': 0, 'oauth_server': None, 'DATA': [], 'auto_activatio... | {
"split": "train",
"index": 66277,
"acecode_id": "bigcode_python_fns_29223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a dictionary representing backup information and returns a list of valid file names to be backed up based on the specified conditions. The structure of the dictionary is as follows: \n- `folder_name`: A string represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_backup_files({'folder_name': '0000-00-00', 'batch': 1}) == ['file1.parquet', 'file2.parquet', 'file3.parquet']\", \"assert get_backup_files({'folder_name': '2023-10-01', 'batch': 1}) == ['file1_1.parquet']\", \"assert get_backup_files({'folder_name': '20... | {
"split": "train",
"index": 66278,
"acecode_id": "bigcode_python_fns_10234",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D array `path` representing a series of points on a plane, where each point is defined by its coordinates (x, y). Your task is to implement a function `make_path_strictly_increase(path: List[List[int]]) -> List[List[int]]` that filters out points from the array... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_path_strictly_increase([[10, 10], [11, 10], [12, 12], [13, 14]]) == [[10, 10], [12, 12], [13, 14]]\", \"assert make_path_strictly_increase([[0, 0], [2, 2], [1, 1], [3, 3]]) == [[0, 0], [2, 2], [3, 3]]\", \"assert make_path_strictly_increase([[0, 0], [0,... | {
"split": "train",
"index": 66279,
"acecode_id": "bigcode_python_fns_1583",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, write a function `advanced_vowel_counter(s)` that returns the total count of vowels present in the string. The vowels to be counted are 'a', 'e', 'i', 'o', 'u', and 'y', but only when they are the last character of the word. The function should be case-sensi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_vowel_counter('abcde') == 2\", \"assert advanced_vowel_counter('hello!') == 2\", \"assert advanced_vowel_counter('world?') == 1\", \"assert advanced_vowel_counter('happy!') == 2\", \"assert advanced_vowel_counter('sky') == 1\", \"assert advanced_vow... | {
"split": "train",
"index": 66280,
"acecode_id": "evol_19680",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `lucas_sequence(n)` that generates the first `n` numbers in the Lucas number sequence. The Lucas sequence starts with 2 and 1, and each subsequent number is the sum of the two preceding ones. If `n` is 0, return an empty list. If `n` is 1, return a list con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lucas_sequence(0) == []\", \"assert lucas_sequence(1) == [2]\", \"assert lucas_sequence(2) == [2, 1]\", \"assert lucas_sequence(3) == [2, 1, 3]\", \"assert lucas_sequence(4) == [2, 1, 3, 4]\", \"assert lucas_sequence(5) == [2, 1, 3, 4, 7]\", \"assert lucas_s... | {
"split": "train",
"index": 66281,
"acecode_id": "evol_17438",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers, write a function `are_anagrams(num1, num2)` that checks if the two integers are anagrams of each other. Two integers are considered anagrams if they contain the same digits in a different order. For example, 123 and 321 are anagrams, while 123 and 124 are no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams(123, 321) == True\", \"assert are_anagrams(456, 654) == True\", \"assert are_anagrams(1001, 1100) == True\", \"assert are_anagrams(123, 456) == False\", \"assert are_anagrams(12, 21) == True\", \"assert are_anagrams(7, 7) == True\", \"assert are... | {
"split": "train",
"index": 66282,
"acecode_id": "evol_31055",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of font paths and a phase string, implement a function `build_font_names(fonts: List[str], phase: str, extra_styles: List[str]) -> List[str]` that returns a list of formatted font names. Each font name should be constructed by combining the base font name (extracte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_font_names(['path/to/font1.ttf', 'path/to/font2.otf'], 'Bold', ['Italic', 'Underline']) == ['font1 Bold, Italic, Underline', 'font2 Bold, Italic, Underline']\", \"assert build_font_names(['fonts/font3.ttf'], 'Regular', []) == ['font3 Regular']\", \"ass... | {
"split": "train",
"index": 66283,
"acecode_id": "bigcode_python_fns_16415",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple slide preview for state senate presentations. The function will take a string `slug` as input, which represents the unique identifier for a state slide. The function should return a string that represents the slide... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert slide_preview('california') == 'Slide content for california'\", \"assert slide_preview('texas') == 'Slide content for texas'\", \"assert slide_preview('florida') == 'Slide content for florida'\", \"assert slide_preview('new_york') == 'Slide content for new_... | {
"split": "train",
"index": 66284,
"acecode_id": "bigcode_python_fns_46832",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two boolean arrays ind1 and ind2 of the same length, return a list containing the counts of true and false values as follows: The first element should be the count of positions where both arrays have true values, the second element should be the count of positions where i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert table_from_bool([True, True, False], [True, False, False]) == [1, 1, 0, 1]\", \"assert table_from_bool([True, False, False], [True, True, False]) == [1, 0, 1, 1]\", \"assert table_from_bool([True, True, True], [True, True, True]) == [3, 0, 0, 0]\", \"assert ... | {
"split": "train",
"index": 66285,
"acecode_id": "bigcode_python_fns_35547",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates the storage and retrieval of data in a node. The function should accept a list of commands, where each command is either a 'store' operation or a 'retrieve' operation. The 'store' command should take a key and da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert node_operations([('store', 'key1', {'port': 100}), ('retrieve', 'key1', None)]) == [{'port': 100}]\", \"assert node_operations([('store', 'key2', {'port': 200}), ('retrieve', 'key3', None)]) == [None]\", \"assert node_operations([('store', 'key3', {'port': 3... | {
"split": "train",
"index": 66286,
"acecode_id": "oss_19324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, implement a function that returns a new list containing the words with the maximum number of syllables. In case of a tie, return the words in lexicographical order. You are only allowed to use built-in Python functions and cannot use external libraries fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_syllable_words(['cat', 'dog', 'fish']) == ['cat', 'dog', 'fish']\", \"assert max_syllable_words(['apple', 'banana', 'cherry']) == ['banana']\", \"assert max_syllable_words(['a', 'an', 'the']) == ['a', 'an', 'the']\", \"assert max_syllable_words(['elephan... | {
"split": "train",
"index": 66287,
"acecode_id": "evol_30881",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary called `voting_dict`, where the keys are the names of senators and the values are lists of integers representing their votes. Each integer corresponds to a vote on a specific issue, where 1 indicates a 'yes' vote, 0 indicates an 'abstain' vote, and -1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_senators_with_votes({'Klein': [-1, 0, 1], 'Fox-Epstein': [-1, -1, -1], 'Ravella': [0, 0, 1]}, {'Klein', 'Fox-Epstein', 'Ravella'}, [-1, 0, 1]) == ['Klein']\", \"assert find_senators_with_votes({'A': [1, 1], 'B': [0, 1]}, {'A', 'B'}, [1, 1]) == ['A']\", ... | {
"split": "train",
"index": 66288,
"acecode_id": "oss_25858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that retrieves benchmark data based on a provided source name and an optional programming language. The function should handle two scenarios: when the language is specified and when it is not. If the language is not specified, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_benchmark_data('source1') == 'Retrieving benchmark data for source1 in Python.'\", \"assert retrieve_benchmark_data('source2', 'Python') == 'Retrieving benchmark data for source2 in Python.'\", \"assert retrieve_benchmark_data('source3', 'R') == 'Re... | {
"split": "train",
"index": 66289,
"acecode_id": "oss_5077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that returns the number of words in the string that contain the letter 'a' (case-insensitive). A word is defined as a sequence of characters separated by spaces. If the input string is empty or contains no words, the function should return 0... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countWordsWithA('No words here') == 0\", \"assert countWordsWithA('') == 0\", \"assert countWordsWithA('apple banana apricot cherry') == 3\", \"assert countWordsWithA('Another test with many words') == 2\", \"assert countWordsWithA('abcd efghijkl mnopqrst uv... | {
"split": "train",
"index": 66290,
"acecode_id": "oss_34068",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a game. The game has a rule that a player's score is computed based on the scores of the last two turns. If the last two turns have the same score, the player's score is doubled. Otherwise, the player's score is the su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_score([1, 2, 3, 4, 5]) == 15\", \"assert calculate_final_score([10]) == 10\", \"assert calculate_final_score([10, 20]) == 30\", \"assert calculate_final_score([5, 5, 10, 10]) == 40\", \"assert calculate_final_score([1]) == 1\", \"assert calcu... | {
"split": "train",
"index": 66291,
"acecode_id": "oss_19449",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a 'dry run' for a given test framework. The function should return a report skeleton as a string which contains the following sections: 1) 'Test Summary', 2) 'Test Results', and 3) 'End of Report'. Each section should b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dry_run() == 'Test Summary\\\\nTotal Tests: 0\\\\nTest Results\\\\nAll tests passed!\\\\nEnd of Report\\\\nReport generated successfully.'\", \"assert dry_run() == 'Test Summary\\\\nTotal Tests: 0\\\\nTest Results\\\\nAll tests passed!\\\\nEnd of Report\\\\n... | {
"split": "train",
"index": 66292,
"acecode_id": "bigcode_python_fns_18040",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sorts a given list of integers using the TimSort algorithm. The function should take a list of integers as input and return a new list that contains the integers sorted in ascending order. The input list can contain both positive... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert timsort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert timsort([3, -1, 0, 2, -5]) == [-5, -1, 0, 2, 3]\", \"assert timsort([1, 1, 1, 1]) == [1, 1, 1, 1]\", \"assert timsort([]) == []\", \"assert timsort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\", \"asser... | {
"split": "train",
"index": 66293,
"acecode_id": "bigcode_python_fns_40104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps representing the start times of various events in microseconds. Your task is to find the average time between consecutive events. Implement a function `average_time_between_events(timestamps: List[int]) -> float` that takes a list of integers ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_time_between_events([0, 100, 200, 300]) == 100.0\", \"assert average_time_between_events([0, 50, 100, 150]) == 50.0\", \"assert average_time_between_events([5, 15]) == 10.0\", \"assert average_time_between_events([1000, 2000, 3000, 4000]) == 1000.0\"... | {
"split": "train",
"index": 66294,
"acecode_id": "bigcode_python_fns_263",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple parser for a subset of GLSL (OpenGL Shading Language) vertex shader code. The parser should be able to extract the input variable names and their corresponding data types from the vertex shader source code. The input vertex shader sourc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parseVertexShader('#version 330 core\\\\nlayout (location = 0) in vec3 aPos; layout (location = 1) in vec3 aColor;') == {'aPos': 'vec3', 'aColor': 'vec3'}\", \"assert parseVertexShader('layout (location = 0) in float aHeight;') == {'aHeight': 'float'}\", \"a... | {
"split": "train",
"index": 66295,
"acecode_id": "oss_31180",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function `get_max_sum(arr)` that returns the sum of all the elements in the array. The function should handle both positive and negative integers. For example, given the input array `arr = [1, -2, 3, 4]`, the function should return `6`, which... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_max_sum([1, 6, 10, 12, 21]) == 50\", \"assert get_max_sum([-1, -2, -3, -4]) == -10\", \"assert get_max_sum([0, 0, 0]) == 0\", \"assert get_max_sum([5]) == 5\", \"assert get_max_sum([-5, 5]) == 0\", \"assert get_max_sum([10, -10, 20]) == 20\", \"assert ge... | {
"split": "train",
"index": 66296,
"acecode_id": "evol_5993",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of shape names based on the number of parts each shape has. Write a function `filter_shapes_by_parts` that takes in a dictionary containing the names of shapes as keys and the corresponding number of parts as value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_shapes_by_parts({'circle': 1, 'triangle': 3, 'square': 4, 'pentagon': 5, 'hexagon': 6}, 3, 5) == ['triangle', 'square', 'pentagon']\", \"assert filter_shapes_by_parts({'circle': 1, 'triangle': 2, 'square': 4, 'pentagon': 5}, 1, 4) == ['circle', 'trian... | {
"split": "train",
"index": 66297,
"acecode_id": "oss_36407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `generate_heatmap_data(values: List[int], tissue_names: List[str]) -> List[Tuple[int, int, int]]` that generates a 3D heatmap data representation for the given values. Each value in the list corresponds to a specific tissue, represente... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_heatmap_data([1, 2, 3], ['Tissue1', 'Tissue2', 'Tissue3']) == [(0, 1, 0), (1, 2, 1), (2, 3, 2)]\", \"assert generate_heatmap_data([0, 0, 0], ['Tissue1', 'Tissue2', 'Tissue3']) == [(0, 0, 0), (1, 0, 1), (2, 0, 2)]\", \"assert generate_heatmap_data([5... | {
"split": "train",
"index": 66298,
"acecode_id": "bigcode_python_fns_4446",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs basic arithmetic operations on two floating-point numbers. The function should support the following operations: addition, subtraction, multiplication, and division. Your function should take three parameters: two floati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_operation(5.23e-4, 3.86e-2, 'divide') == 0.013549222797927461\", \"assert perform_operation(5.23e-4, 0, 'divide') == 'Division by zero is not allowed'\", \"assert perform_operation(-1.5, 2.5, 'add') == 1.0\", \"assert perform_operation(-1.5, -2.5, 's... | {
"split": "train",
"index": 66299,
"acecode_id": "oss_15437",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.