data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the removal of a moderator from a chat channel. The function `remove_moderator(channel_id: str, moderator_id: str) -> int` takes two parameters: `channel_id`, a string representing the unique identifier of the channel, and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_moderator('a_channel', '01BSRT7XMQT33SCNKTYTSES5QQ') == 204\", \"assert remove_moderator('a_channel', '02BSRT7XMQT33SCNKTYTSES5QQ') == 204\", \"assert remove_moderator('a_channel', '03BSRT7XMQT33SCNKTYTSES5QQ') == 204\", \"assert remove_moderator('a_c...
{ "split": "train", "index": 62200, "acecode_id": "bigcode_python_fns_38724", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci_sequence(n: int) -> List[int]` that returns the first n integers in the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_sequence(0) == []\", \"assert fibonacci_sequence(1) == [0]\", \"assert fibonacci_sequence(2) == [0, 1]\", \"assert fibonacci_sequence(3) == [0, 1, 1]\", \"assert fibonacci_sequence(4) == [0, 1, 1, 2]\", \"assert fibonacci_sequence(5) == [0, 1, 1, 2...
{ "split": "train", "index": 62201, "acecode_id": "evol_13949", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple banking system. Implement a function `bank_account_operations(initial_balance: int, deposits: List[int], withdrawals: List[int]) -> int` that takes an initial balance, a list of deposit amounts, and a list of withdrawal amounts. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_operations(100, [50, 20], [30]) == 140\", \"assert bank_account_operations(100, [50, -10, 20], [30, 150]) == 140\", \"assert bank_account_operations(100, [], [30]) == 70\", \"assert bank_account_operations(0, [50, 20], [30]) == 40\", \"assert ba...
{ "split": "train", "index": 62202, "acecode_id": "oss_29349", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of sentences, implement a function that extracts the unique words from these sentences and returns them as a sorted list. A word is defined as a sequence of alphabetic characters. Ignore case sensitivity when determining uniqueness. The input list may have sentence...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_words(['This is a test.', 'This test is only a test.']) == ['a', 'is', 'only', 'test', 'this']\", \"assert extract_unique_words(['No punctuation here', 'Just words']) == ['here', 'just', 'no', 'punctuation', 'words']\", \"assert extract_unique...
{ "split": "train", "index": 62203, "acecode_id": "bigcode_python_fns_547", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple user authentication system. The function should take a username as input and return the corresponding password from a predefined list of users. If the username does not exist in the list, the function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_password('alice') == 'password123'\", \"assert get_password('bob') == 'qwerty'\", \"assert get_password('charlie') == 'mysecret'\", \"assert get_password('dave') == 'abc123'\", \"assert get_password('eve') == 'letmein'\", \"assert get_password('frank') =...
{ "split": "train", "index": 62204, "acecode_id": "oss_17549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given the root of a binary tree. Implement a function `postorderTraversal(root)` that returns the postorder traversal of the values of its nodes. The binary tree is represented using the TreeNode class, where each node has a value and pointers to its left and right chil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert postorderTraversal(None) == []\", \"assert postorderTraversal(TreeNode(1)) == [1]\", \"assert postorderTraversal(TreeNode(1, TreeNode(2), TreeNode(3))) == [2, 3, 1]\", \"assert postorderTraversal(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)), TreeNode(3)...
{ "split": "train", "index": 62205, "acecode_id": "evol_244", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that returns the second smallest odd integer and the second largest even integer from a given list of integers. If there are not enough odd or even integers, return None for that value. The function signature is: def second_smallest_odd_and_second_largest_e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_smallest_odd_and_second_largest_even([1, 2, 3, 4]) == (3, 2)\", \"assert second_smallest_odd_and_second_largest_even([9, 7, 5]) == (7, None)\", \"assert second_smallest_odd_and_second_largest_even([1, 1, 1, 3]) == (1, None)\", \"assert second_smallest...
{ "split": "train", "index": 62206, "acecode_id": "evol_26161", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `binomial(n: int, k: int) -> int` that computes the binomial coefficient C(n, k) in a time and space efficient manner. The function should handle large values of n and k without causing overflow. The binomial coefficient is defined as the number of ways to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binomial(5, 2) == 10\", \"assert binomial(10, 5) == 252\", \"assert binomial(0, 0) == 1\", \"assert binomial(5, 0) == 1\", \"assert binomial(5, 5) == 1\", \"assert binomial(6, 2) == 15\", \"assert binomial(7, 3) == 35\", \"assert binomial(10, 0) == 1\", \"as...
{ "split": "train", "index": 62207, "acecode_id": "evol_2661", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of pipeline strings in the format 'module:task:version', write a function `extract_tasks(pipelines: List[str]) -> List[str]` that extracts and returns a list of unique tasks from the provided pipelines. Each task is represented by the substring between the last ':'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_tasks(['module1:task1:1', 'module2:task2:1', 'module1:task1:2']) == ['task1', 'task2']\", \"assert extract_tasks(['taskA:module1:0', 'taskB:module2:1']) == ['module1', 'module2']\", \"assert extract_tasks(['module1:taskA:1', 'module1:taskA:2', 'modul...
{ "split": "train", "index": 62208, "acecode_id": "bigcode_python_fns_49937", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Write a function that collects all the integers from the list and returns them as a new list. The function should maintain the order of the integers as they appear in the original list. Implement the function `collect_integers(data: List[int]) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collect_integers([]) == []\", \"assert collect_integers([1]) == [1]\", \"assert collect_integers([1, 2, 3]) == [1, 2, 3]\", \"assert collect_integers([1, -1, 0]) == [1, -1, 0]\", \"assert collect_integers([5, 10, 15, 20]) == [5, 10, 15, 20]\", \"assert colle...
{ "split": "train", "index": 62209, "acecode_id": "bigcode_python_fns_42840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to process molecular structure data. Your function should take a list of mol2 file contents, each representing a molecular structure, and combine them into a single string formatted for efficient storage and retrieval. Each molecule's dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_mol2_files(['@<TRIPOS>MOLECULE\\\\nMolecule1\\\\n@<TRIPOS>ATOM\\\\n1\\\\tC\\\\t0.0\\\\t0.0\\\\t0.0\\\\n']) == '@<TRIPOS>MOLECULE\\\\nMolecule1\\\\n@<TRIPOS>ATOM\\\\n1\\\\tC\\\\t0.0\\\\t0.0\\\\t0.0\\\\n'\", \"assert combine_mol2_files(['@<TRIPOS>MOLEC...
{ "split": "train", "index": 62210, "acecode_id": "oss_11411", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the server initialization process for a network server using UDP sockets. Write a function `initialize_server_socket(client_update_port: int) -> str` that takes an integer `client_update_port` as input and returns a string indicating the status of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_server_socket(8080) == 'Server initialized and bound to port 8080'\", \"assert initialize_server_socket(9090) == 'Server initialized and bound to port 9090'\", \"assert initialize_server_socket(10000) == 'Server initialized and bound to port 10000...
{ "split": "train", "index": 62211, "acecode_id": "oss_8343", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple number guessing game. The function will take two parameters: a randomly generated number between 1 and 100 (inclusive) and a list of guesses made by the player. The function should return a list of responses corres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert number_guessing_game(50, [30, 70, 50]) == ['Too low', 'Too high', 'Correct!']\", \"assert number_guessing_game(20, [10, 15, 25, 20]) == ['Too low', 'Too low', 'Too high', 'Correct!']\", \"assert number_guessing_game(1, [1]) == ['Correct!']\", \"assert number...
{ "split": "train", "index": 62212, "acecode_id": "oss_25993", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings, implement a function that returns a new array containing only the strings that are the longest in terms of character count. If there are multiple longest strings, include all of them in the output array.\nPlease reason step by step, then write a self-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_longest_strings(['apple', 'banana', 'kiwi', 'grape']) == ['banana']\", \"assert get_longest_strings(['a', 'bb', 'ccc', 'dd']) == ['ccc']\", \"assert get_longest_strings(['one', 'two', 'three', 'four', 'five']) == ['three']\", \"assert get_longest_strings...
{ "split": "train", "index": 62213, "acecode_id": "evol_27369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, write a function that checks whether they contain the same elements, regardless of the order. The function should return True if they are equal and False if they are not. If the lists are of different lengths, they are automatically considered unequ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_equal_lists([1, 2, 3], [3, 2, 1]) == True\", \"assert check_equal_lists([1, 2, 2], [2, 1, 1]) == False\", \"assert check_equal_lists([], []) == True\", \"assert check_equal_lists([5, 5, 5], [5, 5, 5]) == True\", \"assert check_equal_lists([1, 2, 3], [1...
{ "split": "train", "index": 62214, "acecode_id": "bigcode_python_fns_22695", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the weights of boxes. Your task is to implement a function that takes this list and returns the maximum weight that can be carried in a single trip, given that the maximum weight limit for a trip is 10 units. If the total weight of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_weight([2, 4, 3]) == 9\", \"assert max_weight([1, 2, 3, 4]) == 10\", \"assert max_weight([10]) == 10\", \"assert max_weight([5, 5, 5]) == 10\", \"assert max_weight([12, 15, 8]) == 8\", \"assert max_weight([1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10\", \"assert...
{ "split": "train", "index": 62215, "acecode_id": "bigcode_python_fns_28060", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of lists, convert it into a dictionary where the first element of each inner list serves as the key and the remaining elements are stored as a list of values. Implement a function `list_to_dict(lst: List[List[str]]) -> Dict[str, List[str]]` that performs this conve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_to_dict([['apple', 'red', 'green'], ['banana', 'yellow', 'green']]) == {'apple': ['red', 'green'], 'banana': ['yellow', 'green']}\", \"assert list_to_dict([['car', 'sedan', 'blue'], ['bike', 'mountain', 'black']]) == {'car': ['sedan', 'blue'], 'bike': [...
{ "split": "train", "index": 62216, "acecode_id": "evol_3265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer y, implement a function called multiply_by_two that returns the product of y and 2. This function should not alter the input value, producing a new output instead. Determine whether the function is mutable or immutable based on its behavior with input values.\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_by_two(0) == 0\", \"assert multiply_by_two(1) == 2\", \"assert multiply_by_two(-1) == -2\", \"assert multiply_by_two(10) == 20\", \"assert multiply_by_two(-10) == -20\", \"assert multiply_by_two(5) == 10\", \"assert multiply_by_two(100) == 200\", \"...
{ "split": "train", "index": 62217, "acecode_id": "evol_2660", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function `parse_log_message(log_message)` that processes a log message formatted according to a specific pattern. Each log message contains a timestamp, logger name, log level, and the actual log message, formatted as follows: 'YY-MM-DD HH:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_log_message('21-01-01 13:45:00 my_logger INFO This is an informational log message') == {'timestamp': '21-01-01 13:45:00', 'logger_name': 'my_logger', 'log_level': 'INFO', 'message': 'This is an informational log message'}\", \"assert parse_log_...
{ "split": "train", "index": 62218, "acecode_id": "oss_22972", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given SMS message and extracts the sender's number and the message content. The function should take a string representing the concatenated Short Message Service Center Address (sca) and Protocol Data Unit (pdu) as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_sms_info('smscenter+1234567890This is another message') == {'sender_number': '1234567890', 'message_content': 'This is another message'}\", \"assert extract_sms_info('service+9876543210Greetings') == {'sender_number': '9876543210', 'message_content':...
{ "split": "train", "index": 62219, "acecode_id": "oss_25508", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple JSON-RPC client. The client can make calls to a server, but it must handle various error scenarios. Your function should take a response string as input and return an error message based on the content of that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_jsonrpc_response('invalid-json') == 'unable to decode response as JSON'\", \"assert handle_jsonrpc_response('{\\\"jsonrpc\\\": \\\"1\\\", \\\"result\\\": \\\"value\\\"}') == 'Client only understands JSONRPC v2.0'\", \"assert handle_jsonrpc_response('{...
{ "split": "train", "index": 62220, "acecode_id": "bigcode_python_fns_39953", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `s` of lowercase English letters and an array `widths` denoting how many pixels wide each lowercase English letter is. Specifically, `widths[0]` is the width of `a`, `widths[1]` is the width of `b`, and so on. You are trying to write `s` across several li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numberOfLines([10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10], 'abcdefghijklmnopqrstuvwxyz') == [3, 60, 10]\", \"assert numberOfLines([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], 'zzz') == [1, 3, 1]\", \"assert numbe...
{ "split": "train", "index": 62221, "acecode_id": "evol_30811", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `classify_number(n: int) -> Union[str, Tuple[str, int]]` that takes a whole number n as input and returns 'prime' if the number is a prime number. If the number is composite, return a tuple containing 'composite' and its smallest prime factor. If n is less ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_number(1) == 'neither'\", \"assert classify_number(2) == 'prime'\", \"assert classify_number(3) == 'prime'\", \"assert classify_number(4) == ('composite', 2)\", \"assert classify_number(5) == 'prime'\", \"assert classify_number(6) == ('composite', 2...
{ "split": "train", "index": 62222, "acecode_id": "evol_3375", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a greeting message based on the provided language code. The function should take a language code and a dictionary of localized greeting strings, and return the appropriate greeting message. If the language code is no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_greeting('en', {'en': 'Hello', 'es': 'Hola'}) == 'Hello'\", \"assert generate_greeting('es', {'en': 'Hello', 'es': 'Hola'}) == 'Hola'\", \"assert generate_greeting('fr', {'en': 'Hello', 'es': 'Hola'}) == 'Hello'\", \"assert generate_greeting('de', {...
{ "split": "train", "index": 62223, "acecode_id": "oss_36628", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function that takes an array of integers and returns an array of the squared values of only the prime numbers in the input array. Additionally, calculate the sum of all the squared prime values in the output array. You must implement your own prime-checking function. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert squared_primes([2, 4, 6, 7, 9, 11]) == ([4, 49, 121], 174)\", \"assert squared_primes([3, 5, 8, 13]) == ([9, 25, 169], 203)\", \"assert squared_primes([1, 4, 6, 8]) == ([], 0)\", \"assert squared_primes([19, 23, 29]) == ([361, 529, 841], 1731)\", \"assert sq...
{ "split": "train", "index": 62224, "acecode_id": "evol_26292", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of coordinates (x,y) in text string format separated by semicolons, implement a function that returns a list of coordinates that fall in the first quadrant (where both x and y are positive). The input string will have coordinates in the format '(x, y)'.\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_quadrant_coordinates('(3, 3); (-2, 1); (-1, -2); (5, 0); (1, 4)') == ['(3, 3)', '(1, 4)']\", \"assert get_first_quadrant_coordinates('(1, 1); (2, 2); (3, 3)') == ['(1, 1)', '(2, 2)', '(3, 3)']\", \"assert get_first_quadrant_coordinates('(-1, 1); (0...
{ "split": "train", "index": 62225, "acecode_id": "evol_19781", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes in three distinct strings: 'first_name', 'middle_name', and 'last_name'. The function should return a formatted string that combines these names in the following structure: 'middle_name' + ' ' + first character of 'first_name' + '.' + ' ' + 'last...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_structure('John', 'Paul', 'Doe') == 'Paul J. Doe'\", \"assert convert_to_structure('Alice', 'Marie', 'Smith') == 'Marie A. Smith'\", \"assert convert_to_structure('Robert', 'James', 'Brown') == 'James R. Brown'\", \"assert convert_to_structure('Em...
{ "split": "train", "index": 62226, "acecode_id": "evol_26418", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that deletes a batch of web applications from Azure with retry capability. The function should take a list of web applications and a maximum number of API calls allowed. If the number of applications exceeds the maximum allowed, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_batch_apps([], 10) == None\", \"assert delete_batch_apps(['app1', 'app2'], 5) == None\", \"assert delete_batch_apps(['app1', 'app2', 'app3'], 3) == None\", \"assert delete_batch_apps(['app1'], 1) == None\", \"assert delete_batch_apps(['app1', 'app2', ...
{ "split": "train", "index": 62227, "acecode_id": "evol_35419", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple banking system that supports deposits and withdrawals. Your objective is to create a function `bank_account_transactions(transactions: List[Tuple[str, int]]) -> int` that takes a list of transactions and returns the final balance of a b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_transactions([('deposit', 100), ('withdraw', 50)]) == 50\", \"assert bank_account_transactions([('deposit', 50), ('withdraw', 50), ('deposit', 30)]) == 30\", \"assert bank_account_transactions([('withdraw', 10)]) == 0\", \"assert bank_account_tr...
{ "split": "train", "index": 62228, "acecode_id": "oss_30157", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `choose_num(x, y, z)` that accepts three positive integers x, y, and z. The function should return the greatest even integer within the inclusive range of [x, y] that can be evenly divided by z. If no such number exists, the function should return -1.\nPlea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert choose_num(12, 15, 2) == 14\", \"assert choose_num(13, 12, 3) == -1\", \"assert choose_num(10, 20, 4) == 20\", \"assert choose_num(5, 10, 2) == 10\", \"assert choose_num(8, 8, 4) == 8\", \"assert choose_num(1, 5, 1) == 4\", \"assert choose_num(15, 15, 2) == ...
{ "split": "train", "index": 62229, "acecode_id": "evol_3719", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function `calculate_sum` that returns the sum of all the elements in the list. The function should handle an empty list by returning 0. Write the function `calculate_sum(nums: List[int]) -> int` where `nums` is the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum([]) == 0\", \"assert calculate_sum([1]) == 1\", \"assert calculate_sum([1, 2, 3]) == 6\", \"assert calculate_sum([-1, 1]) == 0\", \"assert calculate_sum([0, 0, 0]) == 0\", \"assert calculate_sum([100, 200, 300]) == 600\", \"assert calculate_sum...
{ "split": "train", "index": 62230, "acecode_id": "oss_35356", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with counting the number of astronauts currently onboard the International Space Station (ISS). Write a function `count_astronauts` that takes in a list of astronaut names and returns the total number of astronauts. The list may contain duplicates, and you should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_astronauts(['Alice', 'Bob', 'Alice', 'Charlie', 'Bob']) == 3\", \"assert count_astronauts(['John', 'Doe', 'John']) == 2\", \"assert count_astronauts(['Neil', 'Buzz', 'Neil', 'Buzz', 'Michael']) == 3\", \"assert count_astronauts(['Alice']) == 1\", \"ass...
{ "split": "train", "index": 62231, "acecode_id": "bigcode_python_fns_48964", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given the definition of a ListNode class. Write a function that takes in two linked lists representing non-negative integers, where each node contains a single digit and the digits are stored in reverse order. Your task is to sum the two numbers represented by the linke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert addTwoNumbers(ListNode(2, ListNode(4, ListNode(3))), ListNode(5, ListNode(6, ListNode(4)))) == ListNode(7, ListNode(0, ListNode(8)))\", \"assert addTwoNumbers(ListNode(0), ListNode(0)) == ListNode(0)\", \"assert addTwoNumbers(ListNode(1), ListNode(9, ListNod...
{ "split": "train", "index": 62232, "acecode_id": "oss_9723", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design a function that evaluates a given arithmetic expression involving addition, subtraction, multiplication, division, and exponentiation. The expression will be provided as a string and can contain parentheses to indicate precedence. The function should return the result of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('5 + 3 * (2 - 1)') == 8\", \"assert evaluate_expression('(3 + 5) * (2 - 1)') == 8\", \"assert evaluate_expression('(1 + 2) * (3 + 4)') == 21\", \"assert evaluate_expression('7 - (3 + 4)') == 0\", \"assert evaluate_expression('8 / 4 * 2') ...
{ "split": "train", "index": 62233, "acecode_id": "evol_24145", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of log entries from a web browser and returns a list of errors that are marked as 'SEVERE'. Each log entry is represented as a dictionary with two keys: 'level' (a string indicating the severity level of the log) and 'me...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_severe_errors([{'level': 'INFO', 'message': 'Page loaded'}, {'level': 'SEVERE', 'message': 'Failed to load resource'}, {'level': 'WARNING', 'message': 'Deprecated API usage'}]) == [{'level': 'SEVERE', 'message': 'Failed to load resource'}]\", \"assert ge...
{ "split": "train", "index": 62234, "acecode_id": "bigcode_python_fns_35907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function to calculate the area of a triangle based on different methods. The function should take parameters that represent the type of triangle and its dimensions. The input can be of three types: 1) For a right-angled triangle, provide the base and height. 2) For ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_triangle_area('right', 6, 4.5) == 13.5\", \"assert calculate_triangle_area('right', 10, 5) == 25.0\", \"assert calculate_triangle_area('heron', 3, 4, 5) == 6.0\", \"assert calculate_triangle_area('right', 8, 15) == 60.0\", \"assert calculate_triang...
{ "split": "train", "index": 62235, "acecode_id": "evol_5880", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with updating the counts of normal and special students assigned to each advisor based on a dataset represented as a list of dictionaries. Each dictionary contains a student's ID and their corresponding advisor's name. A student is considered special if their ID ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_advisor_counts([{'student_id': 123456, 'advisor': 'Advisor A'}, {'student_id': 234567, 'advisor': 'Advisor B'}, {'student_id': 345678, 'advisor': 'Advisor A'}], {'name': ['Advisor A', 'Advisor B', 'Advisor C'], 'normal': [0, 0, 0], 'special': [0, 0, 0...
{ "split": "train", "index": 62236, "acecode_id": "oss_33596", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with managing user roles and their associated permissions in a system. Each role has a unique name and can have multiple permissions associated with it. You are given a mapping of role names to a list of permissions. Your goal is to implement a function that take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_permissions({'user': [], 'guest': ['view']}) == {'guest': ['view']}\", \"assert update_permissions({'manager': ['approve', 'reject'], 'analyst': ['analyze']}) == {'manager': ['approve', 'reject'], 'analyst': ['analyze']}\", \"assert update_permissions...
{ "split": "train", "index": 62237, "acecode_id": "bigcode_python_fns_5541", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates the process of overriding a configuration for a software module. The function `override_config(module: str, config: str)` should take two parameters: a string `module` representing the name of the module and a string `config...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert override_config('audio', 'high_quality') == 'Overriding audio = high_quality'\", \"assert override_config('video', '720p') == 'Overriding video = 720p'\", \"assert override_config('network', 'optimized') == 'Overriding network = optimized'\", \"assert overri...
{ "split": "train", "index": 62238, "acecode_id": "bigcode_python_fns_9269", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns the maximum sum of a contiguous subarray. The function should take an integer list as input and output a single integer representing the maximum sum. For example, given the input list [-2,1,-3,4,-1,2,1,-5,4], the outpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([1, 2, 3, 4]) == 10\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, 2, 3, -5, 4]) == 5\", ...
{ "split": "train", "index": 62239, "acecode_id": "bigcode_python_fns_17994", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class representing a content model that may or may not have a prefetch attribute called 'MTURK_PREFETCH'. Your task is to implement a function that returns a list of fields that should be prefetched based on the presence of this attribute. If 'MTURK_PREFETCH' ex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_prefetch_fields(MockModel(MTURK_PREFETCH=['field1', 'field2'])) == ['content__field1', 'content__field2']\", \"assert get_prefetch_fields(MockModel()) == []\", \"assert get_prefetch_fields(MockModel(photo=True)) == ['content__photo']\", \"assert get_pref...
{ "split": "train", "index": 62240, "acecode_id": "bigcode_python_fns_39757", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of lists as input and returns a new list containing only the elements that occur an odd number of times across the entire input. Each sublist may contain repeated numbers, and the total occurrences of each number should be counted acros...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert odd_occurrences([[1, 1], [2, 2], [3]]) == [3]\", \"assert odd_occurrences([[1, 2, 3], [1, 2, 3], [1]]) == [1]\", \"assert odd_occurrences([[], [1]]) == [1]\", \"assert odd_occurrences([[10, 10], [20, 30, 30], [20, 40]]) == [40]\", \"assert odd_occurrences([[...
{ "split": "train", "index": 62241, "acecode_id": "evol_14707", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a one-dimensional array of integers, implement a function that counts the number of unique palindromic pairs and triplets present in the array. A pair (a, b) is considered palindromic if it appears in the form (x, x) in the array. A triplet (a, b, c) is considered palindr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_palindromic_tuples([1, 2, 3, 4, 5]) == 0\", \"assert check_palindromic_tuples([1, 2, 1]) == 1\", \"assert check_palindromic_tuples([]) == 0\", \"assert check_palindromic_tuples([9]) == 0\", \"assert check_palindromic_tuples([1, 1, 2, 1, 1]) == 2\"]}" }
{ "split": "train", "index": 62242, "acecode_id": "evol_31352", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a string of integers separated by commas, write a function that returns a list containing all the even integers from the string. The integers in the string are ordered chronologically. For example, given the input '23, 2, 5, 16, 1, 9, 8', the output should be [2, 16, 8].\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert even_numbers('23, 2, 5, 16, 1, 9, 8') == [2, 16, 8]\", \"assert even_numbers('1, 3, 5, 7') == []\", \"assert even_numbers('2, 4, 6, 8') == [2, 4, 6, 8]\", \"assert even_numbers('10, 15, 20, 25') == [10, 20]\", \"assert even_numbers('11, 13, 15, 17, 19') == [...
{ "split": "train", "index": 62243, "acecode_id": "evol_6802", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing a set of ranks, implement a function that adjusts these ranks based on the following rules: If the rank is censored (indicated by a corresponding value of 1 in a separate list of the same length), it should be set to NaN. For non-censored r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rank_adjust([1, 2, 3, 4, 5], [0, 0, 0, 0, 0]) == [1.0, 2.0, 3.0, 4.0, 5.0]\", \"assert rank_adjust([1, 2, 3], [1, 1, 1]) == [None, None, None]\", \"assert rank_adjust([2, 4, 6], [0, 0, 0]) == [1.0, 2.0, 3.0]\", \"assert rank_adjust([], []) == []\", \"assert ...
{ "split": "train", "index": 62244, "acecode_id": "bigcode_python_fns_29947", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, return the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Implement a function that calculates the Fibonacci number at the given position n iteratively. The input will...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getFibonacciIterative(0) == 0\", \"assert getFibonacciIterative(1) == 1\", \"assert getFibonacciIterative(2) == 1\", \"assert getFibonacciIterative(3) == 2\", \"assert getFibonacciIterative(4) == 3\", \"assert getFibonacciIterative(5) == 5\", \"assert getFib...
{ "split": "train", "index": 62245, "acecode_id": "bigcode_python_fns_48162", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a bag and the bags it contains, formatted as '<bag_name> contain <contained_bag1>, <contained_bag2>, ...'. A bag can either contain other bags or indicate that it contains no bags at all (e.g., 'no other bags'). Writ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_bags_that_contain_gold(['light red bags contain 1 bright white bag, 2 muted yellow bags.', 'dark orange bags contain 3 bright white bags, 4 muted yellow bags.', 'bright white bags contain 1 shiny gold bag.', 'muted yellow bags contain 2 shiny gold bags...
{ "split": "train", "index": 62246, "acecode_id": "bigcode_python_fns_23476", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `parse_wind_data(data: str) -> Optional[float]` that parses a given wind data string. The input string contains a wind speed measurement followed by a unit of measurement (e.g., 'KT' for knots or 'MPS' for meters per second). If the input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_wind_data('90010KT') == 90010.0\", \"assert parse_wind_data('1000MPS') == 1000.0\", \"assert parse_wind_data('500KT') == 500.0\", \"assert parse_wind_data('0KT') == 0.0\", \"assert parse_wind_data('') == None\", \"assert parse_wind_data('100XY') == Non...
{ "split": "train", "index": 62247, "acecode_id": "bigcode_python_fns_40668", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D array where each row represents a set of parameters for a function. Each parameter set consists of four values: `cutoff`, `delta`, `n_sparse`, and `nlmax`. Write a function `evaluate_metric(parameters: List[List[float]]) -> List[float]` that takes this 2D arr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_metric([[0.0, 0.0, 0.0, 0.0]]) == [0.0]\", \"assert evaluate_metric([[3.0, 2.0, 1.0, 0.0], [4.0, 3.0, 2.0, 1.0]]) == [7.0, 13.0]\", \"assert evaluate_metric([[5.0, 5.0, 5.0, 5.0]]) == [25.0]\", \"assert evaluate_metric([[1.0, 0.0, 0.0, 0.0], [0.0, 1...
{ "split": "train", "index": 62248, "acecode_id": "bigcode_python_fns_29820", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of lists, where each inner list represents a column of a table. Your task is to transform these columns into a table format. If the inner lists are of different lengths, you need to pad the shorter lists with a specified value (which defaults to None) until...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert from_columns([[0, 1, 2], ['a', 'b', 'c']]) == [[0, 'a'], [1, 'b'], [2, 'c']]\", \"assert from_columns([[0, 1, 2], ['a', 'b']], missing='NA') == [[0, 'a'], [1, 'b'], [2, 'NA']]\", \"assert from_columns([[1], ['x', 'y', 'z'], [100, 200]]) == [[1, 'x', 100], [N...
{ "split": "train", "index": 62249, "acecode_id": "bigcode_python_fns_40631", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function for a Python package versioning system. The versioning system should support incrementing the version number and generating a version string. Implement a function `version_control` that takes three integers representing the current `major...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert version_control(0, 0, 0, 'bump_major') == '1.0.0'\", \"assert version_control(1, 0, 0, 'bump_minor') == '1.1.0'\", \"assert version_control(1, 1, 0, 'bump_patch') == '1.1.1'\", \"assert version_control(2, 3, 4, 'bump_major') == '3.0.0'\", \"assert version_co...
{ "split": "train", "index": 62250, "acecode_id": "oss_14447", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of layer configurations for a neural network. Each layer configuration is represented as a dictionary with the following keys: 'type', 'channels', 'bias', and 'norm_cfg'. Your function should ensure that f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_layer_configs([{'type': 'conv', 'channels': 64}]) == [{'type': 'conv', 'channels': 64, 'bias': False}]\", \"assert process_layer_configs([{'type': 'fc', 'channels': 128, 'bias': True}]) == [{'type': 'fc', 'channels': 128, 'bias': True}]\", \"assert p...
{ "split": "train", "index": 62251, "acecode_id": "oss_23991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of possible node values, your task is to implement a function that returns a new list containing only the integer values from the input list. The function should filter out any non-integer values. The input will be a list of mixed values and the output should be a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_integer_values([1, 3, 5, 7, 'hello']) == [1, 3, 5, 7]\", \"assert filter_integer_values(['hello', 2.5, 4, 6]) == [4, 6]\", \"assert filter_integer_values(['world', 'test', 0]) == [0]\", \"assert filter_integer_values([]) == []\", \"assert filter_integ...
{ "split": "train", "index": 62252, "acecode_id": "bigcode_python_fns_31120", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates the first N numbers in the Fibonacci series where N is a positive integer. The function should then return a list of Fibonacci numbers that fall within a specified range defined by two integers, start and end. The range is inclusive, and both sta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_in_range(5, 1, 3) == [0, 1, 1]\", \"assert fibonacci_in_range(1, 1, 1) == [0]\", \"assert fibonacci_in_range(0, 1, 1) == []\", \"assert fibonacci_in_range(10001, 1, 5) == []\", \"assert fibonacci_in_range(10, 1, 1) == [0]\", \"assert fibonacci_in_r...
{ "split": "train", "index": 62253, "acecode_id": "evol_21249", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that activates a list of business service definitions based on their names. The function should take in two parameters: a connection string and a list of service definition names. Each name in the list corresponds to a business servic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert activate_service_definitions('valid_connection', ['service1', 'service2', 'service3']) == 3\", \"assert activate_service_definitions('valid_connection', ['service1', 'invalid_service']) == 1\", \"assert activate_service_definitions('valid_connection', ['inva...
{ "split": "train", "index": 62254, "acecode_id": "bigcode_python_fns_19135", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that verifies the validity of an admin token. The function should take a token as input and return the admin name associated with that token if it exists. If the token is invalid or does not exist, the function should return None. You can...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_admin_name('valid_token_1') == 'Admin A'\", \"assert get_admin_name('valid_token_2') == 'Admin B'\", \"assert get_admin_name('invalid_token') == None\", \"assert get_admin_name('another_invalid_token') == None\", \"assert get_admin_name('non_existent_tok...
{ "split": "train", "index": 62255, "acecode_id": "bigcode_python_fns_1757", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the total number of unique paths to reach the bottom-right corner of a grid from the top-left corner. You can only move either down or to the right at any point in time. The grid is represented as a 2D list wher...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_paths_with_obstacles([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == 2\", \"assert unique_paths_with_obstacles([[0, 0], [0, 0]]) == 2\", \"assert unique_paths_with_obstacles([[0]]) == 1\", \"assert unique_paths_with_obstacles([[1]]) == 0\", \"assert unique_path...
{ "split": "train", "index": 62256, "acecode_id": "oss_12027", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a notification message based on the input parameters. Your function should take in a list of recipient names, a subject, plain text content, and HTML content. The function will return a list of formatted notification...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_notifications(['Charlie'], 'Happy Birthday', 'Wishing you a wonderful birthday!', '<h1>Happy Birthday!</h1>') == ['To: Charlie\\\\nSubject: Happy Birthday\\\\nPlain Text: Wishing you a wonderful birthday!\\\\nHTML: <h1>Happy Birthday!</h1>']\", \"as...
{ "split": "train", "index": 62257, "acecode_id": "oss_28194", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a list of integers as input and returns the sum of all even integers in that list. The function should ignore any negative numbers and only consider non-negative integers for summation. Implement the function `sum_of_evens(nums:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([-1, -2, -3]) == 0\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([-2, -4, 6]) == 6\", ...
{ "split": "train", "index": 62258, "acecode_id": "oss_33085", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a command to execute a specific job in a computational biology application. Write a function `generate_command(job_id: str, max_gap: str, sample_number: str, scale: str) -> List[str]` that takes the following parameters: \n\n- `job_id`: a string r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_command('job123', '100', '10', '0.5') == ['cblaster', 'gne', 'job123', '--max_gap', '100', '--samples', '10', '--scale', '0.5', '--plot', 'job123_plot.html', '--output', 'job123_summary.txt']\", \"assert generate_command('job456', '200', '20', '1.0'...
{ "split": "train", "index": 62259, "acecode_id": "bigcode_python_fns_14364", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, implement a function `prime_factors(n)` that returns a list of all unique prime factors of n in ascending order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_factors(28) == [2, 7]\", \"assert prime_factors(30) == [2, 3, 5]\", \"assert prime_factors(49) == [7]\", \"assert prime_factors(60) == [2, 3, 5]\", \"assert prime_factors(97) == [97]\", \"assert prime_factors(1) == []\", \"assert prime_factors(45) == [...
{ "split": "train", "index": 62260, "acecode_id": "evol_8733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a function `is_supported_platform()` that checks if the current platform is supported for a certain application. The supported platforms are Linux and macOS (Darwin). Additionally, the application requires Python version 3.5 or higher. The function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_supported_platform() == True\", \"assert is_supported_platform() == True\", \"assert is_supported_platform() == True\", \"assert is_supported_platform() == True\", \"assert is_supported_platform() == True\", \"assert is_supported_platform() == True\", \"a...
{ "split": "train", "index": 62261, "acecode_id": "bigcode_python_fns_2495", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that analyzes version changes and determines the type of change (breaking, minor, micro, or no change) based on the input version information and the provided change details. You are given a dictionary called `version_info` that co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_version_change({'version': '2018.1.0', 'change_details': {'is_breaking_change': True, 'is_minor_change': False, 'is_micro_change': False}}) == 'breaking'\", \"assert analyze_version_change({'version': '2019.2.1', 'change_details': {'is_breaking_chang...
{ "split": "train", "index": 62262, "acecode_id": "oss_27051", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string containing multiple lines of text and returns a list of strings, where each string corresponds to a line from the input text. Your function should remove any leading or trailing whitespace from each line. Implement the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_lines('Line 1\\\\n Line 2 \\\\nLine 3') == ['Line 1', 'Line 2', 'Line 3']\", \"assert extract_lines(' Hello World \\\\nPython \\\\n ') == ['Hello World', 'Python']\", \"assert extract_lines('\\\\nLine A\\\\nLine B\\\\n') == ['Line A', 'Line B']...
{ "split": "train", "index": 62263, "acecode_id": "bigcode_python_fns_29305", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the daily stock prices of a certain stock. Your task is to write a function that calculates the maximum profit that can be obtained by buying and selling the stock at most once. If it is not possible to make any profit, the function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([3, 1, 4, 1, 5, 9]) == 8\", \"assert max_profit([2, 2, 2, 2, 2])...
{ "split": "train", "index": 62264, "acecode_id": "oss_20867", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple bank account. The account should have attributes for the account holder's name, account number, and current balance. The function should take the account holder's name, account number, a list of deposit amounts, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_final_balance('Alice Smith', '987654321', [1000, 200, 300], [500, 400]) == 600\", \"assert calculate_final_balance('Bob Brown', '123123123', [100, 200, 300], [150]) == 450\", \"assert calculate_final_balance('Charlie Johnson', '456456456', [0, 0, 0...
{ "split": "train", "index": 62265, "acecode_id": "oss_16464", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the number of active tasks in a Mesos cluster. Given a dictionary that represents the state of the Mesos master with the following keys: 'started_tasks', 'staged_tasks', 'failed_tasks', 'killed_tasks', 'lost_tasks', an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert num_active_tasks({'started_tasks': 0, 'staged_tasks': 0, 'failed_tasks': 0, 'killed_tasks': 0, 'lost_tasks': 0, 'finished_tasks': 0}) == 0\", \"assert num_active_tasks({'started_tasks': 3, 'staged_tasks': 2, 'failed_tasks': 1, 'killed_tasks': 0, 'lost_tasks'...
{ "split": "train", "index": 62266, "acecode_id": "bigcode_python_fns_24276", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a paginated data source. The function `generate_paginated_data` takes two parameters: `num_pages` (the total number of pages) and `page_size` (the number of items per page). The function should return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_paginated_data(1, 3) == [[(1, 0), (1, 1), (1, 2)]]\", \"assert generate_paginated_data(2, 2) == [[(1, 0), (1, 1)], [(2, 0), (2, 1)]]\", \"assert generate_paginated_data(3, 1) == [[(1, 0)], [(2, 0)], [(3, 0)]]\", \"assert generate_paginated_data(0, 5...
{ "split": "train", "index": 62267, "acecode_id": "oss_2230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple web application routing system. The function should take in a request path and a dictionary of routes, and return the appropriate response based on the request path. The function signature should be: `def ro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert route_request('/', {'/': 'Welcome to the homepage!'}) == 'Welcome to the homepage!'\", \"assert route_request('/about', {'/about': 'Learn more about us!'}) == 'Learn more about us!'\", \"assert route_request('/contact', {'/contact': 'Get in touch with us!'})...
{ "split": "train", "index": 62268, "acecode_id": "oss_30255", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the volume of a pyramid using the formula V = (1/3) * base_area * height, where base_area is the area of the pyramid's base and height is the height of the pyramid. Implement a function `calculate_volume(base_area: float, height: float) -> float`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_volume(0, 10) == 0.0\", \"assert calculate_volume(1, 1) == 0.3333333333333333\", \"assert calculate_volume(60, 30) == 600.0\", \"assert calculate_volume(75, 3) == 75.0\", \"assert calculate_volume(10, 0) == 0.0\", \"assert calculate_volume(0.5, 2) ...
{ "split": "train", "index": 62269, "acecode_id": "evol_24659", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a validation mechanism for a news retrieval system that filters news articles based on specific keywords. Create a Python function `validate_news_query_parameter(parameter)` that takes a single string parameter as input and returns a list of val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_news_query_parameter('technology') == []\", \"assert validate_news_query_parameter('') == ['Parameter is required.']\", \"assert validate_news_query_parameter('a' * 51) == ['Parameter length exceeds the maximum allowed length.']\", \"assert validate...
{ "split": "train", "index": 62270, "acecode_id": "oss_35206", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the number of contiguous subarrays in a given array where the product of all elements in the subarray is positive. A contiguous subarray is a subarray formed by selecting a contiguous segment of the original arr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_positive_product_subarrays([1, -2, 3, 0, -1, 2]) == 3\", \"assert count_positive_product_subarrays([1, 2, 3, 4]) == 10\", \"assert count_positive_product_subarrays([-1, 0, -1]) == 0\", \"assert count_positive_product_subarrays([0, 0, 0]) == 0\", \"asse...
{ "split": "train", "index": 62271, "acecode_id": "oss_12409", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a string representing a document in a simple format where each line starts with a number followed by a colon and some text. Your task is to implement a function that extracts the first two numbers from the document and returns them as a list of integers. If the do...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_first_two_numbers('376: Some text\\\\n914: More text') == [376, 914]\", \"assert extract_first_two_numbers('123: First line\\\\n456: Second line\\\\n789: Third line') == [123, 456]\", \"assert extract_first_two_numbers('42: Answer\\\\n100: Another an...
{ "split": "train", "index": 62272, "acecode_id": "bigcode_python_fns_42355", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `standard_deviation(lst)` that calculates the standard deviation of a list of numbers. The function should take a list of integers or floats as input and return the standard deviation as a float. Do not use any external libraries such as numpy. Your impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert standard_deviation([1, 2, 3, 4, 5]) == 1.4142135623730951\", \"assert standard_deviation([10, 20, 30]) == 8.16496580927726\", \"assert standard_deviation([0, 0, 0, 0]) == 0.0\", \"assert standard_deviation([-5, -10, -15]) == 4.08248290463863\", \"assert stan...
{ "split": "train", "index": 62273, "acecode_id": "evol_33391", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `validate_url(url: str) -> bool` that checks if a given URL is valid according to the following criteria: the URL must start with 'https://', end with '.com', and include at least one subdomain (e.g., 'sub.example.com'). The URL must not contain any query p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_url('https://sub.domain.com') == True\", \"assert validate_url('https://sub1.sub2.example.com') == True\", \"assert validate_url('https://example.com') == False\", \"assert validate_url('http://sub.domain.com') == False\", \"assert validate_url('htt...
{ "split": "train", "index": 62274, "acecode_id": "evol_28128", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a document represented as a dictionary, which contains a string of text and annotations for specific tokens within that text. Each annotation consists of a start index, an end index, and a value representing the token. Your task is to implement a function `extract...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_tokens({'text': 'Hello world', 'annotations': {'annotationName': [{'start': 0, 'end': 5, 'value': 'Hello'}, {'start': 6, 'end': 11, 'value': 'world'}]}}, 'annotation') == [(0, 5, 'Hello'), (6, 11, 'world')]\", \"assert extract_tokens({'text': 'Hello ...
{ "split": "train", "index": 62275, "acecode_id": "bigcode_python_fns_44881", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `send_email_alert` that takes a string `email` and a string `message` as parameters. The function should simulate sending an email alert by returning a string formatted as 'Email sent to {email} with message: {message}'. The email should be a valid email fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_email_alert('test@example.com', 'Alert: New data event detected') == 'Email sent to test@example.com with message: Alert: New data event detected'\", \"assert send_email_alert('user@domain.com', 'System alert triggered') == 'Email sent to user@domain.co...
{ "split": "train", "index": 62276, "acecode_id": "evol_19534", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the renewal of a cache entry identified by a unique primary key. The function should take a primary key as input and attempt to renew the cache entry. If the cache entry does not exist, the function should log a message...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert renew_cached_query(1) is None\", \"assert renew_cached_query(2) is None\", \"assert renew_cached_query(3) is None\", \"assert renew_cached_query(4) is None\", \"assert renew_cached_query(5) is None\", \"assert renew_cached_query(6) is None\", \"assert renew_...
{ "split": "train", "index": 62277, "acecode_id": "bigcode_python_fns_11013", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that calculates the factorial of a given non-negative integer n using recursion. The factorial of a non-negative integer n, denoted as n!, is the product of all positive integers less than or equal to n. For example, factorial(5) should return 120 as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 62278, "acecode_id": "evol_14062", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of `users` where each element `users[i]` is a list of strings, where the first element `users[i][0]` is a username, and the rest of the elements are usernames representing friends of the user. We want to merge these connections into friend groups. Two users belong ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_friends([[\\\"A\\\",\\\"B\\\"],[\\\"B\\\",\\\"C\\\"],[\\\"C\\\",\\\"D\\\"],[\\\"E\\\",\\\"F\\\"]]) == [[\\\"A\\\",\\\"B\\\",\\\"C\\\",\\\"D\\\"],[\\\"E\\\",\\\"F\\\"]]\", \"assert merge_friends([[\\\"Alpha\\\",\\\"Beta\\\"],[\\\"Beta\\\",\\\"Gamma\\\"]...
{ "split": "train", "index": 62279, "acecode_id": "evol_18971", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a string `namespace` and a string `alias`, implement a function that translates the given namespace and alias into a tuple representing a database mapping. The function should return a list of tuples where each tuple consists of a source and a transformed alias based on t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_api2db('refseq', 'SQ.1234') == [('NCBI', 'SQ.1234')]\", \"assert translate_api2db('ensembl', 'SQ.1234') == [('Ensembl', 'SQ.1234')]\", \"assert translate_api2db('lrg', 'SQ.1234') == [('LRG', 'SQ.1234')]\", \"assert translate_api2db('sha512t24u', '1...
{ "split": "train", "index": 62280, "acecode_id": "bigcode_python_fns_39743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that returns a list of all prime numbers up to a given integer n. The function should take a single integer parameter n and return a list containing all prime numbers less than or equal to n.\nPlease reason step by step, then write a self-contained Python solut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_primes(10) == [2, 3, 5, 7]\", \"assert get_primes(1) == []\", \"assert get_primes(2) == [2]\", \"assert get_primes(3) == [2, 3]\", \"assert get_primes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert get_primes(30) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\...
{ "split": "train", "index": 62281, "acecode_id": "evol_21101", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of strings, return a list of lists where each inner list contains all the strings of the same length, sorted in lexicographical order. The output should contain only lists for lengths that have at least one string. The function should implement the following signat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_and_sort_strings(['a', 'b', 'c', 'd']) == [['a', 'b', 'c', 'd']]\", \"assert group_and_sort_strings(['hello', 'world', 'hi']) == [['hi'], ['hello', 'world']]\", \"assert group_and_sort_strings(['one', 'two', 'three', 'four']) == [['one', 'two'], ['four...
{ "split": "train", "index": 62282, "acecode_id": "bigcode_python_fns_30412", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `cumulative_sum(data)` that computes the cumulative sum of all integer values in a multi-tiered data structure, which can include dictionaries, lists, and integers. Your function should be able to handle nested structures and ignore non-integer values such ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_sum({'a': 1, 'b': 2, 'c': {'d': 3}}) == 6\", \"assert cumulative_sum({'x': [1, 2, '3', 4], 'y': {'z': 5}}) == 12\", \"assert cumulative_sum({'a': 1, 'b': {'c': 2, 'd': {'e': 3}}, 'f': 4}) == 10\", \"assert cumulative_sum([1, 2, 3, 'four', 5]) == 1...
{ "split": "train", "index": 62283, "acecode_id": "evol_26913", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple student management system. The system needs to store and manage student records, where each student has a unique ID, a name, an age, and a grade. Your goal is to create a function called `manage_students` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_students([('add', (3, 'Charlie', 19, 'C'))]) == ['Student added']\", \"assert manage_students([('update', (3, 'Charlie', 20, 'C+'))]) == ['Student not found']\", \"assert manage_students([('add', (4, 'David', 21, 'A-')), ('delete', 4)]) == ['Student a...
{ "split": "train", "index": 62284, "acecode_id": "oss_20325", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function called `find_str` that takes in a list of lists called `info` and a string `y`. The function should return a list of tuples, where each tuple contains the row index and the column index of each occurrence of `y` in `info`. If `y` appears multiple times in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_str([['apple', 'banana'], ['orange', 'apple'], ['grape']], 'apple') == [(0, 0), (1, 1)]\", \"assert find_str([['kiwi'], ['banana', 'kiwi', 'pear'], ['peach']], 'kiwi') == [(0, 0), (1, 1)]\", \"assert find_str([], 'mango') == []\", \"assert find_str([['a...
{ "split": "train", "index": 62285, "acecode_id": "evol_10396", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a function that generates a list of fish with specified attributes, implement a function `generate_fish_list(n: int, lim_neighbors: tuple, neighbor_weights: list, fish_max_speeds: list, clock_freqs: list, names: list) -> list` that returns a list of fish represented as di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_fish_list(3, (2, 5), [0.5, 1.0], [1.5, 2.0], [1, 2], ['Fish1', 'Fish2', 'Fish3']) == [{'id': 0, 'lim_neighbors': (2, 5), 'neighbor_weight': 0.5, 'fish_max_speed': 1.5, 'clock_freq': 1, 'name': 'Fish1'}, {'id': 1, 'lim_neighbors': (2, 5), 'neighbor_w...
{ "split": "train", "index": 62286, "acecode_id": "bigcode_python_fns_19332", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with processing user comments in a text processing application. Your goal is to create a function that removes punctuation marks from a given comment and extracts individual words. Write a function named `clean_and_extract_words(comment: str) -> List[str]` that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_and_extract_words('Hello, how are you today?') == ['Hello', 'how', 'are', 'you', 'today']\", \"assert clean_and_extract_words('This is a test!') == ['This', 'is', 'a', 'test']\", \"assert clean_and_extract_words('What is your name?') == ['What', 'is', ...
{ "split": "train", "index": 62287, "acecode_id": "oss_8062", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function that takes a string representing the current time in the format 'HH:MMAM' or 'HH:MMPM' and returns the equivalent time in minutes since midnight. The input will always be a valid time string.\nPlease reason step by step, then write a self-contained Python solut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert time_to_minutes('12:30PM') == 750\", \"assert time_to_minutes('12:00AM') == 0\", \"assert time_to_minutes('01:00AM') == 60\", \"assert time_to_minutes('01:00PM') == 780\", \"assert time_to_minutes('06:45AM') == 405\", \"assert time_to_minutes('11:59PM') == 1...
{ "split": "train", "index": 62288, "acecode_id": "evol_34368", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing sizes of markers to be used in a scatter plot. Your task is to implement a function `scale_sizes(sizes: List[int], smin: Optional[int] = None, smax: Optional[int] = None) -> List[float]` that scales the sizes in the list such that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_sizes([5, 15, 25]) == [5.0, 15.0, 25.0]\", \"assert scale_sizes([]) == []\", \"assert scale_sizes([10, 30]) == [10.0, 30.0]\", \"assert scale_sizes([0, 0, 0]) == [0.0, 0.0, 0.0]\", \"assert scale_sizes([1]) == [1.0]\", \"assert scale_sizes([5, 5, 5]) =...
{ "split": "train", "index": 62289, "acecode_id": "bigcode_python_fns_48653", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of strings called `labels`. Your task is to implement a function `reindex(labels: List[str]) -> List[int]` that reindexes each label in the list as an integer starting from 1 up to the number of unique labels. The labels should be reindexed based on their p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reindex(['cat', 'dog', 'dog', 'cat', 'fish']) == [1, 2, 2, 1, 3]\", \"assert reindex(['a', 'b', 'c', 'a', 'c', 'b', 'a']) == [1, 2, 3, 1, 3, 2, 1]\", \"assert reindex(['x', 'y', 'z', 'x', 'y', 'x']) == [1, 2, 3, 1, 2, 1]\", \"assert reindex(['red', 'blue', '...
{ "split": "train", "index": 62290, "acecode_id": "bigcode_python_fns_44395", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two arrays of integers, `tp_support` and `tn_support`, your task is to implement a function `find_clip_score(tp_support: List[int], tn_support: List[int], clip_factor: Optional[float] = None) -> float` that calculates a clipping score based on the maximum values of these ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(find_clip_score([100, 200, 50000], [10, 30, 110], 1.0) - 110.0) < 1e-9\", \"assert abs(find_clip_score([100, 200, 50000], [10, 30, 110], None) - 50000.0) < 1e-9\", \"assert abs(find_clip_score([1, 2, 3], [1, 2, 3], 2.0) - 3.0) < 1e-9\", \"assert abs(find...
{ "split": "train", "index": 62291, "acecode_id": "bigcode_python_fns_1694", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function called `calculate_unique_product` that takes a list of integers as input and returns the product of all unique integers in the list. If the list is empty, return 1. Make sure to exclude any repeated integers from the computation.\nPlease reason step by s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_unique_product([1, 2, 3, 4]) == 24\", \"assert calculate_unique_product([0, 1, 2]) == 0\", \"assert calculate_unique_product([]) == 1\", \"assert calculate_unique_product([1, 1, 1, 1, 1]) == 1\", \"assert calculate_unique_product([-1, -1, 0, 1]) ==...
{ "split": "train", "index": 62292, "acecode_id": "evol_34895", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of temperature readings for different states in the United States, create a function that partitions these readings by state and returns a dictionary where each key is a state name and the value is a list of temperatures recorded in that state. The input will be a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert partition_temperatures([('California', 75.0), ('Texas', 80.5), ('California', 70.5)]) == {'California': [75.0, 70.5], 'Texas': [80.5]}\", \"assert partition_temperatures([('New York', 60.0), ('New York', 62.5), ('Florida', 85.0)]) == {'New York': [60.0, 62.5...
{ "split": "train", "index": 62293, "acecode_id": "bigcode_python_fns_5564", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings called 'tokens' and an integer 'n'. Your task is to implement a function that generates n-grams from the 'tokens' list. An n-gram is defined as a contiguous sequence of 'n' elements from the list. For each n-gram, you need to compute its hash val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_ngrams_and_hashit(['a', 'b', 'c', 'd'], 3) == [binascii.crc32(b'a b c'), binascii.crc32(b'b c d')]\", \"assert generate_ngrams_and_hashit(['hello', 'world'], 2) == [binascii.crc32(b'hello world')]\", \"assert generate_ngrams_and_hashit(['a'], 1) == ...
{ "split": "train", "index": 62294, "acecode_id": "bigcode_python_fns_18707", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the string with all characters converted to lowercase and the order of the characters reversed. For example, if the input string is 'Hello World!', the function should return '!dlrow olleh'.\nPlease reason step by st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_lower('Hello World!') == '!dlrow olleh'\", \"assert reverse_lower('Python Programming') == 'gnimmargorp nohtyp'\", \"assert reverse_lower('1234') == '4321'\", \"assert reverse_lower('') == ''\", \"assert reverse_lower('!@#$%^&*()') == ')(*&^%$#@!'\",...
{ "split": "train", "index": 62295, "acecode_id": "evol_8387", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a logging system for a Python application. The application should be able to log messages at different severity levels: debug, info, notice, warning, and error. Your task is to implement a single function `log_message(level: str, message: str) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('debug', 'This is a debug message') == 'DEBUG: This is a debug message'\", \"assert log_message('info', 'This is an info message') == 'INFO: This is an info message'\", \"assert log_message('notice', 'This is a notice message') == 'NOTICE: This i...
{ "split": "train", "index": 62296, "acecode_id": "oss_22959", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing key-value pairs representing parameters for a hypothetical API request. Your task is to implement a function that takes this dictionary as input and returns a string representation of the JSON-like structure of the dictionary. The string sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_dict_to_json_string({'name': 'John', 'age': '30'}) == '{\\\"name\\\": \\\"John\\\", \\\"age\\\": \\\"30\\\"}'\", \"assert format_dict_to_json_string({'city': 'New York', 'country': 'USA'}) == '{\\\"city\\\": \\\"New York\\\", \\\"country\\\": \\\"USA\...
{ "split": "train", "index": 62297, "acecode_id": "bigcode_python_fns_21613", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that increments a software version number given a specific set of rules. The version number is represented as a string in the format 'major.minor.revision' or 'major.minor.revision.devX', where 'X' is a non-negative integer representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment_version('1.0.0', False) == '1.0.1'\", \"assert increment_version('1.0.0', True) == '1.0.1.dev'\", \"assert increment_version('1.0.1', False) == '1.0.2'\", \"assert increment_version('1.0.1', True) == '1.0.2.dev'\", \"assert increment_version('1.0.d...
{ "split": "train", "index": 62298, "acecode_id": "bigcode_python_fns_39242", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `update_metadata(data_type: str, file_name: str, folder_name: str) -> Tuple[Dict[str, str], Dict[str, str]]` that updates user interface metadata based on the given data type. The function should handle two different cases: one for th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_metadata('time_spectra', 'file1.txt', 'folder1') == ({'text': 'file1.txt', 'folder': 'folder1'}, {'folder': 'folder1'})\", \"assert update_metadata('normalized', 'file2.txt', 'folder2') == ({}, {'full_file_name': 'file2.txt'})\", \"assert update_metad...
{ "split": "train", "index": 62299, "acecode_id": "oss_4028", "num_tests": 16 }