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": "Given a 2D grid represented as a list of lists, write a function `get_shape` that returns the shape of the grid as a tuple. The shape is defined as the number of unique values in each column of the grid. The input grid will contain integers. For example, a grid with 3 rows and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_shape([[1, 1], [1, 1]]) == (1, 1)\", \"assert get_shape([[1, 2, 3], [1, 2, 3], [1, 2, 3]]) == (1, 1, 1)\", \"assert get_shape([[0, 1], [1, 0], [0, 1]]) == (2, 2)\", \"assert get_shape([]) == (0, 0)\", \"assert get_shape([[1, 1, 1], [1, 1, 1]]) == (1, 1, ... | {
"split": "train",
"index": 61700,
"acecode_id": "bigcode_python_fns_19014",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a grid represented as a dictionary with the following structure: {'nodes': [...], 'edges': [...], 'faces': [...]}. Each key contains a list of identifiers for nodes, edges, and faces. Your task is to implement a function `get_grid_face_count(grid)` that takes this... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_grid_face_count({'nodes': [1, 2, 3], 'edges': [1, 2], 'faces': [1, 2, 3]}) == 3\", \"assert get_grid_face_count({'nodes': [], 'edges': [], 'faces': []}) == 0\", \"assert get_grid_face_count({'nodes': [1], 'edges': [1], 'faces': [1]}) == 1\", \"assert get... | {
"split": "train",
"index": 61701,
"acecode_id": "oss_3134",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple logging mechanism for a web application. Create a function `log_error(message: str) -> None` that takes an error message as input and logs it to a list. The log should ensure that no duplicate messages are stored. If the message is alre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_error('Error 404: Not Found') is None\", \"assert log_error('Error 500: Internal Server Error') is None\", \"assert log_error('Warning: Low Disk Space') is None\", \"assert log_error('Error 404: Not Found') is None\", \"assert log_error('Error 403: Forbi... | {
"split": "train",
"index": 61702,
"acecode_id": "evol_1458",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('12321') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') ... | {
"split": "train",
"index": 61703,
"acecode_id": "oss_31197",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple chatbot that responds to user input based on predefined keywords and phrases. Implement a function that takes a string input from the user and returns a corresponding response based on the following rules: \n\n- If the input contains the wo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_response('Hello') == 'Hi there! How can I assist you today?'\", \"assert generate_response('bye') == 'Goodbye! Have a great day!'\", \"assert generate_response('HELP') == 'Sure! What do you need help with?'\", \"assert generate_response('hElLo') == ... | {
"split": "train",
"index": 61704,
"acecode_id": "oss_12960",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of strings representing manufacturers and their associated tags. Each string contains the manufacturer's name followed by a series of tags, separated by whitespace. Your goal is to extract the manufacturer's name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_manufacturer_names(['Nike sports running', 'Adidas casual shoes', ' Puma fitness apparel ']) == ['Nike', 'Adidas', 'Puma']\", \"assert extract_manufacturer_names(['Apple electronics gadgets', 'Samsung home appliances']) == ['Apple', 'Samsung']\... | {
"split": "train",
"index": 61705,
"acecode_id": "oss_31893",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the average pixel value of a specific region within an image represented as a 2D array of pixel values. The region of interest is defined by a set of positions, where each position consists of a row and column coordinate ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_region_value([[1, 2, 3], [4, 5, 6], [7, 8, 9]], [(0, 0), (1, 1)]) == 3.0\", \"assert calculate_average_region_value([[10, 20], [30, 40]], [(0, 1), (1, 0)]) == 25.0\", \"assert calculate_average_region_value([[5]], [(0, 0)]) == 5.0\", \"asse... | {
"split": "train",
"index": 61706,
"acecode_id": "oss_34087",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a 3D matrix filled with 0s and 1s, write a function `updateMatrix(matrix)` that returns a new 3D matrix where each cell contains the distance to the nearest 0. The distance is defined as the number of cells you have to traverse to get from the cell to the nearest 0 in any... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert updateMatrix([[[0,0,0],[0,1,0],[0,0,0]], [[0,0,0],[0,1,0],[0,0,0]]]) == [[[0,0,0],[0,1,0],[0,0,0]], [[0,0,0],[0,1,0],[0,0,0]]]\", \"assert updateMatrix([[[0,0],[0,0]], [[0,0],[0,0]]]) == [[[0,0],[0,0]], [[0,0],[0,0]]]\", \"assert updateMatrix([[[1,1,1],[1,1,... | {
"split": "train",
"index": 61707,
"acecode_id": "evol_4009",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the Least Common Multiple (LCM) for two integers (x, y) using an efficient algorithm. The LCM of two integers is the smallest positive integer that is divisible by both numbers. You must ensure that your implementation adheres to the constrain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm(4, 6) == 12\", \"assert lcm(21, 14) == 42\", \"assert lcm(10, 25) == 50\", \"assert lcm(12, 15) == 60\", \"assert lcm(9, 3) == 9\", \"assert lcm(1, 1) == 1\", \"assert lcm(5, 10) == 10\", \"assert lcm(8, 12) == 24\", \"assert lcm(7, 3) == 21\", \"assert ... | {
"split": "train",
"index": 61708,
"acecode_id": "evol_9035",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that generates all possible combinations of binary strings of length n. A binary string is a sequence composed of characters '0' and '1'. The function should return a list containing all unique binary strings of length n, in lexicographical ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_binary_strings(1) == ['0', '1']\", \"assert generate_binary_strings(2) == ['00', '01', '10', '11']\", \"assert generate_binary_strings(3) == ['000', '001', '010', '011', '100', '101', '110', '111']\", \"assert generate_binary_strings(4) == ['0000', ... | {
"split": "train",
"index": 61709,
"acecode_id": "bigcode_python_fns_33118",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string input representing a unique identifier (UUID) and returns a response indicating whether the UUID is valid or not. A valid UUID must follow the standard 8-4-4-4-12 hexadecimal format (i.e., 8 characters followed by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_uuid('123e4567-e89b-12d3-a456-426614174000') == 'valid'\", \"assert validate_uuid('123E4567-E89B-12D3-A456-426614174000') == 'valid'\", \"assert validate_uuid('123e4567e89b12d3a456426614174000') == 'invalid'\", \"assert validate_uuid('123e4567-e89b-... | {
"split": "train",
"index": 61710,
"acecode_id": "bigcode_python_fns_22161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that connects to an event processing system. The function should accept an optional parameter `channel_name` which represents the name of the events channel to connect to. If the `channel_name` is provided, the function should log a messa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect_to_event_channel('test_channel') == 'Connection established to test_channel'\", \"assert connect_to_event_channel() == 'Connection established to default_channel'\", \"assert connect_to_event_channel('') == 'Connection established to default_channel'... | {
"split": "train",
"index": 61711,
"acecode_id": "bigcode_python_fns_27182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a connection object (conn) with several attributes that define its behavior. Your task is to implement a function `test_connection_properties(loop, conn)` that checks the following properties of the connection object: 1. The attribute 'loop' of conn should match t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_connection_properties('event_loop', MockConnection('event_loop', 5, False, False, '', None, str)) == True\", \"assert test_connection_properties('event_loop', MockConnection('event_loop', 5, True, False, '', None, str)) == False\", \"assert test_connect... | {
"split": "train",
"index": 61712,
"acecode_id": "bigcode_python_fns_30904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of authors, each represented by a dictionary containing their name, age, country, email, and website. Your task is to write a function that takes this list and returns a list of only those authors who are from a specified country and whose age is not empty.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_authors([{'name': 'Alice', 'age': '30', 'country': 'USA', 'email': 'alice@example.com', 'website': 'http://alice.com'}, {'name': 'Bob', 'age': '', 'country': 'USA', 'email': 'bob@example.com', 'website': 'http://bob.com'}, {'name': 'Charlie', 'age': '... | {
"split": "train",
"index": 61713,
"acecode_id": "oss_37224",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `find_substrings` that takes three parameters: a list of strings (`string_list`), a substring (`sub_string`), and an optional boolean parameter (`case_sensitive`). The function should return a list of all strings in `string_list` that contain the subs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_substrings([], 'test') == 'No strings to search.'\", \"assert find_substrings(['abc', 'def'], '') == 'No substring provided.'\", \"assert find_substrings(['hello', 'world'], 'o') == ['hello', 'world']\", \"assert find_substrings(['hello', 'hello'], 'hel... | {
"split": "train",
"index": 61714,
"acecode_id": "evol_12803",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns the largest subset where each element in the subset is divisible by at least one other element in the subset. Ensure to handle cases where the input is not a list or contains non-integer values. If the input is vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_divisible_subset([1, 2, 4, 8]) == [1, 2, 4, 8]\", \"assert largest_divisible_subset([3, 6, 12]) == [3, 6, 12]\", \"assert largest_divisible_subset([5, 10, 20, 25]) == [5, 10, 20]\", \"assert largest_divisible_subset([]) == []\", \"assert largest_divi... | {
"split": "train",
"index": 61715,
"acecode_id": "evol_10584",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dates in the format 'YYYYMMDD' and a corresponding list of stock prices. Implement a function that takes these two lists as input and returns a dictionary where the keys are the dates (as strings) and the values are the stock prices (as floats). The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_stock_prices(['20220101', '20220102', '20220101'], [100.0, 150.0, 200.0]) == {'20220101': 200.0, '20220102': 150.0}\", \"assert get_stock_prices(['20220101', '20220101', '20220101'], [100.0, 150.0, 200.0]) == {'20220101': 200.0}\", \"assert get_stock_pri... | {
"split": "train",
"index": 61716,
"acecode_id": "bigcode_python_fns_34664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an item which can either be a list, a tuple, or a single element. Your task is to implement a function that ensures the item is a list. If the item is already a list or a tuple, return it as is. If the item is a single element (like an integer, string, etc.), wrap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ensure_list(5) == [5]\", \"assert ensure_list('hello') == ['hello']\", \"assert ensure_list([1, 2, 3]) == [1, 2, 3]\", \"assert ensure_list([]) == []\", \"assert ensure_list(10.5) == [10.5]\", \"assert ensure_list(True) == [True]\", \"assert ensure_list(None... | {
"split": "train",
"index": 61717,
"acecode_id": "bigcode_python_fns_7417",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two sorted integer lists, `list1` and `list2`. Your task is to merge these two lists into a single sorted list. The merged list should maintain the order of elements from both `list1` and `list2`, and you should return the merged list. Implement a function `merge_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 2, 4], [1, 3, 4]) == [1, 1, 2, 3, 4, 4]\", \"assert merge_sorted_lists([], [0]) == [0]\", \"assert merge_sorted_lists([0], []) == [0]\", \"assert merge_sorted_lists([], []) == []\", \"assert merge_sorted_lists([1, 5, 9], [2, 3, 6]) == ... | {
"split": "train",
"index": 61718,
"acecode_id": "bigcode_python_fns_32946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a Fibonacci Search on a sorted list of integers. The function should take in a sorted list of integers and a target integer to search for in the list. If the target integer is found in the list, return its index; otherwise, return -1.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibMonaccianSearch([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144], 5, 13) == 5\", \"assert fibMonaccianSearch([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144], 0, 13) == 0\", \"assert fibMonaccianSearch([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144], 144, 13) ... | {
"split": "train",
"index": 61719,
"acecode_id": "evol_33424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of meal records, where each meal contains information about the user, date, meal name, and entries. Each entry in a meal contains a short name, quantity, unit, and nutritional totals (calories, carbohydrates, fat, protein, sodium, sugar). Your task is to im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_meal_entries([Meal('user1', '2023-10-01', 'Breakfast', [Entry('Oatmeal', 1, 'bowl', {'calories': 150, 'carbohydrates': 27, 'fat': 3, 'protein': 5, 'sodium': 0, 'sugar': 1})])]) == [('user1', '2023-10-01', 'Breakfast', 'Oatmeal', 1, 'bowl', 150, 27, 3... | {
"split": "train",
"index": 61720,
"acecode_id": "bigcode_python_fns_46700",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the execution of a series of tests for a playbook execution system. You will receive a list of test results for three playback runs of a playbook, represented as a list of strings, where each string can either be 'FAILED' or 'COMPLETED'. Your goal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_playbook_status('mocked_playbook', ['COMPLETED', 'FAILED', 'FAILED'], ['mocked_playbook']) == False\", \"assert check_playbook_status('mocked_playbook', ['FAILED', 'FAILED', 'COMPLETED'], []) == True\", \"assert check_playbook_status('mocked_playbook',... | {
"split": "train",
"index": 61721,
"acecode_id": "bigcode_python_fns_6832",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging function that records messages with a certain severity level. Create a function `log_message(message: str, severity: str) -> str` that takes a message and a severity level as input. The severity level will be one of the following: 'INF... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message('File not found', 'ERROR') == 'ERROR: File not found'\", \"assert log_message('User logged in successfully', 'INFO') == 'INFO: User logged in successfully'\", \"assert log_message('Disk space is low', 'WARNING') == 'WARNING: Disk space is low'\",... | {
"split": "train",
"index": 61722,
"acecode_id": "bigcode_python_fns_26590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the quantities of items in an inventory, write a function `get_inventory_summary` that returns a dictionary containing the total number of items, the average quantity of items, and the count of unique quantities. The total number of items i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_inventory_summary([10, 20, 30]) == {'total': 60, 'average': 20.0, 'unique_count': 3}\", \"assert get_inventory_summary([5, 5, 5, 5]) == {'total': 20, 'average': 5.0, 'unique_count': 1}\", \"assert get_inventory_summary([]) == {'total': 0, 'average': 0, '... | {
"split": "train",
"index": 61723,
"acecode_id": "bigcode_python_fns_36600",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the area of a triangle using Heron's formula based on the lengths of its three sides. The function should take three parameters, which are the lengths of the sides of the triangle. If the provided lengths do not form a valid triangle, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert heron_triangle_area(3, 4, 5) == 6.0\", \"assert heron_triangle_area(5, 12, 13) == 30.0\", \"assert heron_triangle_area(7, 8, 9) == 26.832815729997478\", \"assert heron_triangle_area(10, 10, 10) == 43.30127018922193\", \"assert heron_triangle_area(1, 1, 3) ==... | {
"split": "train",
"index": 61724,
"acecode_id": "evol_375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user data for a web application. The function should accept a dictionary representing user data, which includes the keys 'username', 'password', and 'is_admin'. Your function should validate the data according to the follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_data([{'username': 'user1', 'password': 'Password123!', 'is_admin': True}]) == {}\", \"assert validate_user_data([{'username': '', 'password': 'Password123!', 'is_admin': True}]) == {'username': ['Username cannot be empty']}\", \"assert validat... | {
"split": "train",
"index": 61725,
"acecode_id": "oss_1035",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple authentication system for a web application. Your goal is to create a function `check_auth` that takes in a username and password as input. The function should return `True` if the provided credentials match a predefined set of valid cr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_auth('user1', 'password1') == True\", \"assert check_auth('user2', 'password2') == True\", \"assert check_auth('user3', 'password3') == True\", \"assert check_auth('user1', 'wrongpassword') == False\", \"assert check_auth('wronguser', 'password1') == F... | {
"split": "train",
"index": 61726,
"acecode_id": "oss_19225",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `password` and two integers `position_x` and `position_y`, your task is to reverse the substring of `password` from index `position_x` to index `position_y` (inclusive). You need to implement a function `reverse_substring(password: str, position_x: int, position_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_substring('abcde', 1, 3) == 'adcbe'\", \"assert reverse_substring('hello', 0, 4) == 'olleh'\", \"assert reverse_substring('abcdef', 2, 5) == 'abfedc'\", \"assert reverse_substring('python', 1, 1) == 'python'\", \"assert reverse_substring('testcase', ... | {
"split": "train",
"index": 61727,
"acecode_id": "bigcode_python_fns_523",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of depth values to identify the positions of objects in a two-dimensional space. Each depth value represents the distance of an object from the camera at a certain angle. Your goal is to implement a function that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_depth_data([]) == ([], [])\", \"assert process_depth_data([0]) == ([], [])\", \"assert process_depth_data([1]) == ([0], [1])\", \"assert process_depth_data([0, 2, 0]) == ([1], [2])\", \"assert process_depth_data([3, 0, 4, 5]) == ([0, 2, 3], [3, 4, 5]... | {
"split": "train",
"index": 61728,
"acecode_id": "oss_1582",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, implement a function that returns the values of its nodes in a preorder traversal sequence. Preorder traversal is defined as visiting the root node first, then recursively visiting the left subtree, followed by the right subtree. If the tree is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preorderTraversal(None) == []\", \"assert preorderTraversal(TreeNode(1)) == [1]\", \"assert preorderTraversal(TreeNode(1, TreeNode(2), TreeNode(3))) == [1, 2, 3]\", \"assert preorderTraversal(TreeNode(1, None, TreeNode(2))) == [1, 2]\", \"assert preorderTrav... | {
"split": "train",
"index": 61729,
"acecode_id": "evol_9986",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that calculates the nth polite number. A polite number is defined as a positive integer that can be expressed as the sum of two or more consecutive positive integers. Your task is to implement a function that takes an integer n and returns the nth polite numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert polite_number(6) == 8\", \"assert polite_number(7) == 9\", \"assert polite_number(8) == 10\", \"assert polite_number(10) == 13\", \"assert polite_number(11) == 14\", \"assert polite_number(12) == 15\"]}"
} | {
"split": "train",
"index": 61730,
"acecode_id": "evol_8852",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing different types of packets identified by their type. Each packet can be of type 'INF', 'TRN', or 'USR'. Implement a function `process_packet(packet_type, packet_data)` that takes a string `packet_type` and an associated data `packet_data`. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_packet('INF', 'Important information') == 'Processed information packet with data: Important information'\", \"assert process_packet('TRN', (100.00, '2022-01-01 12:00:00')) == 'Processed transaction packet with amount: 100.0 at timestamp: 2022-01-01 ... | {
"split": "train",
"index": 61731,
"acecode_id": "oss_26318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a word normalization system. Given a list of misspelled words, your goal is to return a list of correctly spelled words based on predefined corrections. Implement a function called `normalize_words` that takes a list of strings as input and retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_words(['seacreat', 'wi\\u00fee', 'example']) == ['secret', 'with', 'example']\", \"assert normalize_words(['paft', 'friendlhip']) == ['past', 'friendship']\", \"assert normalize_words(['hello', 'world']) == ['hello', 'world']\", \"assert normalize_... | {
"split": "train",
"index": 61732,
"acecode_id": "oss_27400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_primes_multiples_and_sort(list1: list, list2: list) -> list` that returns a list of prime numbers and numbers that are multiples of 5 from both input lists, combined and sorted in descending order. The function should only include numbers that are grea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_primes_multiples_and_sort([10, 15, 20], [25, 30, 35]) == [35, 30, 25, 20]\", \"assert get_primes_multiples_and_sort([1, 2, 3], [4, 5, 6]) == []\", \"assert get_primes_multiples_and_sort([29, 28, 27], [26, 25, 24]) == [29, 25]\", \"assert get_primes_multi... | {
"split": "train",
"index": 61733,
"acecode_id": "evol_2969",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers within the range of 1-100, return the interquartile range (IQR) of the numbers and identify any outliers in the list according to Tukey's method. An outlier is defined as any number that falls below Q1 - 1.5 * IQR or above Q3 + 1.5 * IQR, where Q1 and Q... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([1, 1, 1, 1, 1, 1, 1, 1]) == (0.0, [])\", \"assert process_numbers([6, 7, 8, 9, 10, 11, 12, 13, 14, 100]) == (5.0, [100])\", \"assert process_numbers([5, 5, 5, 5]) == (0.0, [])\", \"assert process_numbers([10, 20, 30, 40, 50, 60, 70, 80, 90, ... | {
"split": "train",
"index": 61734,
"acecode_id": "evol_25808",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `compute_aggregate(m: int, n: int) -> int` that calculates the sum of all integers from a given lower limit `m` to an upper limit `n`, inclusive. For example, if `m` is 10 and `n` is 20, the function should return the sum of integers from 10 to 20.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_aggregate(10, 20) == 165\", \"assert compute_aggregate(1, 1) == 1\", \"assert compute_aggregate(5, 5) == 5\", \"assert compute_aggregate(1, 10) == 55\", \"assert compute_aggregate(0, 0) == 0\", \"assert compute_aggregate(-5, 5) == 0\", \"assert compu... | {
"split": "train",
"index": 61735,
"acecode_id": "evol_10680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given email address is associated with an active realm member in a predefined list of realms and members. The function should take two arguments: a string 'email' representing the email address to check, and a string 'rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_realm_member('user1@example.com', 'realm1') == {'status': 'active'}\", \"assert check_realm_member('user3@example.com', 'realm2') == {'status': 'active'}\", \"assert check_realm_member('user2@example.com', 'realm1') == {'status': 'active'}\", \"assert ... | {
"split": "train",
"index": 61736,
"acecode_id": "bigcode_python_fns_10818",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a Python dictionary representing a mapping of characters to a list of string functions (which are represented as strings for simplicity). Each character is associated with a list of functions that can be applied to it, where each function is denoted by a string. Y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_functions({'A': ['func1', 'func2'], 'B': ['func3']}, 'AB') == 'func1func2func3'\", \"assert apply_functions({'C': ['func4'], 'D': []}, 'CD') == 'func4D'\", \"assert apply_functions({}, 'XYZ') == 'XYZ'\", \"assert apply_functions({'X': ['func5']}, 'X') ... | {
"split": "train",
"index": 61737,
"acecode_id": "oss_16731",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of package dependencies, where each dependency is a string representing the required package name. Your task is to create a function `count_package_dependencies(dependencies)` that takes this list of package dependencies as input and returns a dictionary. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_package_dependencies(['package1', 'package2', 'package3']) == {'package1': 1, 'package2': 1, 'package3': 1}\", \"assert count_package_dependencies(['pkg1', 'pkg2', 'pkg1', 'pkg3', 'pkg2']) == {'pkg1': 2, 'pkg2': 2, 'pkg3': 1}\", \"assert count_package_... | {
"split": "train",
"index": 61738,
"acecode_id": "oss_11594",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `classify_number(n: int) -> Tuple[str, str]` that takes an integer `n` as input and returns a tuple containing two strings. The first string should indicate the parity of the number ('Even' or 'Odd'), and the second string should classify the number as 'Pri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_number(0) == ('Even', 'Neither prime nor composite')\", \"assert classify_number(1) == ('Odd', 'Neither prime nor composite')\", \"assert classify_number(2) == ('Even', 'Prime')\", \"assert classify_number(3) == ('Odd', 'Prime')\", \"assert classify... | {
"split": "train",
"index": 61739,
"acecode_id": "evol_30083",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the number of combinations (n choose r) for given values of n and r. The number of combinations is calculated using the formula C(n, r) = n! / (r! * (n - r)!), where n! denotes the factorial of n. Your task is to create a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_combinations(5, 3) == 10\", \"assert calculate_combinations(10, 2) == 45\", \"assert calculate_combinations(10, 10) == 1\", \"assert calculate_combinations(0, 0) == 1\", \"assert calculate_combinations(5, 0) == 1\", \"assert calculate_combinations(... | {
"split": "train",
"index": 61740,
"acecode_id": "oss_21462",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to check the spelling of words in a given list. The function should take the following parameters: \n- `word_list`: A list of strings representing the words to be checked. \n- `dictionary`: A set of strings representing the correctly ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_spelling(['apple', 'banana', 'cherry'], {'apple', 'banana', 'grape'}) == [True, True, False]\", \"assert check_spelling(['hello', 'world', 'test'], {'hello', 'world'}) == [True, True, False]\", \"assert check_spelling(['spell', 'check', 'function'], {'... | {
"split": "train",
"index": 61741,
"acecode_id": "oss_8328",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that checks if a given string contains a valid date and if it is, return it in YYYY-MM-DD format. The function should handle and validate inputs for day, month, and year separately. Invalid dates such as 30th of February or 31st of November should be returned a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_date('2023-01-15') == '2023-01-15'\", \"assert check_date('2023/01/15') == '2023-01-15'\", \"assert check_date('2020/02/29') == '2020-02-29'\", \"assert check_date('1000-01-01') == '1000-01-01'\", \"assert check_date('9999-12-31') == '9999-12-31'\"]}"
... | {
"split": "train",
"index": 61742,
"acecode_id": "evol_18949",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, write a function `count_cubeful_primes(n)` that returns the number of prime numbers less than n for which there exists a positive integer k such that the expression k^3 + k^2 * p is a perfect cube. A prime number p is considered cubeful if it satisfi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_cubeful_primes(20) == 1\", \"assert count_cubeful_primes(30) == 1\", \"assert count_cubeful_primes(50) == 1\", \"assert count_cubeful_primes(1) == 0\", \"assert count_cubeful_primes(25) == 1\"]}"
} | {
"split": "train",
"index": 61743,
"acecode_id": "evol_9483",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents column names in a DataFrame. Your task is to implement a function that renames specific columns based on a predefined mapping. The mapping is as follows: 'Man1' to 'Manufacturer (PE)', 'Pro1' to 'Model (PE)', 'Man2' to 'Manufacturer (B... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rename_columns_dict({'Man1': 1, 'Pro1': 2}) == {'Manufacturer (PE)': 1, 'Model (PE)': 2}\", \"assert rename_columns_dict({'Man2': 3, 'Pro2': 4}) == {'Manufacturer (BAT)': 3, 'Model (BAT)': 4}\", \"assert rename_columns_dict({'Random_Column': 100}) == {'Rando... | {
"split": "train",
"index": 61744,
"acecode_id": "bigcode_python_fns_26400",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree represented by its root node, implement a function `good_nodes(root)` that counts the number of good nodes in the tree. A node is considered good if there are no nodes with a value greater than the node's value on the path from the root to that node. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert good_nodes(TreeNode(3)) == 1\", \"assert good_nodes(TreeNode(3, TreeNode(3, TreeNode(4), TreeNode(2)))) == 3\", \"assert good_nodes(TreeNode(1)) == 1\", \"assert good_nodes(TreeNode(2, TreeNode(2), TreeNode(2))) == 3\", \"assert good_nodes(TreeNode(-1, TreeN... | {
"split": "train",
"index": 61745,
"acecode_id": "evol_3578",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates the first n numbers of the Fibonacci sequence and returns a list containing only the odd numbers from that sequence. The function should have the following signature: def odd_fibonacci_sequence(n: int) -> List[int].\nPlease reason step by step, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_fibonacci_sequence(1) == [1]\", \"assert odd_fibonacci_sequence(2) == [1, 1]\", \"assert odd_fibonacci_sequence(4) == [1, 1, 3]\", \"assert odd_fibonacci_sequence(5) == [1, 1, 3, 5]\", \"assert odd_fibonacci_sequence(6) == [1, 1, 3, 5]\", \"assert odd_fi... | {
"split": "train",
"index": 61746,
"acecode_id": "evol_8646",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of octal numbers represented as strings and converts each number to its decimal equivalent. The function should process the list, convert each octal string to a decimal integer, and then return a list of decimal n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_octal_to_decimal(['075', '123', '456']) == ['61', '83', '302']\", \"assert convert_octal_to_decimal(['0', '1', '2']) == ['0', '1', '2']\", \"assert convert_octal_to_decimal(['10', '20', '30']) == ['8', '16', '24']\", \"assert convert_octal_to_decimal... | {
"split": "train",
"index": 61747,
"acecode_id": "oss_17065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string containing XML formatted data, write a function `extract_emails` that extracts all valid email addresses from the XML content using regular expression syntax. The email addresses must match the standard format of an email (local-part@domain). Ensure that non-emai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_emails('<emails><email>test.user@example.com</email></emails>') == ['test.user@example.com']\", \"assert extract_emails('<emails><email>user123@sub.example.co.uk</email></emails>') == ['user123@sub.example.co.uk']\", \"assert extract_emails('<emails>... | {
"split": "train",
"index": 61748,
"acecode_id": "evol_9474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of floating point numbers and a threshold as arguments. The function should return the largest non-negative number from the list that is also smaller than the provided threshold.\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_below_threshold([0.2, -0.5, 3.5, 7.9, 0.0], 0.5) == 0.2\", \"assert largest_below_threshold([0.4, 0.5, 0.6, 0.3, 0.1], 0.5) == 0.4\", \"assert largest_below_threshold([-1.0, -2.0, -3.0], 0) == None\", \"assert largest_below_threshold([0.0, 0.0, 0.0],... | {
"split": "train",
"index": 61749,
"acecode_id": "evol_4819",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `filter_greater_than_threshold` that takes two parameters: `numbers`, a list of integers, and `threshold`, an integer. The function should return a new list containing only the integers from the input list that are greater than the spe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_greater_than_threshold([1, 2, 3, 4, 5], 3) == [4, 5]\", \"assert filter_greater_than_threshold([10, 20, 30, 40], 25) == [30, 40]\", \"assert filter_greater_than_threshold([-1, -2, -3, -4], -3) == [-1, -2]\", \"assert filter_greater_than_threshold([5, ... | {
"split": "train",
"index": 61750,
"acecode_id": "bigcode_python_fns_36471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_percent_match(uri: str, uc_data: List[str]) -> int` that determines the percent match of a given URI from a list of strings that represent rows of data. Each row in the data consists of multiple space-separated values, and the percen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_percent_match('example_uri', ['1 2 3 85 5 6 7 8 9 another_uri']) == -1\", \"assert get_percent_match('not_found_uri', ['1 2 3 80 5 6 7 8 9 example_uri']) == -1\", \"assert get_percent_match('non_existent_uri', ['1 2 3 40 5 6 7 8 9 example_uri']) == -1\",... | {
"split": "train",
"index": 61751,
"acecode_id": "bigcode_python_fns_1435",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Depth-First Search (DFS) algorithm to traverse a graph and find the connected components. The graph is represented using an adjacency list, where each vertex is associated with a list of its neighboring vertices. Your goal is to implement a fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dfs_connected_components({0: [1], 1: [0], 2: [], 3: [4], 4: [3]}, 0) == [[0, 1]]\", \"assert dfs_connected_components({0: [1, 2], 1: [0], 2: [0], 3: [], 4: [5], 5: [4]}, 0) == [[0, 1, 2]]\", \"assert dfs_connected_components({0: [], 1: [], 2: []}, 0) == [[0]... | {
"split": "train",
"index": 61752,
"acecode_id": "oss_31684",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer 'n', implement a function that returns a list of all prime numbers which are also palindromic, that are less than or equal to 'n'. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_prime_palindromes(0) == []\", \"assert find_prime_palindromes(1) == []\", \"assert find_prime_palindromes(2) == [2]\", \"assert find_prime_palindromes(3) == [2, 3]\", \"assert find_prime_palindromes(4) == [2, 3]\", \"assert find_prime_palindromes(5) == ... | {
"split": "train",
"index": 61753,
"acecode_id": "evol_24433",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that interchanges the positions of its first and last characters. If the string is empty or contains only one character, return the string unchanged.\nPlease reason step by step, then write a self-contained Python solution. Give your final p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_chars('build') == 'duilb'\", \"assert swap_chars('hello') == 'oellh'\", \"assert swap_chars('a') == 'a'\", \"assert swap_chars('') == ''\", \"assert swap_chars('ab') == 'ba'\", \"assert swap_chars('python') == 'nythop'\", \"assert swap_chars('test') == ... | {
"split": "train",
"index": 61754,
"acecode_id": "evol_7229",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two integers mu_i and mu_ij along with a positive integer N, generate a 2D list (matrix) of dimensions N x N where each element at position (i, j) is calculated using the function I_ij(i, j, mu_i, mu_ij, N). Implement a function `generate_matrix(mu_i, mu_ij, N)` that retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_matrix(2, 3, 2) == [[0, 1], [1, 0]]\", \"assert generate_matrix(0, 0, 1) == [[0]]\", \"assert generate_matrix(4, 5, 4) == [[0, 1, 2, 3], [1, 2, 3, 0], [2, 3, 0, 1], [3, 0, 1, 2]]\", \"assert generate_matrix(7, 6, 6) == [[0, 1, 2, 3, 4, 5], [1, 2, 3,... | {
"split": "train",
"index": 61755,
"acecode_id": "bigcode_python_fns_7787",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of elements that can be integers, floats, or instances of a custom class called 'Symbol'. Your task is to implement a function called `validate_elements(elements)` that checks if all elements in the list are either integers, floats, or instances of the 'Sym... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_elements([1, 2.5, Symbol('x')]) == True\", \"assert validate_elements([1, 2, 3]) == True\", \"assert validate_elements([Symbol('a'), Symbol('b')]) == True\", \"assert validate_elements([3.14, 2.71, Symbol('pi')]) == True\", \"assert validate_element... | {
"split": "train",
"index": 61756,
"acecode_id": "bigcode_python_fns_34980",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers and returns a new list containing only the even integers from the original list. The function should take in the following parameters: \n- `numbers`: A list of integers. \n\nYour task is to impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([7, 9, 11]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([0, 0, 0]) == [0, 0, 0]\", \"assert filter_even_numbers([]... | {
"split": "train",
"index": 61757,
"acecode_id": "oss_16843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that updates the characteristics of a flower based on the provided data. The function should take in the following parameters: an integer ID, two floats representing sepal length and width, two floats representing petal length and width, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_flower(1, 5.1, 3.5, 1.4, 0.2, 'setosa') == {'id': 1, 'sepal_length': 5.1, 'sepal_width': 3.5, 'petal_length': 1.4, 'petal_width': 0.2, 'species': 'setosa'}\", \"assert update_flower(2, 6.7, 3.1, 4.7, 1.5, 'versicolor') == {'id': 2, 'sepal_length': 6.7... | {
"split": "train",
"index": 61758,
"acecode_id": "bigcode_python_fns_13552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sequence y = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20,...] which follows an arithmetic progression, write a function that returns the nth element in the sequence without using any built-in functions. The function should compute in O(1) time and should not use explicit loops.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nth_element(1) == 2\", \"assert nth_element(2) == 4\", \"assert nth_element(3) == 6\", \"assert nth_element(4) == 8\", \"assert nth_element(5) == 10\", \"assert nth_element(6) == 12\", \"assert nth_element(7) == 14\", \"assert nth_element(8) == 16\", \"asser... | {
"split": "train",
"index": 61759,
"acecode_id": "evol_5553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a stopwatch. The function should take a list of commands as input, where each command can be 'start', 'stop', or 'reset'. The function should return the total elapsed time in seconds after processing all... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_stopwatch(['start', 'stop', 'reset']) == 0\", \"assert simulate_stopwatch(['start', 'start', 'stop', 'reset']) == 0\", \"assert simulate_stopwatch(['start', 'stop']) == 1\", \"assert simulate_stopwatch(['start', 'start', 'stop', 'start', 'stop']) ==... | {
"split": "train",
"index": 61760,
"acecode_id": "oss_6270",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid of integers where each integer represents a cell in a puzzle. A cell can either be a positive integer (representing a valid piece of the puzzle), zero (representing an empty cell), or a negative integer (representing an invalid piece of the puzzle). Writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_head([[3, -1, -1], [-1, 2, -1], [0, -1, -1]]) == (1, 1)\", \"assert get_head([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == (-1, -1)\", \"assert get_head([[1, 0, 0], [0, -1, -1], [0, -1, -1]]) == (0, 0)\", \"assert get_head([[-1, -1, -1], [-1, -1, -1], [-1, -1, -... | {
"split": "train",
"index": 61761,
"acecode_id": "bigcode_python_fns_49713",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D vector represented as a tuple (x, y), where x and y are integers, write a function that rotates this vector 90 degrees counterclockwise and returns the resulting vector as a tuple. For example, if the input vector is (1, 2), the output should be (-2, 1).\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate90ccw((1, 2)) == (-2, 1)\", \"assert rotate90ccw((0, 1)) == (-1, 0)\", \"assert rotate90ccw((3, 4)) == (-4, 3)\", \"assert rotate90ccw((5, 0)) == (0, 5)\", \"assert rotate90ccw((-1, -1)) == (1, -1)\", \"assert rotate90ccw((1, 0)) == (0, 1)\", \"assert ... | {
"split": "train",
"index": 61762,
"acecode_id": "bigcode_python_fns_17695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words and an integer m, implement a function `find_max(words, m)` that returns a list of tuples. Each tuple should contain a word from the input list and a dictionary that represents the count of each character in that word. However, only include words where the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max(['aaa', 'bb', 'c', 'ddd'], 1) == [('aaa', {'a': 3}), ('bb', {'b': 2}), ('c', {'c': 1}), ('ddd', {'d': 3})]\", \"assert find_max(['x', 'y', 'z'], 1) == [('x', {'x': 1}), ('y', {'y': 1}), ('z', {'z': 1})]\", \"assert find_max(['aaa', 'bbb', 'ccc', 'dd... | {
"split": "train",
"index": 61763,
"acecode_id": "evol_1946",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are developing a function that maps status codes to their corresponding display names. You have a predefined list of statuses represented as tuples, where each tuple contains a status code and its associated display name. Implement a function `get_status_display(status_code... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_status_display('active') == 'Active'\", \"assert get_status_display('failed') == 'Failed'\", \"assert get_status_display('suspended') == 'Suspended'\", \"assert get_status_display('completed') == 'Completed'\", \"assert get_status_display('inactive') == ... | {
"split": "train",
"index": 61764,
"acecode_id": "oss_28551",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a set of validation rules are met based on given inputs. The function `validate_input` takes in two parameters: `error` (a dictionary with keys `type` and `message`, where `type` is a string) and `properties` (a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_input({'type': 'info', 'message': 'Informational message'}, [True, True], {'critical'}) == True\", \"assert validate_input({'type': 'warning', 'message': 'Warning issued'}, [], {'warning'}) == False\", \"assert validate_input(None, [True, True], {'i... | {
"split": "train",
"index": 61765,
"acecode_id": "oss_19595",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given username is present in a predefined list of usernames. The function should take a single string parameter representing the username and return a boolean indicating whether the username exists in the list. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_username('jbloggs') == True\", \"assert check_username('alice') == True\", \"assert check_username('bob') == True\", \"assert check_username('charlie') == True\", \"assert check_username('dave') == True\", \"assert check_username('eve') == False\", \"a... | {
"split": "train",
"index": 61766,
"acecode_id": "bigcode_python_fns_31969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `sum_odd_numbers_minus_duplicates(sequence)` that calculates the cumulative total of all odd numbers in the list. Additionally, find all duplicate odd numbers and subtract their sum from the cumulative total. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_odd_numbers_minus_duplicates([2, 4, 6]) == 0\", \"assert sum_odd_numbers_minus_duplicates([1, 3, 5, 7, 9]) == 25\", \"assert sum_odd_numbers_minus_duplicates([]) == 0\", \"assert sum_odd_numbers_minus_duplicates([2, 3, 4, 3]) == 3\", \"assert sum_odd_num... | {
"split": "train",
"index": 61767,
"acecode_id": "evol_25398",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Create a function that encrypts a given string based on a provided Vigenère cipher table. Use the first letter of the string, excluding non-alphabetic characters, as the key to the cipher. The string can include both upper and lower case letters. The Vigenère cipher table is as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encrypt_with_vigenere('abc', Vigen\\u00e8re_cipher_table) == 'bcd'\", \"assert encrypt_with_vigenere('123abc', Vigen\\u00e8re_cipher_table) == '123bcd'\", \"assert encrypt_with_vigenere('abc123', Vigen\\u00e8re_cipher_table) == 'bcd123'\", \"assert encrypt_w... | {
"split": "train",
"index": 61768,
"acecode_id": "evol_9805",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of repositories, where each repository is represented by a list of its dependencies. Your task is to implement a function that calculates the Jaccard similarity index for each pair of repositories. The Jaccard similarity index is defined as the size of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_jaccard_similarity([[], []]) == [[1.0, 1.0], [1.0, 1.0]]\", \"assert calculate_jaccard_similarity([[1], [1], [1]]) == [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]\", \"assert calculate_jaccard_similarity([[1], [2], [3], [4]]) == [[1.0, 0.0, ... | {
"split": "train",
"index": 61769,
"acecode_id": "bigcode_python_fns_12092",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function to process genomic data. Write a Python function `retrieve_genomic_position` that takes in a list of lists representing genomic data, an integer `row_index`, and an integer `subset_index`. The function should return a tuple `(contig, po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_genomic_position([['Seq1', 100, 150], ['Seq2', 200, 250], ['Seq3', 300, 350]], 1, 2) == ('Seq2', 250)\", \"assert retrieve_genomic_position([['Gene1', 1500, 1600], ['Gene2', 1700, 1800]], 1, 2) == ('Gene2', 1800)\", \"assert retrieve_genomic_positio... | {
"split": "train",
"index": 61770,
"acecode_id": "oss_15625",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where each key is an image name (a string) and the corresponding value is a list of annotations for that image. Each annotation is represented as a list of five elements: [class_id, xmin, ymin, width, height]. The class_id is an integer that maps to a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_gt_from_anno({'img1': [[0, 10, 20, 5, 5], [1, 15, 25, 5, 5]], 'img2': [[-1, 0, 0, 0, 0]]}, ['cat', 'dog']) == {'img1': [{'class': 'cat', 'box': [10, 20, 14, 24]}, {'class': 'dog', 'box': [15, 25, 19, 29]}], 'img2': []}\", \"assert parse_gt_from_anno({'... | {
"split": "train",
"index": 61771,
"acecode_id": "bigcode_python_fns_27825",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a title, pitch, and category as strings, and returns a dictionary representing a new pitch. The dictionary should include the title, pitch, category, and a user ID, which is provided as an argument to the function. The user ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_pitch('Pitch Title', 'This is the pitch content', 'Category1', 1) == {'title': 'Pitch Title', 'pitch': 'This is the pitch content', 'category': 'Category1', 'user_id': 1}\", \"assert create_pitch('Another Title', 'Another pitch content', 'Category2', ... | {
"split": "train",
"index": 61772,
"acecode_id": "bigcode_python_fns_25299",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a basic message passing system using a queue. Your function should take two parameters: a list of messages and a target message. The function should return the index of the target message in the list if it exists, or -1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_message_index(['Hello', 'World', 'Test'], 'World') == 1\", \"assert find_message_index(['Hello', 'World', 'Test'], 'Test') == 2\", \"assert find_message_index(['Hello', 'World', 'Test'], 'Hello') == 0\", \"assert find_message_index(['Hello', 'World', 'T... | {
"split": "train",
"index": 61773,
"acecode_id": "bigcode_python_fns_10259",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the fabric consumption for a suit based on the growth of a person. Given a person's growth in centimeters, you need to implement a function that calculates the fabric consumption using the formula: fabric_consumption = 2 * growth + 0.3. Write a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fabric_consumption(0) == 0.3\", \"assert calculate_fabric_consumption(1) == 2.3\", \"assert calculate_fabric_consumption(10) == 20.3\", \"assert calculate_fabric_consumption(65) == 130.3\", \"assert calculate_fabric_consumption(100) == 200.3\", \"a... | {
"split": "train",
"index": 61774,
"acecode_id": "oss_28311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, str1 and str2, return the shortest common supersequence of these two strings. The shortest common supersequence is the shortest string that contains both str1 and str2 as subsequences. Additionally, ensure that the result does not contain any repeating sequen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortestCommonSupersequence('abac', 'cab') == 'cabac'\", \"assert shortestCommonSupersequence('abc', 'def') == 'abcdef'\", \"assert shortestCommonSupersequence('a', 'b') == 'ab'\", \"assert shortestCommonSupersequence('abc', 'abc') == 'abc'\", \"assert short... | {
"split": "train",
"index": 61775,
"acecode_id": "evol_8179",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `fhs` representing file handles to maps (just integers for simplicity) and `dates` representing corresponding dates (as strings in 'YYYY-MM-DD' format). Your task is to calculate the monthly and yearly spatial averages from the maps associated with the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_averages([1, 2, 3, 4], ['2023-01-01', '2023-01-15', '2023-02-01', '2023-02-15']) == (2.5, 2.5)\", \"assert calculate_averages([1, 2, 3], ['2023-01-01', '2023-01-15', '2023-01-30']) == (2.0, 2.0)\", \"assert calculate_averages([5, 15, 25], ['2023-03... | {
"split": "train",
"index": 61776,
"acecode_id": "bigcode_python_fns_27631",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `handle_speak(event: str) -> dict` that takes a string `event` as input and returns a dictionary. The dictionary should contain the following keys and values: 'client_name' which should always be 'neon_speech', 'source' which should a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_speak('Hello World!') == {'client_name': 'neon_speech', 'source': 'audio', 'destination': ['skills']}\", \"assert handle_speak('Test event') == {'client_name': 'neon_speech', 'source': 'audio', 'destination': ['skills']}\", \"assert handle_speak('Anot... | {
"split": "train",
"index": 61777,
"acecode_id": "bigcode_python_fns_44086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps represented as strings in the format 'YYYY-MM-DD HH:MM:SS'. Your task is to convert these timestamps into a list of corresponding Unix timestamps (the number of seconds since January 1, 1970). Implement a function `convert_to_unix_timestamps(t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_unix_timestamps(['1970-01-01 00:00:00']) == [0]\", \"assert convert_to_unix_timestamps(['1970-01-01 00:00:01']) == [1]\", \"assert convert_to_unix_timestamps(['2000-01-01 00:00:00']) == [946684800]\", \"assert convert_to_unix_timestamps(['2023-01-... | {
"split": "train",
"index": 61778,
"acecode_id": "bigcode_python_fns_45317",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates logging output for a specific process. The function `watch_log(process)` should take a string `process` as input and return a string that represents the log messages being generated for that process. The log messages should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert watch_log('processA') in ['Process processA is running...', 'Process processA has completed.', 'Process processA encountered an error.']\", \"assert watch_log('processB') in ['Process processB is running...', 'Process processB has completed.', 'Process proce... | {
"split": "train",
"index": 61779,
"acecode_id": "bigcode_python_fns_18746",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function called `combine_and_sum` that takes no arguments. Inside the function, you should perform the following steps: 1. Create a list of integers from 1 to 100 (inclusive). 2. Filter the list to include only even numbers. 3. Calculate th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_and_sum() == 2550\", \"assert combine_and_sum() > 0\", \"assert combine_and_sum() % 2 == 0\", \"assert isinstance(combine_and_sum(), int)\", \"assert combine_and_sum() == sum(i for i in range(1, 101) if i % 2 == 0)\", \"assert combine_and_sum() == 2 ... | {
"split": "train",
"index": 61780,
"acecode_id": "oss_34821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines whether a given integer n is a Fibonacci number. The function should return 'yes' if n is a Fibonacci number and 'no' if it is not.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_fibonacci(0) == 'yes'\", \"assert is_fibonacci(1) == 'yes'\", \"assert is_fibonacci(2) == 'yes'\", \"assert is_fibonacci(3) == 'yes'\", \"assert is_fibonacci(4) == 'no'\", \"assert is_fibonacci(5) == 'yes'\", \"assert is_fibonacci(6) == 'no'\", \"assert i... | {
"split": "train",
"index": 61781,
"acecode_id": "evol_5798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of points, `path1` and `path2`, where each point is represented as a tuple of (x, y) coordinates, return the Manhattan distance from the starting location (0, 0) to the closest intersection point between the two paths. The paths are formed by moving in straight ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_closest_intersection_pt_dist([(0, 0), (0, 1)], [(1, 0), (1, 1)]) == -1\", \"assert get_closest_intersection_pt_dist([(0, 0), (3, 0)], [(0, 3), (3, 3)]) == -1\", \"assert get_closest_intersection_pt_dist([(0, 0), (1, 1)], [(0, 0), (1, 0)]) == 0\", \"asser... | {
"split": "train",
"index": 61782,
"acecode_id": "bigcode_python_fns_39270",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of decimal fractional numbers and classifies them into three categories: positive numbers, negative numbers, and zeros. The function should return a tuple containing three lists: the first list for positive numbers, the second for negative num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_numbers([4.5, -3.2, 0, 7.1, -8.9, 0, 2.3]) == ([4.5, 7.1, 2.3], [-3.2, -8.9], [0, 0])\", \"assert classify_numbers([-1.1, -2.2, -3.3]) == ([], [-1.1, -2.2, -3.3], [])\", \"assert classify_numbers([0, 0, 0]) == ([], [], [0, 0, 0])\", \"assert classif... | {
"split": "train",
"index": 61783,
"acecode_id": "evol_29921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the maximum bid from a list of bids in an auction. The function should take a list of integer bids as input, and return the highest bid found in the list. If the list is empty, the function should return 0. You can ass... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_winning_bid([100, 150, 120, 200]) == 200\", \"assert calculate_winning_bid([10, 20, 30, 40, 50]) == 50\", \"assert calculate_winning_bid([5, 5, 5, 5]) == 5\", \"assert calculate_winning_bid([0, 0, 0]) == 0\", \"assert calculate_winning_bid([300]) =... | {
"split": "train",
"index": 61784,
"acecode_id": "oss_9762",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given string can be rearranged to form a palindrome. A palindrome is a string that reads the same backward as forward. Your function should take a single string as input and return a boolean value indicating whether the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_form_palindrome('A man, a plan, a canal: Panama') == True\", \"assert can_form_palindrome('racecar') == True\", \"assert can_form_palindrome('hello') == False\", \"assert can_form_palindrome('') == True\", \"assert can_form_palindrome('a') == True\", \"a... | {
"split": "train",
"index": 61785,
"acecode_id": "oss_21260",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sentence as a string and a word, implement a function that returns the index of the word in the sentence if it exists; otherwise, return None. The sentence will be a sequence of words separated by spaces. You can assume that the input will always be a valid string and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_word_index('the quick brown fox', 'quick') == 1\", \"assert get_word_index('the quick brown fox', 'fox') == 3\", \"assert get_word_index('the quick brown fox', 'the') == 0\", \"assert get_word_index('the quick brown fox', 'lazy') == None\", \"assert get_... | {
"split": "train",
"index": 61786,
"acecode_id": "evol_6875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted string representation of an INCON block. The function should accept the following parameters: a list of labels (strings), a list of primary variables (numbers), a list of porosities (numbers), an optional 2D lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_incon_block(['Label1', 'Label2'], [1.0, 2.0], [0.1, 0.2], [[10.0], [20.0]], [0.5, 0.6], 'EOS1') == ['Label: Label1, Primary Variable: 1.0, Porosity: 0.1, Permeability: 10.0, Phase Composition: 0.5, EOS: EOS1', 'Label: Label2, Primary Variable: 2.0, ... | {
"split": "train",
"index": 61787,
"acecode_id": "bigcode_python_fns_9133",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function `second_highest_prime(arr)` that returns the second highest prime number in the array. If there are fewer than two prime numbers, the function should return None.\nPlease reason step by step, then write a self-contained Python soluti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert second_highest_prime([3, 10, 2, 6, 4]) == 2\", \"assert second_highest_prime([4, 6, 8, 10]) == None\", \"assert second_highest_prime([2, 3, 5, 7]) == 5\", \"assert second_highest_prime([1, 4, 6, 8, 9]) == None\", \"assert second_highest_prime([11, 13, 17, 19... | {
"split": "train",
"index": 61788,
"acecode_id": "evol_16908",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes user data represented as a list of dictionaries. Each dictionary contains user details such as name, email, and age. Your function should return a list of unique email addresses from the input user data. If there are duplic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_emails([{ 'name': 'Charlie', 'email': 'charlie@example.com', 'age': 22 }, { 'name': 'David', 'email': 'david@example.com', 'age': 29 }, { 'name': 'Charlie', 'email': 'charlie@example.com', 'age': 22 }]) == ['charlie@example.com', 'david@exampl... | {
"split": "train",
"index": 61789,
"acecode_id": "oss_18305",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of password change requests, where each request is represented by a dictionary containing the user's email and the new password. Your task is to process these requests and return a list of results indicating whether each password change was successful or no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_password_changes([{ 'email': 'user1@example.com', 'password': 'newpass1' }, { 'email': 'user2@example.com', 'password': 'newpass2' }]) == ['Success', 'Success']\", \"assert process_password_changes([{ 'email': 'user1@example.com', 'password': '' }, {... | {
"split": "train",
"index": 61790,
"acecode_id": "bigcode_python_fns_43225",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_singleton_instance(cls)` that takes a class `cls` as an argument and returns a singleton instance of that class. If an instance of the class already exists, return that instance; otherwise, create a new instance and return it. Ensure that the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_singleton_instance(MyClass) is get_singleton_instance(MyClass)\", \"assert get_singleton_instance(MyClass) is not get_singleton_instance(AnotherClass)\", \"assert get_singleton_instance(AnotherClass) is get_singleton_instance(AnotherClass)\", \"assert ge... | {
"split": "train",
"index": 61791,
"acecode_id": "evol_6850",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that performs a specific arithmetic operation on two numbers. The function should take three parameters: two numbers (num1 and num2) and an operation (a string) which can be either 'add', 'subtract', 'multiply', or 'divide'. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_operation(3, 5, 'add') == 8\", \"assert perform_operation(10, 4, 'subtract') == 6\", \"assert perform_operation(7, 6, 'multiply') == 42\", \"assert perform_operation(20, 5, 'divide') == 4\", \"assert perform_operation(-3, 5, 'add') == 2\", \"assert p... | {
"split": "train",
"index": 61792,
"acecode_id": "oss_31745",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `next_prime_above(x)` that returns the smallest prime number strictly greater than the given integer x. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function should handle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_prime_above(0) == 2\", \"assert next_prime_above(1) == 2\", \"assert next_prime_above(2) == 3\", \"assert next_prime_above(3) == 5\", \"assert next_prime_above(4) == 5\", \"assert next_prime_above(5) == 7\", \"assert next_prime_above(6) == 7\", \"assert... | {
"split": "train",
"index": 61793,
"acecode_id": "bigcode_python_fns_23677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `nthPoliteNumber(n: int) -> int` that returns the nth polite number. A polite number is defined as a positive integer that is not a power of two. Your function should handle large inputs efficiently.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nthPoliteNumber(6) == 9\", \"assert nthPoliteNumber(13) == 17\", \"assert nthPoliteNumber(14) == 18\", \"assert nthPoliteNumber(16) == 21\", \"assert nthPoliteNumber(17) == 22\", \"assert nthPoliteNumber(18) == 23\", \"assert nthPoliteNumber(19) == 24\", \"a... | {
"split": "train",
"index": 61794,
"acecode_id": "evol_19002",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a stock ranking system based on the EV/EBITDA ratio. The EV/EBITDA ratio is calculated as the enterprise value (EV) divided by earnings before interest, taxes, depreciation, and amortization (EBITDA). The ranking system assigns a score to each s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rank_stocks({'TSLA': 12.0, 'FB': 6.5, 'NFLX': 11.0, 'NVDA': 9.5}) == {'FB': 1, 'NVDA': 2, 'NFLX': 3, 'TSLA': 4}\", \"assert rank_stocks({'IBM': 15.0, 'CSCO': 14.0, 'ORCL': 13.5, 'INTC': 12.0}) == {'INTC': 1, 'ORCL': 2, 'CSCO': 3, 'IBM': 4}\", \"assert rank_s... | {
"split": "train",
"index": 61795,
"acecode_id": "oss_24739",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that registers a new user by taking their username, password, and email address. The function should ensure that the username is unique (not already registered), the password meets certain criteria (at least 8 characters long and cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_user('john_doe', 'Password1', 'john@example.com') == 'Registration Successful'\", \"assert register_user('john_doe', 'Pass', 'john@example.com') == 'Password must be at least 8 characters long and contain at least one letter and one number'\", \"ass... | {
"split": "train",
"index": 61796,
"acecode_id": "bigcode_python_fns_16560",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a data structure that manages a collection of products. Each product has the following attributes: name (string), price (float), quantity (integer), and created_at (string in ISO 8601 format). Your task is to implement a function called `add_product... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_product([], {'name': 'Apple', 'price': 1.0, 'quantity': 5, 'created_at': '2023-10-01T00:00:00Z'}) == [{'name': 'Apple', 'price': 1.0, 'quantity': 5, 'created_at': '2023-10-01T00:00:00Z'}]\", \"assert add_product([{'name': 'Apple', 'price': 1.0, 'quantity... | {
"split": "train",
"index": 61797,
"acecode_id": "oss_194",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of loan rates and an amount, write a function `calculate_repayment(loan_amount: float, rates: List[float]) -> Tuple[float, float, float]` that calculates the monthly repayment, total repayment, and effective interest rate for a loan. The function should return a tu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_repayment(200000, [5.0, 5.5, 6.0]) == (5.0, 833.3333333333334, 10000.0)\", \"assert calculate_repayment(50000, []) == (-1, -1, -1)\", \"assert calculate_repayment(100000, [8.5, 9.0, 7.5]) == (7.5, 625.0, 7500.0)\", \"assert calculate_repayment(2000... | {
"split": "train",
"index": 61798,
"acecode_id": "bigcode_python_fns_20738",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the initialization of a card in a card game. Each card can have a specific color and a tapped state. Write a function `initialize_card(color: str) -> dict` that takes a string representing the color of the card and returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_card('Red') == {'color': 'Red', 'tapped': False}\", \"assert initialize_card('Blue') == {'color': 'Blue', 'tapped': False}\", \"assert initialize_card('Green') == {'color': 'Green', 'tapped': False}\", \"assert initialize_card('White') == {'color'... | {
"split": "train",
"index": 61799,
"acecode_id": "bigcode_python_fns_32018",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.