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 analyzing the positions of astronomical sources based on their observed coordinates. Given a list of source names and their corresponding observed positions (as tuples of (x, y) coordinates), your function should compute the negative positions of each source...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_negative_positions(['SourceA', 'SourceB'], [(1.0, 2.0), (3.0, 4.0)]) == {'SourceA': (-1.0, -2.0), 'SourceB': (-3.0, -4.0)}\", \"assert compute_negative_positions(['Alpha', 'Beta', 'Gamma'], [(5.5, 6.5), (7.0, 8.0), (9.0, 10.0)]) == {'Alpha': (-5.5, -...
{ "split": "train", "index": 85200, "acecode_id": "bigcode_python_fns_16508", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that removes a node from a singly linked list at a specified index. The function should take the head of the linked list and the index of the node to be removed as parameters. If the index is out of bounds, the function should return the linked list unchang...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_node(head, 0) == head.next\", \"assert remove_node(head, 3).data == 'A'\", \"assert remove_node(head, 4) == head\", \"assert remove_node(head, 5) == head\", \"assert remove_node(head, -1) == head\", \"assert remove_node(None, 0) == None\", \"assert re...
{ "split": "train", "index": 85201, "acecode_id": "evol_34712", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks whether a given key is present in a dictionary or not. Your function should take two parameters: a dictionary and a key. The function should return True if the key is present in the dictionary and False if it is not. Pl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_key_in_dictionary({'name': 'Nemo'}, 'alive') == False\", \"assert is_key_in_dictionary({'name': 'Nemo'}, 'name') == True\", \"assert is_key_in_dictionary({}, 'key') == False\", \"assert is_key_in_dictionary({'a': 1, 'b': 2, 'c': 3}, 'a') == True\", \"asse...
{ "split": "train", "index": 85202, "acecode_id": "oss_33576", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `update_records` that takes in a list of dictionaries representing records, a specific field name, a value to search for, a new field name, and a transformation function. The function should find all records where the specified field contains the given value. F...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_records([{'name': 'Alice', 'tags': ['python', 'mongodb']}, {'name': 'Bob', 'tags': ['javascript']}], 'tags', 'python', 'tag_count', lambda doc: len(doc['tags'])) == [{'name': 'Alice', 'tags': ['python', 'mongodb'], 'tag_count': 2}]\", \"assert update_...
{ "split": "train", "index": 85203, "acecode_id": "evol_8428", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of distinct integers, write a function that returns the last three elements from the array. If the array has fewer than three elements, return all of the elements in the array. The function should handle any array length greater than zero.\nPlease reason step by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_final_three([1, 2, 3]) == [1, 2, 3]\", \"assert get_final_three([4, 5, 6, 7, 8]) == [6, 7, 8]\", \"assert get_final_three([10, 20, 30, 40, 50, 60]) == [40, 50, 60]\", \"assert get_final_three([100]) == [100]\", \"assert get_final_three([1, 2]) == [1, 2]\...
{ "split": "train", "index": 85204, "acecode_id": "evol_31567", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple game of 'Guess the Number'. The function should take a list of user guesses and a target number as inputs. After processing the guesses, the function should return a list of strings providing feedback for each gues...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert guess_the_number([50, 20, 75, 100], 75) == (['Too low!', 'Too low!', 'Correct!', 'Too high!'], 4)\", \"assert guess_the_number([30, 45, 60, 70, 80], 60) == (['Too low!', 'Too low!', 'Correct!', 'Too high!', 'Too high!'], 5)\", \"assert guess_the_number([10, ...
{ "split": "train", "index": 85205, "acecode_id": "oss_34649", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of two strings, where the first string represents a final statement and the second string is a list of initialization statements. Your task is to implement a function that concatenates all the initialization statements followed by the final statement, separ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert where_handle(['final_statement', ['init1', 'init2']]) == 'init1init2final_statement\\\\n'\", \"assert where_handle(['result', ['a', 'b', 'c']]) == 'abcresult\\\\n'\", \"assert where_handle(['output', ['start', 'end']]) == 'startendoutput\\\\n'\", \"assert wh...
{ "split": "train", "index": 85206, "acecode_id": "bigcode_python_fns_32663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `numbering` that takes in a source text, a numbering style, an output format, and additional options. The numbering style is defined by a prefix (a string) and a starting number (an integer). The output format can be either 'latex' or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numbering('Single Item', ('Task #', 5), 'html', {}) == '<p>Task # 5. Single Item</p>'\", \"assert numbering('Just One', ('Note #', 3), 'html', {}) == '<p>Note # 3. Just One</p>'\", \"assert numbering([], ('Empty #', 1), 'latex', {}) == ''\", \"assert numberi...
{ "split": "train", "index": 85207, "acecode_id": "oss_4457", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with determining the combat status of a single character in a game. Write a function `character_status(base_hp: int, max_hp_effects: List[int], wounds: List[int], heals: List[int]) -> Tuple[int, int, int]` that calculates the current health points (HP), maximum h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert character_status(50, [], [], []) == (50, 50, 0)\", \"assert character_status(200, [50], [30, 10], [20]) == (230, 250, 20)\", \"assert character_status(120, [10, 20], [0], [0]) == (150, 150, 0)\", \"assert character_status(90, [0], [15, 15], [10]) == (70, 90,...
{ "split": "train", "index": 85208, "acecode_id": "bigcode_python_fns_29034", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a Python function that extracts the individual elements associated with each key in a nested dictionary. The dictionary contains a key called 'studentData', which itself is a dictionary holding various attributes of a student, including their name, age, university, and a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_data({'studentData': {'studentName': 'Alice Johnson', 'age': 21, 'university': 'Stanford University', 'courses': {'major': 'Computer Science', 'minor': 'Mathematics', 'elective': 'Psychology'}}}) == ['Alice Johnson', 21, 'Stanford University', 'Compu...
{ "split": "train", "index": 85209, "acecode_id": "evol_11069", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a type (like 'Boolean', 'Integer', 'Number', 'String'), write a function that returns a dictionary mapping the input type to its corresponding lowercase string representation. If the input type is not recognized, return a dictionary with a single key...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert type_definition('Boolean') == {'type': 'boolean'}\", \"assert type_definition('Integer') == {'type': 'integer'}\", \"assert type_definition('Number') == {'type': 'number'}\", \"assert type_definition('String') == {'type': 'string'}\", \"assert type_definitio...
{ "split": "train", "index": 85210, "acecode_id": "bigcode_python_fns_39032", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of virtual machine (VM) objects, where each VM is represented by a dictionary containing the following keys: 'id', 'name', and 'status'. Write a function, `filter_running_vms(vms: List[Dict[str, Union[str, int]]]) -> List[Dict[str, Union[str, int]]]`, that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_running_vms([]) == []\", \"assert filter_running_vms([{'id': '1', 'name': 'vm1', 'status': 'running'}, {'id': '2', 'name': 'vm2', 'status': 'stopped'}]) == [{'id': '1', 'name': 'vm1', 'status': 'running'}]\", \"assert filter_running_vms([{'id': '1', '...
{ "split": "train", "index": 85211, "acecode_id": "bigcode_python_fns_32832", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of segments rendered from different data files. Write a function `total_segments_rendered(segments: List[int]) -> int` that calculates the total number of segments rendered across all data files. The input will be a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_segments_rendered([0, 1, 2, 3]) == 6\", \"assert total_segments_rendered([5, 10, 15]) == 30\", \"assert total_segments_rendered([0]) == 0\", \"assert total_segments_rendered([]) == 0\", \"assert total_segments_rendered([1, 1, 1, 1]) == 4\", \"assert to...
{ "split": "train", "index": 85212, "acecode_id": "bigcode_python_fns_21587", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves a user's information based on their netid. The function should first attempt to find the user in a simulated database using their netid as the username. If the user is found, the function should return the user object (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user('user1', {}) == {'username': 'user1', 'password': 'generated_password_user1'}\", \"assert get_user('user2', {'user2': {'username': 'user2', 'password': 'pass2'}}) == {'username': 'user2', 'password': 'pass2'}\", \"assert get_user('user3', {'user3': ...
{ "split": "train", "index": 85213, "acecode_id": "oss_32406", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string is a valid International Mobile Equipment Identity (IMEI) number. A valid IMEI number must be exactly 15 digits long and must pass the Luhn algorithm. The Luhn algorithm checks the validity of the number by applying certain tra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_imei('490154203237518') == True\", \"assert is_valid_imei('490154203237519') == False\", \"assert is_valid_imei('123456789012345') == False\", \"assert is_valid_imei('12345678901234') == False\", \"assert is_valid_imei('1234567890123456') == False\"...
{ "split": "train", "index": 85214, "acecode_id": "evol_35766", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `count_musicians_by_genre(band)` that takes a list of `Musician` objects representing a band and returns a dictionary where the keys are genres and the values are the count of musicians in each genre. Ensure that the function handles edge cases such as an e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_musicians_by_genre([]) == {}\", \"assert count_musicians_by_genre([Musician('Alice', 30, Instrument('Guitar', 'Fender'), 'Rock', 10)]) == {'Rock': 1}\", \"assert count_musicians_by_genre([Musician('Bob', 25, Instrument('Drums', 'Yamaha'), 'Jazz', 5), M...
{ "split": "train", "index": 85215, "acecode_id": "evol_27407", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two lists, `dims` and `strides`, where `dims` represents the dimensions of a tensor and `strides` represents the strides for each dimension, implement a function `fuse_stride_arrays(dims: List[int], strides: List[int]) -> List[int]` that computes the linear positions of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fuse_stride_arrays([1], [1]) == [0]\", \"assert fuse_stride_arrays([1, 1, 1], [1, 1, 1]) == [0]\", \"assert fuse_stride_arrays([3], [2]) == [0, 2, 4]\", \"assert fuse_stride_arrays([0], [1]) == []\", \"assert fuse_stride_arrays([4], [3]) == [0, 3, 6, 9]\", \...
{ "split": "train", "index": 85216, "acecode_id": "bigcode_python_fns_2840", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of dictionaries representing user data and modifies it based on given rules. Each dictionary contains an 'id' and a 'name'. If a user with the same 'id' already exists in the list, you should update the 'name' of tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upsert_users([{'id': 1, 'name': 'Alice'}, {'id': 1, 'name': 'Bob'}]) == [{'id': 1, 'name': 'Bob'}]\", \"assert upsert_users([{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Cathy'}, {'id': 1, 'name': 'Bob'}]) == [{'id': 1, 'name': 'Bob'}, {'id': 2, 'name': 'C...
{ "split": "train", "index": 85217, "acecode_id": "bigcode_python_fns_42089", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that sorts a list of integers in either ascending or descending order. Additionally, your function should identify any anomalies in the list, specifically non-integer values, and return an error message if such values are encountered....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_list([1, 2, 3, 4, 5], 'ascending') == ([1, 2, 3, 4, 5], '')\", \"assert sort_list([], 'ascending') == ([], '')\", \"assert sort_list([3, 2, 1], 'ascending') == ([1, 2, 3], '')\", \"assert sort_list([5, 4, 3, 2, 1], 'descending') == ([5, 4, 3, 2, 1], '')...
{ "split": "train", "index": 85218, "acecode_id": "evol_15236", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of strings representing parameters, a platform code, and optional time and depth constraints, write a function `get_filtered_data` that returns a dictionary containing the parameters and their corresponding values for a specific platform code. The function should t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_filtered_data('PL123', ['temp', 'salinity'], '2023-01-01', '2023-01-31', 0, 100) == {'temp': [10.5, 11.0, 12.3], 'salinity': []}\", \"assert get_filtered_data('PL456', ['pressure'], '2023-02-01', '2023-02-28', 0, 50) == {'pressure': [1013.25, 1012.90]}\"...
{ "split": "train", "index": 85219, "acecode_id": "bigcode_python_fns_37316", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of temperature readings from a forest fire monitoring system, along with a list of corresponding DC values (a measure of some environmental factor). Your task is to implement a function that returns the minimum temperature from the list only if the minimum ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_conditions([3, 4, 5], [150, 150, 150]) == 3\", \"assert check_conditions([1, 2, 3], [150, 150, 150]) == -1\", \"assert check_conditions([5, 6, 7], [1000, 1100, 1200]) == 5\", \"assert check_conditions([8, 9, 10], [500, 600, 700]) == -1\", \"assert chec...
{ "split": "train", "index": 85220, "acecode_id": "bigcode_python_fns_27163", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves all the tags associated with a specific project, given a predefined mapping of projects and their associated tags. You will be given a project ID, and you need to return a list of tag names associated with that project. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_project_tags(1) == ['tag1', 'tag2']\", \"assert get_project_tags(2) == ['tag3']\", \"assert get_project_tags(3) == ['tag4', 'tag5', 'tag6']\", \"assert get_project_tags(4) == []\", \"assert get_project_tags(0) == []\", \"assert get_project_tags(7) == []\...
{ "split": "train", "index": 85221, "acecode_id": "oss_17897", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function 'prime_index' that takes a list of integers and returns a list of unique elements located at prime index positions. The function should handle lists of varying lengths, including empty and single-element lists. Prime indices are defined as indices that are prim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_index([]) == []\", \"assert prime_index([1]) == []\", \"assert prime_index([1, 2]) == []\", \"assert prime_index([1, 2, 2, 3, 4, 5, 5, 6, 7]) == [2, 3, 5, 6]\", \"assert prime_index([1, 0, 0, 1, 0]) == [0, 1]\"]}" }
{ "split": "train", "index": 85222, "acecode_id": "evol_12742", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the filtering of import tasks based on specific criteria. The function should take in a list of import tasks, each represented as a dictionary with the following keys: 'importTaskId', 'name', 'status', 'importUrl', 'imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_import_tasks([{'importTaskId': '1', 'name': 'Task1', 'status': 'IMPORT_COMPLETE', 'importUrl': 'url1', 'importRequestTime': 1622548800, 'importCompletionTime': 1622548860, 'serverImportSuccess': 10, 'serverImportFailure': 0, 'applicationImportSuccess'...
{ "split": "train", "index": 85223, "acecode_id": "bigcode_python_fns_19181", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Create a function that calculates the median salary for individuals with a university degree from the provided JSON data. The function should take a JSON string as input and return the median salary of those individuals. If no individual with a university degree is found, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_median_income('[{\\\"name\\\": \\\"Linda\\\", \\\"age\\\": 30, \\\"gender\\\": \\\"female\\\", \\\"education\\\": \\\"university\\\", \\\"salary\\\": 6000}, {\\\"name\\\": \\\"Tom\\\", \\\"age\\\": 26, \\\"gender\\\": \\\"male\\\", \\\"education\\\...
{ "split": "train", "index": 85224, "acecode_id": "evol_4809", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that returns the maximum sum of non-adjacent elements in the list. Non-adjacent elements are elements that are not next to each other in the list. For example, given the list [2, 4, 6, 2, 5], the maximum sum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_non_adjacent_sum([]) == 0\", \"assert max_non_adjacent_sum([1]) == 1\", \"assert max_non_adjacent_sum([1, 2]) == 2\", \"assert max_non_adjacent_sum([5, 1, 1, 5]) == 10\", \"assert max_non_adjacent_sum([3, 2, 7, 10]) == 13\", \"assert max_non_adjacent_sum...
{ "split": "train", "index": 85225, "acecode_id": "bigcode_python_fns_2515", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the growth rate of a key performance indicator (KPI) over specified periods. Write a function `calculate_growth_rate(kpi_values, period, latest)` that takes a list of float values `kpi_values`, a string `period` which can be 'monthly', 'quarterly...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_growth_rate([300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0], 'monthly', 6) == 0.0\", \"assert calculate_growth_rate([100.0, 50.0], 'annually', 1) == None\", \"assert calculate_growth_rate([100.0, 200.0, 300.0], 'monthly', 1) == 100.0\", \"assert ...
{ "split": "train", "index": 85226, "acecode_id": "oss_36615", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with updating a configuration string for a quiz application. Implement a function `update_quiz_config(quiz_name: str) -> Tuple[str, str]` that takes a quiz name as input and returns a tuple containing two formatted strings: the index string in the format 'index =...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_quiz_config('Math Quiz') == ('index = idx-Math_Quiz', 'dataset = Math_Quiz')\", \"assert update_quiz_config('Science Test') == ('index = idx-Science_Test', 'dataset = Science_Test')\", \"assert update_quiz_config('History') == ('index = idx-History', ...
{ "split": "train", "index": 85227, "acecode_id": "bigcode_python_fns_44142", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary where the keys are integers and the values are lists of strings, implement a function that sorts the dictionary by its keys and then sorts each list of strings in alphabetical order. The function should return a new dictionary with the sorted keys and values....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dict_and_values({1: [\\\"apple\\\", \\\"banana\\\"], 2: [\\\"peach\\\", \\\"apple\\\"]}) == {1: [\\\"apple\\\", \\\"banana\\\"], 2: [\\\"apple\\\", \\\"peach\\\"]}\", \"assert sort_dict_and_values({5: [\\\"grape\\\"], 1: [\\\"banana\\\", \\\"apple\\\", ...
{ "split": "train", "index": 85228, "acecode_id": "evol_24733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple linear regression model in Python. Your task is to write a function `linear_regression_predict(X: List[float], y: List[float], X_pred: List[float]) -> List[float]` that predicts target values based on input features using the formula: y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_regression_predict([0, 1, 2], [1, 2, 3], [3]) == [4.0]\", \"assert linear_regression_predict([1, 2, 3, 4], [3, 5, 7, 9], [5]) == [11.0]\", \"assert linear_regression_predict([1, 0, 2, 3], [1, 4, 2, 1], [4]) == [0.0]\", \"assert linear_regression_predi...
{ "split": "train", "index": 85229, "acecode_id": "oss_30118", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total discount rate for a given time period and duration. Write a function `total_discount_rate(t: int, dur: int) -> float` that takes two integer inputs, `t` representing the time period and `dur` representing the duration. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_discount_rate(1, 1) == 0.05\", \"assert total_discount_rate(2, 1) == 0.07\", \"assert total_discount_rate(1, 2) == 0.10\", \"assert total_discount_rate(3, 2) == 0.14\", \"assert total_discount_rate(2, 3) == 0.17\", \"assert total_discount_rate(1, 4) ==...
{ "split": "train", "index": 85230, "acecode_id": "bigcode_python_fns_28045", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string `instance_name` and a list of tuples `ocr_result`. Each tuple contains a pair: the first element is a tuple of coordinates (x1, y1) and (x2, y2), and the second element is a list of strings. Your task is to find the first tuple in `ocr_result` where `inst...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert click_instance_center('button', [((0, 0), (2, 2), ['button']), ((3, 3), (4, 4), ['link'])]) == 1\", \"assert click_instance_center('link', [((0, 0), (2, 2), ['button']), ((3, 3), (4, 4), ['link'])]) == 3\", \"assert click_instance_center('icon', [((1, 1), (3...
{ "split": "train", "index": 85231, "acecode_id": "bigcode_python_fns_465", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `cumulative_summing(limit: int) -> int` that calculates the cumulative sum of all integers from 0 up to a given `limit` (inclusive) that are divisible by both 3 and 5. The function should return the cumulative sum as an integer.\nPlease reason step by step, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_summing(15) == 15\", \"assert cumulative_summing(0) == 0\", \"assert cumulative_summing(1) == 0\", \"assert cumulative_summing(3) == 0\", \"assert cumulative_summing(5) == 0\", \"assert cumulative_summing(10) == 0\", \"assert cumulative_summing(11...
{ "split": "train", "index": 85232, "acecode_id": "evol_1432", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two 3-dimensional vectors, vec1 and vec2, represented by lists of three integers [x1, y1, z1] and [x2, y2, z2], respectively, write a function `cross_product(vec1, vec2)` that computes the cross product of these two vectors. The cross product of vec1 and vec2 is a vector ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cross_product([1, 2, 3], [4, 5, 6]) == [-3, 6, -3]\", \"assert cross_product([0, 0, 0], [1, 2, 3]) == [0, 0, 0]\", \"assert cross_product([1, 0, 0], [0, 1, 0]) == [0, 0, 1]\", \"assert cross_product([1, 1, 1], [2, 2, 2]) == [0, 0, 0]\", \"assert cross_produc...
{ "split": "train", "index": 85233, "acecode_id": "bigcode_python_fns_22833", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes an integer representing a propulsion type of a vehicle and returns its corresponding string representation. The available propulsion types are defined as follows: 1 for 'human', 2 for 'electric_assist', 3 for 'electric', an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_propulsion_type_string(1) == 'human'\", \"assert get_propulsion_type_string(2) == 'electric_assist'\", \"assert get_propulsion_type_string(3) == 'electric'\", \"assert get_propulsion_type_string(4) == 'solar'\", \"assert get_propulsion_type_string(0) == ...
{ "split": "train", "index": 85234, "acecode_id": "oss_17247", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function in Python to determine the least common multiple (LCM) of three integers. Implement a function `lcm_of_three(x: int, y: int, z: int) -> int` that takes three integers as input and returns their least common multiple.\nPlease reason step by step, then write a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcm_of_three(15, 20, 30) == 60\", \"assert lcm_of_three(1, 1, 1) == 1\", \"assert lcm_of_three(7, 5, 3) == 105\", \"assert lcm_of_three(2, 3, 4) == 12\", \"assert lcm_of_three(10, 15, 25) == 150\", \"assert lcm_of_three(6, 8, 12) == 24\", \"assert lcm_of_thr...
{ "split": "train", "index": 85235, "acecode_id": "evol_15326", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a value, determine if it is a valid domain interval represented as a tuple. A valid domain interval must satisfy the following conditions: 1. It must be a tuple. 2. It must contain at least two elements, and the first two elements must be integers. 3. The second integer m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_domain_interval((1, 5)) == True\", \"assert is_valid_domain_interval((5, 5)) == True\", \"assert is_valid_domain_interval((2, 4, 'INVALID')) == False\", \"assert is_valid_domain_interval((1, 2, 3)) == False\", \"assert is_valid_domain_interval((5, 2...
{ "split": "train", "index": 85236, "acecode_id": "bigcode_python_fns_26544", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a dictionary representing a response from a search engine, return a list of documents contained in the response. The input dictionary will have a key 'response' which itself is another dictionary containing a key 'docs' that holds the list of documents. Your task is to im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_documents({'response': {'docs': [{'id': 1}, {'id': 2}]} }) == [{'id': 1}, {'id': 2}]\", \"assert extract_documents({'response': {'docs': []}}) == []\", \"assert extract_documents({'response': {}}) == []\", \"assert extract_documents({}) == []\", \"as...
{ "split": "train", "index": 85237, "acecode_id": "bigcode_python_fns_45902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `input_str` that contains a sentence with various words and numerical values. Your task is to write a Python function `extract_numbers(input_str)` that extracts all the numerical values from the string and returns them as a list of floats. The numbers may...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_numbers('The price is $25.50 and the quantity is 10') == [25.50, 10.0]\", \"assert extract_numbers('There are 3 apples and 2.5 bananas') == [3.0, 2.5]\", \"assert extract_numbers('No numbers here!') == []\", \"assert extract_numbers('I have 100 dolla...
{ "split": "train", "index": 85238, "acecode_id": "oss_11647", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `start_ticker()` that simulates starting a ticker for a cryptocurrency. The function should take no parameters and return a string indicating that the ticker has started. The output string should be 'Ticker started successfully.'\nPle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_ticker() == 'Ticker started successfully.'\", \"assert start_ticker() == 'Ticker started successfully.'\", \"assert start_ticker() == 'Ticker started successfully.'\", \"assert start_ticker() == 'Ticker started successfully.'\", \"assert start_ticker()...
{ "split": "train", "index": 85239, "acecode_id": "bigcode_python_fns_6594", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing stock symbols and their corresponding stock quotes. Your task is to implement a function `process_quotes(quotes_dict)` that takes in a dictionary `quotes_dict` and returns a new dictionary where the stock symbols are the same but the quotes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_quotes({'AAPL': '123.45', 'GOOGL': '987.65', 'MSFT': '234.56'}) == {'AAPL': '123.45', 'GOOGL': '987.65', 'MSFT': '234.56'}\", \"assert process_quotes({'TSLA': '1000.00', 'AMZN': '2000.00'}) == {'TSLA': '1000.00', 'AMZN': '2000.00'}\", \"assert proces...
{ "split": "train", "index": 85240, "acecode_id": "oss_34142", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting data between two different data structures: an 'Alumn' and a 'Client'. Both structures have similar attributes: name, surname, id_card, phone1, phone2, email, id, price, and observations. Your goal is to implement a function `convert_data(data, ty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_data(Alumn('John', 'Doe', '12345678', '123-456-7890', '098-765-4321', 'john.doe@example.com', 1, 100.0, 'Some observations'), 'alumn_to_client') == Client('John', 'Doe', '12345678', '123-456-7890', '098-765-4321', 'john.doe@example.com', 1, 100.0, 'S...
{ "split": "train", "index": 85241, "acecode_id": "oss_34281", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that simulates the state of a device during a migration process. The device can be in one of two states: 'SAVING' or 'ERROR'. When the device is in the 'ERROR' state, any attempt to write to its migration state should return an error code. Your task is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_device_migration('SAVING') == 0\", \"assert simulate_device_migration('ERROR') == -1\", \"assert simulate_device_migration('SAVING') == 0\", \"assert simulate_device_migration('ERROR') == -1\", \"assert simulate_device_migration('SAVING') == 0\", \"...
{ "split": "train", "index": 85242, "acecode_id": "bigcode_python_fns_13060", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of players in a game. Write a function `evaluate_scores(scores: List[int]) -> Dict[str, Union[int, float]]` that evaluates the scores and returns a dictionary containing the following information: \n\n- 'highest_score': t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_scores([10, 20, 30, 40]) == {'highest_score': 40, 'lowest_score': 10, 'average_score': 25.0}\", \"assert evaluate_scores([5]) == {'highest_score': 5, 'lowest_score': 5, 'average_score': 5.0}\", \"assert evaluate_scores([1, 2, 3, 4, 5]) == {'highest_...
{ "split": "train", "index": 85243, "acecode_id": "bigcode_python_fns_13289", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates moving a player in a grid-based game. The player can move in four cardinal directions: 'North', 'East', 'South', and 'West'. The grid is defined as follows: the player starts at a specific position (x, y) in the grid. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_position(5, 5, 0, 0, ['North']) == (0, 0)\", \"assert final_position(5, 5, 2, 2, ['North', 'East', 'South', 'West']) == (2, 2)\", \"assert final_position(5, 5, 4, 4, ['South']) == (4, 4)\", \"assert final_position(5, 5, 1, 1, ['North', 'North']) == (1,...
{ "split": "train", "index": 85244, "acecode_id": "bigcode_python_fns_24155", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a recursive function `factorial(n)` that calculates the factorial of a non-negative integer `n`. The function should handle invalid inputs by raising a `ValueError` if `n` is negative. The base cases for the recursion should be when `n` is 0 or 1, both of which should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 85245, "acecode_id": "evol_5610", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sum_numbers` that takes a variable number of integer arguments and returns their sum. For example, `sum_numbers(3, 5, 7)` should return `15`.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_numbers(0) == 0\", \"assert sum_numbers(1) == 1\", \"assert sum_numbers(1, 2) == 3\", \"assert sum_numbers(3, 5, 7) == 15\", \"assert sum_numbers(-1, -2, -3) == -6\", \"assert sum_numbers(10, 20, 30) == 60\", \"assert sum_numbers(1, 2, 3, 4, 5) == 15\", ...
{ "split": "train", "index": 85246, "acecode_id": "evol_28407", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the square of a given integer. The function should take a single integer input and return its square. For example, if the input is 5, the output should be 25. Please implement the function `calculate_square(b)` that pe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_square(0) == 0\", \"assert calculate_square(1) == 1\", \"assert calculate_square(-1) == 1\", \"assert calculate_square(2) == 4\", \"assert calculate_square(-2) == 4\", \"assert calculate_square(3) == 9\", \"assert calculate_square(-3) == 9\", \"ass...
{ "split": "train", "index": 85247, "acecode_id": "oss_20388", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sorted lists, A and B, implement a function that returns the union of the two lists, ensuring all elements in the result are unique and sorted. You should not use built-in union functions and should utilize a binary search technique to check for existence. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert union_sorted_lists([1, 2, 3, 4, 5], [3, 4, 5, 6, 7]) == [1, 2, 3, 4, 5, 6, 7]\", \"assert union_sorted_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert union_sorted_lists([], []) == []\", \"assert union_sorted_lists([], [1, 2, 3]) == [1, 2, 3]\"...
{ "split": "train", "index": 85248, "acecode_id": "evol_19648", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings of equal length, implement a function that checks if the two strings are isomorphic to each other. Two strings are isomorphic if the characters in one string can be replaced to get the second string. The mapping must be one-to-one, meaning that no two characte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_isomorphic('egg', 'add') == True\", \"assert are_isomorphic('foo', 'bar') == False\", \"assert are_isomorphic('paper', 'title') == True\", \"assert are_isomorphic('abc', 'def') == True\", \"assert are_isomorphic('aabb', 'xxyy') == True\", \"assert are_is...
{ "split": "train", "index": 85249, "acecode_id": "evol_21364", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple bank account. Write a function `bank_account_operations` that takes in an initial balance, a list of operations, and a minimum balance requirement. The function should process the operations which include deposits and withdrawals, ensurin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_operations(500, [('deposit', 300), ('withdraw', 200)], 100) == 600\", \"assert bank_account_operations(500, [('withdraw', 600)], 100) == 500\", \"assert bank_account_operations(200, [('withdraw', 50), ('deposit', 100)], 100) == 250\", \"assert b...
{ "split": "train", "index": 85250, "acecode_id": "oss_20478", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a configuration item. This dictionary may contain details such as 'type', 'name', 'icon', and a list of 'children' which are also configuration items represented in the same way. Your task is to write a function that extracts the 'type' a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_configuration_item({'type': 'Server', 'name': 'Main Server', 'icon': 'server.png'}) == 'Server: Main Server'\", \"assert format_configuration_item({'type': 'Database', 'name': 'User DB'}) == 'Database: User DB'\", \"assert format_configuration_item({'...
{ "split": "train", "index": 85251, "acecode_id": "bigcode_python_fns_48735", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a method to compute the area of a circle given its radius. The method should take a single parameter, which is the radius of the circle, and return the area calculated using the formula: area = π * radius². The value of π can be approximated as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_circle_area(0) == 0.0\", \"assert calculate_circle_area(1) == 3.14\", \"assert calculate_circle_area(2) == 12.56\", \"assert calculate_circle_area(3) == 28.26\", \"assert calculate_circle_area(4) == 50.24\", \"assert calculate_circle_area(5) == 78....
{ "split": "train", "index": 85252, "acecode_id": "oss_27361", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a color choice for a geometric shape. The function should accept a string input representing a color and check if it is one of the valid colors: 'red', 'green', or 'blue'. If the input color is valid, the function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_color('red') == 'red'\", \"assert validate_color('green') == 'green'\", \"assert validate_color('blue') == 'blue'\", \"assert validate_color('RED') == 'red'\", \"assert validate_color('GREEN') == 'green'\", \"assert validate_color('BLUE') == 'blue'\...
{ "split": "train", "index": 85253, "acecode_id": "oss_31420", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `extract_messages(mp3_files: List[str]) -> Tuple[str, str]` that takes a list of MP3 file names (as strings) and extracts messages based on the titles present in the audio files. Each MP3 file title may contain the words 'left' or 'right'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_messages(['left_message.mp3', 'right_message.mp3']) == ('left_message', 'right_message')\", \"assert extract_messages(['left_1.mp3', 'left_2.mp3']) == ('left_1left_2', '')\", \"assert extract_messages(['right_1.mp3', 'right_2.mp3']) == ('', 'right_1r...
{ "split": "train", "index": 85254, "acecode_id": "oss_17387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to retrieve the balance of a specified account from a cryptocurrency trading platform. Your function, `get_balance`, should take an optional parameter `acct_id` representing the account ID for which the balance needs to be retrieved. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_balance() == 1000\", \"assert get_balance('123') == 1500\", \"assert get_balance('789') == 0\", \"assert get_balance('999') == 0\", \"assert get_balance() == 1000\", \"assert get_balance('123') == 1500\"]}" }
{ "split": "train", "index": 85255, "acecode_id": "oss_36930", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of words, implement a function `max_letter_word` that returns the word with the maximum number of letters. If there are multiple words with the same maximum length, return the first one encountered in the list. The input list will only contain lowercase alphabetica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_letter_word(['apple', 'banana', 'watermelon', 'grape']) == 'watermelon'\", \"assert max_letter_word(['cat', 'dog', 'mouse', 'elephant']) == 'elephant'\", \"assert max_letter_word(['a', 'ab', 'abc', 'abcd']) == 'abcd'\", \"assert max_letter_word(['foo', '...
{ "split": "train", "index": 85256, "acecode_id": "evol_4459", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that filters a list of module names based on specific criteria. A valid module name is defined as a string that starts with 'CBF' and ends with 'Reader'. Your function should return a new list containing only the valid module n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_module_names(['CBFModuleReader', 'SomeOtherModule']) == ['CBFModuleReader']\", \"assert filter_module_names(['CBFStartReader', 'CBFEndReader']) == ['CBFStartReader', 'CBFEndReader']\", \"assert filter_module_names([]) == []\", \"assert filter_module_n...
{ "split": "train", "index": 85257, "acecode_id": "oss_26518", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that generates all distinct permutations of strings of length k using the provided lowercase alphabet characters. The function should return a list of these permutations. For example, given the set of characters {'a', 'b', 'c'} and k = 3, the function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_permutations({'x', 'y'}, 1) == ['x', 'y']\", \"assert generate_permutations({'x', 'y'}, 2) == ['xx', 'xy', 'yx', 'yy']\", \"assert generate_permutations({'x', 'y'}, 3) == ['xxx', 'xxy', 'xyx', 'xyy', 'yxx', 'yxy', 'yyx', 'yyy']\", \"assert generate_...
{ "split": "train", "index": 85258, "acecode_id": "evol_4133", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to draw a polyline on a 2D grid represented as a list of lists (where each sub-list represents a row of pixels). The function `draw_polyline` takes four parameters: `grid` (the 2D grid to draw on), `points` (a list of tuples represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_polyline([[0,0,0],[0,0,0],[0,0,0]], [(0,0), (0,1), (0,2)], 1, True) == [[1,1,1],[0,0,0],[0,0,0]]\", \"assert draw_polyline([[0,0,0],[0,0,0],[0,0,0]], [(0,0), (1,0), (2,0)], 1, True) == [[1,0,0],[1,0,0],[1,0,0]]\", \"assert draw_polyline([[0,0,0],[0,0,0]...
{ "split": "train", "index": 85259, "acecode_id": "oss_9424", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that provides role-based access control and error handling for a project management application. Implement a function `get_project_role` that takes a user's role as input (a string) and returns the corresponding project role constant....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_project_role('owner') == 'PROJECT_ROLE_OWNER'\", \"assert get_project_role('delegate') == 'PROJECT_ROLE_DELEGATE'\", \"assert get_project_role('admin') == 'Unknown role'\", \"assert get_project_role('') == 'Unknown role'\", \"assert get_project_role('man...
{ "split": "train", "index": 85260, "acecode_id": "oss_30688", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `unique_alphabetical_chars` that takes a string as input and returns a set of unique alphabetical characters (case insensitive) from that string. Ignore any non-alphabetical characters. For example, if the input string is 'Hello, World!', the function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_alphabetical_chars('programming') == {'p', 'r', 'o', 'g', 'a', 'm', 'i', 'n'}\", \"assert unique_alphabetical_chars('Hello, World!') == {'h', 'e', 'l', 'o', 'r', 'w', 'd'}\", \"assert unique_alphabetical_chars('1234!@#$') == set()\", \"assert unique_a...
{ "split": "train", "index": 85261, "acecode_id": "evol_11973", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that processes a mode parameter and a target output file path. The function should handle different modes of operation: 'read', 'write', 'append', and 'invalid'. Based on the mode provided in the dictionary `params` under the key 'MODE', the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_output_file('/path/to/file.txt', {'MODE': 'read'}) == 'Read content from /path/to/file.txt'\", \"assert process_output_file('/path/to/file.txt', {'MODE': 'write'}) == 'Wrote sample content to /path/to/file.txt'\", \"assert process_output_file('/path/...
{ "split": "train", "index": 85262, "acecode_id": "oss_11373", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of stellar velocities represented as floats and a redshift value. Write a function `estimate_redshift` that estimates the new redshift based on the stellar velocities. The new redshift should be calculated using the formula: new_redshift = (z + 1) * (1 + st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert estimate_redshift(2.0, [0, 0, 0]) == (2.0, 0.1, 0.1)\", \"assert estimate_redshift(0.0, [299792.458, 299792.458]) == (1.0, 0.1, 0.1)\", \"assert estimate_redshift(1.0, [0]) == (1.0, 0.1, 0.1)\", \"assert estimate_redshift(1.5, [0, 0, 0, 0]) == (1.5, 0.1, 0.1...
{ "split": "train", "index": 85263, "acecode_id": "bigcode_python_fns_35864", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that formats a given Python object into a human-readable string representation. The function should accept the following parameters: the object to be formatted (`obj`), an optional `indent` level (default is 1), an optional `width` fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_object({'key': 'value'}, indent=2, width=50, depth=2) == \\\"{'key': 'value'}\\\"\", \"assert format_object('Hello, World!', indent=1, width=80, depth=None) == \\\"'Hello, World!'\\\"\", \"assert format_object((1, 2, 3), indent=1, width=80, depth=1) =...
{ "split": "train", "index": 85264, "acecode_id": "bigcode_python_fns_12630", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple item storage system. The storage system allows you to set properties for an item using a key-value format. Your function should take two parameters: a dictionary representing the item and a key-value pair to be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_item_property({}, 'x', 10) == {'x': 10}\", \"assert set_item_property({'x': 10}, 'y', 42) == {'x': 10, 'y': 42}\", \"assert set_item_property({'x': 10, 'y': 42}, 'x', 20) == {'x': 20, 'y': 42}\", \"assert set_item_property({}, 'name', 'Alice') == {'name'...
{ "split": "train", "index": 85265, "acecode_id": "bigcode_python_fns_9743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks a given line of code for the use of a specific method. The method to be checked is 'nova.policy._ENFORCER.enforce()'. If the line of code contains this method, the function should return a tuple containing an integer 0 and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_policy_enforce('nova.policy._ENFORCER.enforce()') == (0, 'N351: nova.policy._ENFORCER.enforce() should not be used. Use the authorize() method instead.')\", \"assert check_policy_enforce('user.policy.authorize()') == None\", \"assert check_policy_enfor...
{ "split": "train", "index": 85266, "acecode_id": "bigcode_python_fns_23019", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given the coordinates of a ship defined by its starting and ending points on a grid. Your task is to implement a function `get_ship_coordinates(start: Tuple[int, int], end: Tuple[int, int]) -> List[Tuple[int, int]]` that returns a list of all the coordinates occupied by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_ship_coordinates((1, 1), (1, 3)) == [(1, 1), (1, 2), (1, 3)]\", \"assert get_ship_coordinates((2, 2), (5, 2)) == [(2, 2), (3, 2), (4, 2), (5, 2)]\", \"assert get_ship_coordinates((3, 3), (3, 5)) == [(3, 3), (3, 4), (3, 5)]\", \"assert get_ship_coordinate...
{ "split": "train", "index": 85267, "acecode_id": "oss_33331", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integer or float values and returns the index of the first occurrence of the maximum value found within the array. If the array is empty, return -1.\nPlease reason step by step, then write a self-contained Python solution. Give your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_index([4, 7, 9, 2, 10]) == 4\", \"assert find_max_index([-1, -5, -3, -4]) == 0\", \"assert find_max_index([1.5, 2.5, 3.5, 2.5]) == 2\", \"assert find_max_index([10]) == 0\", \"assert find_max_index([]) == -1\", \"assert find_max_index([0, 0, 0]) == ...
{ "split": "train", "index": 85268, "acecode_id": "evol_26895", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary that represents a file configuration with two keys: `content_type`, which is a string that can either be 'application/json' or 'text/yaml', and `content`, which can be either a string, a dictionary, or a list. Write a function `get_serialized_content(extra_fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_serialized_content({'content_type': 'application/json', 'content': {'key': 'value'}}) == '{\\\"key\\\": \\\"value\\\"}'\", \"assert get_serialized_content({'content_type': 'text/yaml', 'content': {'key': 'value'}}) == 'key: value\\\\n'\", \"assert get_se...
{ "split": "train", "index": 85269, "acecode_id": "bigcode_python_fns_49936", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string representing an HTML document, write a function `is_valid_html(html: str) -> bool` that checks if the document contains a `<div>` element with the id `storeArea`. The function should return `True` if such a `<div>` exists, and `False` otherwise. The HTML is consi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_html('<html><body><div id=\\\"storeArea\\\">Content</div></body></html>') == True\", \"assert is_valid_html('<html><body></body></html>') == False\", \"assert is_valid_html('<div id=\\\"storeArea\\\"></div>') == True\", \"assert is_valid_html('<div ...
{ "split": "train", "index": 85270, "acecode_id": "bigcode_python_fns_16455", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a potential parameter name for a function. Additionally, you are given a list of standard argument names that should not appear in the parameter list. Your task is to implement a function `validate_parameters(params:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_parameters(['a', 'b', 'c'], ['d', 'e', 'f']) == True\", \"assert validate_parameters(['x', 'y', 'z'], ['x', 'w', 'v']) == False\", \"assert validate_parameters(['param1', 'param2'], ['standard1', 'standard2']) == True\", \"assert validate_parameters...
{ "split": "train", "index": 85271, "acecode_id": "bigcode_python_fns_41843", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, you need to write a function that returns a new list containing only the even numbers from the input list. The output list should maintain the original order of the even numbers. You are to implement a function named `filter_even_numbers` that takes a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 21, 32, 43, 54]) == [10, 32, 54]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) =...
{ "split": "train", "index": 85272, "acecode_id": "oss_22686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_primes` that takes a list of integers as input and returns a generator expression that yields only the prime numbers from the input list. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(generate_primes([23, 45, 7, 18, 9, 11, 14, 39, 22])) == [23, 7, 11]\", \"assert list(generate_primes([1, 4, 6, 8, 10, 12])) == []\", \"assert list(generate_primes([2, 3, 5, 7, 11, 13])) == [2, 3, 5, 7, 11, 13]\", \"assert list(generate_primes([15, 21, 2...
{ "split": "train", "index": 85273, "acecode_id": "evol_20597", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that removes the \"http://\" or \"https://\" prefix from a given URL string. Your function should take a single string parameter representing a URL and return the URL without the \"http://\" or \"https://\" prefix, if present. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simplified_striphttp(\\\"http://www.example.com\\\") == \\\"www.example.com\\\"\", \"assert simplified_striphttp(\\\"https://subdomain.example.com\\\") == \\\"subdomain.example.com\\\"\", \"assert simplified_striphttp(\\\"ftp://ftp.example.com\\\") == \\\"ft...
{ "split": "train", "index": 85274, "acecode_id": "oss_35503", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a set of validators for a blockchain system. The function, `manage_validators`, should take two arguments: a list of validators and a list of operations. The operations can either be 'add' or 'remove', indicating whether ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_validators(['validator1', 'validator2', 'validator3'], ['add', 'add', 'remove']) == {'validator1', 'validator2'}\", \"assert manage_validators(['validator1'], ['add']) == {'validator1'}\", \"assert manage_validators(['validator1', 'validator2'], ['add...
{ "split": "train", "index": 85275, "acecode_id": "oss_28750", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of sales records, where each record is represented by a dictionary containing the following keys: 'Product' (the name of the product), 'Date' (the date of the sale in the format 'YYYY-MM-DD'), 'Revenue' (the revenue generated from the sale), and 'Units_Sold...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sales_analysis([{'Product': 'A', 'Date': '2023-01-01', 'Revenue': 100, 'Units_Sold': 10}, {'Product': 'B', 'Date': '2023-01-02', 'Revenue': 200, 'Units_Sold': 15}]) == (300, 12.5, ('B', '2023-01-02'), 200)\", \"assert sales_analysis([{'Product': 'C', 'Date':...
{ "split": "train", "index": 85276, "acecode_id": "oss_22618", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Design a Python function that verifies if all the elements in a given 2D array are in ascending order both row-wise and column-wise. The function should take a 2D list of integers as input and return True if the array is sorted in both directions, otherwise return False.\nPleas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_sorted([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == True\", \"assert is_sorted([[1, 2], [2, 3]]) == True\", \"assert is_sorted([[1, 1, 1], [1, 1, 1]]) == True\", \"assert is_sorted([[1, 3, 2], [4, 5, 6]]) == False\", \"assert is_sorted([[1, 2, 3], [5, 4, 6]]) ==...
{ "split": "train", "index": 85277, "acecode_id": "evol_30554", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing the name of a template (pc_name), implement a function that returns the path of the template as a string. The path should be the name of the template with a '.json' extension. If the template name includes a subdirectory, the function should return t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_path_from_pc_name('template1', ['templates/template1.json', 'templates/template2.json']) == 'templates/template1.json'\", \"assert get_path_from_pc_name('template2', ['templates/template1.json', 'templates/template2.json']) == 'templates/template2.json'\...
{ "split": "train", "index": 85278, "acecode_id": "bigcode_python_fns_33201", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a user object, determine if the user is a superuser. A user object is defined as a dictionary that may contain a key 'is_superuser' which is a boolean value. If the key 'is_superuser' is present and its value is True, return True. If the key is absent or its value is Fals...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_superuser({'is_superuser': True}) == True\", \"assert is_superuser({'is_superuser': False}) == False\", \"assert is_superuser({'name': 'Alice', 'is_superuser': True}) == True\", \"assert is_superuser({'name': 'Bob', 'is_superuser': False}) == False\", \"a...
{ "split": "train", "index": 85279, "acecode_id": "bigcode_python_fns_5424", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `generate_coroutine` that returns a string representing a coroutine definition. The coroutine should be formatted with indentation and include the decorator `@coroutine` placed above the function definition. The function definition should take a single para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_coroutine() == ' @coroutine\\\\n def __query(__connection):'\", \"assert generate_coroutine() == ' @coroutine\\\\n def __query(__connection):'\", \"assert generate_coroutine() == ' @coroutine\\\\n def __query(__connection):'\", \"a...
{ "split": "train", "index": 85280, "acecode_id": "bigcode_python_fns_26492", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a game development project where you need to simulate the trajectory of shots fired by a player. The game world is represented as a 2D grid, and the player can fire shots at different angles. Your task is to write a function that calculates the total number o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_good_shots(0, 5, 0, 5, 1, 3, 1, 3) == 9\", \"assert calculate_good_shots(-2, 2, -2, 2, 0, 1, 0, 1) == 4\", \"assert calculate_good_shots(0, 1, 0, 1, 0, 0, 0, 0) == 1\", \"assert calculate_good_shots(-1, 1, -1, 1, -1, 1, -1, 1) == 9\", \"assert calc...
{ "split": "train", "index": 85281, "acecode_id": "oss_8455", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with counting the number of words in a given diary entry. Write a function `count_words` that takes a string `entry` as input, representing the content of a diary entry. Your function should return an integer representing the total number of words in the entry. A...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_words('Hello world') == 2\", \"assert count_words(' Hello world ') == 2\", \"assert count_words('') == 0\", \"assert count_words(' ') == 0\", \"assert count_words('word1 word2 word3') == 3\", \"assert count_words('word') == 1\", \"assert count_w...
{ "split": "train", "index": 85282, "acecode_id": "oss_28165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings `a` and `b`, implement a function `cyclic_pattern_check(a: str, b: str) -> bool` that checks if string `b` can be obtained from string `a` by rotating `a` and then swapping adjacent characters not more than three times. The function should return `True` if it'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cyclic_pattern_check('abcd', 'abd') == False\", \"assert cyclic_pattern_check('3fef', '3ff') == False\", \"assert cyclic_pattern_check('abcdef', 'defabc') == True\", \"assert cyclic_pattern_check('xyz', 'zyx') == False\", \"assert cyclic_pattern_check('rotat...
{ "split": "train", "index": 85283, "acecode_id": "evol_29794", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the product of all prime numbers within a specified range defined by two integers, num1 and num2 (inclusive). The function should handle cases where the range includes negative numbers or zero. If there are no prime numbers in the range, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_primes(1, 10) == 210\", \"assert product_of_primes(-10, 10) == 210\", \"assert product_of_primes(0, 5) == 30\", \"assert product_of_primes(15, 15) == 1\", \"assert product_of_primes(-5, -1) == 1\", \"assert product_of_primes(2, 2) == 2\", \"assert...
{ "split": "train", "index": 85284, "acecode_id": "evol_3757", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a number, which may contain various formatting characters such as commas, periods, and spaces. Your task is to implement a function that normalizes this string based on the specified number format. The supported formats are: 'COMMA_POINT',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_number('1 234,56', 'SPACE_COMMA') == '1234.56'\", \"assert normalize_number('1,234.56', 'NONE_COMMA') == '1.234.56'\", \"assert normalize_number('1,234.56', 'UNRECOGNIZED_FORMAT') == '1,234.56'\", \"assert normalize_number('12.345,67', 'POINT_COMMA...
{ "split": "train", "index": 85285, "acecode_id": "bigcode_python_fns_5364", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Create a function `create_person` that takes in four parameters: `name` (string), `age` (integer), `occupation` (string), and `married` (string). The function should return a JSON string representing a person with the provided information. The JSON should have keys 'name', 'age...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_person('John', 35, 'Engineer', 'No') == '{\\\"name\\\": \\\"John\\\", \\\"age\\\": 35, \\\"occupation\\\": \\\"Engineer\\\", \\\"married\\\": \\\"No\\\"}'\", \"assert create_person('Alice', 28, 'Doctor', 'Yes') == '{\\\"name\\\": \\\"Alice\\\", \\\"ag...
{ "split": "train", "index": 85286, "acecode_id": "evol_30472", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with transforming a list of custom attributes into a specific format required for synchronization. The input is a list of dictionaries, where each dictionary contains two keys: 'name' and 'value'. Your job is to implement a function `transform_custom_attributes` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_custom_attributes([{'name': 'a', 'value': 'val-a'}, {'name': 'b', 'value': 'val-b'}]) == [{'name': 'a', 'value': 'val-a'}, {'name': 'b', 'value': 'val-b'}]\", \"assert transform_custom_attributes([{'name': 'x', 'value': '1'}, {'name': 'y', 'value':...
{ "split": "train", "index": 85287, "acecode_id": "oss_9984", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, implement a function `prime_factors(n)` that returns a list of all prime factors of n in ascending order. The input n will always be greater than 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_factors(30) == [2, 3, 5]\", \"assert prime_factors(17) == [17]\", \"assert prime_factors(77) == [7, 11]\", \"assert prime_factors(91) == [7, 13]\", \"assert prime_factors(14) == [2, 7]\", \"assert prime_factors(1) == []\", \"assert prime_factors(15) ==...
{ "split": "train", "index": 85288, "acecode_id": "evol_29627", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a Python function that takes two strings as input and returns a set of common alphabetical characters found in both strings. The comparison should be case-insensitive, meaning 'A' and 'a' are considered the same character. The function should ignore any non-alphabetical c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_letters('Apple123', 'Pineapple!') == {'p', 'a', 'e', 'l'}\", \"assert common_letters('hello', 'world') == {'o', 'l'}\", \"assert common_letters('abc', 'def') == set()\", \"assert common_letters('1234', '5678') == set()\", \"assert common_letters('Open...
{ "split": "train", "index": 85289, "acecode_id": "evol_6839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a proposal group, which is a collection of proposals submitted by users. Each proposal group has a unique group name and can contain multiple proposals. Implement a function `edit_proposal_group` that takes a proposal group's current name, a new nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert edit_proposal_group('test group', 'test group', ['Proposal 1'], [], []) == {'group_name': 'test group', 'proposals': ['Proposal 1']}\", \"assert edit_proposal_group('old group', 'old group', [], ['New Proposal'], []) == {'group_name': 'old group', 'proposals...
{ "split": "train", "index": 85290, "acecode_id": "oss_33889", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `pattern` and `target`, write a function `is_subset(pattern: List[int], target: List[int]) -> bool` that checks if `target` is a subset of `pattern`. A list `target` is considered a subset of `pattern` if every element in `target` exists in `pattern...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_subset([1, 2, 3, 4], [2, 3]) == True\", \"assert is_subset([1, 2, 3, 4], [2, 2]) == False\", \"assert is_subset([1, 1, 2, 3], [1, 1]) == True\", \"assert is_subset([], [1]) == False\", \"assert is_subset([5, 6, 7], []) == True\", \"assert is_subset([1, 2,...
{ "split": "train", "index": 85291, "acecode_id": "bigcode_python_fns_7830", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing face indices of a mesh and a reordering list. Your task is to return a new list of face indices that are reordered according to the provided list. The reordering list will contain unique indices that range from 0 to the length of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reindex_faces([0, 1, 2, 3], [2, 0, 3, 1]) == [2, 0, 3, 1]\", \"assert reindex_faces([5, 10, 15, 20], [3, 0, 1, 2]) == [20, 5, 10, 15]\", \"assert reindex_faces([1, 2, 3], [1, 0, 2]) == [2, 1, 3]\", \"assert reindex_faces([4, 3, 2, 1], [0, 2, 1, 3]) == [4, 2,...
{ "split": "train", "index": 85292, "acecode_id": "bigcode_python_fns_34430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of feature vectors and a list of cluster centroids. Each feature vector is a list of floating-point numbers representing normalized data points. Your task is to compute the repulsive chain loss, which is defined as the negative mean of the similarities betw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_repulsive_chain_loss([[1, 0], [0, 1]], [[1, 0], [0, 1]], [0, 1]) == -1.0\", \"assert compute_repulsive_chain_loss([[0, 1], [1, 0]], [[1, 1], [-1, -1]], [0, 1]) == -0.0\", \"assert compute_repulsive_chain_loss([[1, 0]], [[0, 1]], [0]) == -0.0\", \"ass...
{ "split": "train", "index": 85293, "acecode_id": "bigcode_python_fns_49879", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process a list of numerical data and calculate the mean and standard deviation of specified columns. Your task is to write a Python function that accomplishes this. The function should take two parameters: a list of lists where eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data([[1, 2]], [0]) == ({0: 1.0}, {0: 0.0})\", \"assert process_data([[1]], [1]) == ({}, {})\", \"assert process_data([[1, 2, 3, 4]], [0, 1, 2, 3]) == ({0: 1.0, 1: 2.0, 2: 3.0, 3: 4.0}, {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0})\", \"assert process_data([[1, ...
{ "split": "train", "index": 85294, "acecode_id": "oss_34846", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `complex_merge(strings: List[str]) -> str` that merges a given list of strings by interweaving alternating characters from each string while maintaining the order of each input string. Once the strings are merged, the function should reverse the entire conc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_merge(['a', 'b', 'c']) == 'cba'\", \"assert complex_merge(['x', 'y', 'z']) == 'zyx'\", \"assert complex_merge(['']) == ''\", \"assert complex_merge(['single']) == 'elgnis'\", \"assert complex_merge(['']) == ''\"]}" }
{ "split": "train", "index": 85295, "acecode_id": "evol_4783", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `find_pattern(text: str) -> List[str]` that takes a string as input and returns a list of all occurrences of the pattern 'xaaab' within the string. The function should use regular expressions to find the pattern. If the pattern is not found, return an empty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pattern('This text contains the xaaab pattern') == ['xaaab']\", \"assert find_pattern('No matching pattern here') == []\", \"assert find_pattern('xaaab is present at the start') == ['xaaab']\", \"assert find_pattern('multiple xaaab instances xaaab') == ...
{ "split": "train", "index": 85296, "acecode_id": "evol_31398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `download_table` that takes three parameters: `project_id`, `dataset_id`, and `table_id`. The function should return a string that indicates a successful download of the specified table from BigQuery. The returned string should be in the format: 'Table {table_i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert download_table('project1', 'dataset1', 'table1') == 'Table table1 from dataset dataset1 in project project1 downloaded successfully.'\", \"assert download_table('project2', 'dataset2', 'table2') == 'Table table2 from dataset dataset2 in project project2 down...
{ "split": "train", "index": 85297, "acecode_id": "evol_32802", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `rotate_authentication_key(new_key: bytes) -> str` that simulates rotating an account's authentication key. The function should receive a new authentication key represented as a byte sequence. The new key must be exactly 32 bytes long to be considered valid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_authentication_key(b'12345678901234567890123456789012') == 'Key rotation successful'\", \"assert rotate_authentication_key(b'1234567890123456789012345678901') == 'Invalid authentication key length'\", \"assert rotate_authentication_key(b'1234567890123...
{ "split": "train", "index": 85298, "acecode_id": "bigcode_python_fns_8134", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function for a simple note-taking application that supports the following operations: adding, viewing, deleting, and listing notes. Your function should take a list of operations and return the results of those operations. Each operation is re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_notes([{'command': 'add', 'title': 'Note1', 'content': 'Content1'}, {'command': 'view', 'title': 'Note1'}]) == ['Note added successfully.', 'Content1']\", \"assert manage_notes([{'command': 'add', 'title': 'Note2', 'content': 'Content2'}, {'command': ...
{ "split": "train", "index": 85299, "acecode_id": "oss_27815", "num_tests": 13 }