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 matrices, where each matrix is represented as a list of lists (2D array). Your task is to implement a function that stacks these matrices horizontally. The input is a list of matrices, and you need to ensure that all matrices have the same number of rows...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stack_matrices_horizontally([[[1, 2], [3, 4]], [[5, 6], [7, 8]]]) == [[1, 2, 5, 6], [3, 4, 7, 8]]\", \"assert stack_matrices_horizontally([[[1]], [[2]], [[3]]]) == [[1, 2, 3]]\", \"assert stack_matrices_horizontally([[[1, 2]], [[3, 4]], [[5, 6]]]) == [[1, 2,...
{ "split": "train", "index": 3600, "acecode_id": "bigcode_python_fns_22207", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string containing multiple paragraphs separated by a period followed by a space, write a function that identifies and returns the most frequent word in each paragraph along with its frequency. If there are multiple words with the same highest frequency, return all of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_frequent_word('') == []\", \"assert most_frequent_word('Hello! Hello? Hello.') == [('hello', 3)]\", \"assert most_frequent_word('Hello hello. Goodbye goodbye.') == [('hello', 2), ('goodbye', 2)]\", \"assert most_frequent_word('No punctuation here no pun...
{ "split": "train", "index": 3601, "acecode_id": "evol_19389", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of packages, where each package is represented as a dictionary containing the keys 'owner' and 'name'. Your task is to create a function that returns a list of formatted strings representing the full names of the packages in the format 'owner/name'. Impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_package_names([{'owner': 'alice', 'name': 'lib1'}, {'owner': 'bob', 'name': 'lib2'}]) == ['alice/lib1', 'bob/lib2']\", \"assert format_package_names([{'owner': 'charlie', 'name': 'lib3'}, {'owner': 'dave', 'name': 'lib4'}, {'owner': 'eve', 'name': 'li...
{ "split": "train", "index": 3602, "acecode_id": "bigcode_python_fns_23063", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_client_info(name: str, dob: str, address: str, phone: str, email: str) -> Tuple[bool, bool]` that takes in a client's full legal name, date of birth in 'YYYY-MM-DD' format, permanent residential address, verified contact number, and registered ema...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_client_info('John Doe', '1985-05-15', '123 Street, City, State', '1234567890', 'email@example.com') == (True, True)\", \"assert validate_client_info('Alice Brown', '2000-11-25', '789 Boulevard, Village, Region', '1122334455', 'alice.brown@example.co...
{ "split": "train", "index": 3603, "acecode_id": "evol_18816", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `display_vinyl_record_info(album_name: str, artist: str, genre: str, release_year: int) -> str` that takes in the album name, artist, genre, and release year of a music vinyl record and returns a formatted string containing this information. The format should b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert display_vinyl_record_info('The Dark Side of the Moon', 'Pink Floyd', 'Rock', 1973) == 'Album Name: The Dark Side of the Moon, Artist: Pink Floyd, Genre: Rock, Release Year: 1973'\", \"assert display_vinyl_record_info('Back in Black', 'AC/DC', 'Rock', 1980) =...
{ "split": "train", "index": 3604, "acecode_id": "evol_19740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of time periods represented as pairs of integers, return a list of the smallest quantity of disjoint time periods that encompass all the given time periods. Each time period is represented as [start, end], where start and end are inclusive. The output should be a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_disjoint_periods([[1, 4], [2, 6], [8, 9]]) == [[1, 6], [8, 9]]\", \"assert min_disjoint_periods([[1, 3], [2, 4], [5, 7], [6, 8]]) == [[1, 4], [5, 8]]\", \"assert min_disjoint_periods([[1, 2], [3, 4], [5, 6]]) == [[1, 2], [3, 4], [5, 6]]\", \"assert min_d...
{ "split": "train", "index": 3605, "acecode_id": "evol_30228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `get_default_file_path()`. This function should return the string 'data/hifld_substations_conus_albers.zip'. This simulates the action of retrieving a default file path from a resource directory. Your function should not take a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_default_file_path() == 'data/hifld_substations_conus_albers.zip'\", \"assert get_default_file_path() == 'data/hifld_substations_conus_albers.zip'\", \"assert get_default_file_path() == 'data/hifld_substations_conus_albers.zip'\", \"assert get_default_fil...
{ "split": "train", "index": 3606, "acecode_id": "bigcode_python_fns_43994", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a python function that calculates the Fibonacci series up to a specified number of terms. The function should take one argument, an integer, which represents the number of terms to generate. The function should handle edge cases such as negative numbers and non-integer in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(1) == [0]\", \"assert fib(2) == [0, 1]\", \"assert fib(3) == [0, 1, 1]\", \"assert fib(4) == [0, 1, 1, 2]\", \"assert fib(5) == [0, 1, 1, 2, 3]\", \"assert fib(6) == [0, 1, 1, 2, 3, 5]\", \"assert fib(7) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fib(8) == [0,...
{ "split": "train", "index": 3607, "acecode_id": "evol_18649", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a split number, which is an integer between 1 and 20, and a boolean value indicating whether you want the training data or the testing data. Your task is to create a function that generates the corresponding file path for the training or testing data based on the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_data_path(1, True) == 'index_train_1.txt'\", \"assert get_data_path(1, False) == 'index_test_1.txt'\", \"assert get_data_path(2, True) == 'index_train_2.txt'\", \"assert get_data_path(2, False) == 'index_test_2.txt'\", \"assert get_data_path(3, True) == ...
{ "split": "train", "index": 3608, "acecode_id": "bigcode_python_fns_28757", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters a list of strings based on a specific criterion. Given a list of strings and a boolean flag that indicates whether or not to filter by length, your function should return a new list that includes only the strings that are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_strings(['apple', 'bat', 'car', 'dog'], True) == ['apple']\", \"assert filter_strings(['hello', 'world', 'hi', 'python'], True) == ['hello', 'world', 'python']\", \"assert filter_strings(['a', 'b', 'c'], True) == []\", \"assert filter_strings(['one', ...
{ "split": "train", "index": 3609, "acecode_id": "oss_23174", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the reporting of an assembly strategy. The function `report_strategy(strategy: str, proceed: bool) -> str` takes two parameters: a string `strategy` representing the strategy being used for assembling, and a boolean `procee...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert report_strategy('Strategy A', True) == 'Strategy A'\", \"assert report_strategy('Strategy B', False) == 'Strategy B\\\\nThe assembly was unable to proceed.\\\\n'\", \"assert report_strategy('Default Strategy', True) == 'Default Strategy'\", \"assert report_s...
{ "split": "train", "index": 3610, "acecode_id": "bigcode_python_fns_33057", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the IDs of recorded runs. Each recorded run can have a status represented by an enumeration: UNKNOWN = 0, STARTING = 1, RUNNING = 2, COMPLETED = 3, FAILED = 4, CANCELLED = 5. Implement a function `update_run_status(run_ids: List[int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_run_status([1, 2, 3], [1, 2, 3]) == {1: 1, 2: 2, 3: 3}\", \"assert update_run_status([1, 2, 2], [1, 2, 3]) == {1: 1, 2: 3}\", \"assert update_run_status([1, 2, 3], [3, 2]) == {}\", \"assert update_run_status([], []) == {}\", \"assert update_run_status...
{ "split": "train", "index": 3611, "acecode_id": "bigcode_python_fns_403", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function `count_vowels(strings: List[str]) -> List[int]` that counts the number of vowels (a, e, i, o, u) in each string of the list. The function should return a list of integers where each integer corresponds to the count of vowels in the resp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_vowels(['hello', 'world']) == [2, 1]\", \"assert count_vowels(['python', 'programming']) == [1, 3]\", \"assert count_vowels(['a', 'e', 'i', 'o', 'u']) == [1, 1, 1, 1, 1]\", \"assert count_vowels(['vowels', 'are', 'fun']) == [2, 2, 1]\", \"assert count_...
{ "split": "train", "index": 3612, "acecode_id": "bigcode_python_fns_4087", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an array 'arr' of N integers, ascertain whether it's feasible to generate a non-decreasingly sorted array by performing right-shift operations as you see fit. You are also allowed to swap precisely two elements within the array, up to three times max. Additionally, ensure...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_three_elements([3, 4, 5, 1, 2, 6]) == True\", \"assert rearrange_three_elements([1, 3, 5, 4, 2, 6]) == True\", \"assert rearrange_three_elements([1, 2, 3, 5, 4, 6]) == True\", \"assert rearrange_three_elements([10, 9, 8, 7, 6]) == False\", \"assert...
{ "split": "train", "index": 3613, "acecode_id": "evol_5169", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of numbers, `lst1` and `lst2`, which may contain floating-point numbers and numbers in scientific notation. Your task is to implement a function `exchange_with_floats_and_sci_notation(lst1, lst2)` that checks if, after potentially swapping elements betwe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert exchange_with_floats_and_sci_notation([1.1e1, 2.3e0, 3.7e1, 4.6e2], [1.1e1, 2.3e2, 3.4e1, 4.5e2]) == 'YES'\", \"assert exchange_with_floats_and_sci_notation([1.1e2, 2.3e-1, 3.7e2, 4.6e2], [1.8e2, 2.2e-1, 5.4e2, 4.5e1]) == 'NO'\", \"assert exchange_with_float...
{ "split": "train", "index": 3614, "acecode_id": "evol_10824", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a search operation in a database. The function should return an empty list to indicate that there are no search results. Implement a function called `empty_search` that takes no parameters and returns an empty list. Your fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert empty_search() == {'results': []}\", \"assert empty_search() == {'results': []}\", \"assert empty_search() == {'results': []}\", \"assert empty_search() == {'results': []}\", \"assert empty_search() == {'results': []}\", \"assert empty_search() == {'results'...
{ "split": "train", "index": 3615, "acecode_id": "bigcode_python_fns_32880", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a version comparator for software packages. Write a function `check_package_version(current_version, specified_version)` that takes two version numbers as input, where each version number is represented as a string in the format 'x.y.z', where 'x', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_package_version('2.7.1', '2.7.0') == 'Up to date'\", \"assert check_package_version('2.7.1', '2.7.2') == 'Update available'\", \"assert check_package_version('1.0.0', '1.0.0') == 'Up to date'\", \"assert check_package_version('1.0.1', '1.0.0') == 'Up t...
{ "split": "train", "index": 3616, "acecode_id": "oss_37115", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `launch_pipeline` that simulates the launching of a pipeline based on various parameters. The function should take the following parameters: `pipeline` (a string representing the name of the pipeline), `id` (a string representing an ident...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert launch_pipeline('pipeline1', 'id1', 'v1.0', False, {'param1': 'value1'}, {'output1': 'result1'}, True, False, 'http://example.com') == True\", \"assert launch_pipeline('pipeline2', 'id2', 'v1.1', True, {'param1': 'value1'}, {'output1': 'result1'}, False, Tru...
{ "split": "train", "index": 3617, "acecode_id": "bigcode_python_fns_49293", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `calculate_circle_area_and_sphere_volume(radius: float) -> tuple` that takes a radius as input and returns a tuple containing the area of a circle and the volume of a sphere. The area of the circle should be calculated using the formula A = π * r², and the volu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_circle_area_and_sphere_volume(0) == (0.0, 0.0)\", \"assert calculate_circle_area_and_sphere_volume(1) == (3.141592653589793, 4.1887902047863905)\", \"assert calculate_circle_area_and_sphere_volume(2) == (12.566370614359172, 33.510321638291124)\", \...
{ "split": "train", "index": 3618, "acecode_id": "evol_19277", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers, your task is to implement a function that reverses the list in place and returns the reversed list. Write a function called `reverse_list` that takes a list of integers as input and returns the list reversed. For example, if the input list is [1, 2, 3,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_list([1, 2, 3, 4]) == [4, 3, 2, 1]\", \"assert reverse_list([7, 15, 26, 31, 47]) == [47, 31, 26, 15, 7]\", \"assert reverse_list([]) == []\", \"assert reverse_list([42]) == [42]\", \"assert reverse_list([1, 2]) == [2, 1]\", \"assert reverse_list([10,...
{ "split": "train", "index": 3619, "acecode_id": "evol_9693", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n and a list of positive integers, implement a function that returns a new list where every element that is less than or equal to n is incremented by 1. The function should be named `increment_elements` and should take two parameters: `n` (a positive in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment_elements(3, [1, 2, 3, 4]) == [2, 3, 4, 4]\", \"assert increment_elements(5, [5, 6, 7, 8]) == [6, 6, 7, 8]\", \"assert increment_elements(10, [5, 10, 15, 20]) == [6, 11, 15, 20]\", \"assert increment_elements(7, [3, 8, 7, 5]) == [4, 8, 8, 6]\", \"as...
{ "split": "train", "index": 3620, "acecode_id": "evol_1717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the temperatures recorded over a week. Your task is to implement a function that returns the number of days in which the temperature was above the average temperature of that week. The average temperature is calculated as the sum of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_above_average_days([30, 40, 50, 60, 70, 80, 90]) == 3\", \"assert count_above_average_days([10, 20, 30, 40, 50]) == 2\", \"assert count_above_average_days([0, 0, 0, 0, 0]) == 0\", \"assert count_above_average_days([-10, -5, 0, 5, 10]) == 2\", \"assert ...
{ "split": "train", "index": 3621, "acecode_id": "bigcode_python_fns_29612", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a linked list represented by an array of integers, implement a function that finds the indexes of all occurrences of a specified number in the list while preserving the order of occurrence. The function should utilize a data structure other than arrays for the implementat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_indexes([1, 2, 3, 2, 4, 2, 5, 2, 3, 2, 1], 2) == [1, 3, 5, 7, 9]\", \"assert find_indexes([5, 5, 5, 5], 5) == [0, 1, 2, 3]\", \"assert find_indexes([1, 3, 5, 7, 9], 2) == []\", \"assert find_indexes([], 1) == []\", \"assert find_indexes([1, 1, 1, 1], 0)...
{ "split": "train", "index": 3622, "acecode_id": "evol_10386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of roles for a specific node. Each role is represented by a string. Your task is to create a function `construct_node_role_dimension` that takes two parameters: a string `dimension_name` and a list of strings `roles`. The function should return a dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_node_role_dimension('g1', ['a', 'b']) == {'g1': ['a', 'b']}\", \"assert construct_node_role_dimension('g1', []) == {}\", \"assert construct_node_role_dimension('g2', ['x']) == {'g2': ['x']}\", \"assert construct_node_role_dimension('g3', ['role1', ...
{ "split": "train", "index": 3623, "acecode_id": "bigcode_python_fns_32809", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two binary strings representing the states of two quantum bits (qubits). Each qubit can either be in state 0 or 1. The first string represents the control qubit and the second string represents the target qubit. Implement a function `evolve_qubit(control: str, tar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evolve_qubit('0', '0') == '0'\", \"assert evolve_qubit('0', '1') == '1'\", \"assert evolve_qubit('1', '1') == '0'\", \"assert evolve_qubit('0', '000') == '000'\", \"assert evolve_qubit('000', '111') == '111'\", \"assert evolve_qubit('000', '111') == '111'\",...
{ "split": "train", "index": 3624, "acecode_id": "bigcode_python_fns_6812", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a binary tree represented by a node structure with left and right child pointers, implement a function `process_binary_tree(obj, node, out=None)` that processes the binary tree based on the input parameter `obj`. The function should handle two scenarios: 1. If `obj` is `N...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_binary_tree(None, Node(1)) is not None\", \"assert process_binary_tree(None, Node(2)) is not None\", \"assert process_binary_tree('print', Node(3)) is None\", \"assert process_binary_tree('print', Node(6)) is None\", \"assert process_binary_tree('pri...
{ "split": "train", "index": 3625, "acecode_id": "oss_8736", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages the translations of a webpage for a multilingual website. The function should take in the current title, current text, a flag indicating if the translation is currently being updated, the current version number, and a fla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_page_translation('About', 'Learn more about us', False, 3, False, 'About Us', 'Learn more about our mission', True) == {'title': 'About Us', 'text': 'Learn more about our mission', 'currently_in_translation': False, 'version': 3, 'minor_edit': True}\"...
{ "split": "train", "index": 3626, "acecode_id": "oss_18335", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the percentage of positive values in a given list. The function should take a list of integers as input and return a formatted string that includes the count of positive values, the total count of values, and the pe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_percentage([1, 2, 3, 4, 5]) == 'Baseline 5 positives from 5 overall = 100.0%'\", \"assert calculate_percentage([-1, -2, -3, -4, -5]) == 'Baseline 0 positives from 5 overall = 0.0%'\", \"assert calculate_percentage([0]) == 'Baseline 0 positives from...
{ "split": "train", "index": 3627, "acecode_id": "oss_3431", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two strings as input and returns the reversed concatenation of those strings. The function should take two parameters, `string1` and `string2`, and return a single string that is the result of concatenating `string1` and `string2`, followed by re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_concatenated_string('Good', 'Morning') == 'gninroMdooG'\", \"assert reverse_concatenated_string('Hello', 'World') == 'dlroWolleH'\", \"assert reverse_concatenated_string('Python', 'Programming') == 'gnimmargorPnohtyP'\", \"assert reverse_concatenated...
{ "split": "train", "index": 3628, "acecode_id": "evol_17313", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Develop a function that returns a list of 7 unique numbers between 1 and 100 in ascending order. The function must ensure that no two consecutive numbers in the list have a difference greater than 20. If it is not possible to generate such a list, the function should return an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_numbers() == []\", \"assert get_numbers() == []\", \"assert get_numbers() == []\", \"assert get_numbers() == []\", \"assert get_numbers() == []\", \"assert get_numbers() == []\", \"assert get_numbers() == []\", \"assert get_numbers() == []\"]}" }
{ "split": "train", "index": 3629, "acecode_id": "evol_33164", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are required to create a Python function `generate_revision_identifier()` that generates a unique 12-character alphanumeric string identifier for a database migration tool. The generated identifier should consist of lowercase letters (a-z) and digits (0-9). Each time the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_revision_identifier() != generate_revision_identifier()\", \"assert generate_revision_identifier() != generate_revision_identifier()\", \"assert generate_revision_identifier() != generate_revision_identifier()\", \"assert generate_revision_identifie...
{ "split": "train", "index": 3630, "acecode_id": "oss_36547", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines whether a given list of integers represents a sparse list or not. A list is considered sparse if at least 70% of its elements are zeros. Your function should take a list of integers as input and return True if the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_sparse_list([0, 0, 0, 0, 0]) == True\", \"assert is_sparse_list([1, 2, 3, 4, 5]) == False\", \"assert is_sparse_list([1, 1, 1, 1, 1]) == False\", \"assert is_sparse_list([0, 0, 0, 0, 0, 0, 0]) == True\", \"assert is_sparse_list([0, 0, 1, 0, 0, 0, 0]) == T...
{ "split": "train", "index": 3631, "acecode_id": "oss_1213", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with processing GPS data from a list of NavSatFix messages. Each NavSatFix message contains latitude and longitude, and you need to implement a function that calculates the average latitude and longitude from a given list of these messages. Each message is repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_gps_position([]) is None\", \"assert average_gps_position([{'latitude': 10.0, 'longitude': 20.0}]) == {'latitude': 10.0, 'longitude': 20.0}\", \"assert average_gps_position([{'latitude': 10.0, 'longitude': 20.0}, {'latitude': 30.0, 'longitude': 40.0}...
{ "split": "train", "index": 3632, "acecode_id": "oss_29637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a file storage system. Your function, `store_files`, takes a list of tuples, where each tuple contains a file name (as a string) and its corresponding content (as bytes). Your function should store the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert store_files([('file_a', b'content_a'), ('file_b', b'content_b')]) == ['file_a', 'file_b']\", \"assert store_files([('file_a', b'content_a'), ('file_a', b'content_a_2')]) == ['file_a', 'file_a']\", \"assert store_files([]) == []\", \"assert store_files([('fil...
{ "split": "train", "index": 3633, "acecode_id": "bigcode_python_fns_13722", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates logging the status of a task based on its success or failure. The function, `log_task_status`, takes in two parameters: a boolean `success` which indicates whether the task was successful, and a string `task_id` which repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_task_status(True, 'task_1') == 'task_1 success'\", \"assert log_task_status(False, 'task_2') == 'task_2 failed'\", \"assert log_task_status(True, 'task_3') == 'task_3 success'\", \"assert log_task_status(False, 'task_4') == 'task_4 failed'\", \"assert lo...
{ "split": "train", "index": 3634, "acecode_id": "bigcode_python_fns_34818", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with building a function that retrieves available notification channels for various alerting plugins. You have predefined key constants for these plugins and their corresponding notification channels. Write a function `get_alerting_plugins()` that returns a dicti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_alerting_plugins() == {'hipchat': 'alerting/notify/hipchat', 'slack': 'alerting/notify/slack', 'mailgun': 'alerting/notify/mailgun', 'email': 'alerting/notify/email', 'pagerduty': 'alerting/notify/pagerduty', 'influxdb': 'alerting/notify/influxdb', 'elas...
{ "split": "train", "index": 3635, "acecode_id": "oss_36299", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple URL shortening service. Your goal is to implement a function that generates a unique shortened URL for a given long URL. The shortened URL should be a random alphanumeric string of length 6. If the long URL has already been shortened, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_short_url('http://example.com') is not None\", \"assert generate_short_url('http://example.com') == generate_short_url('http://example.com')\", \"assert len(generate_short_url('http://test.com')) == 6\", \"assert generate_short_url('http://test.com'...
{ "split": "train", "index": 3636, "acecode_id": "oss_14199", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `mirrored_string_analysis(s: str) -> Tuple[str, int, int]` that takes a string `s` as input and returns a tuple containing three values: the mirrored version of the string, the count of alphanumeric characters, and the count of non-alphanumeric characters i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mirrored_string_analysis('abc123') == ('321cba', 6, 0)\", \"assert mirrored_string_analysis('Hello, World!') == ('!dlroW ,olleH', 10, 3)\", \"assert mirrored_string_analysis('123456') == ('654321', 6, 0)\", \"assert mirrored_string_analysis('') == ('', 0, 0)...
{ "split": "train", "index": 3637, "acecode_id": "evol_5200", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `is_palindrome(s: str) -> bool` that checks if a given input string is a palindrome, ignoring whitespace and considering only alphanumeric characters. A palindrome is a string that reads the same forwards and backwards. For example, 'A man, a plan, a canal:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('') == Tr...
{ "split": "train", "index": 3638, "acecode_id": "evol_3633", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers where the first integer represents an ID and the subsequent integers represent coordinates in the form of triples (x, y, frame_number), implement a function that extracts the ID and constructs a list of tuples for the coordinates. Each tuple should cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_frame_coords_list([1, 10, 20, 0, 30, 40, 1]) == (1, [(10, 20, 0), (30, 40, 1)])\", \"assert create_frame_coords_list([2, 5, 15, 0, 25, 35, 1]) == (2, [(5, 15, 0), (25, 35, 1)])\", \"assert create_frame_coords_list([3, 1, 2, 0, 3, 4, 1, 5, 6, 2]) == (3...
{ "split": "train", "index": 3639, "acecode_id": "bigcode_python_fns_27170", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates running tests for a given project configuration. The function should take a list of test results, where each result is represented by a boolean value indicating whether the test passed (True) or failed (False). The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert run_all_tests([True, True, True]) == True\", \"assert run_all_tests([False, True, True]) == False\", \"assert run_all_tests([True, False, True]) == False\", \"assert run_all_tests([True, True, False]) == False\", \"assert run_all_tests([]) == True\", \"asser...
{ "split": "train", "index": 3640, "acecode_id": "bigcode_python_fns_27666", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a command lookup system. Implement a function `add_to_command_lookup(command: str, entity: str) -> None` that takes in a command and an entity as input. The function should add the entity to a command lookup dictionary, where each command maps to a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_to_command_lookup('move', 'robot') == None\", \"assert add_to_command_lookup('move', 'human') == None\", \"assert add_to_command_lookup('jump', 'frog') == None\", \"assert add_to_command_lookup('move', 'robot') == None\", \"assert add_to_command_lookup('...
{ "split": "train", "index": 3641, "acecode_id": "bigcode_python_fns_31344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of items and a transformation function as inputs. The function should apply the transformation function to each item in the given list and return a transformed list. The function should also accept a boolean parameter that indicates whether it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_strings(['hello', 'world'], str.lower, True) == ['hello', 'world']\", \"assert transform_strings(['HELLO', 'WORLD'], str.lower, False) == ['hello', 'world']\", \"assert transform_strings(['Python', 42, 'rocks'], str.upper, False) == ['PYTHON', 42, ...
{ "split": "train", "index": 3642, "acecode_id": "evol_7275", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with defining a function that creates a role-playing hub for customers in a data processing system. The function should accept a dictionary representing the process configuration, a string representing the hub customer, and a string representing the staging table...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_role_playing_hub({'target_schema': 'schema1'}, 'customer1', 'staging1') == {'schema': 'schema1', 'name': 'h_customer_role_playing', 'fields': [{'parent_table_name': 'h_customer_role_playing', 'name': 'h_customer_role_playing_hashkey', 'data_type': 'TE...
{ "split": "train", "index": 3643, "acecode_id": "bigcode_python_fns_564", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the configuration of a machine learning training setup. The function `configure_training` should accept the following parameters: \n\n- `augment` (bool): Whether to augment the training set. \n- `batch_size` (int): Batch si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_training(True, 128, 256, 512, '/data/', '/logs/', 'resnet18', 10, 5, 0.01, 0.0001) == {'augment': True, 'batch_size': 128, 'batch_size_validation': 256, 'num_samples_eval': 512, 'data_dir': '/data/', 'log_dir': '/logs/', 'model': 'resnet18', 'num_s...
{ "split": "train", "index": 3644, "acecode_id": "bigcode_python_fns_23083", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the overall Variance Inflation Factor (VIF) for a regression model based on multiple scales. The VIF for a particular scale is calculated as the ratio of the VIF numerator to the VIF denominator for that scale. The overall VIF is the average of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_overall_vif({'vif_num_scale0_scores_key': [0], 'vif_den_scale0_scores_key': [1], 'vif_num_scale1_scores_key': [1], 'vif_den_scale1_scores_key': [1]}, 2) == 0.5\", \"assert calculate_overall_vif({'vif_num_scale0_scores_key': [100], 'vif_den_scale0_s...
{ "split": "train", "index": 3645, "acecode_id": "oss_18662", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `word_guessing_game` that simulates a basic word guessing game. The function takes three parameters: a string `word` representing the word to be guessed, a list of strings `guesses` representing the player's guesses, and an integer `m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_guessing_game('banana', ['b', 'a', 'n'], 3) == 'banana'\", \"assert word_guessing_game('cherry', ['c', 'h', 'e', 'r', 'y'], 5) == 'cherry'\", \"assert word_guessing_game('grape', ['g', 'z', 'r', 'p', 'e'], 5) == 'gr_pe'\", \"assert word_guessing_game('o...
{ "split": "train", "index": 3646, "acecode_id": "oss_14811", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string, write a function that determines if the string contains only phonetic characters. Phonetic characters include the letters of the English alphabet (both uppercase and lowercase), digits (0-9), and spaces. The function should return True if the string contains onl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_only_phonetic_chars('The quick brown fox jumps over the lazy dog 1234567890') == True\", \"assert contains_only_phonetic_chars('Hello, World!') == False\", \"assert contains_only_phonetic_chars('1234567890') == True\", \"assert contains_only_phoneti...
{ "split": "train", "index": 3647, "acecode_id": "bigcode_python_fns_41097", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `heapsort` that takes a list of integers as input and returns a new list containing the integers sorted in ascending order using the heapsort algorithm. Do not use any built-in sort functions. The input list may contain duplicate integers and will no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert heapsort([1, 6, 5, 4, 8, 2]) == [1, 2, 4, 5, 6, 8]\", \"assert heapsort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert heapsort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert heapsort([3, 1, 2]) == [1, 2, 3]\", \"assert heapsort([-1, -3, -2, 0, 2]) == [-...
{ "split": "train", "index": 3648, "acecode_id": "evol_791", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a base class Animal with the abstract methods: speak(), which should return the sound the animal makes, and eat(), which should return the food the animal eats. Extend this class to create two subclasses - Carnivore and Herbivore. Both these classes must override the spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert animal_info(Lion('Simba')) == 'Simba says Roar and eats Meat'\", \"assert animal_info(Sheep('Shaun')) == 'Shaun says Baa and eats Vegetation'\", \"assert animal_info(Lion('Mufasa')) == 'Mufasa says Roar and eats Meat'\", \"assert animal_info(Sheep('Dolly')) ...
{ "split": "train", "index": 3649, "acecode_id": "evol_32487", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate a point on a B-spline curve given a set of control points and a knot vector. The B-spline curve is defined by a set of control points and a knot vector, and it smoothly interpolates the control points. Write a function `c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_bspline_curve([[0, 0], [1, 2], [2, 0]], [0, 0, 0, 1, 1, 1], 0.5) == [1.0, 1.0]\", \"assert calculate_bspline_curve([[0, 0], [1, 1], [2, 0], [3, 1]], [0, 0, 0, 1, 1, 1, 1], 0) == [0.0, 0.0]\", \"assert calculate_bspline_curve([[1, 2], [3, 4], [5, 6]...
{ "split": "train", "index": 3650, "acecode_id": "oss_34584", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a message string to extract resource names and their corresponding types. The message string contains information about resources in a specific format, and your function should parse this information and return a dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_resources('Aaa (type: DummyResource) Bbb (type: DummyResource)') == {'Aaa': 'DummyResource', 'Bbb': 'DummyResource'}\", \"assert parse_resources('Xyz (type: TestResource)') == {'Xyz': 'TestResource'}\", \"assert parse_resources('Foo (type: Bar) Baz (ty...
{ "split": "train", "index": 3651, "acecode_id": "oss_21681", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function in Python to generate a list of numbers that are the cube of all prime numbers up to and including a given number. The function should take an integer input and return a list of cubes of all prime numbers within that range.\nPlease reason step by step, then wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cube_primes(1) == []\", \"assert cube_primes(2) == [8]\", \"assert cube_primes(3) == [8, 27]\", \"assert cube_primes(4) == [8, 27]\", \"assert cube_primes(5) == [8, 27, 125]\"]}" }
{ "split": "train", "index": 3652, "acecode_id": "evol_14029", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a file system helper function that simulates basic file and directory operations. The function should accept a list of operations and their associated paths and return the results of each operation. The operations include: 'create_file', 'create...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fs_operations([('create_file', 'file1.txt'), ('exists', 'file1.txt')]) == [None, True]\", \"assert fs_operations([('create_directory', 'dir1'), ('exists', 'dir1')]) == [None, True]\", \"assert fs_operations([('create_file', 'file3.txt'), ('delete', 'file3.tx...
{ "split": "train", "index": 3653, "acecode_id": "oss_36232", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that calculates the sum of all even numbers and the sum of all odd numbers in the list. The function should return a dictionary containing both sums, where the key 'even_sum' corresponds to the sum of even numbers and the key 'odd_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_even_odd([1, 2, 3, 4, 5]) == {'even_sum': 6, 'odd_sum': 9}\", \"assert sum_even_odd([10, 15, 20, 25]) == {'even_sum': 30, 'odd_sum': 40}\", \"assert sum_even_odd([]) == {'even_sum': 0, 'odd_sum': 0}\", \"assert sum_even_odd([2, 4, 6, 8]) == {'even_sum': ...
{ "split": "train", "index": 3654, "acecode_id": "bigcode_python_fns_33637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of forms and a case. Each form is represented as a dictionary with various attributes, including 'action' and 'type'. Your task is to implement a function that retrieves the first form from the list that meets two criteria: it must pass an action filter and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_valid_form([{'action': 'run', 'type': 'A'}, {'action': 'jump', 'type': 'B'}, {'action': 'run', 'type': 'C'}], lambda a: a == 'run', lambda t: t == 'A') == {'action': 'run', 'type': 'A'}\", \"assert get_first_valid_form([{'action': 'swim', 'type': '...
{ "split": "train", "index": 3655, "acecode_id": "bigcode_python_fns_25687", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_valid_string()` that fabricates a string of exactly eight characters. This string must include both uppercase and lowercase letters, as well as numerals. Additionally, the string should not start with a digit. The function should return the generated ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_valid_string() != ''\", \"assert len(generate_valid_string()) == 8\", \"assert any(c.isupper() for c in generate_valid_string())\", \"assert any(c.islower() for c in generate_valid_string())\", \"assert not generate_valid_string()[0].isdigit()\", \"...
{ "split": "train", "index": 3656, "acecode_id": "evol_25624", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to create a function that determines if the sum of the integers in the list is even or odd. You should return the string 'Even' if the sum is even and 'Odd' if the sum is odd. Write a function `sum_parity(nums: List[int]) -> str:` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_parity([1, 2, 3]) == 'Even'\", \"assert sum_parity([1, 1, 1]) == 'Odd'\", \"assert sum_parity([0, 0, 0]) == 'Even'\", \"assert sum_parity([-1, -1, 2]) == 'Even'\", \"assert sum_parity([-1, 1]) == 'Even'\", \"assert sum_parity([10, 3, 5]) == 'Even'\", \"a...
{ "split": "train", "index": 3657, "acecode_id": "bigcode_python_fns_41088", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `get_full_url(protocol: str, domain: str) -> str` that takes two parameters: a string `protocol` representing the HTTP protocol (e.g., 'http://', 'https://') and a string `domain` representing the domain name (e.g., 'example.com'). The function should return th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_full_url('http://', 'example.com') == 'http://example.com'\", \"assert get_full_url('https://', 'openai.com') == 'https://openai.com'\", \"assert get_full_url('http://', 'leetcode.com') == 'http://leetcode.com'\", \"assert get_full_url('https://', 'githu...
{ "split": "train", "index": 3658, "acecode_id": "bigcode_python_fns_16180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two different stacks stack1 and stack2, write a function that merges and sorts these stacks into a single stack. The input stacks will be represented as lists, with the top of the stack at the end of the list. The merged stack should also have the largest element at the e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_and_sort([7, 5, 3], [4, 2]) == [7, 5, 4, 3, 2]\", \"assert merge_and_sort([1, 3, 5], [2, 4, 6]) == [6, 5, 4, 3, 2, 1]\", \"assert merge_and_sort([10, 30, 50], [20, 40]) == [50, 40, 30, 20, 10]\", \"assert merge_and_sort([], [1, 2, 3]) == [3, 2, 1]\", \...
{ "split": "train", "index": 3659, "acecode_id": "evol_10421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the coefficients of a quadratic equation represented by the integers a, b, and c, implement a Python function that calculates the roots of the quadratic equation ax^2 + bx + c = 0. The function should return the roots as a tuple. If the roots are complex, they should be r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_quadratic(1, -3, 2) == (2.0, 1.0)\", \"assert solve_quadratic(1, -2, 1) == (1.0, 1.0)\", \"assert solve_quadratic(2, 4, 2) == (-1.0, -1.0)\", \"assert solve_quadratic(1, -5, 6) == (3.0, 2.0)\", \"assert solve_quadratic(1, 0, -1) == (1.0, -1.0)\", \"ass...
{ "split": "train", "index": 3660, "acecode_id": "evol_34234", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `validate_contact_form` that takes three parameters: `name` (string), `email` (string), and `message` (string). The function should validate the following: the `name` should not be empty, the `email` should be in a valid format, and the `message` should not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_contact_form('John Doe', 'john@example.com', 'Hello, this is a message.') == {'status': 'success'}\", \"assert validate_contact_form('', 'john@example.com', 'Hello, this is a message.') == {'status': 'error', 'message': 'Name cannot be empty.'}\", \...
{ "split": "train", "index": 3661, "acecode_id": "evol_24716", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of samples and an array of target labels, write a function `separate_classes(samples: List[int], labels: List[int]) -> List[Tuple[int, List[int]]]` that separates the samples based on their corresponding labels. The function should return a list of tuples, where ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert separate_classes([1, 2, 3, 4, 5], [0, 1, 0, 1, 2]) == [(0, [1, 3]), (1, [2, 4]), (2, [5])]\", \"assert separate_classes([10, 20, 30, 40, 50, 60], [1, 2, 1, 2, 3, 3]) == [(1, [10, 30]), (2, [20, 40]), (3, [50, 60])]\", \"assert separate_classes([5, 10, 15, 20...
{ "split": "train", "index": 3662, "acecode_id": "bigcode_python_fns_868", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of categorical values, implement a function that performs one-hot encoding on these categorical values. The function should take two parameters: a list of categories and a list of corresponding values. For each unique category, the function should return a new list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert one_hot_encoding(['red', 'green', 'blue'], ['green', 'blue', 'red', 'blue', 'green']) == [[0, 1, 0], [0, 0, 1], [1, 0, 0], [0, 0, 1], [0, 1, 0]]\", \"assert one_hot_encoding(['apple', 'banana', 'orange'], ['banana', 'apple', 'apple', 'orange']) == [[0, 1, 0]...
{ "split": "train", "index": 3663, "acecode_id": "bigcode_python_fns_18006", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `dev` and `apdev`, representing two different groups of devices. Your task is to implement a function that simulates an opportunistic wireless encryption transition mode. The function should take these two lists and return the number of devi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_successful_connections([1, 2, 3], [2, 3, 4]) == 3\", \"assert count_successful_connections([5, 3, 6], [1, 2, 3]) == 0\", \"assert count_successful_connections([10, 20, 30], [15, 25, 35]) == 3\", \"assert count_successful_connections([0, 0, 0], [1, 1, 1...
{ "split": "train", "index": 3664, "acecode_id": "bigcode_python_fns_24444", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing the status of a pod in a Kubernetes environment. The pod dictionary contains a 'status' key, which itself contains a 'phase' that can be one of the following: 'Pending', 'Running', 'Succeeded', 'Failed', or 'Unknown'. Your task is to impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_container_state({'status': {'phase': 'Pending'}}, 'my_container') == 'waiting'\", \"assert get_container_state({'status': {'phase': 'Running'}}, 'my_container') == 'running'\", \"assert get_container_state({'status': {'phase': 'Succeeded'}}, 'my_containe...
{ "split": "train", "index": 3665, "acecode_id": "bigcode_python_fns_44593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the average of a fixed set of numbers. The function will take a list of exactly 10 numbers (which can be either integers or floating-point numbers) as input, and return the average of these numbers. The average should be c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == 55.0\", \"assert calculate_average([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 5.5\", \"assert calculate_average([-10, -20, -30, -40, -50, -60, -70, -80, -90, -100]) == -55.0\", \"assert calculate_avera...
{ "split": "train", "index": 3666, "acecode_id": "oss_17539", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given the state of a button which can either be 'pressed' or 'not pressed'. Your task is to implement a function that determines the device's state based on the button's state. If the button is 'pressed', the device state should be 'ON'; if the button is 'not pressed', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_device_state('pressed') == 'ON'\", \"assert determine_device_state('not pressed') == 'OFF'\", \"assert determine_device_state('pressed') == 'ON'\", \"assert determine_device_state('not pressed') == 'OFF'\", \"assert determine_device_state('pressed'...
{ "split": "train", "index": 3667, "acecode_id": "oss_5127", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function that performs a series of arithmetic or bitwise operations on a list of integers. The operations are specified as a string, with operations separated by commas. The supported operations are: 'div3' (divide by 3), 'pow2' (raise to the power of 2), 'add5'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ops_handler('pow2,add5', [1, 2, 3]) == [6, 9, 14]\", \"assert ops_handler('bxor1', [0, 1, 2, 3]) == [1, 0, 3, 2]\", \"assert ops_handler('add5', [10, 20, 30]) == [15, 25, 35]\", \"assert ops_handler('div3', [9, 6, 3]) == [3.0, 2.0, 1.0]\", \"assert ops_handl...
{ "split": "train", "index": 3668, "acecode_id": "evol_1253", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list consisting of strings that include open and close characters of different bracket types '()', '{}', '[]', and '<>'. Determine if a proper concatenation order exists, resulting in a string with correctly nested brackets of all types. For instance, '(<{}>)' is valid,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intricate_brackets([')', '[', '{', '{']) == 'No'\", \"assert intricate_brackets(['{', '(', '}', ')']) == 'No'\", \"assert intricate_brackets(['[', '(', '{', '}', ')', ']']) == 'Yes'\", \"assert intricate_brackets(['<', '{', '(', '[', '}', ')']) == 'No'\", \"...
{ "split": "train", "index": 3669, "acecode_id": "evol_27153", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of UniProt accessions and a desired output format. Your task is to construct a query string that combines all of the accessions into a single query string, formatted as 'id:accession1 OR id:accession2 OR ...'. Additionally, you need to return a string conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_uniprot_query(['P12345', 'Q67890'], 'fasta') == 'id:P12345 OR id:Q67890'\", \"assert build_uniprot_query(['A00001', 'B00002', 'C00003'], 'txt') == 'id:A00001 OR id:B00002 OR id:C00003'\", \"assert build_uniprot_query(['X1234', 'Y5678'], 'xml') == 'id:X...
{ "split": "train", "index": 3670, "acecode_id": "bigcode_python_fns_36389", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves syntax specifications based on a programming language identifier. The function will take an integer `lang_id` as input, which represents a specific programming language. If the `lang_id` corresponds to Java (represented by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_syntax_spec(1) == ['public', 'private', 'protected', 'void', 'class', 'static', 'final', 'interface', 'extends', 'implements']\", \"assert get_syntax_spec(0) == []\", \"assert get_syntax_spec(2) == []\", \"assert get_syntax_spec(-1) == []\", \"assert get...
{ "split": "train", "index": 3671, "acecode_id": "bigcode_python_fns_46077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of formatted strings from a list of input strings. Each formatted string should include a title, a color code, an author, and a footer. The function should take a list of strings as input and return a list of formatt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_formatted_strings(['page1', 'page2']) == ['Title: Commands List, Color: #FFD700, Author: Birthday Bot, Footer: No more status page lul, Content: page1', 'Title: Commands List, Color: #FFD700, Author: Birthday Bot, Footer: No more status page lul, Cont...
{ "split": "train", "index": 3672, "acecode_id": "oss_24662", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total number of occurrences of a specific word in a given text. The function should be case-insensitive and should consider only whole word matches. A word is defined as a sequence of alphanumeric characters, and a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_occurrences('Hello world! Hello everyone. Hello!', 'hello') == 3\", \"assert count_word_occurrences('Python is great. Python is powerful.', 'python') == 2\", \"assert count_word_occurrences('Data science is the future. Future is bright.', 'future'...
{ "split": "train", "index": 3673, "acecode_id": "oss_26702", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of input file names and a list of corresponding definition file names, write a function that generates a list of import library file names based on a specified naming convention. The naming convention for each library is 'partX.lib' where X is the index of the inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_import_libs(3, ['file1.obj', 'file2.obj', 'file3.obj'], ['file1.def', 'file2.def', 'file3.def']) == ['part0.lib', 'part1.lib', 'part2.lib']\", \"assert generate_import_libs(2, ['fileA.obj', 'fileB.obj'], ['fileA.def', 'fileB.def']) == ['part0.lib', ...
{ "split": "train", "index": 3674, "acecode_id": "bigcode_python_fns_26620", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `selection_sort` that takes a list of integers as input and returns a new list containing the same integers sorted in ascending order using the selection sort algorithm. The input list may contain duplicate values. You should not modify the original ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert selection_sort([64, 34, 25, 12, 22, 11, 90]) == [11, 12, 22, 25, 34, 64, 90]\", \"assert selection_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert selection_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert selection_sort([1, 1, 1, 1]) == [1, 1, 1, 1...
{ "split": "train", "index": 3675, "acecode_id": "evol_476", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing user codes. Write a function `filter_users_by_code(codes: List[str], target_code: str) -> List[str]` that returns a list of all user codes from the input list that match the `target_code`. The function should be case-sensitive. If no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_users_by_code(['ABC', 'abc', 'DEF', 'abc', 'ABC'], 'ABC') == ['ABC', 'ABC']\", \"assert filter_users_by_code(['abc', 'def', 'ghi'], 'xyz') == []\", \"assert filter_users_by_code(['A1', 'B2', 'C3', 'A1'], 'A1') == ['A1', 'A1']\", \"assert filter_users_...
{ "split": "train", "index": 3676, "acecode_id": "bigcode_python_fns_14267", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of process IDs (PIDs) representing running processes in a system. Write a function `terminate_processes(pids: List[int]) -> List[int]` that simulates the termination of each process by returning a list of PIDs that were successfully terminated. A PID is con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert terminate_processes([1, 2, 3, 4, 5]) == [2, 4]\", \"assert terminate_processes([10, 12, 14, 16]) == [10, 12, 14, 16]\", \"assert terminate_processes([1, 3, 5]) == []\", \"assert terminate_processes([2, 4, 6, 8, 10]) == [2, 4, 6, 8, 10]\", \"assert terminate_...
{ "split": "train", "index": 3677, "acecode_id": "bigcode_python_fns_24095", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 3D binary image represented as a list of lists of lists, where each element is either 0 or 1. Your task is to count the number of distinct parcels (connected components) in the 3D image. Two voxels (1s) are considered part of the same parcel if they are adjacent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_parcels([[[0]]]) == 0\", \"assert count_parcels([[[1]]]) == 1\", \"assert count_parcels([[[1, 1], [1, 0]], [[0, 0], [0, 0]]]) == 1\", \"assert count_parcels([[[1, 1], [1, 1]], [[1, 1], [1, 1]]]) == 1\", \"assert count_parcels([[[1, 0], [0, 1]], [[0, 1]...
{ "split": "train", "index": 3678, "acecode_id": "bigcode_python_fns_43106", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `determine_letter_grade(numerical_grade: int) -> str` that takes an integer representing a student's numerical grade and returns the corresponding letter grade. The grading scale is as follows: A for grades 90 and above, B for grades between 80 and 89, C fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_letter_grade(95) == 'A'\", \"assert determine_letter_grade(90) == 'A'\", \"assert determine_letter_grade(89) == 'B'\", \"assert determine_letter_grade(85) == 'B'\", \"assert determine_letter_grade(80) == 'B'\", \"assert determine_letter_grade(79) =...
{ "split": "train", "index": 3679, "acecode_id": "evol_17276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of numerical values, `Xexact` and `Xinferred`, implement a function `compare_force_components(Xexact: List[float], Xinferred: List[float]) -> float` that computes the Pearson correlation coefficient between the two lists. The function should return the correlati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_force_components([1, 2, 3], [1, 2, 3]) == 1.0\", \"assert compare_force_components([1, 2, 3], [3, 2, 1]) == -1.0\", \"assert compare_force_components([1, 2, 3, 4], [2, 4, 6, 8]) == 1.0\", \"assert compare_force_components([1, 2], [3, 4]) == 1.0\", \"...
{ "split": "train", "index": 3680, "acecode_id": "bigcode_python_fns_14860", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `validate_exposure_time` that checks if a given exposure time is within an acceptable range. The function should take three parameters: `bt` (begin time), `ct` (end time), and `exposure` (exposure time). The function should ens...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_exposure_time(0, 10, 0.5) == (0, 10, 0.5)\", \"assert validate_exposure_time(1, 5, 1) == (1, 5, 1)\", \"assert validate_exposure_time(0, 5, 0) == (0, 5, 0)\", \"assert validate_exposure_time(2, 12, 0.75) == (2, 12, 0.75)\", \"assert validate_exposur...
{ "split": "train", "index": 3681, "acecode_id": "oss_9866", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with determining the total number of force types included in a coarse-grained model. Implement a function `get_num_forces` that takes a dictionary representing the configuration of the model as input, where the keys are the types of forces ('bond', 'nonbonded', '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_num_forces({'bond': True, 'nonbonded': True, 'bond_angle': True, 'torsion': True}) == 4\", \"assert get_num_forces({'bond': False, 'nonbonded': False, 'bond_angle': False, 'torsion': False}) == 0\", \"assert get_num_forces({'bond': True, 'nonbonded': Fal...
{ "split": "train", "index": 3682, "acecode_id": "bigcode_python_fns_16600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a function `create_product` that takes a `user` and a variable number of keyword arguments representing product attributes. The function should create a product with the following default attributes: a name of 'Ron Cacique', a description of 'El ron cacique e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_product('user1') == {'name': 'Ron Cacique', 'description': 'El ron cacique es...', 'price': 20, 'weight': '0.70', 'units': 'l', 'featured': True}\", \"assert create_product('user2', name='Custom Product') == {'name': 'Custom Product', 'description': '...
{ "split": "train", "index": 3683, "acecode_id": "bigcode_python_fns_23180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_member_id(hostname: str, pid: int) -> bytes` that generates a member ID for a process based on the provided hostname and process ID (pid). The member ID should be formatted as a byte string in the following format: `'{hostname}_{...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_member_id('server1', 1234) == b'server1_1234'\", \"assert get_member_id('localhost', 5678) == b'localhost_5678'\", \"assert get_member_id('my-machine', 1) == b'my-machine_1'\", \"assert get_member_id('test-server', 42) == b'test-server_42'\", \"assert ge...
{ "split": "train", "index": 3684, "acecode_id": "bigcode_python_fns_27398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that filters out specific unwanted messages from a list of messages. The function should take two parameters: a list of messages and a list of messages to ignore. The output should be a new list that contains only the messages that are no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_messages(['Error 404', 'Warning', 'Info', 'Debug'], ['Error 404', 'Info']) == ['Warning', 'Debug']\", \"assert filter_messages(['Hello', 'World', 'Test'], ['Test']) == ['Hello', 'World']\", \"assert filter_messages(['Message1', 'Message2', 'Message3']...
{ "split": "train", "index": 3685, "acecode_id": "bigcode_python_fns_22736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates controlling an LED. The function should accept three parameters: `pin_number` (an integer representing the GPIO pin number), `action` (a string that can either be 'turn_on', 'turn_off', or 'set_brightness'), and `brightness...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert control_led(2, 'turn_on') == 'LED on pin 2 is turned ON'\", \"assert control_led(2, 'turn_off') == 'LED on pin 2 is turned OFF'\", \"assert control_led(2, 'set_brightness', 50) == 'LED on pin 2 brightness set to 50%'\", \"assert control_led(2, 'set_brightnes...
{ "split": "train", "index": 3686, "acecode_id": "oss_15818", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of audio feature vectors represented as lists of floats. Each audio feature vector contains several coefficients representing audio characteristics. Your goal is to compute the mean of each audio feature vector. Implement a function `proces...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_audio_features([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]) == [2.0, 5.0]\", \"assert process_audio_features([[0.5, 1.5], [2.5, 3.5]]) == [1.0, 3.0]\", \"assert process_audio_features([[1.0], [2.0], [3.0]]) == [1.0, 2.0, 3.0]\", \"assert process_audio_feature...
{ "split": "train", "index": 3687, "acecode_id": "oss_34179", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with renaming a list of files based on a specified pattern. Implement a function `rename_files(files: List[str], search_pattern: str, replacement: str, max_replacements: int) -> List[str]` that takes in a list of file names and renames them according to a search ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rename_files(['file1.txt', 'file2.txt'], 'file', 'document', 1) == ['document1.txt', 'document2.txt']\", \"assert rename_files(['report.pdf', 'summary.pdf'], 'report', 'document', 0) == ['document.pdf', 'summary.pdf']\", \"assert rename_files(['test1.txt', '...
{ "split": "train", "index": 3688, "acecode_id": "bigcode_python_fns_22295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a Python function that takes a collection of integers and returns a tuple containing the following three components: an array of prime numbers in ascending order, the product of all prime numbers, and the sum of all prime numbers. The function should handle exceptions f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_prime_numbers([2, 3, 5, 7]) == ([2, 3, 5, 7], 210, 17)\", \"assert find_prime_numbers([10, 11, 12, 13]) == ([11, 13], 143, 24)\", \"assert find_prime_numbers([4, 6, 8, 9]) == ([], 1, 0)\", \"assert find_prime_numbers([15, 16, 17, 18, 19]) == ([17, 19], ...
{ "split": "train", "index": 3689, "acecode_id": "evol_21549", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that takes a two-dimensional list (sparse matrix) as input and returns a sorted list of all non-zero elements from the matrix. The sorting should be done using the QuickSort algorithm. The input matrix can contain negative numbers and may have irregular sha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quicksort([[5, 0, 0], [0, 10, -3], [0, -2, 0]]) == [-3, -2, 5, 10]\", \"assert quicksort([[0, 0], [0, 0]]) == []\", \"assert quicksort([[1, 0, 2], [0, -1, 0], [3, 0, 0]]) == [-1, 1, 2, 3]\", \"assert quicksort([[0], [0], [0]]) == []\", \"assert quicksort([[0...
{ "split": "train", "index": 3690, "acecode_id": "evol_31982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given four integers representing True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN), implement a function `compute_F1(TP: int, TN: int, FP: int, FN: int) -> Tuple[float, float]` that calculates and returns the F1 score and the accuracy of a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_F1(0, 100, 0, 0) == (0.0, 100.0)\", \"assert compute_F1(100, 100, 0, 0) == (1.0, 100.0)\", \"assert compute_F1(0, 0, 0, 0) == (0.0, 0.0)\", \"assert compute_F1(50, 50, 0, 0) == (1.0, 100.0)\", \"assert compute_F1(0, 1, 0, 0) == (0.0, 100.0)\", \"asse...
{ "split": "train", "index": 3691, "acecode_id": "bigcode_python_fns_44210", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given three lengths a, b, and c, write a function `validate_triangle` that checks if a triangle can be formed with these sides. If a triangle can be formed, the function should return 'Equilateral triangle', 'Isosceles triangle', or 'Scalene triangle'. If a triangle cannot be f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_triangle(5, 10, 15) == 'Invalid triangle'\", \"assert validate_triangle(3, 3, 3) == 'Equilateral triangle'\", \"assert validate_triangle(3, 4, 5) == 'Scalene triangle'\", \"assert validate_triangle(5, 5, 8) == 'Isosceles triangle'\", \"assert valida...
{ "split": "train", "index": 3692, "acecode_id": "evol_32343", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string that may contain surplus spaces, write a function to remove the extra spaces and reverse each word in the string. Punctuation should be treated as part of the words. The output should be a single string with words separated by a single space.\nPlease reason step ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_words_in_string(' Hello World ') == 'olleH dlroW'\", \"assert reverse_words_in_string(' Python programming ') == 'nohtyP gnimmargorp'\", \"assert reverse_words_in_string(' LeetCode is fun ') == 'edoCteeL si nuf'\", \"assert reverse_words_in...
{ "split": "train", "index": 3693, "acecode_id": "evol_13849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a square matrix A represented as a list of lists, implement a function `get_P(A)` that computes the Markov matrix P using the formula P = D^{-1} * A, where D is a diagonal matrix constructed from the sum of each row of A. The function should return the resulting matrix P ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_P([[1, 2], [3, 4]]) == [[0.3333333333333333, 0.6666666666666666], [0.42857142857142855, 0.5714285714285714]]\", \"assert get_P([[1, 0], [0, 1]]) == [[1.0, 0.0], [0.0, 1.0]]\", \"assert get_P([[2, 2], [2, 2]]) == [[0.5, 0.5], [0.5, 0.5]]\", \"assert get_P...
{ "split": "train", "index": 3694, "acecode_id": "bigcode_python_fns_30192", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with managing a simple task system. Each task has a unique job ID, a brightness setting, and an interval for execution. You need to implement a function `show_job` that takes the following parameters: `job_id` (string): A unique identifier for the task, `bright` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert show_job('001', True, 10) == 'Job ID: 001, Bright: True, Interval: 10 seconds'\", \"assert show_job('002', False, 5) == 'Job ID: 002, Bright: False, Interval: 5 seconds'\", \"assert show_job('003', True, 1) == 'Job ID: 003, Bright: True, Interval: 1 seconds'...
{ "split": "train", "index": 3695, "acecode_id": "oss_8621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a lighting inventory system for a theater. You need to define a function `create_fixture` that takes a string input representing the type of fixture. The function should return a dictionary with two keys: 'source', which sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_fixture('LED') == {'source': 'LED', 'default': False}\", \"assert create_fixture('Conventional') == {'source': 'Conventional', 'default': True}\", \"assert create_fixture('Mover') == {'source': 'Mover', 'default': False}\", \"assert create_fixture('In...
{ "split": "train", "index": 3696, "acecode_id": "oss_36958", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a hash table represented as a dictionary, write a function that checks if a given input is a valid hash table. If the input is not a hash table, the function should raise a TypeError with the message 'Input must be HashTable.' Otherwise, the function should return True. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_hash_table({'key': 'value'}) == True\", \"assert validate_hash_table({}) == True\", \"assert validate_hash_table({1: 'one', 2: 'two'}) == True\", \"assert validate_hash_table({'a': 1, 'b': 2}) == True\", \"assert validate_hash_table({'key1': 'value1...
{ "split": "train", "index": 3697, "acecode_id": "bigcode_python_fns_5897", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that annotates links in a given text with HTML anchor tags. The function should take a string of text as input and return the text with all the URLs replaced by anchor tags in the format `<a href=\"url\">url</a>`. However, the functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert annotate_links_no_site('Visit our site at http://example.com', 'example.com') == 'Visit our site at http://example.com'\", \"assert annotate_links_no_site('Check out https://google.com and http://example.com', 'example.com') == 'Check out <a href=\\\"https:/...
{ "split": "train", "index": 3698, "acecode_id": "oss_35561", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function that sorts the list in ascending order and returns a new list containing tuples, where each tuple consists of the sorted word and the count of vowels in that word. The function should be named `sort_and_count_vowels` and should take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_count_vowels(['zebra', 'antelope', 'giraffe']) == [('antelope', 4), ('giraffe', 3), ('zebra', 2)]\", \"assert sort_and_count_vowels(['xylophone', 'ukulele', 'piano']) == [('piano', 3), ('ukulele', 4), ('xylophone', 3)]\", \"assert sort_and_count_vow...
{ "split": "train", "index": 3699, "acecode_id": "evol_30275", "num_tests": 15 }