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": "Implement a function that checks if all integers in a list are below a specified threshold. The function should raise a ValueError if the threshold is non-positive or if the list is empty. The function should return True if all integers are less than the threshold, and False ot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert below_threshold([1, 2, 4, 10], 100) == True\", \"assert below_threshold([1, 20, 4, 10], 5) == False\", \"assert below_threshold([3, 5, 7], 10) == True\", \"assert below_threshold([10, 20, 30], 40) == True\", \"assert below_threshold([100, 200, 300], 400) == ...
{ "split": "train", "index": 81400, "acecode_id": "evol_17282", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates moving a game object within a defined 2D game window. The game object starts at the center of the window and can be moved to any specified position. Your function should take the current position of the object and a tar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_object((50, 50), (100, 100), (200, 200)) == (100, 100)\", \"assert move_object((50, 50), (-50, -50), (200, 200)) == (0, 0)\", \"assert move_object((50, 50), (0, 0), (200, 200)) == (0, 0)\", \"assert move_object((0, 0), (10, 10), (200, 200)) == (10, 10)\...
{ "split": "train", "index": 81401, "acecode_id": "oss_32944", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the deletion of a specific user strain from a system. The function should take a string parameter representing the name of the strain to be deleted and return that same string as a confirmation of the deletion. However, for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_strain('strain_a') == 'strain_a'\", \"assert delete_strain('strain_b') == 'strain_b'\", \"assert delete_strain('strain_c') == 'strain_c'\", \"assert delete_strain('strain_d') == 'strain_d'\", \"assert delete_strain('strain_e') == 'strain_e'\", \"asser...
{ "split": "train", "index": 81402, "acecode_id": "bigcode_python_fns_4718", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that converts a binary number (string) to its octal number (string). The function should handle invalid inputs by raising a ValueError. The binary input is a string consisting only of '0' and '1'. Return the octal representation as a string. If the input is i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_to_octal('0') == '0'\", \"assert binary_to_octal('1') == '1'\", \"assert binary_to_octal('10') == '2'\", \"assert binary_to_octal('11') == '3'\", \"assert binary_to_octal('100') == '4'\", \"assert binary_to_octal('101') == '5'\", \"assert binary_to_oc...
{ "split": "train", "index": 81403, "acecode_id": "evol_22756", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the amplitude of a melody at various points over time, write a function `local_maxima(amplitudes: List[int]) -> List[Tuple[int, int]]` that returns a list of tuples, where each tuple contains the index of a local maximum and its correspondi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert local_maxima([1, 3, 2, 4, 1]) == [(1, 3), (3, 4)]\", \"assert local_maxima([5, 1, 5, 1, 5]) == [(0, 5), (2, 5), (4, 5)]\", \"assert local_maxima([1, 3, 2, 5, 4]) == [(1, 3), (3, 5)]\", \"assert local_maxima([2, 3, 2, 3, 2]) == [(1, 3), (3, 3)]\", \"assert lo...
{ "split": "train", "index": 81404, "acecode_id": "bigcode_python_fns_30068", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Create a Python function that takes a date string in the format YYYY-MM-DD and returns the corresponding day of the week. If the input date string is invalid, the function should return an error message indicating that the date is not valid. The function should handle both vali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert day_of_week('2020-12-30') == 'Wednesday'\", \"assert day_of_week('2021-01-01') == 'Friday'\", \"assert day_of_week('2022-02-28') == 'Monday'\", \"assert day_of_week('2023-03-01') == 'Wednesday'\", \"assert day_of_week('2020-02-29') == 'Saturday'\", \"assert ...
{ "split": "train", "index": 81405, "acecode_id": "evol_23524", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a softmax selection mechanism with an added epsilon parameter for exploration. The function will take two parameters: an epsilon value and a temperature value. If the temperature is greater than zero, the function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert softmax_with_epsilon(0.1, 0.0, [1.0, 2.0, 3.0]) == [0.1, 0.1, 0.1]\", \"assert softmax_with_epsilon(0.5, 1.0, [0.0, 0.0, 0.0]) == [0.3333333333333333, 0.3333333333333333, 0.3333333333333333]\", \"assert softmax_with_epsilon(0.0, 1.0, [10.0, 10.0]) == [0.5, 0...
{ "split": "train", "index": 81406, "acecode_id": "bigcode_python_fns_34214", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing various performance metrics for a model, which includes the following keys: 'Loss', 'Accuracy', 'Precision', 'Recall', and 'F1'. Write a function that takes this dictionary as input and returns a formatted string with the values of these me...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_metrics({'Loss': 0.1, 'Accuracy': 0.95, 'Precision': 0.93, 'Recall': 0.92, 'F1': 0.925}) == 'Loss: 0.1, Accuracy: 0.95, Precision: 0.93, Recall: 0.92, F1: 0.925'\", \"assert format_metrics({'Loss': 0.5, 'Accuracy': 0.85, 'Precision': 0.80, 'Recall': 0...
{ "split": "train", "index": 81407, "acecode_id": "bigcode_python_fns_36410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `average(arr)` that takes a list of integers `arr` and returns the average of all elements in the array. The average should be calculated as the sum of the elements divided by the number of elements. If the array is empty, the function should return 0.\nPlease ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average([10, 20, 30, 40, 50]) == 30.0\", \"assert average([1, 2, 3, 4]) == 2.5\", \"assert average([-1, -2, -3]) == -2.0\", \"assert average([0, 0, 0]) == 0.0\", \"assert average([5]) == 5.0\", \"assert average([]) == 0\", \"assert average([10, 20, 30]) == 2...
{ "split": "train", "index": 81408, "acecode_id": "evol_29491", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of items, each representing a household object. Your task is to write a Python function that categorizes these items into different groups based on their first letter. The function should return a dictionary where the keys are the first letters of the items...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_items(['Apple', 'Banana', 'Apricot', '1Fruit', '@Home', 'Couch']) == {'A': ['Apple', 'Apricot'], 'B': ['Banana'], '#': ['1Fruit', '@Home'], 'C': ['Couch']}\", \"assert categorize_items(['Dog', 'Cat', 'Elephant', '1Test', 'Frog']) == {'D': ['Dog'],...
{ "split": "train", "index": 81409, "acecode_id": "oss_18800", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of non-negative integers representing the heights of vertical bars, write a function `maxRectangleArea(heights: List[int]) -> int` that calculates the area of the largest rectangle that can be formed within the histogram represented by these bars. The width of each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert maxRectangleArea([1, 1, 1, 1, 1]) == 5\", \"assert maxRectangleArea([5, 4, 1, 2]) == 8\", \"assert maxRectangleArea([0, 0, 0, 0]) == 0\", \"assert maxRectangleArea([]) == 0\", \"assert maxRectangleArea([...
{ "split": "train", "index": 81410, "acecode_id": "bigcode_python_fns_29415", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function called `classify_number` that takes an integer `n` as input and returns a string indicating whether the number is 'prime', 'composite', or 'narcissistic'. A number is called a prime if it is greater than 1 and has no divisors other than 1 and itself. A comp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_number(2) == 'prime'\", \"assert classify_number(4) == 'composite'\", \"assert classify_number(-5) == 'invalid input'\", \"assert classify_number(10) == 'composite'\", \"assert classify_number(5) == 'prime'\", \"assert classify_number(28) == 'compos...
{ "split": "train", "index": 81411, "acecode_id": "evol_1592", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing only the unique elements from the original list, while maintaining the order of their first occurrence. The function should remove duplicates but keep the first appearance of each element. The input l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, -1, 0, 1, -1]) == [1...
{ "split": "train", "index": 81412, "acecode_id": "bigcode_python_fns_30541", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tool IDs, write a function `get_tools_by_ids(tool_ids: List[int]) -> List[str]` that returns a list of tool names corresponding to the provided IDs. The function should return an empty list if no valid tool IDs are provided. Assume that the tool names are predef...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_tools_by_ids([1, 2, 3]) == ['Hammer', 'Screwdriver', 'Wrench']\", \"assert get_tools_by_ids([4, 5]) == ['Pliers', 'Saw']\", \"assert get_tools_by_ids([]) == []\", \"assert get_tools_by_ids([6]) == []\", \"assert get_tools_by_ids([1, 6, 3]) == ['Hammer', ...
{ "split": "train", "index": 81413, "acecode_id": "bigcode_python_fns_22548", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of room entries, each represented by a dictionary containing 'room_name' and 'room_id', write a function that extracts the room names and generates a dictionary where the keys are the room names and the values are the corresponding room IDs. The function should ign...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_room_dict([{'room_name': 'Conference Room', 'room_id': '101'}, {'room_name': 'Meeting Room', 'room_id': '102'}, {'room_id': '103'}]) == {'Conference Room': '101', 'Meeting Room': '102'}\", \"assert get_room_dict([{'room_name': 'Room A', 'room_id': '201'}...
{ "split": "train", "index": 81414, "acecode_id": "bigcode_python_fns_32770", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `retrieve_nested_data(data, key_list)` that retrieves specific nested data from a JSON-like dictionary structure based on a list of keys. The keys will be provided in a list in the order in which they appear in the JSON structure. If any key in the list doe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_nested_data({'a': {'b': 'value'}}, ['a', 'b']) == 'value'\", \"assert retrieve_nested_data({'a': {'b': 'value'}}, ['a']) == {'b': 'value'}\", \"assert retrieve_nested_data({'a': {'b': 'value'}}, []) == {'a': {'b': 'value'}}\", \"assert retrieve_nest...
{ "split": "train", "index": 81415, "acecode_id": "evol_1410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings, denoted as 'equations', which symbolize the relationships between variables, each string `equations[i]` is of length `4` and can be in one of two distinct forms: `a==b` or `a!=b`. In these equations, `a` and `b` are lowercase alphabets (not necessaril...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert equationsPossible([\\\"a==b\\\", \\\"b!=a\\\"]) == False\", \"assert equationsPossible([\\\"b==a\\\", \\\"a==b\\\"]) == True\", \"assert equationsPossible([\\\"a==b\\\", \\\"b==c\\\", \\\"a==c\\\"]) == True\", \"assert equationsPossible([\\\"a==b\\\", \\\"b!...
{ "split": "train", "index": 81416, "acecode_id": "evol_34618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, identify the lengthiest mutually occurring substring within them. Write a function that takes in two strings and returns the longest common substring. If there are multiple substrings of the same maximum length, return the first one found. If no common substr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_substring('Hello, world!', 'world, goodbye!') == 'world'\", \"assert longest_common_substring('abcdef', 'ghijk') == ''\", \"assert longest_common_substring('abcdxyz', 'xyzabcd') == 'abcd'\", \"assert longest_common_substring('python', 'java') ...
{ "split": "train", "index": 81417, "acecode_id": "evol_26661", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `add_and_find` that takes a list of tuples, where each tuple contains a key-value pair, and a key as input. The function should first build a dictionary from the list of tuples and then return the value corresponding to the provided key. If the key do...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_and_find([('Apple', 'Fruit'), ('Carrot', 'Vegetable')], 'Apple') == 'Fruit'\", \"assert add_and_find([('Apple', 'Fruit'), ('Carrot', 'Vegetable')], 'Carrot') == 'Vegetable'\", \"assert add_and_find([('Apple', 'Fruit'), ('Carrot', 'Vegetable')], 'Banana')...
{ "split": "train", "index": 81418, "acecode_id": "evol_575", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `juxtapose_strings(sentence1, sentence2)` that takes in two strings and returns a dictionary containing the alphabetical characters that appear at the same indices in both strings, along with their counts of occurrences. Only consider alphabetical character...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert juxtapose_strings('abc', 'xyz') == {}\", \"assert juxtapose_strings('123abc', '456abc') == {'a': 1, 'b': 1, 'c': 1}\", \"assert juxtapose_strings('aaa', 'bbb') == {}\", \"assert juxtapose_strings('', '') == {}\", \"assert juxtapose_strings('abcdef', 'abcdef'...
{ "split": "train", "index": 81419, "acecode_id": "evol_14648", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple 2D game level progression. Given a list of level maps, where each map is represented by a string containing characters that describe the terrain, implement a function `progress_levels(levels: List[str]) -> List[str]` that simulates the pl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert progress_levels(['...C...', '......', 'C......']) == ['Level 0 complete', 'Level 1 not complete', 'Level 2 complete']\", \"assert progress_levels(['.....C', 'C.....', '......C']) == ['Level 0 complete', 'Level 1 complete', 'Level 2 complete']\", \"assert pro...
{ "split": "train", "index": 81420, "acecode_id": "bigcode_python_fns_22346", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two UUIDs representing an organization and a following request, write a function `get_following_request(organization_id: str, following_id: str) -> str` that simulates retrieving a following request. The function should return a string message indicating whether the reque...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_following_request('123e4567-e89b-12d3-a456-426614174000', '123e4567-e89b-12d3-a456-426614174001') == 'Following request found for organization 123e4567-e89b-12d3-a456-426614174000 with request 123e4567-e89b-12d3-a456-426614174001.'\", \"assert get_follow...
{ "split": "train", "index": 81421, "acecode_id": "bigcode_python_fns_16886", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage and sort file paths based on their likelihood. Each file path is represented by a tuple containing a string (the path) and a float (the likelihood). Write a function `get_sorted_paths(paths, limit)` that takes a list of such...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sorted_paths([('/home/user/documents/file1.txt', 0.8), ('/home/user/documents/file2.txt', 0.6), ('/home/user/documents/file3.txt', 0.9)], 2) == ['/home/user/documents/file3.txt', '/home/user/documents/file1.txt']\", \"assert get_sorted_paths([('/home/use...
{ "split": "train", "index": 81422, "acecode_id": "oss_29789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that uses a binary search algorithm to find the index of a target element x in a sorted array arr. If the target element is not found, the function should return -1. The input array is guaranteed to be sorted in ascending order.\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5], 2) == 1\", \"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([1, 2, 3, 4, 5], 4) == 3\", \"assert binary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert bin...
{ "split": "train", "index": 81423, "acecode_id": "evol_1097", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating HTTP requests. Implement a function `simulate_request` that takes in four parameters: `method` (a string representing the HTTP method, either 'GET' or 'POST'), `path` (a string representing the request path), `data` (a string representing the data...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_request('GET', '/api/resource', None, '12345') == 'GET request to /api/resource with data: None, token: 12345'\", \"assert simulate_request('POST', '/api/resource', 'data1', '12345') == 'POST request to /api/resource with data: data1, token: 12345'\...
{ "split": "train", "index": 81424, "acecode_id": "oss_2559", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a password strength checker function. The function should evaluate the strength of a given password based on the following criteria: 1. The password must be at least 8 characters long. 2. The password must contain at least one uppercase letter, one ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert password_strength('short!') == 'weak'\", \"assert password_strength('LongPasswordThatIsWeak') == 'weak'\", \"assert password_strength('!abc123') == 'weak'\", \"assert password_strength('password123!') == 'weak'\", \"assert password_strength('!aB1') == 'weak'...
{ "split": "train", "index": 81425, "acecode_id": "oss_28270", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `open_device(device_type: str) -> dict` that simulates the process of opening a device based on its type. The function takes a string representing the device type (e.g., 'DEV_USB1', 'DEV_USB2', etc.) and returns a dictionary containing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert open_device('DEV_USB1') == {'deviceType': 'DEV_USB1', 'lptBaseAddress': 0, 'ipAddress': 0}\", \"assert open_device('DEV_USB2') == {'deviceType': 'DEV_USB2', 'lptBaseAddress': 0, 'ipAddress': 0}\", \"assert open_device('DEV_SERIAL') == {'deviceType': 'DEV_SER...
{ "split": "train", "index": 81426, "acecode_id": "bigcode_python_fns_47088", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing an annotated variable in parentheses, where the annotation is separated from the variable by a colon, implement a function `parse_annotated_variable` that returns a dictionary containing the variable and its annotation. If no annotation is present, r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_annotated_variable('(x : A)') == {'variable': 'x', 'annotation': 'A'}\", \"assert parse_annotated_variable('(y)') == {'variable': 'y', 'annotation': None}\", \"assert parse_annotated_variable('(var1 : type1)') == {'variable': 'var1', 'annotation': 'typ...
{ "split": "train", "index": 81427, "acecode_id": "bigcode_python_fns_33835", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, implement a function that calculates and returns the binary parity categorization of the integer as either 'even' or 'odd'. The binary parity is determined by counting the number of '1's in the binary representation of the integer. If the count of '1's is ev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_parity(0) == 'even'\", \"assert binary_parity(1) == 'odd'\", \"assert binary_parity(6) == 'even'\", \"assert binary_parity(7) == 'odd'\", \"assert binary_parity(12) == 'even'\", \"assert binary_parity(13) == 'odd'\", \"assert binary_parity(14) == 'odd...
{ "split": "train", "index": 81428, "acecode_id": "evol_27133", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a recursive function that returns the Fibonacci sequence up to the nth number. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. The function should return an array of the Fibo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 81429, "acecode_id": "evol_536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python decorator that measures the execution time of a function and logs the result. Your decorator should be able to handle both synchronous and asynchronous functions. You should ensure that the decorator can be used with functions that return a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert measure_execution_time(lambda x: x + 1)(5) == 6\", \"assert measure_execution_time(lambda x, y: x * y)(3, 4) == 12\", \"assert measure_execution_time(lambda x: x)(10) == 10\", \"assert measure_execution_time(lambda x, y: x + y)(2, 3) == 5\", \"assert measure...
{ "split": "train", "index": 81430, "acecode_id": "oss_32994", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of file names and a target file extension. Your task is to implement a function `filter_files_by_extension(file_list, target_extension)` that filters the list of file names and returns a new list containing only the file names that end with the specified ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_files_by_extension(['file1.cpp', 'file2.py', 'file3.cpp', 'file4.txt'], '.cpp') == ['file1.cpp', 'file3.cpp']\", \"assert filter_files_by_extension(['document.docx', 'image.png', 'presentation.pptx'], '.pptx') == ['presentation.pptx']\", \"assert filt...
{ "split": "train", "index": 81431, "acecode_id": "oss_30385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that analyzes a video file and extracts specific information about its frames. The function should take in two parameters: 'fps' (frames per second) and 'num_frames' (total number of frames), both of which are integers representing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_video(30, 300) == {'fps': 30, 'num_frames': 300}\", \"assert analyze_video(24, 1200) == {'fps': 24, 'num_frames': 1200}\", \"assert analyze_video(60, 1500) == {'fps': 60, 'num_frames': 1500}\", \"assert analyze_video(15, 450) == {'fps': 15, 'num_fram...
{ "split": "train", "index": 81432, "acecode_id": "oss_10251", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending SMS messages. The function should accept three parameters: the recipient's phone number, the sender's phone number, and the message to be sent. Your function should validate the phone numbers to ensure they are in a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_sms('+1234567890', '+0987654321', 'Hello!') == 'Message sent successfully.'\", \"assert send_sms('+1234567890', '0987654321', 'Hello!') == 'Error: Invalid from_number.'\", \"assert send_sms('1234567890', '+0987654321', 'Hello!') == 'Error: Invalid to_nu...
{ "split": "train", "index": 81433, "acecode_id": "oss_36036", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integer vectors representing reciprocal lattice vectors, where each vector is defined as a tuple of three integers (x, y, z). Your task is to implement a function that takes a list of these integer vectors and returns a new list that contains only the un...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_vectors([(1, 2, 3), (4, 5, 6), (1, 2, 3), (7, 8, 9)]) == [(1, 2, 3), (4, 5, 6), (7, 8, 9)]\", \"assert unique_vectors([(1, 1, 1), (1, 1, 1), (2, 2, 2)]) == [(1, 1, 1), (2, 2, 2)]\", \"assert unique_vectors([(0, 0, 0), (1, 1, 1), (0, 0, 0), (1, 1, 1), ...
{ "split": "train", "index": 81434, "acecode_id": "bigcode_python_fns_1865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that takes a list of action history records, where each record is represented as a dictionary. Each dictionary has the following keys: 'pk', 'response_id', 'execution_order', 'disuse_flag', 'rule_type_id', 'rule_type_name', 'rule_name', 'incident_happened', 'h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_active_records([{'pk': 1, 'disuse_flag': '0', 'status': '1'}, {'pk': 2, 'disuse_flag': '1', 'status': '2'}]) == [{'pk': 1, 'disuse_flag': '0', 'status': '1', 'is_active': True}]\", \"assert filter_active_records([{'pk': 3, 'disuse_flag': '0', 'status'...
{ "split": "train", "index": 81435, "acecode_id": "bigcode_python_fns_48001", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary representation of a user's session, implement a function that retrieves the user's ID, authentication token, user data, and authentication backend path from the session. If any of these keys are missing, return 'Anonymous User' instead. If all keys are presen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user({'session_key': 'session_value'}) == 'Anonymous User'\", \"assert get_user({'session_key': 'session_value', 'AUTH_TOKEN_SESSION_KEY': 'token_value'}) == 'Anonymous User'\", \"assert get_user({'session_key': 'session_value', 'AUTH_TOKEN_SESSION_KEY':...
{ "split": "train", "index": 81436, "acecode_id": "bigcode_python_fns_38053", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a battle ID in the form of a string. Implement a function `start_timer(battle_id: str) -> str` that returns a formatted string indicating that the timer has been started for the specified battle ID. The returned string should be in the format '{battle_id}|/timer o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_timer('battle123') == 'battle123|/timer on'\", \"assert start_timer('battle456') == 'battle456|/timer on'\", \"assert start_timer('') == '|/timer on'\", \"assert start_timer('test_battle') == 'test_battle|/timer on'\", \"assert start_timer('12345') == ...
{ "split": "train", "index": 81437, "acecode_id": "bigcode_python_fns_5569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates file paths for language model and dictionary files used in a speech recognition system based on a given username. The function should take a username as input and construct the file paths using the base directory '/D...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_file_paths('user1') == ('/DTAI_Internship/src/speech_recognizer_node/data/generated_language_model.lm', '/DTAI_Internship/src/speech_recognizer_node/data/generated_dictionary.dic')\", \"assert generate_file_paths('user2') == ('/DTAI_Internship/src/s...
{ "split": "train", "index": 81438, "acecode_id": "oss_16392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that is deprecated and needs to be replaced with a new implementation. Implement a function `add_shader(builder: str, shader: str) -> str` that takes two strings: `builder` and `shader`. The function should return a message indicating that the shader ha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_shader('builder1', 'shaderA') == 'Shader shaderA has been added to builder builder1'\", \"assert add_shader('builder2', 'shaderB') == 'Shader shaderB has been added to builder builder2'\", \"assert add_shader('builder3', 'shaderC') == 'Shader shaderC has...
{ "split": "train", "index": 81439, "acecode_id": "bigcode_python_fns_48241", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer 'subnet' representing a CIDR prefix and a boolean 'v6' indicating whether the subnet is IPv6 or IPv4, implement a function that returns the subnet mask as an integer. For IPv4, the subnet mask is a 32-bit integer, while for IPv6, it is a 128-bit integer. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_subnet_mask(24, False) == 4294967040\", \"assert get_subnet_mask(32, False) == 4294967295\", \"assert get_subnet_mask(16, False) == 4294901760\", \"assert get_subnet_mask(128, True) == 340282366920938463463374607431768211455\", \"assert get_subnet_mask(0...
{ "split": "train", "index": 81440, "acecode_id": "bigcode_python_fns_6631", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of timestamps in milliseconds to derive the time intervals between consecutive timestamps. Implement a function `derive_time_intervals(timestamps: List[int]) -> List[float]` that takes a list of integers, where each integer represents a tim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert derive_time_intervals([]) == []\", \"assert derive_time_intervals([1000]) == []\", \"assert derive_time_intervals([1000, 2000]) == [1.0]\", \"assert derive_time_intervals([1000, 3000]) == [2.0]\", \"assert derive_time_intervals([1000, 4000]) == [3.0]\", \"as...
{ "split": "train", "index": 81441, "acecode_id": "oss_31225", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a context object representing a message interaction. Your task is to implement a function that checks if the message has already been responded to. If it has not been responded to, the function should return a formatted error message indicating that a specified au...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert respond_wrong_author({'responded': False}, '@user1', True) == 'Error: The author of the message must be @user1\\\\nPlease try again'\", \"assert respond_wrong_author({'responded': True}, '@user1', True) == False\", \"assert respond_wrong_author({'responded':...
{ "split": "train", "index": 81442, "acecode_id": "bigcode_python_fns_26156", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a program number represented as an integer. Your task is to implement a function that decodes this program number into a corresponding program code represented as a string. The mapping from program numbers to program codes is predefined in a dictionary. For exampl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_number_as_code(1) == 'START'\", \"assert decode_number_as_code(2) == 'END'\", \"assert decode_number_as_code(3) == 'GOTO'\", \"assert decode_number_as_code(4) == 'UNKNOWN'\", \"assert decode_number_as_code(5) == 'UNKNOWN'\", \"assert decode_number_as_...
{ "split": "train", "index": 81443, "acecode_id": "bigcode_python_fns_7812", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of packages, where each package is represented as a list containing the names of its executables. Your task is to write a function `find_package_with_most_executables(packages: List[List[str]]) -> Tuple[str, int]` that determines which package has the highe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_package_with_most_executables([['a', 'b'], ['c']]) == ('a', 2)\", \"assert find_package_with_most_executables([[], ['a', 'b', 'c'], ['d']]) == ('a', 3)\", \"assert find_package_with_most_executables([['single']]) == ('single', 1)\", \"assert find_packag...
{ "split": "train", "index": 81444, "acecode_id": "oss_31864", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Write a function `separate_numbers` that takes an iterable of integers and separates them into two lists: one containing the even numbers and the other containing the odd numbers. The function should return a list containing both lists, where t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert separate_numbers([1, 2, 3, 4, 5]) == [[2, 4], [1, 3, 5]]\", \"assert separate_numbers([0, -1, -2, -3, -4]) == [[0, -2, -4], [-1, -3]]\", \"assert separate_numbers([10, 15, 20, 25, 30]) == [[10, 20, 30], [15, 25]]\", \"assert separate_numbers([2, 4, 6, 8, 10]...
{ "split": "train", "index": 81445, "acecode_id": "bigcode_python_fns_24051", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a given string to extract and translate any text enclosed within double curly braces, {{text_to_translate}}. Your function should replace any instance of this format with its translated version. If the text is no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_text('This is {{sample_text}} for translation') == 'This is translated_sample_text for translation'\", \"assert process_text('Hello {{world}}!') == 'Hello translated_world!'\", \"assert process_text('No translation here.') == 'No translation here.'\"...
{ "split": "train", "index": 81446, "acecode_id": "oss_20699", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Create a function that determines the maximum profit that can be achieved by buying and selling stock given an array of stock prices. You can only complete one buy and one sell operation. The function should return the maximum profit from these transactions. If no profit can be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_profit([11, 13, 8, 12, 15, 7, 10]) == 7\", \"assert max_profit([10, 9, 8, 7, 6]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([3, 2, 6, 5, 0, 3]) == 4\", \"assert max_profit([7, 1, ...
{ "split": "train", "index": 81447, "acecode_id": "evol_21720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a package structure validation for a hypothetical Python package named 'relimp'. The package should consist of multiple modules and submodules, and your function should check if the naming conventions are followed corre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert package_structure() == {'relimp_name': 'relimp.relimp', 'relimp2_name': 'relimp.relimp2', 'relimp3_name': 'relimp.relimp.relimp3'}\", \"assert package_structure()['relimp_name'] == 'relimp.relimp'\", \"assert package_structure()['relimp2_name'] == 'relimp.re...
{ "split": "train", "index": 81448, "acecode_id": "oss_16263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string consisting of alphanumeric characters and special characters, implement a function that counts the number of distinct words in the string while ignoring case sensitivity and punctuation. Additionally, for each distinct word, determine whether it is a palindrome o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_words_and_check_palindrome('Hello, World! Hello!') == {'hello': {'count': 2, 'palindrome': False}, 'world': {'count': 1, 'palindrome': False}}\", \"assert count_words_and_check_palindrome('A man, a plan, a canal: Panama!') == {'a': {'count': 3, 'palind...
{ "split": "train", "index": 81449, "acecode_id": "evol_15790", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to identify valid Docker images based on their tags. Your function should take a list of dictionaries representing Docker images as input. Each dictionary contains keys 'ID' and 'Tag'. Your goal is to return a set of IDs of images tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_valid_images([{'ID': 'image1', 'Tag': 'latest'}, {'ID': 'image2', 'Tag': '<none>'}, {'ID': 'image3', 'Tag': '1.0'}]) == {'image1', 'image3'}\", \"assert find_valid_images([{'ID': 'image1', 'Tag': '<none>'}, {'ID': 'image2', 'Tag': '<none>'}]) == set()\"...
{ "split": "train", "index": 81450, "acecode_id": "oss_17858", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with upgrading a database from version 2 to version 3 while renaming a specific asset. Your function should take three parameters: a list representing the database settings, a string representing the username, and a string for the asset to be renamed. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upgrade_db([('version', '2'), ('asset', 'BCHSV')], 'user1', 'BCHSV') == [('version', '3'), ('asset', 'BSV')]\", \"assert upgrade_db([('version', '2'), ('asset', 'BCHSV')], 'user2', 'BCH') == [('version', '3'), ('asset', 'BCHSV')]\", \"assert upgrade_db([('ve...
{ "split": "train", "index": 81451, "acecode_id": "bigcode_python_fns_7256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D grid consisting of integers, write a function `count_zeros(grid)` that returns the total number of occurrences of the integer zero in the grid. The grid is represented as a list of lists, where each inner list represents a row of the grid. Your function should handle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_zeros([[1, 0, 2], [0, 3, 0], [4, 5, 6]]) == 3\", \"assert count_zeros([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == 9\", \"assert count_zeros([[1, 2, 3], [4, 5, 6]]) == 0\", \"assert count_zeros([[], [], []]) == 0\", \"assert count_zeros([[1, 1, 1], [1, 1, 1]]...
{ "split": "train", "index": 81452, "acecode_id": "bigcode_python_fns_35619", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array A of integers, write a function `numberOfValidSubarrays(A)` that calculates the quantity of non-empty continuous subarrays that satisfy the following conditions: 1. The leftmost element of the subarray does not exceed other elements within the same subarray. 2. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numberOfValidSubarrays([1,2,3,4,5]) == 6\", \"assert numberOfValidSubarrays([2,4,6,8]) == 10\", \"assert numberOfValidSubarrays([0,0,0,0]) == 10\", \"assert numberOfValidSubarrays([4,4,4,4]) == 10\", \"assert numberOfValidSubarrays([2,2,3,3]) == 6\"]}" }
{ "split": "train", "index": 81453, "acecode_id": "evol_24484", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a floating-point number x, a float c representing the center of a distribution, a float w representing the width of the distribution, and a float h representing the height of the distribution. Write a function `analytic_pi(x: float, c: float, w: float, h: float) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(analytic_pi(0, 1, 1, 1) - 1.0) < 1e-9\", \"assert abs(analytic_pi(0, 0, 1, 1) - 0.0) < 1e-9\", \"assert abs(analytic_pi(0, 1, 1, 0) - 0.0) < 1e-9\", \"assert abs(analytic_pi(0, -1, 1, 1) - -1.0) < 1e-9\", \"assert abs(analytic_pi(0, 0.5, 1, 1) - 0.8) < 1...
{ "split": "train", "index": 81454, "acecode_id": "bigcode_python_fns_7734", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes temperature, humidity, and dewpoint data from multiple sensors. The function `process_sensor_data` takes in the number of sensors and a list of readings where each reading is a list containing temperature, humidity, and dew...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_sensor_data(1, [[25.0, 50.0, 10.0]]) == {'temperature': 25.0, 'humidity': 50.0, 'dewpoint': 10.0}\", \"assert process_sensor_data(2, [[25.0, 50.0, 10.0], [30.0, 60.0, 15.0]]) == {'temperature': 25.0, 'humidity': 50.0, 'dewpoint': 10.0, 'temperature2'...
{ "split": "train", "index": 81455, "acecode_id": "bigcode_python_fns_26529", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given two non-empty lists of integers, lst1 and lst2. Your task is to implement a function that determines whether it is possible to swap elements between these two lists in such a way that all elements in lst1 become prime numbers. The total sum of the elements in both...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swapPrimes([1, 2, 3, 4], [1, 5, 3, 4]) == 'NO'\", \"assert swapPrimes([10, 12], [7, 11]) == 'NO'\", \"assert swapPrimes([15, 18], [2, 5, 7]) == 'NO'\", \"assert swapPrimes([14, 15], [2, 3, 5]) == 'NO'\", \"assert swapPrimes([7, 9], [10, 11]) == 'NO'\", \"ass...
{ "split": "train", "index": 81456, "acecode_id": "evol_16544", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a string `symbol` and a range defined by `start_year` and `end_year`, write a function `construct_futures_symbols(symbol: str, start_year: int, end_year: int) -> List[str]` that constructs a list of futures contract codes for the specified symbol and time frame. The contr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_futures_symbols('AAPL', 2020, 2021) == ['AAPLH2020', 'AAPLM2020', 'AAPLU2020', 'AAPLZ2020', 'AAPLH2021', 'AAPLM2021', 'AAPLU2021', 'AAPLZ2021']\", \"assert construct_futures_symbols('GOOG', 2015, 2015) == ['GOOGH2015', 'GOOGM2015', 'GOOGU2015', 'GO...
{ "split": "train", "index": 81457, "acecode_id": "bigcode_python_fns_47287", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates different types of feature columns required for a machine learning model. Implement a function called `create_feature_columns` that returns a tuple containing five lists: \n1. `dense_feature_columns`: a list of numeric feat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_feature_columns() == (['videoplayseconds', 'u_read_comment_7d_sum', 'u_like_7d_sum', 'u_click_avatar_7d_sum', 'u_forward_7d_sum', 'u_comment_7d_sum', 'u_follow_7d_sum', 'u_favorite_7d_sum', 'i_read_comment_7d_sum', 'i_like_7d_sum', 'i_click_avatar_7d_...
{ "split": "train", "index": 81458, "acecode_id": "bigcode_python_fns_23423", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings and returns a single string formed by joining the input strings with a specified separator. Implement a function `join_with_separator` that takes a list of strings `lines` and a string `separator` as input and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert join_with_separator(['Hello', 'World', 'Python'], '\\\\n') == 'Hello\\\\nWorld\\\\nPython'\", \"assert join_with_separator(['Line1', 'Line2', 'Line3'], '---') == 'Line1---Line2---Line3'\", \"assert join_with_separator(['A', 'B', 'C'], ', ') == 'A, B, C'\", \...
{ "split": "train", "index": 81459, "acecode_id": "oss_25864", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `milliseconds`, convert it into a timestamp format 'HH:MM:SS,mmm'. The timestamp should be formatted in two-digit hours, two-digit minutes, two-digit seconds, and three-digit milliseconds. If the input milliseconds is negative, treat it as 0. If the input milli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ms_to_timestamp(0) == '00:00:00,000'\", \"assert ms_to_timestamp(500) == '00:00:00,500'\", \"assert ms_to_timestamp(1000) == '00:00:01,000'\", \"assert ms_to_timestamp(61000) == '00:01:01,000'\", \"assert ms_to_timestamp(3600000) == '01:00:00,000'\", \"asser...
{ "split": "train", "index": 81460, "acecode_id": "bigcode_python_fns_33876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary where the keys are strings formatted as 'Ni', where 'N' is a letter (a-z or A-Z) and 'i' is a non-negative integer, write a function that returns a list of the keys sorted in ascending order based on the integer part. If two keys have the same integer part, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sorted_keys({'A1': 0, 'A10': 1, 'A2': 2}) == ['A1', 'A2', 'A10']\", \"assert get_sorted_keys({'C2': 3, 'C1': 1}) == ['C1', 'C2']\", \"assert get_sorted_keys({'B2': 1, 'B1': 2, 'A1': 0}) == ['A1', 'B1', 'B2']\", \"assert get_sorted_keys({'A5': 5, 'A3': 3,...
{ "split": "train", "index": 81461, "acecode_id": "bigcode_python_fns_17933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_complex_number(real: int, imag: int) -> str` that takes two integers representing the real and imaginary parts of a complex number and returns a string representation of the complex number in the format 'real + imagi'. If the imaginary part is negat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_complex_number(1, 2) == '1 + 2i'\", \"assert create_complex_number(3, -4) == '3 - 4i'\", \"assert create_complex_number(0, 0) == '0 + 0i'\", \"assert create_complex_number(-5, 5) == '-5 + 5i'\", \"assert create_complex_number(-1, -1) == '-1 - 1i'\", \...
{ "split": "train", "index": 81462, "acecode_id": "evol_18254", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to perform a binary search on a sorted list of integers. The function should take a sorted list of integers and a target integer as inputs. If the target integer is found in the list, the function should return a message indicating th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == '3 found at index 2'\", \"assert binary_search([1, 2, 3, 4, 5], 6) == '6 not found in the list'\", \"assert binary_search([10, 20, 30, 40, 50], 20) == '20 found at index 1'\", \"assert binary_search([10, 20, 30, 40, 50], ...
{ "split": "train", "index": 81463, "acecode_id": "oss_37173", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that generates a new list where each element is calculated using the formula 3*x - 5 for each integer x in the input list. The function should take the list as input and return the new list of computed values.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_numbers([1]) == [-2]\", \"assert generate_numbers([2]) == [1]\", \"assert generate_numbers([5]) == [10]\", \"assert generate_numbers([8]) == [19]\", \"assert generate_numbers([0]) == [-5]\", \"assert generate_numbers([-1]) == [-8]\", \"assert genera...
{ "split": "train", "index": 81464, "acecode_id": "evol_25573", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple Rule Engine that can store rules and match them based on given tags. Each rule consists of an action and a set of optional tags. Your goal is to implement a function `match_rules(rules, *tags)` that takes a list of rules and a variable ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match_rules([{'action': 'action1', 'tags': ['tag1', 'tag2']}, {'action': 'action2', 'tags': ['tag2', 'tag3']}], 'tag1', 'tag3') == ['action1', 'action2']\", \"assert match_rules([{'action': 'action1', 'tags': ['tag1', 'tag2']}, {'action': 'action2', 'tags': ...
{ "split": "train", "index": 81465, "acecode_id": "oss_1951", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of floats, implement a function that determines the 5th smallest number without using any built-in sorting methods. You must create a custom implementation using only conditional statements and loops. The array may contain duplicate values.\nPlease reason step by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_5th_smallest_number([3.5, 2.7, 8.9, 1.1, 9.2, 2.3, 5.6, 7.1, 4.2, 0.5, 1.9, 8.4, 7.5]) == 2.7\", \"assert find_5th_smallest_number([10.1, 10.2, 10.3, 10.4, 10.5]) == 10.5\", \"assert find_5th_smallest_number([1.5, 2.5, 3.5, 4.5, 5.5, 6.5]) == 5.5\", \"a...
{ "split": "train", "index": 81466, "acecode_id": "evol_34330", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given two numbers, a and b, implement a function that calculates the result of the mathematical expression defined as: g(a,b) = 2*a^2 + 3*b^3. Your function should correctly handle both real and complex numbers as inputs. Return the resulting value as a complex number if either...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert g(1, 1) == 5\", \"assert g(0, 0) == 0\", \"assert g(-1, -1) == -1\", \"assert g(4, 0) == 32\", \"assert g(0, 5) == 375\", \"assert g(0, 5+0j) == 375\", \"assert g(1.0, 1.0) == 5.0\"]}" }
{ "split": "train", "index": 81467, "acecode_id": "evol_32131", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function to find the greatest of three distinct integers. The function should take three integers as input parameters and return the greatest of them.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_greatest(3, 7, 4) == 7\", \"assert find_greatest(10, 5, 2) == 10\", \"assert find_greatest(-1, -5, -3) == -1\", \"assert find_greatest(0, 0, 0) == 0\", \"assert find_greatest(1, 2, 3) == 3\", \"assert find_greatest(-10, -20, -5) == -5\", \"assert find_g...
{ "split": "train", "index": 81468, "acecode_id": "evol_8627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates user registration data based on specific criteria. The function should take four parameters: `username`, `email`, `password`, and `passwordConf`. It should check the following conditions: 1. All fields must be filled ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_registration('user_name', 'user@example.com', 'password123', 'password123') == 'Registration successful'\", \"assert validate_registration('', 'user@example.com', 'password123', 'password123') == 'Please fill out all the fields'\", \"assert validate...
{ "split": "train", "index": 81469, "acecode_id": "bigcode_python_fns_22931", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Develop a Python function that identifies Fibonacci numbers from a list of integers. The function should handle exceptions for non-numeric inputs, empty lists, and lists with more than 10,000 elements. The output should be a pair: the first element is a list of Fibonacci number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_fibonacci_numbers([13, 21, 34, 55]) == ([13, 21, 34, 55], 123)\", \"assert find_fibonacci_numbers([-1, -5, 8, 13, 22]) == ([8, 13], 21)\", \"assert find_fibonacci_numbers([144, 233, 377]) == ([144, 233, 377], 754)\", \"assert find_fibonacci_numbers([0, ...
{ "split": "train", "index": 81470, "acecode_id": "evol_11361", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function `sumArray(arr)` that returns the cumulative total of all the integers in the array. The function should take a single parameter, `arr`, which is a list of integers. Do not use any external libraries or resources.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sumArray([1, 5, 8, 4, 2]) == 20\", \"assert sumArray([0, 0, 0, 0]) == 0\", \"assert sumArray([-1, -2, -3]) == -6\", \"assert sumArray([10, 20, 30]) == 60\", \"assert sumArray([5]) == 5\", \"assert sumArray([]) == 0\", \"assert sumArray([100, 200, 300, 400]) ...
{ "split": "train", "index": 81471, "acecode_id": "evol_31572", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list containing only the unique integers from the input list, preserving the order of their first occurrence. The function should also handle the case when the input li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1]) == [1]\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique...
{ "split": "train", "index": 81472, "acecode_id": "bigcode_python_fns_31161", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the drawing of clouds on a 2D coordinate system defined by a grid. Each cloud is represented by an oval shape. Write a function `draw_clouds()` that takes no parameters and returns a list of tuples. Each tuple should repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_clouds() == [(70, 150), (170, 100), (270, 10), (700, 160), (500, 70)]\", \"assert len(draw_clouds()) == 5\", \"assert draw_clouds()[0] == (70, 150)\", \"assert draw_clouds()[1] == (170, 100)\", \"assert draw_clouds()[2] == (270, 10)\", \"assert draw_clo...
{ "split": "train", "index": 81473, "acecode_id": "bigcode_python_fns_24281", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `min_max_normalise(lst)` that takes a list of mixed data types and normalizes all numerical values to a range of 0 to 1. The function should exclude non-numerical data types and handle missing or NaN values appropriately. If the minimum and maximum values i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_max_normalise([1, 2, 3, 4, 5]) == [0.0, 0.25, 0.5, 0.75, 1.0]\", \"assert min_max_normalise([3, 3, 3]) == [0.0, 0.0, 0.0]\", \"assert min_max_normalise([1, 2, None, 4, 'a', 5]) == [0.0, 0.25, 0.75, 1.0]\", \"assert min_max_normalise([]) == []\", \"assert...
{ "split": "train", "index": 81474, "acecode_id": "evol_16898", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that substitutes each occurrence of the character 'a' with the character 'o' in the supplied string. The function should take a single string as input and return the modified string.\nPlease reason step by step, then write a self-contained Python solution. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert substitute_a_with_o('apple') == 'opple'\", \"assert substitute_a_with_o('banana') == 'bonono'\", \"assert substitute_a_with_o('cat') == 'cot'\", \"assert substitute_a_with_o('data') == 'doto'\", \"assert substitute_a_with_o('grape') == 'grope'\", \"assert su...
{ "split": "train", "index": 81475, "acecode_id": "evol_9435", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that compares two cross-validation scores: `score_10cv` and `score_90lccv`. The comparison is based on a predefined threshold `r` and a tolerance value `tol`. If `score_90lccv` is NaN (not a number), the function should return True if `score_10c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_cross_validation_scores(0.8, float('nan'), 0.5, 0.1) == True\", \"assert compare_cross_validation_scores(0.6, 0.5, 0.5, 0.1) == True\", \"assert compare_cross_validation_scores(0.5, 0.5, 0.5, 0.1) == True\", \"assert compare_cross_validation_scores(0...
{ "split": "train", "index": 81476, "acecode_id": "oss_14713", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of strings and a list of substrings. Your task is to implement a function that filters the list of strings by removing any strings that contain any of the substrings from the second list. Write a function `filter_strings(string_list: List[str], substrings: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_strings(['cat', 'dog', 'fish', 'bird'], ['cat', 'fish']) == ['dog', 'bird']\", \"assert filter_strings(['python', 'java', 'c++', 'javascript'], ['py', 'java']) == ['c++']\", \"assert filter_strings(['one', 'two', 'three', 'four'], ['five', 'six']) == ...
{ "split": "train", "index": 81477, "acecode_id": "bigcode_python_fns_35791", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a Python dictionary `bo_dict` containing various parameters for a machine learning model, write a function `process_model_params(bo_dict)` that extracts specific information from this dictionary and returns a tuple with the following elements: 1. The value associated with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_model_params({'depth': 80, 'kldloss': False, 'layers': (10,), 'blocks': ('D',), 'slink': ('A',)}) == (80, 'KLD Loss Disabled', (10,), ('D',), ('A',))\", \"assert process_model_params({'depth': 50, 'kldloss': True, 'layers': (20, 30), 'blocks': ('X', ...
{ "split": "train", "index": 81478, "acecode_id": "oss_36252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three arrays of integers, write a function that returns a list of elements that are present in all three arrays. The output list should contain unique elements and be sorted in ascending order. Each input array can have duplicates, but the output should only include disti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_elements([2, 3, 4, 2, 7], [1, 2, 5, 4], [2, 4, 6, 7]) == [2, 4]\", \"assert common_elements([1, 2, 3], [4, 5, 6], [7, 8, 9]) == []\", \"assert common_elements([1, 1, 1], [1, 1, 1], [1, 1, 1]) == [1]\", \"assert common_elements([1, 2, 3], [3, 4, 5], [5...
{ "split": "train", "index": 81479, "acecode_id": "evol_11757", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, floating-point numbers, and negative numbers, write a function to determine whether the array is a palindrome. A palindrome is defined as a sequence that reads the same backward as forward. Your function should return True if the array is a palindrom...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome([1, -2, 3.5, -2, 1]) == True\", \"assert is_palindrome([1, 2, 3, 4, 5]) == False\", \"assert is_palindrome([3.5, -2, -2, 3.5]) == True\", \"assert is_palindrome([1, 1, 1, 1]) == True\", \"assert is_palindrome([-1, -2, -3, -2, -1]) == True\", \"...
{ "split": "train", "index": 81480, "acecode_id": "evol_34887", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing student data from a structured input list, where each student is represented by a dictionary containing their university number, name, email, and role. Your goal is to categorize students into three groups based on the following criteria: 1) Creat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_students([{'number': 's123', 'name': 'Alice', 'email': 'alice@example.com', 'role': 'student'}, {'number': 's456', 'name': 'Bob', 'email': 'bob@example.com', 'role': 'student'}], 1) == {'created': [['Alice', 's123'], ['Bob', 's456']], 'studying': [],...
{ "split": "train", "index": 81481, "acecode_id": "bigcode_python_fns_37890", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and a target integer as inputs. The function should return a list of pairs of integers from the input list that sum up to the target integer. Each pair should be represented as a tuple. If no pairs are fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pairs_with_sum([1, 2, 3, 4, 3], 6) == [(2, 4), (3, 3)]\", \"assert find_pairs_with_sum([1, 2, 3, 4, 5], 10) == []\", \"assert find_pairs_with_sum([], 0) == []\", \"assert find_pairs_with_sum([0, 0, 0, 0], 0) == [(0, 0)]\", \"assert find_pairs_with_sum([...
{ "split": "train", "index": 81482, "acecode_id": "bigcode_python_fns_1793", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given two strings, `repo_owner` and `repo_name`, create a function that returns a dictionary representing a GitHub repository with the keys 'owner' and 'name'. The value for 'owner' should be the input `repo_owner` and the value for 'name' should be the input `repo_name`. Imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_github_repository('user123', 'repo456') == {'owner': 'user123', 'name': 'repo456'}\", \"assert create_github_repository('octocat', 'Hello-World') == {'owner': 'octocat', 'name': 'Hello-World'}\", \"assert create_github_repository('johnDoe', 'my-repo')...
{ "split": "train", "index": 81483, "acecode_id": "bigcode_python_fns_38430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two agents, where each agent can have multiple capabilities. Your task is to implement a function that allows one agent to call a method of another agent if it has the necessary capabilities. Write a function `can_agent_call_method(agent1_capabilities: List[str], ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_agent_call_method(['can_call_foo'], ['can_call_foo', 'can_call_foo2'], ['can_call_foo', 'can_call_foo2'], 42) == 42\", \"assert can_agent_call_method(['can_call_foo'], ['can_call_foo'], ['can_call_foo', 'can_call_foo2'], 10) == -1\", \"assert can_agent_c...
{ "split": "train", "index": 81484, "acecode_id": "bigcode_python_fns_16701", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a representation of a 3D diamond shape using a list of 3D points. Each diamond is defined by five vertices: the four corners of a square base and one vertex at the top. The points are defined in a 3D coordinate system as fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_diamond() == [[(-1.0, -1.0, 0.0), (1.0, -1.0, 0.0), (0.0, 0.0, 1.0)], [(1.0, -1.0, 0.0), (1.0, 1.0, 0.0), (0.0, 0.0, 1.0)], [(1.0, 1.0, 0.0), (-1.0, 1.0, 0.0), (0.0, 0.0, 1.0)], [(-1.0, 1.0, 0.0), (-1.0, -1.0, 0.0), (0.0, 0.0, 1.0)], [(1.0, -1.0, 0.0)...
{ "split": "train", "index": 81485, "acecode_id": "bigcode_python_fns_9168", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with determining if a collection of energy spectra is missing any specific absorption indices for a given element in a crystal structure. Each spectrum consists of an absorbing element and its corresponding absorption index. The crystal structure provides a metho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_missing_absorption_indices([('O', 1), ('O', 2)], {'O': [1, 2, 3], 'Si': [4, 5]}) == True\", \"assert is_missing_absorption_indices([('Si', 5)], {'O': [1, 2], 'Si': [4, 5]}) == True\", \"assert is_missing_absorption_indices([('O', 3), ('O', 4)], {'O': [1, ...
{ "split": "train", "index": 81486, "acecode_id": "bigcode_python_fns_5965", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given three floating-point numbers delta, S, and V, write a function that calculates the leverage of an option. The leverage is defined as the product of delta and the ratio of S to V. Implement a function `calculate_leverage(delta: float, S: float, V: float) -> float` that ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_leverage(0.5, 100, 200) == 0.25\", \"assert calculate_leverage(1.0, 200, 100) == 2.0\", \"assert calculate_leverage(0.0, 50, 150) == 0.0\", \"assert calculate_leverage(-0.5, 100, 200) == -0.25\", \"assert calculate_leverage(0.75, 150, 300) == 0.375...
{ "split": "train", "index": 81487, "acecode_id": "bigcode_python_fns_44261", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that calculates the total count of all integer elements in a nested list, regardless of how deeply they are nested. The function should handle lists that can contain other lists as elements. The function should return an integer representing the tota...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_nested_integers([1, 2, 3]) == 3\", \"assert count_nested_integers([1, [2, 3], 4]) == 4\", \"assert count_nested_integers([[1], [2], [3]]) == 3\", \"assert count_nested_integers([[[1]]]) == 1\", \"assert count_nested_integers([[], [], []]) == 0\", \"ass...
{ "split": "train", "index": 81488, "acecode_id": "evol_28636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of numbers (both integers and floating-point) as input and returns the sum, average, and median of the list. The function should format the output such that the sum, average, and median are returned as a dictionary with keys 'sum', 'ave...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_and_display([1.5, 2, 3.6, 4, 5.5]) == {'sum': 16.6, 'average': 3.32, 'median': 3.6}\", \"assert calculate_and_display([10, 20, 30]) == {'sum': 60, 'average': 20.0, 'median': 20}\", \"assert calculate_and_display([-1, -2, -3, -4, -5]) == {'sum': -15...
{ "split": "train", "index": 81489, "acecode_id": "evol_4425", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of assembly summaries, where each summary is represented as a dictionary containing information about the submission date and other details. Each dictionary has the following structure: {'name': str, 'submissiondate': str}. The 'submissiondate' is formatted...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_recent_assembly([{'name': 'Assembly A', 'submissiondate': '2023-10-01'}, {'name': 'Assembly B', 'submissiondate': '2023-09-30'}]) == {'name': 'Assembly A', 'submissiondate': '2023-10-01'}\", \"assert most_recent_assembly([{'name': 'Assembly C', 'submiss...
{ "split": "train", "index": 81490, "acecode_id": "bigcode_python_fns_31841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of user profiles and need to implement a function that checks if a user has an associated profile. Write a function `check_profile_association(user_id: int, profiles: List[Tuple[int, int]]) -> bool` that takes a user ID and a list of profiles represented as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_profile_association(1, [(1, 101), (2, 102), (3, 103)]) == True\", \"assert check_profile_association(2, [(1, 101), (2, 102), (3, 103)]) == True\", \"assert check_profile_association(3, [(1, 101), (2, 102), (3, 103)]) == True\", \"assert check_profile_a...
{ "split": "train", "index": 81491, "acecode_id": "bigcode_python_fns_21217", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple request handler for a server application. The function should take a single string input representing a request and return an appropriate response based on the content of the request. If the request is 'Hello',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_request('Hello') == 'Hi there!'\", \"assert handle_request('Goodbye') == 'Invalid request'\", \"assert handle_request('Hi') == 'Invalid request'\", \"assert handle_request('Hello, server!') == 'Invalid request'\", \"assert handle_request('') == 'Inval...
{ "split": "train", "index": 81492, "acecode_id": "oss_5780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that extracts and returns a dictionary of job resource requirements from given parameters. The parameters are provided as a dictionary with keys representing different resource requirements. Your function should return a new dictionary th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_job_resources({'min_cores': 2, 'min_ram': 4096, 'machine_type': 'n1-standard-1'}) == {'min_cores': 2, 'min_ram': 4096, 'machine_type': 'n1-standard-1'}\", \"assert extract_job_resources({'disk_size': 100, 'disk_type': 'SSD'}) == {'disk_size': 100, 'd...
{ "split": "train", "index": 81493, "acecode_id": "bigcode_python_fns_35209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers representing the number of occurrences of a specific event, where each integer corresponds to a unique time point. Your task is to implement a function 'gamma_map' that takes in three parameters: 'event_counts' (a list of integers), 'threshold...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gamma_map([1, 3, 5, 2, 4], 2, 1) == [1, 2, 4]\", \"assert gamma_map([0, 0, 0, 0, 0], 1, 0.1) == []\", \"assert gamma_map([10, 20, 30, 40, 50], 30, 5) == [3, 4]\", \"assert gamma_map([10, 20, 30, 40, 50], 60, 5) == []\", \"assert gamma_map([5, 5, 5, 5], 6, 0)...
{ "split": "train", "index": 81494, "acecode_id": "bigcode_python_fns_32027", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the process of transferring a file over a network connection. Your goal is to create a function `file_transfer_progress` that takes in two parameters: `total_bytes` (an integer representing the total size of the file in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_transfer_progress(1000, 500) == 50.0\", \"assert file_transfer_progress(2000, 2000) == 100.0\", \"assert file_transfer_progress(0, 0) == 0.0\", \"assert file_transfer_progress(100, 0) == 0.0\", \"assert file_transfer_progress(100, 100) == 100.0\", \"ass...
{ "split": "train", "index": 81495, "acecode_id": "oss_5030", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a series of games. Write a function `find_highest_score(scores)` that takes in a list of integers `scores` (1 <= len(scores) <= 100) representing the scores of the games. The function should return the highest score ac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_highest_score([72, 89, 65, 102, 78]) == 102\", \"assert find_highest_score([1, 2, 3, 4, 5]) == 5\", \"assert find_highest_score([100, 200, 300]) == 300\", \"assert find_highest_score([-1, -5, -3]) == -1\", \"assert find_highest_score([0]) == 0\", \"asse...
{ "split": "train", "index": 81496, "acecode_id": "oss_12824", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the absolute value of the product of a constant and an angle represented as a string. The function should take in a constant `kp` and a string `yaw_error_state` representing an angle in degrees (for example, '30°'). Yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_abs_product(2.5, '45\\u00b0') == 112.5\", \"assert calculate_abs_product(1.0, '90\\u00b0') == 90.0\", \"assert calculate_abs_product(3.0, '-30\\u00b0') == 90.0\", \"assert calculate_abs_product(0.0, '180\\u00b0') == 0.0\", \"assert calculate_abs_pr...
{ "split": "train", "index": 81497, "acecode_id": "oss_14335", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function `find_palindromes` that returns a new list containing only the strings that are palindromes. A palindrome is defined as a word that reads the same forward and backward, ignoring case and spaces. For example, if the input list is `['...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_palindromes(['radar', 'hello', 'level', 'world', 'Anna']) == ['radar', 'level', 'Anna']\", \"assert find_palindromes(['racecar', 'civic', 'deified', 'hello', 'world']) == ['racecar', 'civic', 'deified']\", \"assert find_palindromes(['noon', 'test', 'rot...
{ "split": "train", "index": 81498, "acecode_id": "oss_0", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a list of n Fibonacci numbers. The function should accept an integer n and a string parameter 'modification'. If 'modification' is set to 'standard', the function should return the standard Fibonacci sequence. If 'modification' is 'modified',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_generator(5, 'standard') == [0, 1, 1, 2, 3]\", \"assert fibonacci_generator(5, 'modified') == [0, 1, 1, 2, 4]\", \"assert fibonacci_generator(1, 'standard') == [0]\", \"assert fibonacci_generator(1, 'modified') == [0]\", \"assert fibonacci_generato...
{ "split": "train", "index": 81499, "acecode_id": "evol_12785", "num_tests": 16 }