data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a dictionary `data` that contains two keys: 'code' and 'message'. The 'code' key holds an integer value which represents the status of a process. A 'code' of 0 indicates success, while any other integer indicates an error. Your task is to implement a function `che...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_process_status({'code': 0, 'message': 'All good'}) == 'Success'\", \"assert check_process_status({'code': 1, 'message': 'Error occurred'}) == 'Error occurred'\", \"assert check_process_status({'code': 2, 'message': 'Invalid input'}) == 'Invalid input'\...
{ "split": "train", "index": 80500, "acecode_id": "bigcode_python_fns_24119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing file extensions, determine if a specific extension is available in that list. The function should take two inputs: a list of strings `extensions` and a string `specifier`. The function should return `True` if the `specifier` (with '.' replac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert checkExtension(['jpg', 'png', 'gif'], '.bmp') == False\", \"assert checkExtension(['doc', 'pdf', 'txt'], '.xls') == False\", \"assert checkExtension(['exe', 'bat', 'sh'], '.cmd') == False\", \"assert checkExtension(['html', 'css', 'js'], '.php') == False\", ...
{ "split": "train", "index": 80501, "acecode_id": "bigcode_python_fns_30643", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that identifies the differences between two strings, taking into account a boolean flag that indicates whether the operation should be case-sensitive. Your function should return a list of differences where each difference is represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_text_diff('hello', 'hello', True) == [('equal', 'hello')]\", \"assert perform_text_diff('abc', 'abc', False) == [('equal', 'abc')]\", \"assert perform_text_diff('abc', 'abcd', True) == [('equal', 'abc'), ('insert', 'd')]\", \"assert perform_text_diff...
{ "split": "train", "index": 80502, "acecode_id": "oss_30916", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string s, implement a function that determines whether the string is a palindrome, considering only alphanumeric characters and ignoring case sensitivity. A palindrome reads the same forward and backward. Write a function `is_palindrome(s: str) -> bool` that returns Tru...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('race a car') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome(' ') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_pal...
{ "split": "train", "index": 80503, "acecode_id": "evol_2252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function `generate_base32_string` that generates a unique 17-character string using a base-32 character set consisting of uppercase letters (A-Z) and the digits 2, 3, 4, 5, 6, 7. The function should return a string of exactly 17 characters, randomly generated from this...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_base32_string() is not None\", \"assert len(generate_base32_string()) == 17\", \"assert all(c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' for c in generate_base32_string())\", \"assert generate_base32_string() != generate_base32_string()\", \"assert len(s...
{ "split": "train", "index": 80504, "acecode_id": "evol_31690", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the status of a swimming pool based on the water temperature. The function will take an integer input representing the temperature in degrees Celsius and will return a string indicating the status of the pool. If the te...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pool_status(10) == 'Too Cold'\", \"assert pool_status(15) == 'Comfortable'\", \"assert pool_status(20) == 'Comfortable'\", \"assert pool_status(25) == 'Comfortable'\", \"assert pool_status(26) == 'Too Hot'\", \"assert pool_status(30) == 'Too Hot'\", \"assert...
{ "split": "train", "index": 80505, "acecode_id": "bigcode_python_fns_47259", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the average of loss values provided in a list. The function should take a list of floating-point numbers representing the loss values for different batches and return the average loss. If the input list is empty, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_loss([1.0, 2.0, 3.0]) == 2.0\", \"assert calculate_average_loss([5.0, 15.0, 10.0]) == 10.0\", \"assert calculate_average_loss([0.0, 0.0, 0.0]) == 0.0\", \"assert calculate_average_loss([4.5]) == 4.5\", \"assert calculate_average_loss([]) ==...
{ "split": "train", "index": 80506, "acecode_id": "oss_17593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the updating of DNS records on Cloudflare. The function should take three parameters: a string `domain` representing the domain for which to update DNS records, a string `record` representing the DNS record to update...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_dns_record('example.com', 'A', '192.0.2.1') == 'Successfully updated A for example.com to 192.0.2.1'\", \"assert update_dns_record('test.com', 'CNAME', 'example.com') == 'Successfully updated CNAME for test.com to example.com'\", \"assert update_dns_r...
{ "split": "train", "index": 80507, "acecode_id": "oss_25876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that simulates a user authentication process. The function should take in three parameters: a dictionary `user_data`, a dictionary `token_response`, and a string `api_response`. The `user_data` dictionary contains user informat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_user_data({'username': 'user1'}, {'access_token': 'token123'}, '{\\\"username\\\": \\\"user1\\\"}') == 'Authentication successful'\", \"assert fetch_user_data({'username': 'user2'}, {'access_token': 'token123'}, '{\\\"username\\\": \\\"user1\\\"}') == ...
{ "split": "train", "index": 80508, "acecode_id": "oss_11505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function `reverse_array(arr)` that constructs a new array containing the elements of the original array in reverse order. The original array should remain unmodified. You must not use any built-in reverse methods, and your solution should hav...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_array([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_array([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_array([5]) == [5]\", \"assert reverse_array([]) == []\", \"assert reverse_array([1, 3, 5, 7]) == [7, 5, 3, 1]\", \"assert reverse_ar...
{ "split": "train", "index": 80509, "acecode_id": "evol_32826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even integers from the original list. The function should preserve the order of the even integers as they appear in the input list. If there are no even integers, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_...
{ "split": "train", "index": 80510, "acecode_id": "oss_15679", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of words, implement a function `sort_words_by_len(list_of_words)` that sorts the words based on their length. If two words have the same length, they should be sorted alphabetically, ignoring case and any special characters. The function should return a new list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_words_by_len(['apple', 'banana', 'cherry', 'date', 'fig', 'grape']) == ['fig', 'date', 'apple', 'grape', 'banana', 'cherry']\", \"assert sort_words_by_len(['a', 'ab', 'abc', 'abcd']) == ['a', 'ab', 'abc', 'abcd']\", \"assert sort_words_by_len(['hello!',...
{ "split": "train", "index": 80511, "acecode_id": "evol_5644", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that simulates the training of a stock price prediction model using a simplified dataset. The function `train_model` should take in a list of daily stock prices, represented as floats, and a string representing the stock symbol, and it ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert train_model([100.0, 200.0, 300.0], 'AAPL') == 200.0\", \"assert train_model([150.5, 250.5, 350.5], 'GOOGL') == 250.5\", \"assert train_model([50.0, 75.0, 100.0, 125.0], 'TSLA') == 87.5\", \"assert train_model([], 'NFLX') == 0.0\", \"assert train_model([200.0...
{ "split": "train", "index": 80512, "acecode_id": "bigcode_python_fns_7276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that merges two distinct strings into one composite string, separating them with a space. If the strings are not distinct, the function should return a message indicating that the strings are not distinct. The function signature is: def merge_strings(string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_strings('Hello', 'World') == 'Hello World'\", \"assert merge_strings('Python', 'Programming') == 'Python Programming'\", \"assert merge_strings('OpenAI', 'ChatGPT') == 'OpenAI ChatGPT'\", \"assert merge_strings('Leet', 'Code') == 'Leet Code'\", \"asser...
{ "split": "train", "index": 80513, "acecode_id": "evol_3236", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the subscription of a user to a financial market symbol. The function should take in a symbol string that the user wants to subscribe to. If the symbol is already in the subscription list, it should return False, indica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subscribe('AAPL') == True\", \"assert subscribe('GOOGL') == True\", \"assert subscribe('TSLA') == True\", \"assert subscribe('MSFT') == True\", \"assert subscribe('AMZN') == True\", \"assert subscribe('NFLX') == True\", \"assert subscribe('FB') == True\", \"...
{ "split": "train", "index": 80514, "acecode_id": "bigcode_python_fns_27574", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with normalizing a key combination input. A key combination consists of a main key and any number of modifier keys. The main key must be a single character, and it can be an uppercase letter or one of the special keys. The valid modifier keys are 'Control', 'Alt'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_key_combo('a') == 'A'\", \"assert normalize_key_combo('A') == 'A'\", \"assert normalize_key_combo('Control+a') == 'Control+A'\", \"assert normalize_key_combo('Alt+b') == 'Alt+B'\", \"assert normalize_key_combo('Shift+c') == 'Shift+C'\", \"assert no...
{ "split": "train", "index": 80515, "acecode_id": "bigcode_python_fns_6871", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of programming language names, implement a function `convert_to_tuples(lst)` that converts the list into a tuple of strings, where each string is reversed. The function should return a tuple containing the reversed names of the programming languages. For example, i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_tuples(['Python', 'Java', 'JavaScript']) == ('nohtyP', 'avaJ', 'tpircSavaJ')\", \"assert convert_to_tuples(['C', 'C++', 'C#']) == ('C', '++C', '#C')\", \"assert convert_to_tuples(['Ruby', 'Swift']) == ('ybuR', 'tfiwS')\", \"assert convert_to_tuple...
{ "split": "train", "index": 80516, "acecode_id": "evol_20711", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether a given Docker volume exists based on its name. The function should take a string representing the volume name and return a boolean value: True if the volume exists, and False otherwise. The names of existing volum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert docker_volume_exist('my_volume') == True\", \"assert docker_volume_exist('test_volume') == True\", \"assert docker_volume_exist('backup_volume') == False\", \"assert docker_volume_exist('logs_volume') == False\", \"assert docker_volume_exist('temp_volume') =...
{ "split": "train", "index": 80517, "acecode_id": "bigcode_python_fns_46049", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the penalty for late submission of a project based on the maximum possible score and the difference in hours between the deadline and the submission date. Write a function `penalty_eqn(s_m: int, Dt: int) -> int` that takes in two parameters: `s_m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert penalty_eqn(100, 0) == 90\", \"assert penalty_eqn(75, -48) == 64\", \"assert penalty_eqn(80, 0) == 72\", \"assert penalty_eqn(200, 0) == 180\", \"assert penalty_eqn(0, 0) == 0\"]}" }
{ "split": "train", "index": 80518, "acecode_id": "bigcode_python_fns_8748", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with generating HTML content for a blog post. Write a function called `generate_heading` that takes a single parameter, `author`, a string representing the author's name. The function should return a string that contains the author's name enclosed in `<h3>` HTML ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_heading('John Doe') == '<h3>John Doe</h3>'\", \"assert generate_heading('Alice Johnson') == '<h3>Alice Johnson</h3>'\", \"assert generate_heading('Bob Brown') == '<h3>Bob Brown</h3>'\", \"assert generate_heading('Charlie White') == '<h3>Charlie Whit...
{ "split": "train", "index": 80519, "acecode_id": "oss_36544", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a multi-tiered, complexly intertwined numerical sequence (a list that may contain other lists), write a function named `count_elements_in_nested_list` that returns a dictionary. The dictionary should have the unique numbers from the list as keys and their corresponding fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_elements_in_nested_list([1, [2], 3, [4, [5, 6], 7], 1, [2, 3, [2, [1]]]]) == {1: 3, 2: 3, 3: 2, 4: 1, 5: 1, 6: 1, 7: 1}\", \"assert count_elements_in_nested_list([]) == {}\", \"assert count_elements_in_nested_list([1]) == {1: 1}\", \"assert count_eleme...
{ "split": "train", "index": 80520, "acecode_id": "evol_2736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of user IDs and a service class, then creates a service instance for each user ID if it does not already exist. The service class has a method `get` that checks if an instance for a given user ID exists and a method `cre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_services([1, 2, 3], Service) == None\", \"assert create_services([1, 1, 2], Service) == None\", \"assert create_services([4, 5], Service) == None\", \"assert create_services([], Service) == None\", \"assert create_services([6], Service) == None\", \"a...
{ "split": "train", "index": 80521, "acecode_id": "bigcode_python_fns_22252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers `nums`. Your task is to find the length of the shortest subarray that, when sorted, makes the entire array sorted in non-decreasing order. If the array is already sorted, return 0. Write a function `findUnsortedSubarray(nums)` to solve this pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findUnsortedSubarray([1, 2, 3, 4, 5]) == 0\", \"assert findUnsortedSubarray([5, 4, 3, 2, 1]) == 5\", \"assert findUnsortedSubarray([1, 2, 3, 5, 4]) == 2\", \"assert findUnsortedSubarray([1]) == 0\", \"assert findUnsortedSubarray([2, 1, 3, 4, 5]) == 2\", \"as...
{ "split": "train", "index": 80522, "acecode_id": "oss_25452", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function `manage_duplicates(lst)` that modifies the list in place such that any duplicate values are replaced with the string 'X', while maintaining the original order of the list. The function should return the modified list.\nPlease reason ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_duplicates(['Lion', 'Tiger', 'Bear', 'Lion']) == ['Lion', 'Tiger', 'Bear', 'X']\", \"assert manage_duplicates(['Cat', 'Dog', 'Cat', 'Mouse']) == ['Cat', 'Dog', 'X', 'Mouse']\", \"assert manage_duplicates(['Apple', 'Banana', 'Apple', 'Orange', 'Banana'...
{ "split": "train", "index": 80523, "acecode_id": "evol_22669", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings. Your task is to write a function that takes this list as input and returns a new list where each string is inverted. Inverting a string means reversing the order of its characters. Write a function `invert_strings` that takes a list of strings a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert invert_strings(['hello', 'world', 'python']) == ['olleh', 'dlrow', 'nohtyp']\", \"assert invert_strings(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert invert_strings(['123', '456', '789']) == ['321', '654', '987']\", \"assert invert_strings(['racecar', 'lev...
{ "split": "train", "index": 80524, "acecode_id": "oss_26167", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains a string and an integer. Your task is to implement a function that calculates the total count of integers that are greater than a specified threshold. Additionally, you need to compute the sum of these integers that are ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_and_sum_greater_than([('apple', 5), ('banana', 10), ('cherry', 15)], 8) == (2, 25)\", \"assert count_and_sum_greater_than([('one', 1), ('two', 2), ('three', 3)], 3) == (0, 0)\", \"assert count_and_sum_greater_than([], 0) == (0, 0)\", \"assert count_and...
{ "split": "train", "index": 80525, "acecode_id": "bigcode_python_fns_22356", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the root of a binary tree, return the length of the longest consecutive path in the tree. This path can be either increasing or decreasing. The path can be in the child-Parent-child order, but must not contain any duplicate values. For example, both [1,2,3,4] and [4,3,2,1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_consecutive(TreeNode(1, TreeNode(2), TreeNode(3))) == 2\", \"assert longest_consecutive(TreeNode(2, TreeNode(1), TreeNode(3))) == 3\", \"assert longest_consecutive(TreeNode(1)) == 1\", \"assert longest_consecutive(TreeNode(1, TreeNode(2, TreeNode(3))...
{ "split": "train", "index": 80526, "acecode_id": "evol_4123", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of tuples where each tuple contains a command ID and its corresponding command object. Implement a function `get_command_by_id(commands_by_id: List[Tuple[str, Command]], command_id: str) -> Command` that retrieves the command object associated with the prov...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_command_by_id([('command-id', Command()), ('another-id', Command())], 'command-id') is not None\", \"assert get_command_by_id([('cmd1', Command()), ('cmd2', Command())], 'cmd1') is not None\", \"assert get_command_by_id([('test-id', Command())], 'test-id...
{ "split": "train", "index": 80527, "acecode_id": "bigcode_python_fns_35727", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function to preprocess a list of discharge summary notes. The function should perform the following tasks: 1. Preprocess the discharge summary notes by cleaning the text and splitting sections by headers. The headers are denoted by the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert preprocess_notes([(1, 'Section: Introduction\\\\nThis is the introduction.\\\\nSection: Summary\\\\nThis is the summary.')]) == [{'PK': 1, 'TEXT': ['Introduction This is the introduction.', 'Summary This is the summary.']}]\", \"assert preprocess_notes([(2, ...
{ "split": "train", "index": 80528, "acecode_id": "oss_32635", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that computes the sum of all even integers in the list and returns the result. If there are no even integers, return 0. Implement the function `sum_of_evens(nums: List[int]) -> int` where `nums` is the list of i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([0]) == 0\", \"assert sum_of_...
{ "split": "train", "index": 80529, "acecode_id": "bigcode_python_fns_35569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_user_ages(users: List[Dict[str, int]], lower_age: int, upper_age: int) -> List[int]` that takes a list of user records and returns a list of ages of users whose ages fall within the specified range [lower_age, upper_age]. The input `users` is a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_ages([{'age': 25}, {'age': 30}, {'age': 35}], 20, 30) == [25, 30]\", \"assert get_user_ages([{'age': 15}, {'age': 22}, {'age': 29}, {'age': 40}], 25, 35) == [29]\", \"assert get_user_ages([{'age': 10}, {'age': 20}, {'age': 30}], 40, 50) == []\", \"a...
{ "split": "train", "index": 80530, "acecode_id": "evol_35252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_max(words, case_sensitive=False)` that accepts a list of distinct strings as input. The function should return the string with the greatest number of unique characters. In the event of a tie, it should return the first string in lexicographical order....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max(['aaa', 'bb', 'c'], True) == 'aaa'\", \"assert find_max(['1', '2', '3']) == '1'\", \"assert find_max(['same', 'same', 'same']) == 'same'\", \"assert find_max(['A', 'b', 'C']) == 'A'\", \"assert find_max(['unique', 'characters', 'test']) == 'characte...
{ "split": "train", "index": 80531, "acecode_id": "evol_7322", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a recursive function `is_palindrome` that checks whether a given string is a palindrome, ignoring case sensitivity, punctuation, and spaces. The function should return `True` if the string is a palindrome and `False` otherwise. For the purpose of this problem, a palin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('race a car') == False\", \"assert is_palindrome('Madam, in Eden, I\\u2019m Adam.') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('W...
{ "split": "train", "index": 80532, "acecode_id": "evol_14257", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes an input value 'y' and returns the value of 'y' multiplied by 2. However, if the input is not of the integer data type, the function should raise a TypeError with the message 'Input value must be an integer.'\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double(0) == 0\", \"assert double(1) == 2\", \"assert double(-1) == -2\", \"assert double(5) == 10\", \"assert double(100) == 200\", \"assert double(-100) == -200\", \"assert double(10) == 20\", \"assert double(42) == 84\", \"assert double(99) == 198\", \"as...
{ "split": "train", "index": 80533, "acecode_id": "evol_10728", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that constructs a `LibraryDoc` object from a dictionary containing specifications for the library documentation. The `LibraryDoc` class has the following attributes: `name`, `doc`, `version`, `type`, and `scope`. Your task is to implement...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_library_doc({'name': 'LibraryA', 'doc': 'Documentation A', 'version': '1.0', 'type': 'Python', 'scope': 'Public'}) == LibraryDoc('LibraryA', 'Documentation A', '1.0', 'Python', 'Public')\", \"assert build_library_doc({'name': 'LibraryB', 'doc': 'Docume...
{ "split": "train", "index": 80534, "acecode_id": "oss_14126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs a linear search on a list of strings. The function should take two parameters: a list of strings `arr` and a string `x`. It should return the index of the first occurrence of `x` in `arr`, or -1 if `x` is not found. The search should be case-s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_search(['apple', 'banana', 'cherry', 'date'], 'cherry') == 2\", \"assert linear_search(['apple', 'banana', 'cherry', 'date'], 'banana') == 1\", \"assert linear_search(['apple', 'banana', 'cherry', 'date'], 'apple') == 0\", \"assert linear_search(['app...
{ "split": "train", "index": 80535, "acecode_id": "evol_3525", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a rotated sorted array and a target value, implement a function that returns the index of the last occurrence of the target in the array. If the target is not found, return -1. The array may contain duplicates. The function should be defined as: def search_last(nums: List...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_last([1,1,1,1,1,1], 1) == 5\", \"assert search_last([2,2,2,2,2,2], 3) == -1\", \"assert search_last([], 1) == -1\", \"assert search_last([1,2,3,4,5,5,5], 5) == 6\", \"assert search_last([5,5,5,5,5], 5) == 4\", \"assert search_last([2,5,6,0,0,1,2], 0) ...
{ "split": "train", "index": 80536, "acecode_id": "evol_28394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves a specific object set from a list of object sets based on a provided group name. The function should take in a list of object sets (strings) and a target group name (string). It should return the first object set that c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_set_by_group_name(['controllers_grp_set1', 'controllers_grp_set2', 'other_set'], 'controllers_grp') == 'controllers_grp_set1'\", \"assert get_set_by_group_name(['set1', 'set2', 'set3'], 'controllers_grp') == None\", \"assert get_set_by_group_name(['contr...
{ "split": "train", "index": 80537, "acecode_id": "bigcode_python_fns_32764", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two dictionaries, `dct` and `merge_dct`. Implement a function `dict_merge(dct: dict, merge_dct: dict) -> None` that merges `merge_dct` into `dct`. If a key exists in both dictionaries and the corresponding value in both is also a dictionary, you need to merge them...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dict_merge({'a': 1, 'b': {'c': 2}}, {'b': {'d': 3}, 'e': 4}) == None\", \"assert dict_merge({'x': {'y': 1}}, {'x': {'z': 2}}) == None\", \"assert dict_merge({}, {'a': 1}) == None\", \"assert dict_merge({'a': 1}, {}) == None\", \"assert dict_merge({'a': 1}, {...
{ "split": "train", "index": 80538, "acecode_id": "bigcode_python_fns_2505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of positive integers, implement a function that calculates the highest common factor (HCF) of the numbers in the array. The function should return an error message if any of the inputs are not positive integers. You need to ensure that the function can handle an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_hcf([12, 15, 21]) == 3\", \"assert calculate_hcf([2, 4, 6, 8]) == 2\", \"assert calculate_hcf([5, 10, 15]) == 5\", \"assert calculate_hcf([7, 11, 13]) == 1\", \"assert calculate_hcf([100, 25, 50]) == 25\", \"assert calculate_hcf([18, 24, 30]) == 6\...
{ "split": "train", "index": 80539, "acecode_id": "evol_26511", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a convolution operation on a 2D input tensor based on the specified parameters. The function should take three inputs: a 2D list `input_tensor` representing the input data, an integer `inplanes` representing the number ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convolution_operation([[1, 2], [3, 4]], 1, 1, 1) == [[1, 2], [3, 4]]\", \"assert convolution_operation([[1, 0], [0, 1]], 1, 1, 1) == [[1, 0], [0, 1]]\", \"assert convolution_operation([[5, 6], [7, 8]], 1, 1, 1) == [[5, 6], [7, 8]]\", \"assert convolution_ope...
{ "split": "train", "index": 80540, "acecode_id": "oss_5426", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `is_event_set(event_state: bool) -> bool` that determines if a stop event has been set. The function takes a boolean input `event_state`, which represents whether the stop event is set (True) or not (False). The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_event_set(True) == True\", \"assert is_event_set(False) == False\", \"assert is_event_set(True) == True\", \"assert is_event_set(False) == False\", \"assert is_event_set(True) == True\", \"assert is_event_set(False) == False\", \"assert is_event_set(True)...
{ "split": "train", "index": 80541, "acecode_id": "oss_3460", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `quaternion_multiply(q1, q2)` that takes two quaternions represented as tuples `(real, i_part, j_part, k_part)` and returns their product as a new tuple in the same format. The multiplication of two quaternions is defined as follows: \n\nIf `q1 = (r1, i1, j...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quaternion_multiply((0, 0, 0, 0), (0, 0, 0, 0)) == (0, 0, 0, 0)\", \"assert quaternion_multiply((1, 0, 0, 0), (0, 1, 1, 1)) == (0, 1, 1, 1)\", \"assert quaternion_multiply((0, 1, 0, 0), (0, 0, 1, 0)) == (0, 0, 0, 1)\", \"assert quaternion_multiply((1, 0, 0, ...
{ "split": "train", "index": 80542, "acecode_id": "evol_20692", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a command-line utility that simulates a basic server management system. The utility should accept a command as an input, which can be one of the following: 'start', 'stop', 'restart', or 'status'. Your function should return a corresponding message ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_server('start') == 'Server started'\", \"assert manage_server('stop') == 'Server stopped'\", \"assert manage_server('restart') == 'Server restarted'\", \"assert manage_server('status') == 'Server is running'\", \"assert manage_server('unknown') == 'Un...
{ "split": "train", "index": 80543, "acecode_id": "bigcode_python_fns_16843", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a second price auction for cloud computing resources. You are given a list of sellers, where each seller has the following attributes: a name, the number of available cores, the price per core, and an empty list corresponding to the cores (this li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_price([['SellerA', 10, 5, []], ['SellerB', 20, 4, []], ['SellerC', 15, 6, []]], 0, 5) == 25\", \"assert calculate_total_price([['SellerA', 10, 10, []], ['SellerB', 20, 10, []]], 1, 15) == 150\", \"assert calculate_total_price([['SellerA', 10,...
{ "split": "train", "index": 80544, "acecode_id": "bigcode_python_fns_28847", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a dictionary representing a file system where keys are file or directory names and values are either the file size (an integer) or another dictionary representing the contents of a directory, implement a function `disk_usage(file_system: Dict[str, Union[int, Dict[str, Uni...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert disk_usage({'file1.txt': 100, 'file2.txt': 200}) == 300\", \"assert disk_usage({'dir1': {'file1.txt': 150, 'file2.txt': 250}, 'dir2': {'file3.txt': 300}}) == 700\", \"assert disk_usage({'dir1': {'file1.txt': 100}, 'dir2': {'file2.txt': 200, 'dir3': {'file4.t...
{ "split": "train", "index": 80545, "acecode_id": "bigcode_python_fns_31302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary tree structure, implement a function that performs a level-order traversal and returns the values of the nodes in a list. If the tree is empty, return an empty list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert level_order(None) == []\", \"assert level_order(Node(1)) == [1]\", \"assert level_order(Node(1, Node(2))) == [1, 2]\", \"assert level_order(Node(1, Node(2), Node(3))) == [1, 2, 3]\", \"assert level_order(Node(1, Node(2, Node(4), Node(5)), Node(3))) == [1, 2,...
{ "split": "train", "index": 80546, "acecode_id": "evol_4942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple logging system for requests. Each request has a status represented by a positive small integer, with predefined choices for the status: 1 for 'Created', 2 for 'In Progress', and 3 for 'Completed'. Each request also records the time it was c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_completed_requests([{'status': 1, 'created_timestamp': '2023-01-01T12:00:00', 'completed_timestamp': None}, {'status': 3, 'created_timestamp': '2023-01-02T12:00:00', 'completed_timestamp': '2023-01-02T13:00:00'}, {'status': 2, 'created_timestamp': '202...
{ "split": "train", "index": 80547, "acecode_id": "oss_20587", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of blob names represented as strings and a dictionary that maps each blob name to its corresponding value (a tensor). Your task is to implement a function that takes the list of blob names and the dictionary as input, and returns a new dictionary where each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_tensors(['blob1', 'blob2'], {'blob1': 1, 'blob2': 2}) == {'blob1': 1, 'blob2': 2}\", \"assert add_tensors(['blob1', 'blob3'], {'blob1': 1, 'blob2': 2}) == {'blob1': 1}\", \"assert add_tensors(['blob4'], {'blob1': 1, 'blob2': 2}) == {}\", \"assert add_ten...
{ "split": "train", "index": 80548, "acecode_id": "bigcode_python_fns_35144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to solve the N-Queens problem. The N-Queens problem is a classic chess-based problem where the goal is to place N queens on an N×N chessboard in such a way that no two queens threaten each other. Implement a function that takes an int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_n_queens(1) == [['Q']]\", \"assert solve_n_queens(2) == []\", \"assert solve_n_queens(3) == []\", \"assert solve_n_queens(7) != []\", \"assert solve_n_queens(8) != []\", \"assert solve_n_queens(9) != []\"]}" }
{ "split": "train", "index": 80549, "acecode_id": "oss_31690", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a dictionary of lambda layer names and their corresponding versions, write a function that simulates the deletion of each layer version by printing a message for each deletion attempt. If a deletion fails for any reason, raise an exception with the message 'Failed to dele...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_layer_versions({'layer1': [1, 2], 'layer2': [3]}) == ['Deleting layer version layer1:1', 'Deleting layer version layer1:2', 'Deleting layer version layer2:3']\", \"assert delete_layer_versions({'layerA': [1]}) == ['Deleting layer version layerA:1']\",...
{ "split": "train", "index": 80550, "acecode_id": "bigcode_python_fns_47808", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of lists, where each inner list contains categorical feature values for a dataset. Your task is to write a function that calculates the average number of different values for all the categorical features. Each feature corresponds to a column in the inner li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_average_distinct_values([['cat', 'dog', 'fish'], ['cat', 'dog', 'bird'], ['cat', 'cat', 'dog']]) == 2.0\", \"assert get_average_distinct_values([['apple', 'banana', 'apple'], ['banana', 'apple', 'banana']]) == 2.0\", \"assert get_average_distinct_values(...
{ "split": "train", "index": 80551, "acecode_id": "bigcode_python_fns_16652", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes HTTP response headers and constructs a formatted response message. The function should take in the HTTP status code as a string and a list of tuples representing the response headers, and then return a formatted ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_response_message('200 OK', [('Content-type', 'text/plain'), ('Content-length', '128')]) == 'HTTP/1.1 200 OK\\\\nContent-type: text/plain\\\\nContent-length: 128\\\\n\\\\n'\", \"assert format_response_message('404 Not Found', [('Content-type', 'text/ht...
{ "split": "train", "index": 80552, "acecode_id": "oss_21757", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary `parsed_features` that contains various features as key-value pairs. One of the features is called 'input_mask_2', which is a list of binary values (0s and 1s) represented as strings. Your task is to write a function `convert_input_mask_to_int(parsed_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_input_mask_to_int({'input_mask_1': ['1', '1', '0', '1', '0'], 'input_mask_2': ['0', '1', '1', '0', '1']}) == {'input_mask_1': ['1', '1', '0', '1', '0'], 'input_mask_2': [0, 1, 1, 0, 1]}\", \"assert convert_input_mask_to_int({'input_mask_2': ['1', '0'...
{ "split": "train", "index": 80553, "acecode_id": "oss_19859", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that calculates the sum of all prime numbers up to a given integer n. The function should take an integer n as input and return the sum of all prime numbers less than or equal to n.\nPlease reason step by step, then write a self-contained Python solution. Give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_prime_numbers(1) == 0\", \"assert sum_prime_numbers(2) == 2\", \"assert sum_prime_numbers(3) == 5\", \"assert sum_prime_numbers(4) == 5\", \"assert sum_prime_numbers(5) == 10\", \"assert sum_prime_numbers(6) == 10\", \"assert sum_prime_numbers(7) == 17\"...
{ "split": "train", "index": 80554, "acecode_id": "evol_29584", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simplified version of the rock-paper-scissors game. Implement a function `determine_winner(player_choice: str, computer_choice: str) -> str` that takes in two parameters: the player's choice and the computer's choice, which can each be either 'r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_winner('rock', 'paper') == 'Computer wins!'\", \"assert determine_winner('rock', 'scissors') == 'You win!'\", \"assert determine_winner('paper', 'rock') == 'You win!'\", \"assert determine_winner('paper', 'scissors') == 'Computer wins!'\", \"assert...
{ "split": "train", "index": 80555, "acecode_id": "oss_8044", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `intricate_histogram(investigation)` that takes a string containing space-separated characters (including uppercase and lowercase alphabets, numerals, and special characters) and returns a dictionary showing the characters with the highest frequency. Alphab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intricate_histogram('A B c 1 @') == {'a': 1, 'b': 1, 'c': 1, '1': 1, '@': 1}\", \"assert intricate_histogram('A b C a B 1 2 2') == {'a': 2, 'b': 2, '2': 2}\", \"assert intricate_histogram('B B B b A ! ! ! !') == {'b': 4, '!': 4}\", \"assert intricate_histogr...
{ "split": "train", "index": 80556, "acecode_id": "evol_7627", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an array of non-negative integers, write a function that counts the number of distinct triplets (i, j, k) such that the lengths of the sides of a triangle can be formed using the elements at these indices. A triplet (i, j, k) is considered valid if the sum of the lengths ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triangleNumber([2,2,3,4]) == 3\", \"assert triangleNumber([4,2,3,4]) == 4\", \"assert triangleNumber([10, 15, 20]) == 1\", \"assert triangleNumber([1,1,1]) == 1\", \"assert triangleNumber([5,5,5,5]) == 4\", \"assert triangleNumber([0, 0, 0, 0]) == 0\", \"ass...
{ "split": "train", "index": 80557, "acecode_id": "evol_4274", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function `open_picoscope` that simulates the process of opening a PicoScope device. The function should return a handle represented by an integer value. Each time the function is called, it should randomly return a successful handle (a posi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert open_picoscope() >= -1 and open_picoscope() <= 1000\", \"assert open_picoscope() >= -1 and open_picoscope() <= 1000\", \"assert open_picoscope() >= -1 and open_picoscope() <= 1000\", \"assert open_picoscope() >= -1 and open_picoscope() <= 1000\", \"assert op...
{ "split": "train", "index": 80558, "acecode_id": "oss_3301", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of an SPI (Serial Peripheral Interface) device. The device has a maximum clock speed defined in Hz, and it should be able to handle various speed settings. Your function should accept a list of speeds (both...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_max_speed([100000, 500000, 1000000, 2e6]) == (2000000, 'SPI device closed.')\", \"assert get_max_speed([50000, 750000, 250000]) == (750000, 'SPI device closed.')\", \"assert get_max_speed([]) == (0, 'SPI device closed.')\", \"assert get_max_speed([1.5e6,...
{ "split": "train", "index": 80559, "acecode_id": "oss_23596", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three integers in_channels, out_channels, and groups, write a function `condense_simple_conv3x3(in_channels: int, out_channels: int, groups: int) -> dict` that returns a dictionary with the following keys: 'in_channels', 'out_channels', 'ksize', 'stride', 'pad', and 'grou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert condense_simple_conv3x3(16, 32, 1) == {'in_channels': 16, 'out_channels': 32, 'ksize': 3, 'stride': 1, 'pad': 1, 'groups': 1}\", \"assert condense_simple_conv3x3(32, 64, 2) == {'in_channels': 32, 'out_channels': 64, 'ksize': 3, 'stride': 1, 'pad': 1, 'groups...
{ "split": "train", "index": 80560, "acecode_id": "bigcode_python_fns_29173", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D basis defined by two vectors in the form of a 2x2 matrix, and an integer Nmax, implement a function that calculates the total number of unique lattice points that can be formed within a square grid defined by the basis vectors. A lattice point is defined as a point t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_lattice_points([[1, 0], [0, 1]], 1) == 9\", \"assert count_lattice_points([[1, 0], [0, 1]], 2) == 25\", \"assert count_lattice_points([[2, 0], [0, 2]], 1) == 9\", \"assert count_lattice_points([[1, 2], [2, 1]], 2) == 25\", \"assert count_lattice_points...
{ "split": "train", "index": 80561, "acecode_id": "bigcode_python_fns_36282", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string `input_string` and a dictionary `replacements` where each key-value pair represents a substring to be replaced and its corresponding replacement, implement a function `replace_and_count(input_string, replacements)` that replaces all instances of each substring in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_and_count('Hello world, world!', {'world': 'python'}) == ('Hello python, python!', {'world': 2})\", \"assert replace_and_count('abcabcabc', {'a': 'x', 'b': 'y'}) == ('xycxycxyc', {'a': 3, 'b': 3})\", \"assert replace_and_count('test case', {'case': '...
{ "split": "train", "index": 80562, "acecode_id": "evol_17873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 1-dimensional list of integers, write a function that expands the list by a specified beam size. The function should take a list and an integer beam_size as input, and return a new list where each element of the original list is repeated beam_size times consecutively. F...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert expand_to_beam_size([1, 2, 3], 3) == [1, 1, 1, 2, 2, 2, 3, 3, 3]\", \"assert expand_to_beam_size([5, 6], 2) == [5, 5, 6, 6]\", \"assert expand_to_beam_size([0], 5) == [0, 0, 0, 0, 0]\", \"assert expand_to_beam_size([-1, -2, -3], 1) == [-1, -2, -3]\", \"asser...
{ "split": "train", "index": 80563, "acecode_id": "bigcode_python_fns_31337", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that counts the occurrences of each character in a given string. Your function should take a single string as input and return a dictionary where the keys are the characters and the values are the counts of those characters. The input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_characters('hello') == {'h': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert count_characters('') == {}\", \"assert count_characters('12345') == {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1}\", \"assert count_characters('aA') == {'a': 1, 'A': 1}\", \"assert count_ch...
{ "split": "train", "index": 80564, "acecode_id": "bigcode_python_fns_23364", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of intervals represented as pairs of integers, determine the maximum number of non-overlapping intervals that can be selected from the list. An interval is defined as non-overlapping if its start time is greater than or equal to the end time of the last selected in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_non_overlapping_intervals([[1, 4], [2, 6], [8, 9]]) == 2\", \"assert max_non_overlapping_intervals([[1, 2], [2, 3], [3, 4], [4, 5]]) == 4\", \"assert max_non_overlapping_intervals([[1, 3], [2, 4], [3, 5]]) == 2\", \"assert max_non_overlapping_intervals([...
{ "split": "train", "index": 80565, "acecode_id": "evol_23219", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a file name, create a function that appends the suffix '-melodie.mid' to the given input and returns the resulting string. The function should handle various types of input, including strings and numbers, and should always return a string regardless of the input type. Imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_midi_download_name('track1') == 'track1-melodie.mid'\", \"assert get_midi_download_name('piano_piece') == 'piano_piece-melodie.mid'\", \"assert get_midi_download_name('guitar_solo') == 'guitar_solo-melodie.mid'\", \"assert get_midi_download_name('') == '...
{ "split": "train", "index": 80566, "acecode_id": "bigcode_python_fns_32634", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 3D array of integers and a target integer, implement a function `find_element(array3D, target)` that uses a divide and conquer approach to locate the indices of the target integer within the 3D array. If the target is found, return a tuple of its indices (z, y, x). If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_element([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], 4) == (0, 1, 1)\", \"assert find_element([[[1, 2]], [[3, 4]], [[5, 6]]], 5) == (2, 0, 0)\", \"assert find_element([[[10, 20], [30, 40]], [[50, 60], [70, 80]]], 10) == (0, 0, 0)\", \"assert find_element([[[1,...
{ "split": "train", "index": 80567, "acecode_id": "evol_21285", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `find_first_params` that takes three parameters: an evaluator (a string), a current module (a string), and a function name (a string). Your goal is to return the parameters associated with the first module that contains the spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_params('evaluator1', 'moduleA', 'functionX') == ['param1', 'param2']\", \"assert find_first_params('evaluator1', 'moduleA', 'functionY') == None\", \"assert find_first_params('evaluator2', 'moduleB', 'functionA') == None\", \"assert find_first_par...
{ "split": "train", "index": 80568, "acecode_id": "oss_36830", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function `getOddCollatz(n)` that returns a sorted list of all prime numbers that are present in the Collatz sequence starting from n. The Collatz sequence is defined as follows: starting with any positive integer n, the next term is obtained ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getOddCollatz(1) == []\", \"assert getOddCollatz(2) == [2]\", \"assert getOddCollatz(4) == [2]\", \"assert getOddCollatz(8) == [2]\", \"assert getOddCollatz(12) == [2, 3, 5]\", \"assert getOddCollatz(16) == [2]\"]}" }
{ "split": "train", "index": 80569, "acecode_id": "evol_34571", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a non-negative integer `num` and a base `base` (2 <= base <= 36), write a function that converts `num` into its representation in the specified base and returns it as a string. The characters used for bases greater than 10 should include letters 'A' to 'Z' for values 10 t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert base_conv(10, 2) == '1010'\", \"assert base_conv(255, 16) == 'FF'\", \"assert base_conv(100, 10) == '100'\", \"assert base_conv(31, 2) == '11111'\", \"assert base_conv(5, 5) == '10'\", \"assert base_conv(15, 8) == '17'\", \"assert base_conv(0, 2) == '0'\", \...
{ "split": "train", "index": 80570, "acecode_id": "bigcode_python_fns_12542", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a list of places that should not be shown in an address book. The function should return a predefined list of hidden places as strings. Implement a function called `get_hidden_places` that takes no parameters and returns the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_hidden_places() == ['Secret Garden', 'Restricted Zone', 'Confidential Area', 'Private Property', 'Classified Location']\", \"assert len(get_hidden_places()) == 5\", \"assert 'Secret Garden' in get_hidden_places()\", \"assert 'Restricted Zone' in get_hidd...
{ "split": "train", "index": 80571, "acecode_id": "bigcode_python_fns_23642", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of modifications where each modification is represented as a tuple containing a unique identifier and a date (in the format YYYY-MM-DD). Your task is to group these modifications by date and return a list of lists, where each inner list contains all modific...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_modifications_by_date([(1, '2023-10-01'), (2, '2023-10-01'), (3, '2023-10-02')]) == [[(1, '2023-10-01'), (2, '2023-10-01')], [(3, '2023-10-02')]]\", \"assert group_modifications_by_date([(1, '2023-10-02'), (2, '2023-10-01'), (3, '2023-10-02')]) == [[(2...
{ "split": "train", "index": 80572, "acecode_id": "bigcode_python_fns_5606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates fetching historical events within a specified date range. The function should take two dates as input parameters, `start_date` and `end_date`, and return a list of event dates that fall within this range (inclusive). Each d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_events_in_range('2023-01-01', '2023-01-31') == ['2023-01-01', '2023-01-02', '2023-01-03', '2023-01-04', '2023-01-05', '2023-01-06', '2023-01-07', '2023-01-08', '2023-01-09', '2023-01-10', '2023-01-11', '2023-01-12', '2023-01-13', '2023-01-14', '2023-01-1...
{ "split": "train", "index": 80573, "acecode_id": "bigcode_python_fns_37955", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Create a function that generates a unique 6-digit number. The number should be between 100000 and 999999, inclusive. If the function is called multiple times, it should return a different number each time, ensuring uniqueness across calls.\nPlease reason step by step, then writ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_num() != generate_unique_num()\", \"assert 100000 <= generate_unique_num() <= 999999\", \"assert 100000 <= generate_unique_num() <= 999999\", \"assert 100000 <= generate_unique_num() <= 999999\", \"assert 100000 <= generate_unique_num() <= 99...
{ "split": "train", "index": 80574, "acecode_id": "evol_9701", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a JSON string representation of an object, implement a function that parses the JSON and returns a list of tuples containing the keys and values of the object, sorted by the keys based on the ASCII values of the characters in reverse order (i.e., descending). The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_json_keys('{\\\"b\\\": 2, \\\"a\\\": 1, \\\"c\\\": 3}') == [(\\\"c\\\", 3), (\\\"b\\\", 2), (\\\"a\\\", 1)]\", \"assert sort_json_keys('{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\"}') == [(\\\"key2\\\", \\\"value2\\\"), (\\\"key1\\\", \\\...
{ "split": "train", "index": 80575, "acecode_id": "evol_144", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `count_unique_words` that takes a string as input and returns the number of unique words present in that string. A word is defined as a sequence of alphanumeric characters separated by any non-alphanumeric character. The function should ig...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_words('The cat jumped over the fence') == 5\", \"assert count_unique_words('Hello world! Hello') == 2\", \"assert count_unique_words('Python is fun; Python is great!') == 4\", \"assert count_unique_words('Test, test, test.') == 1\", \"assert cou...
{ "split": "train", "index": 80576, "acecode_id": "oss_20753", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given three integers k, n, and p, write a function that calculates the probability of getting exactly k successes in n independent Bernoulli trials, where the probability of success in each trial is p. The formula for the probability mass function (pmf) of a binomial distributi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(EvalBinomialPmf(0, 10, 0.5) - 0.0009765625) < 1e-9\", \"assert abs(EvalBinomialPmf(5, 10, 0.5) - 0.24609375) < 1e-9\", \"assert abs(EvalBinomialPmf(10, 10, 1.0) - 1.0) < 1e-9\", \"assert abs(EvalBinomialPmf(0, 10, 1.0) - 0.0) < 1e-9\", \"assert abs(EvalB...
{ "split": "train", "index": 80577, "acecode_id": "bigcode_python_fns_29411", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `median(lst)` that returns the median of the list. If the list is empty, return the string 'Error'. The median is defined as the middle value when the list is sorted. If the list has an even number of elements, return the average o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([]) == 'Error'\", \"assert median([1]) == 1\", \"assert median([1, 2]) == 1.5\", \"assert median([1, 2, 3]) == 2\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([5, 3, 1, 4, 2]) == 3\", \"assert median([10, 20, 30]) == 20\", \"assert median...
{ "split": "train", "index": 80578, "acecode_id": "evol_24944", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of URL patterns and returns a dictionary containing the count of unique view names for each URL path. Each URL pattern is represented as a string in the format 'app_name/view_name/', and the view name is alway...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_view_names(['users/login/', 'users/register/', 'users/logout/']) == {'users/login/': 1, 'users/register/': 1, 'users/logout/': 1}\", \"assert count_view_names(['products/view/', 'products/edit/', 'products/delete/']) == {'products/view/': 1, 'products/...
{ "split": "train", "index": 80579, "acecode_id": "oss_22569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of dictionaries and returns the total number of unique y-axis values present in the data points. Each dictionary in the list represents a data point and contains the following keys: 'x' (representing the x-coo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_yaxes([{'x': 1, 'y': 2, 'name': 'Point A', 'yaxis': 'y1'}, {'x': 3, 'y': 4, 'name': 'Point B', 'yaxis': 'y2'}, {'x': 5, 'y': 6, 'name': 'Point C', 'yaxis': 'y1'}]) == 2\", \"assert count_unique_yaxes([{'x': 1, 'y': 5, 'name': 'Point D', 'yaxis':...
{ "split": "train", "index": 80580, "acecode_id": "oss_28481", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given path and query parameters to generate a formatted URL. The function should take a string `esi_path` that contains a version followed by sections of the path (and potentially a query string), and a boolean `is_ch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_url('v1/user/info', False) == 'ESI_BASE_URL/v1/user/info'\", \"assert generate_url('v1/user/info?search=test', False) == 'ESI_BASE_URL/v1/user/info?search=test'\", \"assert generate_url('latest/user/info', True) == 'ESI_CHINA/latest/user/info'\", \"...
{ "split": "train", "index": 80581, "acecode_id": "bigcode_python_fns_37729", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, your task is to implement a function that applies a specified operation (function) to each integer in the list. The operation can be any function that takes a single integer as an argument and returns an integer. The function should return a new list c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_function([1, 2, 3], lambda x: x + 1) == [2, 3, 4]\", \"assert apply_function([-1, 0, 1], lambda x: x * 2) == [-2, 0, 2]\", \"assert apply_function([5, 10, 15], lambda x: x - 5) == [0, 5, 10]\", \"assert apply_function([1, 2, 3], lambda x: x ** 2) == [1...
{ "split": "train", "index": 80582, "acecode_id": "oss_1659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two strings, `base` and `end`. Your task is to create a function that constructs a new string by appending `end` to `base`, ensuring that the resulting string begins with `base`. If the resulting string does not start with `base`, the function should raise a Value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert join_strings('folder/', 'file.txt') == 'folder/file.txt'\", \"assert join_strings('/home/user/', 'documents/report.pdf') == '/home/user/documents/report.pdf'\", \"assert join_strings('C:/Program Files/', 'app.exe') == 'C:/Program Files/app.exe'\", \"assert j...
{ "split": "train", "index": 80583, "acecode_id": "bigcode_python_fns_15650", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a pair of words followed by a count, formatted as 'word1 word2: count'. Your task is to calculate the probability P of the second word given the first word for each unique pair. The probability P is defined as the co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_probabilities(['hello world: 1', 'hello friend: 1', 'hello world: 1']) == ['hello world: 0.666667', 'hello friend: 0.333333']\", \"assert calculate_probabilities(['a b: 1', 'a c: 1', 'a d: 1']) == ['a b: 0.333333', 'a c: 0.333333', 'a d: 0.333333']...
{ "split": "train", "index": 80584, "acecode_id": "bigcode_python_fns_16018", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with managing a virtual application (vApp) in a virtual data center (vDC). Your goal is to implement a function that can perform various operations on the vApp based on the input parameters. The operations include listing the vApp details, creating a new vApp, de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_vapp('list', 'vdc1', 'vapp1', '', '', '') == ['vapp1: deployed', 'vapp2: undeployed']\", \"assert manage_vapp('create', 'vdc1', 'new_vapp', 'template1', '', '') == 'vApp created successfully.'\", \"assert manage_vapp('delete', 'vdc1', 'vapp1', '', '',...
{ "split": "train", "index": 80585, "acecode_id": "bigcode_python_fns_8126", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a string containing a mix of uppercase and lowercase letters. Your task is to implement a function that counts the number of uppercase letters in the string and returns this count. The function should ignore any non-letter characters. Write a function `count_upper...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_uppercase_letters('Hello World!') == 2\", \"assert count_uppercase_letters('Python3 is Awesome!') == 2\", \"assert count_uppercase_letters('12345') == 0\", \"assert count_uppercase_letters('') == 0\", \"assert count_uppercase_letters('aA1bB2cC3') == 3\...
{ "split": "train", "index": 80586, "acecode_id": "bigcode_python_fns_32890", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries where each dictionary contains information about geographic data records. Each record has two fields: 'Data_prov' (a string representing the data provider) and 'Record' (a string representing some data associated with that provider). Your ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_geodata([{'Data_prov': 'OSM', 'Record': 'Data1'}, {'Data_prov': 'Microsoft', 'Record': 'Data2'}, {'Data_prov': 'ODB', 'Record': 'Data3'}]) == (['Data1'], ['Data2'], ['Data3'])\", \"assert split_geodata([{'Data_prov': 'OSM', 'Record': 'Data1'}, {'Data_p...
{ "split": "train", "index": 80587, "acecode_id": "bigcode_python_fns_14720", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of three tuples representing the vertices of a triangle in a 2D plane, write a function called `calculate_triangle_area(vertices)` that calculates the area of the triangle formed by these vertices. Each vertex is represented as a tuple of (x, y) coordinates. You sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_triangle_area([(0, 0), (4, 0), (0, 3)]) == 6.0\", \"assert calculate_triangle_area([(1, 1), (4, 1), (1, 5)]) == 6.0\", \"assert calculate_triangle_area([(0, 0), (5, 0), (0, 5)]) == 12.5\", \"assert calculate_triangle_area([(1, 1), (2, 3), (3, 1)]) ...
{ "split": "train", "index": 80588, "acecode_id": "oss_17642", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a client communication channel with a server. Write a function `start_new_session` that takes two boolean parameters: `compression_enabled` and `encryption_enabled`. The function should return a dictionary t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_new_session(False, False) == {'compression': False, 'encryption': False, 'session_data': 'New session data'}\", \"assert start_new_session(True, False) == {'compression': True, 'encryption': False, 'session_data': 'New session data'}\", \"assert start_...
{ "split": "train", "index": 80589, "acecode_id": "oss_20784", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to generate unique identifiers of a specified length. The function should generate a random string that includes digits (0-9) and lowercase and uppercase letters (a-z, A-Z). The function must ensure that the generated identifier is un...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gen_unique_trid(5, ['abc12', '3d4ef']) not in ['abc12', '3d4ef']\", \"assert gen_unique_trid(6, []) not in []\", \"assert gen_unique_trid(10, ['abcdef1234', 'ghijkl5678']) not in ['abcdef1234', 'ghijkl5678']\", \"assert gen_unique_trid(3, ['aaa', 'bbb', 'abc...
{ "split": "train", "index": 80590, "acecode_id": "oss_18533", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of event creators and returns the top 'n' creators based on the number of events they have been associated with. Each creator is represented by a string and the events are represented by a list of strings that include th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_seen_creators(['Alice', 'Bob', 'Alice', 'Charlie', 'Bob', 'Alice'], 2) == ['Alice', 'Bob']\", \"assert most_seen_creators(['Alice', 'Alice', 'Bob', 'Charlie'], 3) == ['Alice', 'Bob', 'Charlie']\", \"assert most_seen_creators(['Alice', 'Bob', 'Charlie'],...
{ "split": "train", "index": 80591, "acecode_id": "bigcode_python_fns_43590", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary that may contain nested dictionaries, write a function `count_elements(data)` that calculates the total number of key-value pairs in the dictionary, including those in any nested dictionaries. The function should handle dictionaries with any level of nesting....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_elements({'name': 'John', 'age': 30}) == 2\", \"assert count_elements({'a': 1, 'b': {'c': 2, 'd': 3}}) == 4\", \"assert count_elements({}) == 0\", \"assert count_elements({'one': 1, 'two': 2, 'three': {'four': 4, 'five': {'six': 6}}}) == 6\", \"assert ...
{ "split": "train", "index": 80592, "acecode_id": "evol_16068", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the future value of an investment using the present value, interest rate, and time period. Implement a function `calculate_future_value(pv: float, r: float, n: float) -> float` that takes in three parameters: the present value (pv), the interest ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_future_value(100, 0.05, 5) == 127.62815625000003\", \"assert calculate_future_value(500, 0.06, 1) == 530.0\", \"assert calculate_future_value(100, 0.0, 10) == 100.0\", \"assert calculate_future_value(0, 0.1, 10) == 0.0\", \"assert calculate_future_...
{ "split": "train", "index": 80593, "acecode_id": "oss_7315", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a given size in bytes to a more human-readable format. Implement a function `convert_size(size: int) -> Tuple[float, str]` that takes an integer `size` (where `0 <= size <= 2^63 - 1`) representing the size in bytes and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_size(0) == (0, 'B')\", \"assert convert_size(500) == (500.0, 'B')\", \"assert convert_size(1024) == (1.0, 'KB')\", \"assert convert_size(2048) == (2.0, 'KB')\", \"assert convert_size(1048576) == (1.0, 'MB')\", \"assert convert_size(1073741824) == (1....
{ "split": "train", "index": 80594, "acecode_id": "bigcode_python_fns_39882", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary represents an element with various properties, write a function `get_unique_types(elements)` that returns a list of unique 'type' values from the input list. Each dictionary in the input list has a 'type' key whose value is a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_types([{'type': 'A'}, {'type': 'B'}, {'type': 'A'}, {'type': 'C'}]) == ['A', 'B', 'C']\", \"assert get_unique_types([{'type': 'single'}, {'type': 'double'}, {'type': 'triple'}, {'type': 'double'}]) == ['single', 'double', 'triple']\", \"assert get...
{ "split": "train", "index": 80595, "acecode_id": "bigcode_python_fns_33116", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `find_median(numbers: List[int]) -> float` that takes a list of integers as input, sorts the list in ascending order, and returns the median value. The median is defined as the middle value in the sorted list if the list has an odd number of elements, or th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_median([1, 3, 5, 7, 9]) == 5\", \"assert find_median([2, 4, 6, 8]) == 5.0\", \"assert find_median([10]) == 10\", \"assert find_median([3, 1, 2]) == 2\", \"assert find_median([-1, -2, -3, -4]) == -2.5\", \"assert find_median([1, 2, 3, 4, 5, 6]) == 3.5\",...
{ "split": "train", "index": 80596, "acecode_id": "evol_17420", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `check_anagram(text1: str, text2: str) -> bool` that determines whether two given strings are anagrams of each other. Two strings are considered anagrams if they can be rearranged to form each other by using the same characters with the same frequency. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_anagram('listen', 'silent') == True\", \"assert check_anagram('triangle', 'integral') == True\", \"assert check_anagram('apple', 'papel') == True\", \"assert check_anagram('rat', 'car') == False\", \"assert check_anagram('evil', 'vile') == True\", \"as...
{ "split": "train", "index": 80597, "acecode_id": "evol_19606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D grid of non-negative integers where each element represents the cost to traverse that cell. Your task is to write a function `minPathSum(grid: List[List[int]]) -> int` that calculates the minimum path sum from the top-left corner to the bottom-right corner of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minPathSum([[1, 3, 1], [1, 5, 1], [4, 2, 1]]) == 7\", \"assert minPathSum([[1]]) == 1\", \"assert minPathSum([[1, 2, 3], [4, 5, 6]]) == 12\", \"assert minPathSum([[0]]) == 0\", \"assert minPathSum([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 5\", \"assert minPathSu...
{ "split": "train", "index": 80598, "acecode_id": "oss_28012", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of numbers `nm`, a scalar multiplier `a`, a scalar mean `x0`, and a scalar standard deviation `sigma`, implement a function `gaussian(nm: List[float], a: float, x0: float, sigma: float) -> List[float]` that computes the Gaussian function value for each element in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gaussian([0], 1, 0, 1) == [1.0]\", \"assert gaussian([0], 2, 0, 1) == [2.0]\", \"assert gaussian([100], 1, 0, 1) == [0.0]\", \"assert gaussian([0, 0], 1, 0, 1) == [1.0, 1.0]\", \"assert gaussian([0, 0], 0, 0, 1) == [0.0, 0.0]\", \"assert gaussian([1, 2, 3], ...
{ "split": "train", "index": 80599, "acecode_id": "bigcode_python_fns_28131", "num_tests": 6 }