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 Python function that simulates a game of rock-paper-scissors. The function should take two arguments representing the choices of two players and determine the winner based on the classic rules of the game: Rock beats scissors, Scissors beats paper...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rock_paper_scissors_winner('rock', 'scissors') == 'Player 1 wins'\", \"assert rock_paper_scissors_winner('scissors', 'paper') == 'Player 1 wins'\", \"assert rock_paper_scissors_winner('paper', 'rock') == 'Player 1 wins'\", \"assert rock_paper_scissors_winner...
{ "split": "train", "index": 72600, "acecode_id": "oss_15826", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `find_phrase(text: str) -> bool` that checks if the specific phrase 'an apple a day keeps the doctor away' is present in the given string `text`. The function should return `True` if the phrase is found, and `False` otherwise.\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_phrase('I believe that an apple a day keeps the doctor away.') == True\", \"assert find_phrase('Eating an apple is healthy, but it does not guarantee anything.') == False\", \"assert find_phrase('The phrase is not present here.') == False\", \"assert fi...
{ "split": "train", "index": 72601, "acecode_id": "evol_14704", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of device statuses represented as strings, where each string can be either 'active' or 'inactive'. Your task is to implement a function `filter_active_devices(statuses: List[str]) -> List[str]` that returns a new list containing only the 'active' statuses, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_active_devices(['active', 'inactive', 'active']) == ['active', 'active']\", \"assert filter_active_devices(['inactive', 'inactive', 'inactive']) == []\", \"assert filter_active_devices(['active', 'active', 'inactive']) == ['active', 'active']\", \"ass...
{ "split": "train", "index": 72602, "acecode_id": "bigcode_python_fns_25487", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `range_of_values` that takes a list of integers as input and returns a tuple containing the minimum and maximum values from the list. If the list is empty, the function should return (None, None). The function signature should be: `def range_of_values(values: L...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert range_of_values([1, 2, 3, 4, 5]) == (1, 5)\", \"assert range_of_values([-1, -2, -3, -4, -5]) == (-5, -1)\", \"assert range_of_values([0, 0, 0]) == (0, 0)\", \"assert range_of_values([5]) == (5, 5)\", \"assert range_of_values([]) == (None, None)\", \"assert r...
{ "split": "train", "index": 72603, "acecode_id": "bigcode_python_fns_49954", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that checks if the list can be partitioned into two subsets such that the sum of the elements in both subsets is equal. The function should return True if such a partition exists, and False otherwise. You mu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_partition([1, 5, 11, 5]) == True\", \"assert can_partition([1, 2, 3, 5]) == False\", \"assert can_partition([2, 2, 2, 2]) == True\", \"assert can_partition([3, 3, 3, 3, 4, 4]) == True\", \"assert can_partition([1, 1, 1, 1, 1, 1, 1, 1]) == True\", \"asser...
{ "split": "train", "index": 72604, "acecode_id": "bigcode_python_fns_2684", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of URLs and returns a dictionary containing the count of each URL's occurrences. The input will be a list of strings, where each string is a URL. The output should be a dictionary with URLs as keys and their respecti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_urls(['http://example.com', 'http://example.com', 'http://test.com']) == {'http://example.com': 2, 'http://test.com': 1}\", \"assert count_urls(['http://google.com', 'http://yahoo.com', 'http://google.com']) == {'http://google.com': 2, 'http://yahoo.co...
{ "split": "train", "index": 72605, "acecode_id": "oss_20176", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary contains information about products. Each product dictionary has the following structure: {'id': int, 'name': str, 'price': float}. Your task is to implement a function that takes a list of these product dictionaries a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_affordable_products([{'id': 1, 'name': 'Apple', 'price': 1.0}, {'id': 2, 'name': 'Banana', 'price': 0.5}], 1.0) == ['Apple', 'Banana']\", \"assert get_affordable_products([{'id': 1, 'name': 'Apple', 'price': 1.0}, {'id': 2, 'name': 'Banana', 'price': 0.5...
{ "split": "train", "index": 72606, "acecode_id": "bigcode_python_fns_35515", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked to create a function that generates SQL commands to create database tables based on a given list of table names. Your function should accept a list of strings, where each string represents a table name, and return a list of SQL 'CREATE TABLE' commands for each ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_tables(['user', 'category', 'article']) == ['CREATE TABLE user;', 'CREATE TABLE category;', 'CREATE TABLE article;']\", \"assert create_tables(['product', 'order']) == ['CREATE TABLE product;', 'CREATE TABLE order;']\", \"assert create_tables(['custom...
{ "split": "train", "index": 72607, "acecode_id": "bigcode_python_fns_40112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the installation of Python packages listed in a requirements file. The function `install_packages(requirements: List[str]) -> List[str]` should take a list of package names as input and return a list of strings indicating t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert install_packages(['numpy', 'pandas']) == ['Successfully installed numpy', 'Successfully installed pandas']\", \"assert install_packages(['requests']) == ['Successfully installed requests']\", \"assert install_packages(['flask', 'django', 'fastapi']) == ['Suc...
{ "split": "train", "index": 72608, "acecode_id": "bigcode_python_fns_36640", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `P`, which may contain multiple lines. Your task is to replace each leading whitespace in every line of the string with a number of spaces corresponding to a specified `tablen`. The whitespace can be a combination of spaces and tabs, and should be replace...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert expand_leading_whitespace('\\\\nJust a line with no leading whitespace', 5) == '\\\\nJust a line with no leading whitespace'\", \"assert expand_leading_whitespace('Single Line', 4) == 'Single Line'\", \"assert expand_leading_whitespace('', 4) == ''\", \"asse...
{ "split": "train", "index": 72609, "acecode_id": "bigcode_python_fns_32889", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function that extracts every character in each string along with the next two characters, forming substrings of length three. Return a list of lists where each inner list contains these substrings for each corresponding string in the input l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_strings(['abc', 'de', 'fghij']) == [['abc'], [], ['fgh', 'ghi', 'hij']]\", \"assert extract_strings([]) == []\", \"assert extract_strings(['one', 'two', 'three']) == [['one'], ['two'], ['thr', 'hre', 'ree']]\", \"assert extract_strings(['cat', 'dog',...
{ "split": "train", "index": 72610, "acecode_id": "evol_92", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `bucket_sort(arr: List[int], num_buckets: int) -> List[int]` that sorts an array of integers using the bucket sort algorithm. The function should divide the input array into a specified number of buckets, sort each bucket, and then concatenate the sorted bu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bucket_sort([5, 3, 8, 1, 2], 2) == [1, 2, 3, 5, 8]\", \"assert bucket_sort([12, 4, 3, 15, 6, 9, 1, 11], 3) == [1, 3, 4, 6, 9, 11, 12, 15]\", \"assert bucket_sort([10, 7, 8, 9, 1, 5], 5) == [1, 5, 7, 8, 9, 10]\", \"assert bucket_sort([-1, -3, -2, 0, 2, 1], 3)...
{ "split": "train", "index": 72611, "acecode_id": "evol_17788", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that constructs a new list from a given list. The new list should include all elements from the original list, and for each nested list found, it should add a deep copy of that nested list to the new list. Ensure that changes made to the original nested lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_list(['a', 'b', ['c', 'd']]) == ['a', 'b', ['c', 'd'], ['c', 'd']]\", \"assert construct_list([1, 2, [3, 4]]) == [1, 2, [3, 4], [3, 4]]\", \"assert construct_list(['x', ['y', 'z']]) == ['x', ['y', 'z'], ['y', 'z']]\", \"assert construct_list(['hell...
{ "split": "train", "index": 72612, "acecode_id": "evol_23926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of tuples and creates a dictionary based on the key-value pairs provided in the tuples. Each tuple in the list contains two elements: a key (a string) and a value (which can be of any type). Your function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_tuples([('a', 1), ('b', 2), ('a', 3), ('c', 4), ('b', 5)]) == {'a': [1, 3], 'b': [2, 5], 'c': 4}\", \"assert process_tuples([('key1', 'value1'), ('key2', 'value2'), ('key1', 'value3')]) == {'key1': ['value1', 'value3'], 'key2': 'value2'}\", \"assert ...
{ "split": "train", "index": 72613, "acecode_id": "oss_29491", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a mission objective system for a simulation game. Your goal is to create a function `determine_objective_state` that takes four parameters: `completes_mission` (a boolean), `previous_objective_complete` (a boolean), `objective_state` (an integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_objective_state(True, True, 3, False) == 3\", \"assert determine_objective_state(False, True, 2, True) == 2\", \"assert determine_objective_state(False, False, 1, False) == 1\", \"assert determine_objective_state(False, True, 0, False) == 1\", \"as...
{ "split": "train", "index": 72614, "acecode_id": "oss_9386", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to implement a function called `get_visible_buildings` that takes this list as input and returns a new list containing the heights of the buildings that are visible when viewe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_visible_buildings([3, 7, 8, 3, 6, 1]) == [3, 7, 8]\", \"assert get_visible_buildings([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert get_visible_buildings([5, 4, 3, 2, 1]) == [5]\", \"assert get_visible_buildings([1, 3, 2, 5, 4]) == [1, 3, 5]\", \"assert...
{ "split": "train", "index": 72615, "acecode_id": "oss_32024", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings `sender` and `recipient`, and a string `message`, implement a function that formats a reply message in the following way: '<sender>: message'. Your function should return this formatted reply message.\nPlease reason step by step, then write a self-contained Py...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert RPL_ENDOFINFO('Alice', 'Bob', 'Hello!') == '<Alice>: Hello!'\", \"assert RPL_ENDOFINFO('Charlie', 'Dave', 'Goodbye!') == '<Charlie>: Goodbye!'\", \"assert RPL_ENDOFINFO('Eve', 'Frank', 'How are you?') == '<Eve>: How are you?'\", \"assert RPL_ENDOFINFO('Georg...
{ "split": "train", "index": 72616, "acecode_id": "bigcode_python_fns_12", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of integers representing speed at different time intervals, calculate the cumulative distance traveled over time. The cumulative distance at time `t` is determined by the speed at time `t-1` multiplied by the difference in time between `t` and `t-1`, with the assum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cumulative_distance([10, 20, 30], [0, 1, 2]) == [0, 10.0, 30.0]\", \"assert calculate_cumulative_distance([0, 0, 0], [0, 1, 2]) == [0, 0.0, 0.0]\", \"assert calculate_cumulative_distance([0, 10, 20, 30], [0, 1, 2, 3]) == [0, 0.0, 10.0, 30.0]\", \"a...
{ "split": "train", "index": 72617, "acecode_id": "bigcode_python_fns_28607", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the configuration of a Wi-Fi access point (AP) using Wi-Fi Protected Setup (WPS). The function should take in the following parameters: an initial SSID (string), a PIN (string), a new SSID (string), a security protocol ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_ap('test-wps-init-ap', '12345670', 'wps-new-ssid-with-tkip', 'WPAPSK', 'TKIP', '1234567890') == {'ssid': 'wps-new-ssid-with-tkip', 'pairwise_cipher': 'CCMP', 'group_cipher': 'TKIP', 'key_mgmt': 'WPA2-PSK'}\", \"assert configure_ap('test1', '1111', ...
{ "split": "train", "index": 72618, "acecode_id": "bigcode_python_fns_37307", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing metrics data of a process. Your task is to implement a function `import_metrics(jsondoc: Dict[str, Any]) -> None` that updates the metrics of processes based on the provided data structure. The input dictionary `jsondoc` contains fields i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert import_metrics({'format': 'jsondoc', 'version': 1, 'host': 'localhost', 'watch_dir': '/tmp', 'started': 1633072800, 'first_update': 1633072900, 'last_update': 1633073000, 'executables': [{'executable': '/usr/bin/python', 'runtime': 120, 'memory': 256, 'cpu':...
{ "split": "train", "index": 72619, "acecode_id": "bigcode_python_fns_17894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that parses a given module docstring and extracts the platform and synopsis information. The module docstring is formatted in reStructuredText and contains metadata about the module. You need to implement a function `parse_module_d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_module_docstring(\\\"\\\"\\\"\\n.. module:: aws_utilities_cli.iam\\n :platform: OS X\\n :synopsis: Small collection of utilities that manage IAM resources.\\n\\\"\\\"\\\") == (\\\"OS X\\\", \\\"Small collection of utilities that manage IAM resour...
{ "split": "train", "index": 72620, "acecode_id": "oss_17322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a list of regions from a given list of region codes, excluding a specific region code 'GB'. If no regions are found after the exclusion, the function should raise a ValueError with the message 'No regions found.'. Write a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_regions_excluding_gb(['US', 'CA', 'GB', 'AU']) == ['US', 'CA', 'AU']\", \"assert get_regions_excluding_gb(['DE', 'FR', 'IT']) == ['DE', 'FR', 'IT']\", \"assert get_regions_excluding_gb(['GB', 'JP', 'IN', 'GB']) == ['JP', 'IN']\", \"assert get_regions_exc...
{ "split": "train", "index": 72621, "acecode_id": "bigcode_python_fns_17478", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `avg_students_excellent` that takes a list of dictionaries representing courses and returns the average number of students for all courses that have a rating of 'Excellent'. Each dictionary will have the keys 'Rating', 'Students', 'Instructor', and 'Duration'. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert avg_students_excellent([{'Rating': 'Excellent', 'Students': 100, 'Instructor': 'Dr. Smith', 'Duration': 7}, {'Rating': 'Excellent', 'Students': 200, 'Instructor': 'Dr. Jones', 'Duration': 8}]) == 150.0\", \"assert avg_students_excellent([{'Rating': 'Good', '...
{ "split": "train", "index": 72622, "acecode_id": "evol_20728", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `list_operations(list1, list2, operations)` that performs various operations on two given lists of integers based on the specified operations. The operations include merging the lists, finding common elements, unique elements, sorting in descending order, c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_operations([1, 2, 3], [4, 5, 6], ['merge']) == [6, 5, 4, 3, 2, 1]\", \"assert list_operations([1, 2, 3], [3, 4, 5], ['common_elements']) == [3]\", \"assert list_operations([], [4, 5, 6], ['merge']) == 'Error: Empty list[s]'\", \"assert list_operations([...
{ "split": "train", "index": 72623, "acecode_id": "evol_31366", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that calculates the sum of even integers from a given list. The function should take a list of integers as input and return the sum of all even numbers in that list. If there are no even numbers, the function should return 0. Write a funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5, 6]) == 12\", \"assert sum_of_even_numbers([7, 11, 13, 17]) == 0\", \"assert sum_of_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_of_even_numbers([-2, -4, 0, 5]) == -6\", \"assert sum_of_even_numbers([1, 2, 3, 4]) == 6\"...
{ "split": "train", "index": 72624, "acecode_id": "oss_34379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple messaging simulation. The system should allow a user to send a message and then receive a response. Your task is to implement a function `simple_message_system` that takes in a message string as input and returns a response string. The resp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_message_system('Hello') == 'Received: Hello'\", \"assert simple_message_system('Test Message') == 'Received: Test Message'\", \"assert simple_message_system('1234') == 'Received: 1234'\", \"assert simple_message_system('') == 'Received: '\", \"assert ...
{ "split": "train", "index": 72625, "acecode_id": "oss_7340", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a range of numbers from 0 to 20, create a list of numbers that are divisible by 3. Write a function that takes this list and returns the sum of numbers from the list that are also prime.\nPlease reason step by step, then write a self-contained Python solution. Give your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_primes([0, 3, 6, 9, 12, 15, 18]) == 3\", \"assert sum_of_primes([0, 3, 6, 9, 12, 15]) == 3\", \"assert sum_of_primes([0, 3, 6, 9, 12, 15, 18, 21]) == 3\", \"assert sum_of_primes([0, 3]) == 3\", \"assert sum_of_primes([3]) == 3\", \"assert sum_of_prime...
{ "split": "train", "index": 72626, "acecode_id": "evol_3840", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string contains only unique alphabetic characters, ignoring case and non-alphabetic characters. The function should return True if all alphabetic characters in the string are unique and False otherwise.\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_alpha_entities('Python') == True\", \"assert unique_alpha_entities('Hello') == False\", \"assert unique_alpha_entities('abcdefg') == True\", \"assert unique_alpha_entities('aabbcc') == False\", \"assert unique_alpha_entities('12345') == True\", \"asse...
{ "split": "train", "index": 72627, "acecode_id": "evol_13494", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `are_anagrams(s1: str, s2: str) -> bool` that checks if two strings are anagrams of each other. An anagram is defined as a rearrangement of the letters of one word to form another word. The function should ignore spaces and be case-insensitive. Return `True...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('abc', 'cba') == True\", \"assert are_anagrams('a gentleman', 'elegant man') == True\", \"assert are_anagrams('The Morse Code', 'Here c...
{ "split": "train", "index": 72628, "acecode_id": "evol_2623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_prime(n)` that determines if a given integer n is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should return True if n is a prime number, and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser...
{ "split": "train", "index": 72629, "acecode_id": "evol_14322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the classic Fizz-Buzz game for a given integer input `n`. Your function should generate a list of strings representing the numbers from 1 to `n`, with specific substitutions based on divisibility rules: if a number is d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fizz_buzz(1) == ['1']\", \"assert fizz_buzz(2) == ['1', '2']\", \"assert fizz_buzz(3) == ['1', '2', 'Fizz']\", \"assert fizz_buzz(4) == ['1', '2', 'Fizz', '4']\", \"assert fizz_buzz(5) == ['1', '2', 'Fizz', '4', 'Buzz']\", \"assert fizz_buzz(6) == ['1', '2',...
{ "split": "train", "index": 72630, "acecode_id": "oss_1361", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `fib(n)` that calculates and returns the Fibonacci series up to a given number `n`. The Fibonacci series is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. Your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(0) == [0]\", \"assert fib(2) == [0, 1, 1, 2]\", \"assert fib(3) == [0, 1, 1, 2, 3]\", \"assert fib(4) == [0, 1, 1, 2, 3]\", \"assert fib(5) == [0, 1, 1, 2, 3, 5]\", \"assert fib(6) == [0, 1, 1, 2, 3, 5]\", \"assert fib(7) == [0, 1, 1, 2, 3, 5]\", \"asser...
{ "split": "train", "index": 72631, "acecode_id": "evol_3658", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a list of provider names and their corresponding metadata. The function should allow you to perform three operations: adding a new provider, retrieving provider metadata, and updating the metadata for existing providers. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_providers([('add', 'ProviderA', {'url': 'https://providerA.com', 'type': 'service'}), ('get', 'ProviderA')]) == [{'url': 'https://providerA.com', 'type': 'service'}]\", \"assert manage_providers([('add', 'ProviderB', {'url': 'https://providerB.com', '...
{ "split": "train", "index": 72632, "acecode_id": "oss_21689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary where keys are strings representing entities and values are lists of strings representing attacks on those entities, implement a function that returns a list of formatted strings. Each formatted string should represent an entity and its corresponding attacks ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_attacks({'A': ['attack1', 'attack3'], 'B': ['attack2']}) == ['A: attack1, attack3', 'B: attack2']\", \"assert format_attacks({'C': [], 'D': ['attack4', 'attack2', 'attack1']}) == ['C: ', 'D: attack1, attack2, attack4']\", \"assert format_attacks({'Ent...
{ "split": "train", "index": 72633, "acecode_id": "bigcode_python_fns_29948", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a hexadecimal string representation into its binary equivalent as a string. The function should not use any built-in or imported functions, and it should handle leading zeroes appropriately. If the input string is empty or contains invalid cha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_hexadecimal_to_binary('0') == '0'\", \"assert advanced_hexadecimal_to_binary('8') == '1000'\", \"assert advanced_hexadecimal_to_binary('F') == '1111'\", \"assert advanced_hexadecimal_to_binary('1A') == '11010'\", \"assert advanced_hexadecimal_to_bin...
{ "split": "train", "index": 72634, "acecode_id": "evol_31694", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a message object that can represent different types of messages such as 'text', 'image', 'video', or 'document'. Write a function `is_valid_message_type(message: str, *valid_types: str) -> bool` that checks if the type of the message is one of the allowed types sp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_message_type('text', 'text', 'image', 'video') == True\", \"assert is_valid_message_type('image', 'text', 'image', 'video') == True\", \"assert is_valid_message_type('video', 'text', 'image', 'video') == True\", \"assert is_valid_message_type('docum...
{ "split": "train", "index": 72635, "acecode_id": "bigcode_python_fns_25730", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `advanced_sum(n: int, k: int, m: int, o: int, p: int) -> int` that calculates the sum of all n-digit prime numbers that satisfy the following conditions: 1) The last digit of the number must not be p. 2) The sum of the digits of the number must be a prime numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_sum(3, 1, 3, 1, 2) == 0\", \"assert advanced_sum(2, 2, 2, 2, 3) == 0\", \"assert advanced_sum(3, 4, 1, 1, 5) == 0\", \"assert advanced_sum(2, 1, 2, 5, 9) == 0\", \"assert advanced_sum(4, 1, 4, 3, 2) == 0\", \"assert advanced_sum(4, 3, 3, 1, 7) == 0\...
{ "split": "train", "index": 72636, "acecode_id": "evol_23599", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a number of dummy tokens and an optional list of additional token strings, implement a function that generates a list of all tokens. The function should first create dummy tokens with the format 'token_0', 'token_1', ..., 'token_n-1' where n is the number of dummy tokens ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_tokens(3) == ['token_0', 'token_1', 'token_2']\", \"assert generate_tokens(0) == []\", \"assert generate_tokens(2, ['a', 'b']) == ['token_0', 'token_1', 'a', 'b']\", \"assert generate_tokens(5, ['x']) == ['token_0', 'token_1', 'token_2', 'token_3', ...
{ "split": "train", "index": 72637, "acecode_id": "bigcode_python_fns_28076", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `prune_list` that removes elements from the list based on a specified pruning ratio. The pruning ratio defines the proportion of the elements to keep from the original list. For example, if the pruning ratio is 0.5, keep 50% of the ele...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prune_list([5, 3, 8, 1, 2], 0.5) == [1, 2]\", \"assert prune_list([1, 2, 3, 4, 5], 1.0) == [1, 2, 3, 4, 5]\", \"assert prune_list([10, 20, 30, 40], 0.0) == []\", \"assert prune_list([7, 6, 5, 4, 3, 2, 1], 0.6) == [1, 2, 3, 4]\", \"assert prune_list([], 0.5) ...
{ "split": "train", "index": 72638, "acecode_id": "bigcode_python_fns_9077", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a function that parses and initializes a dictionary for different atomic lines based on their minimum intensity, minimum Aki, and minimum wavelength. Implement a function `initialize_atomic_lines()` that returns a dictionary where each key is an atomic line identi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_atomic_lines() == { 'ArI': {'min_intensity': 1000, 'min_Aki': 0, 'min_wave': 0}, 'HgI': {'min_intensity': 800, 'min_Aki': 0, 'min_wave': 0}, 'HeI': {'min_intensity': 20, 'min_Aki': 0, 'min_wave': 0}, 'NeI': {'min_intensity': 999, 'min_Aki': 0, 'mi...
{ "split": "train", "index": 72639, "acecode_id": "bigcode_python_fns_49448", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of non-negative integers, implement a function `rolling_max(arr)` that returns a new array where each element at index `i` is the maximum element from the original array from index `0` to `i`. If the input array contains any negative numbers, the function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rolling_max([1, 2, 3, 2, 3]) == [1, 2, 3, 3, 3]\", \"assert rolling_max([5, 4, 3, 2, 1]) == [5, 5, 5, 5, 5]\", \"assert rolling_max([0, 1, 2, 3]) == [0, 1, 2, 3]\", \"assert rolling_max([10, 20, 10, 30, 20]) == [10, 20, 20, 30, 30]\", \"assert rolling_max([]...
{ "split": "train", "index": 72640, "acecode_id": "evol_32457", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings, classify each string into two groups: positive and negative. You are provided with two predefined lists of words - a positive list containing words that are considered positive and a negative list containing words that are negative. Implement a functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_words(['great', 'okay', 'bad']) == {'positive': ['great'], 'negative': ['bad']}\", \"assert classify_words(['good', 'amazing', 'terrible']) == {'positive': ['good', 'amazing'], 'negative': ['terrible']}\", \"assert classify_words(['amazing', 'terrib...
{ "split": "train", "index": 72641, "acecode_id": "evol_6860", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_multiclass_classification_datasets(datasets: List[str], labels: List[List[int]]) -> List[str]` that takes in a list of dataset names and a corresponding list of labels associated with each dataset. The function should return a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_multiclass_classification_datasets(['dataset1', 'dataset2', 'dataset3'], [[0, 1], [0, 1, 2], [3]]) == ['dataset2']\", \"assert get_multiclass_classification_datasets(['datasetA', 'datasetB'], [[0], [1, 2, 3, 4]]) == ['datasetB']\", \"assert get_multiclas...
{ "split": "train", "index": 72642, "acecode_id": "bigcode_python_fns_33926", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a positive integer `n`, write a function that takes `n` as input and returns the result of reversing the sign of `n` and then reversing the digits of the resulting number. The function should handle both positive and negative integers. For example, if `n` is 123, the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_sign_and_digits(123) == -321\", \"assert reverse_sign_and_digits(456) == -654\", \"assert reverse_sign_and_digits(0) == 0\", \"assert reverse_sign_and_digits(-123) == 321\", \"assert reverse_sign_and_digits(-1) == 1\", \"assert reverse_sign_and_digit...
{ "split": "train", "index": 72643, "acecode_id": "oss_29654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a dictionary of HTTP POST request data and extracts a specific value based on a given key. Write a function called `extract_post_value` that takes two parameters: 1. `post_data` (dict): A dictionary containing the HT...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_post_value({'name': 'John'}, 'name') == 'John'\", \"assert extract_post_value({'age': '25'}, 'age') == '25'\", \"assert extract_post_value({'interests': ['coding', 'reading']}, 'interests') == 'coding'\", \"assert extract_post_value({'email': ''}, 'e...
{ "split": "train", "index": 72644, "acecode_id": "oss_23091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that initializes a service using a given configuration. The configuration is represented by a string that denotes the type of service to be initialized. Your function should take this configuration string as input and return a string ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_service('ServiceWithFiles') == 'ServiceWithFiles Initialized'\", \"assert initialize_service('ServiceWithoutFiles') == 'ServiceWithoutFiles Initialized'\", \"assert initialize_service('ServiceWithDatabase') == 'ServiceWithDatabase Initialized'\", ...
{ "split": "train", "index": 72645, "acecode_id": "bigcode_python_fns_46736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, replace all occurrences of the character '?' with the character '#' and return the modified string. For example, given the input 'Where are you???', the output should be 'Where are you###'.\nPlease reason step by step, then write a self-contained Python solution...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_question_marks('Hello? World?') == 'Hello# World#'\", \"assert replace_question_marks('What is this???') == 'What is this###'\", \"assert replace_question_marks('No questions here') == 'No questions here'\", \"assert replace_question_marks('Are you t...
{ "split": "train", "index": 72646, "acecode_id": "evol_6194", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that constructs a delete query for cards based on a specified tag. The `Card` model has a field `tags` which stores a list of tags associated with each card. Your job is to implement the function `construct_delete_query` that takes a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_delete_query('important') == 'DELETE FROM cards WHERE tag = \\\"important\\\"'\", \"assert construct_delete_query('urgent') == 'DELETE FROM cards WHERE tag = \\\"urgent\\\"'\", \"assert construct_delete_query('work') == 'DELETE FROM cards WHERE tag...
{ "split": "train", "index": 72647, "acecode_id": "oss_30390", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that reverses the order of consonants and numbers in a given string while keeping the vowels and special characters in place. The function should ensure that if a consonant is in upper case in the original string, it should also be in uppercase in the output, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_consonant_number('12345') == '54321'\", \"assert reverse_consonant_number('!@#$%^&*()') == '!@#$%^&*()'\", \"assert reverse_consonant_number('AEIOU') == 'AEIOU'\", \"assert reverse_consonant_number('C@t!') == 't@C!'\", \"assert reverse_consonant_numb...
{ "split": "train", "index": 72648, "acecode_id": "evol_10635", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of paths represented as strings, where each path is defined as a sequence of characters. Your task is to write a function `count_valid_paths(pseq: List[str], distinct: bool, trim: bool) -> int` that counts the number of valid paths in the list based on the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_valid_paths(['a', 'b', 'c', 'a'], distinct=False, trim=False) == 4\", \"assert count_valid_paths(['xyz', 'zyx', 'yzx', 'xzy'], distinct=True, trim=True) == 2\", \"assert count_valid_paths(['aaa', 'aaa', 'aaa'], distinct=False, trim=False) == 3\", \"ass...
{ "split": "train", "index": 72649, "acecode_id": "bigcode_python_fns_37838", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the configuration of a shift scheduling tool based on several input parameters. The function should accept the following arguments: \n1. `shifts_assigned_days_before_start`: An integer representing the number of days before...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_shift_tool(5, True, True, True, True, True, True, 30, '2023-12-31') == {'shifts_assigned_days_before_start': 5, 'enable_shiftplanning_export': True, 'enable_timeclock_default': True, 'enable_time_off_requests_default': True, 'enterprise_access': Tr...
{ "split": "train", "index": 72650, "acecode_id": "oss_26633", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that registers font types based on a specified input string. The function should accept a single parameter `typ`, which can either be 'sans-serif-afm' or 'serif'. Depending on the input, the function should return a dictionary that maps f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_fonts('sans-serif-afm') == {'normal': 'Helvetica', 'bold': 'Helvetica-Bold', 'italic': 'Helvetica-Oblique', 'bold_italic': 'Helvetica-BoldOblique'}\", \"assert register_fonts('serif') == {'normal': 'Calibri', 'bold': 'CalibriBd', 'italic': 'CalibriI...
{ "split": "train", "index": 72651, "acecode_id": "bigcode_python_fns_27901", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of numerical values representing data points. Your task is to implement a function that calculates the median of the provided list. The median is defined as the middle value of a sorted list of numbers. If the list has an even number of elements, the median...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_median([1, 2, 3]) == 2\", \"assert calculate_median([1, 3, 2]) == 2\", \"assert calculate_median([1, 2, 3, 4]) == 2.5\", \"assert calculate_median([4, 2, 3, 1]) == 2.5\", \"assert calculate_median([5]) == 5\", \"assert calculate_median([1, 2, 3, 2]...
{ "split": "train", "index": 72652, "acecode_id": "bigcode_python_fns_31035", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the type of a package given its ID. If the package ID exists, return the type of the package if it is set; otherwise, return 'dataset'. If the package ID does not exist, return None. Implement a function `get_package_type(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_package_type(1) == 'library'\", \"assert get_package_type(2) == 'dataset'\", \"assert get_package_type(3) == 'dataset'\", \"assert get_package_type(4) == 'module'\", \"assert get_package_type(5) == 'dataset'\"]}" }
{ "split": "train", "index": 72653, "acecode_id": "bigcode_python_fns_18211", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function `hello_world()` that returns the string 'Hello world!'.\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 hello_world() == 'Hello world!'\", \"assert hello_world() == 'Hello world!'\", \"assert hello_world() == 'Hello world!'\", \"assert hello_world() == 'Hello world!'\", \"assert hello_world() == 'Hello world!'\", \"assert hello_world() == 'Hello world!'\", \"a...
{ "split": "train", "index": 72654, "acecode_id": "evol_14031", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list of predictions where each prediction contains probabilities for 1000 classes. Your task is to implement a function `decode_classnames(preds: List[List[float]], top: int = 5) -> List[List[Tuple[str, str, float]]]` that returns the top `top` classes (class...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_classnames([[0.1]*1000, [0.2]*1000], top=5) == [[('class0', 'Class Name 0', 0.1), ('class1', 'Class Name 1', 0.1), ('class2', 'Class Name 2', 0.1), ('class3', 'Class Name 3', 0.1), ('class4', 'Class Name 4', 0.1)], [('class0', 'Class Name 0', 0.2), ('...
{ "split": "train", "index": 72655, "acecode_id": "bigcode_python_fns_35656", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Develop a Python function that generates a tuple with eight distinct values from a given list. If the list has fewer than eight distinct values, return 'Not possible'. The function should be named 'create_tuple' and accept a single parameter, 'source_list', which is a list of i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_tuple([1, 2, 3, 4, 5, 6, 7, 8]) == (1, 2, 3, 4, 5, 6, 7, 8)\", \"assert create_tuple([1, 2, 3, 4, 5, 6, 7, 9, 10]) == (1, 2, 3, 4, 5, 6, 7, 9)\", \"assert create_tuple([1, 1, 1, 1, 1, 1, 1, 1]) == 'Not possible'\", \"assert create_tuple([1, 2, 3, 4, 5...
{ "split": "train", "index": 72656, "acecode_id": "evol_14696", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given an amount of money in Brazilian Real and a predetermined exchange rate to convert it to US Dollars. Write a function `convert_to_usd(carteira: float, dolar: float) -> float` that takes two parameters: `carteira`, which represents the amount of money in Brazilian R...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_usd(100.0, 3.27) == 30.58\", \"assert convert_to_usd(200.0, 3.27) == 61.16\", \"assert convert_to_usd(0.0, 3.27) == 0.0\", \"assert convert_to_usd(50.0, 3.5) == 14.29\", \"assert convert_to_usd(150.0, 4.0) == 37.5\", \"assert convert_to_usd(250.0,...
{ "split": "train", "index": 72657, "acecode_id": "oss_21766", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that checks if a given string is a valid template name. A valid template name must start with 'TMPL_' followed by one or more uppercase letters (A-Z), digits (0-9), or underscores (_). Implement a function `valid_template_name(s: str) -> b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert valid_template_name('TMPL_VALID_TEMPLATE') == True\", \"assert valid_template_name('TMPL_12345') == True\", \"assert valid_template_name('TMPL_ABC_DEF') == True\", \"assert valid_template_name('TMPL_') == False\", \"assert valid_template_name('NOT_TMPL_123')...
{ "split": "train", "index": 72658, "acecode_id": "bigcode_python_fns_17524", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that removes consecutive, repeating characters in a string. The function should be case-sensitive and must handle special symbols, punctuation, and spacing, in addition to standard alphanumeric characters. The output should be a new string with all cons...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_consecutive_repeating('Hello, Woorld..!') == 'Helo, World.!'\", \"assert remove_consecutive_repeating('') == ''\", \"assert remove_consecutive_repeating('abc') == 'abc'\", \"assert remove_consecutive_repeating('aaa') == 'a'\", \"assert remove_consecut...
{ "split": "train", "index": 72659, "acecode_id": "evol_26424", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of characters, where each character represents a line from a text file. Your task is to count the occurrences of each character in the list and return a dictionary where the keys are the characters and the values are their respective counts. The output dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_characters(['a', 'b', 'a', 'c', 'b', 'a']) == {'a': 3, 'b': 2, 'c': 1}\", \"assert count_characters(['x', 'y', 'x', 'z', 'y', 'x']) == {'x': 3, 'y': 2, 'z': 1}\", \"assert count_characters(['1', '2', '1', '3', '2', '1']) == {'1': 3, '2': 2, '3': 1}\", ...
{ "split": "train", "index": 72660, "acecode_id": "oss_3775", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of integers and returns a new list where each element is the double of the corresponding element in the input list. If the input list is empty, the function should return an empty list. Write a function called `d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_values([]) == []\", \"assert double_values([1]) == [2]\", \"assert double_values([0]) == [0]\", \"assert double_values([-1]) == [-2]\", \"assert double_values([1, 2, 3]) == [2, 4, 6]\", \"assert double_values([5, 10, 15]) == [10, 20, 30]\", \"assert d...
{ "split": "train", "index": 72661, "acecode_id": "oss_1984", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of dictionaries representing menu items. Each dictionary contains 'text' and 'url' keys. Your function should modify the 'url' value based on the following rules: 1. If the 'text' value is 'Manage services', set ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_menu_items([{'text': 'Manage services', 'url': ''}]) == [{'text': 'Manage services', 'url': '/service_catalog/manage_services/'}]\", \"assert process_menu_items([{'text': 'Service A', 'url': ''}]) == [{'text': 'Service A', 'url': ''}]\", \"assert pro...
{ "split": "train", "index": 72662, "acecode_id": "oss_37261", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, implement a function that calculates the factorial of n using an optimized approach. The factorial of a number n is the product of all positive integers less than or equal to n, denoted as n!. Your task is to write a single function optimized_myFunc(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimized_myFunc(1) == 1\", \"assert optimized_myFunc(2) == 2\", \"assert optimized_myFunc(3) == 6\", \"assert optimized_myFunc(4) == 24\", \"assert optimized_myFunc(5) == 120\", \"assert optimized_myFunc(6) == 720\", \"assert optimized_myFunc(7) == 5040\", ...
{ "split": "train", "index": 72663, "acecode_id": "evol_12273", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks if a given title contains a specific substring within a certain number of seconds. The function should take in three parameters: a string 'title' representing the webpage title, an integer 'timeout' representing the num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_title('Welcome to Studio Home', 10, 'Studio') == True\", \"assert check_title('Welcome to Studio Home', 5, 'Home') == True\", \"assert check_title('Welcome to Studio Home', 3, 'Welcome') == True\", \"assert check_title('Welcome to Studio Home', 1, 'Pag...
{ "split": "train", "index": 72664, "acecode_id": "oss_22616", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci_even_sum(n: int) -> Tuple[List[int], List[int]]` that generates the Fibonacci series up to a given integer n and returns a tuple containing two lists. The first list should contain the Fibonacci series, and the second list should contain only the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_even_sum(2) == ([0, 1, 1, 2], [0, 2])\", \"assert fibonacci_even_sum(3) == ([0, 1, 1, 2, 3], [0, 2])\", \"assert fibonacci_even_sum(5) == ([0, 1, 1, 2, 3, 5], [0, 2])\", \"assert fibonacci_even_sum(8) == ([0, 1, 1, 2, 3, 5, 8], [0, 2, 8])\", \"asse...
{ "split": "train", "index": 72665, "acecode_id": "evol_9410", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string consisting of lowercase letters and spaces. Your task is to implement a function that counts the number of words in the string. A word is defined as a sequence of characters separated by spaces. The function should return the count of words in the input s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_words('hello world') == 2\", \"assert count_words(' leading and trailing spaces ') == 4\", \"assert count_words('singleword') == 1\", \"assert count_words(' ') == 0\", \"assert count_words('this is a test') == 4\", \"assert count_words(' multiple...
{ "split": "train", "index": 72666, "acecode_id": "bigcode_python_fns_26298", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `format_calendar_date(year: int, month: int, day: int) -> str` that takes a year, month, and day as input and returns a string representation of the date in the format 'YYYY-MM-DD'. The function should raise a ValueError if the month is not between 1 and 12...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_calendar_date(2023, 1, 1) == '2023-01-01'\", \"assert format_calendar_date(2020, 2, 29) == '2020-02-29'\", \"assert format_calendar_date(2021, 2, 28) == '2021-02-28'\", \"assert format_calendar_date(2021, 3, 15) == '2021-03-15'\", \"assert format_cale...
{ "split": "train", "index": 72667, "acecode_id": "evol_26338", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a dictionary `test_config` which may contain a key `agent_settings` that maps to another dictionary. You need to implement a function `set_environment_variables(test_config: Dict[str, Any], agent_env_settings_fields: List[str]) -> Dict[str, str]` that sets environ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_environment_variables({'agent_settings': {'VAR1': 'custom_value1', 'VAR2': ''}}, ['VAR1', 'VAR2', 'VAR3']) == {'VAR1': 'custom_value1', 'VAR2': 'value2', 'VAR3': 'value3'}\", \"assert set_environment_variables({'agent_settings': {'VAR1': '', 'VAR2': 'cus...
{ "split": "train", "index": 72668, "acecode_id": "bigcode_python_fns_12153", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of character names and their occupations formatted as 'Name (Occupation)', implement a function that identifies the occupation of the second character in the list and calculates the average length of all occupation names. If there is no second character, return 'No...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert character_profession(['John Doe (Writer)', 'Jane Smith (Painter)', 'Tom Johnson (Architect)']) == ('Painter', 7)\", \"assert character_profession(['Alice (Doctor)', 'Bob (Engineer)']) == ('Engineer', 7)\", \"assert character_profession(['Fiona (Nurse)', 'Geo...
{ "split": "train", "index": 72669, "acecode_id": "evol_12011", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given two lists of integers, 'start' and 'end', and an optional list of integers 'weight', implement a function that computes the cumulative weights for each interval defined by the 'start' and 'end' lists. If 'weight' is not provided, assume a default weight of 1 for each inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_cumulative_weights([1, 3, 5], [3, 4, 6], [0, 0, 0]) == [0, 0, 0]\", \"assert compute_cumulative_weights([1, 2], [1, 2], [1, 1]) == [1, 1]\", \"assert compute_cumulative_weights([1, 2, 3], [3, 2, 1]) == []\", \"assert compute_cumulative_weights([1, 2,...
{ "split": "train", "index": 72670, "acecode_id": "bigcode_python_fns_34708", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `smallestNumber` that returns the smallest integer from the list without using Python's built-in `min()` function. The list can contain both positive and negative integers. You can assume that the list is non-empty.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallestNumber([3, 1, 4, 1, 5, 9]) == 1\", \"assert smallestNumber([-1, -5, -3, -4]) == -5\", \"assert smallestNumber([0, -2, 2, -1]) == -2\", \"assert smallestNumber([10, 20, 30, 5]) == 5\", \"assert smallestNumber([-10, -20, 0, 10]) == -20\", \"assert smal...
{ "split": "train", "index": 72671, "acecode_id": "evol_33863", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You have a `labyrinth` represented as an `m x n` grid filled with vacant areas (denoted as `0`) and barriers (denoted as `1`). A sphere can traverse through vacant areas by rolling in any cardinal direction, stopping only when it collides with a barrier. Given the `labyrinth`, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hasPath([[0,0,1,0,0],[0,0,0,0,0],[0,0,0,1,0],[1,1,0,1,1],[0,0,0,0,0]], [0,4], [4,4]) == True\", \"assert hasPath([[0,0,1,0,0],[0,0,0,0,0],[0,0,0,1,0],[1,1,0,1,1],[0,0,0,0,0]], [0,4], [3,2]) == False\", \"assert hasPath([[0,0,0,0,0],[1,1,0,0,1],[0,0,0,0,0],[0...
{ "split": "train", "index": 72672, "acecode_id": "evol_11703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of model configurations and generates a list of results for each model. The function should take in an initial batch size, a list of model configurations, and a set of arguments. Your implementation should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_model_configurations(32, [('resnet', 'checkpoint1.pth')], {'arg1': 'value1'}) == [{'model': 'resnet', 'result': {}}]\", \"assert process_model_configurations(16, [('vgg', 'checkpoint2.pth')], {'arg1': 'value2'}) == [{'model': 'vgg', 'result': {}}]\",...
{ "split": "train", "index": 72673, "acecode_id": "oss_10339", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `extract_emails(html_content: str) -> List[str]` that takes a string containing HTML content and returns a list of all unique email addresses found in the HTML. The email addresses should be extracted using a regular expression pattern that matches valid em...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_emails('<html><body></body></html>') == []\", \"assert extract_emails('<html><body>Contact us at info@example.com</body></html>') == ['info@example.com']\", \"assert extract_emails('<html><body>Emails: test.user123@example.com, example@example.com</b...
{ "split": "train", "index": 72674, "acecode_id": "evol_11951", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of IANA timezone names, implement a function that returns a list of timezone names with 'posix/' and 'right/' prefixes included for each timezone in the input list. If a timezone is not valid (not in the IANA timezone database), it should be excluded from the outpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_timezone_prefixes(['Invalid/Timezone', 'UTC']) == ['UTC', 'posix/UTC', 'right/UTC']\", \"assert add_timezone_prefixes(['Invalid/Timezone', 'Invalid/Timezone']) == []\", \"assert add_timezone_prefixes(['UTC', 'UTC', 'Invalid/Timezone']) == ['UTC', 'posix/...
{ "split": "train", "index": 72675, "acecode_id": "bigcode_python_fns_25119", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `lucas_numbers(n)` that returns the first `n + 1` numbers in the Lucas sequence. The Lucas sequence is defined as follows: L(0) = 2, L(1) = 1, and L(n) = L(n-1) + L(n-2) for n > 1. The function should take an integer `n` (0 <= n <= 30) as input and return a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lucas_numbers(0) == [2]\", \"assert lucas_numbers(1) == [2, 1]\", \"assert lucas_numbers(2) == [2, 1, 3]\", \"assert lucas_numbers(3) == [2, 1, 3, 4]\", \"assert lucas_numbers(4) == [2, 1, 3, 4, 7]\", \"assert lucas_numbers(5) == [2, 1, 3, 4, 7, 11]\", \"ass...
{ "split": "train", "index": 72676, "acecode_id": "evol_5323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_max_sum_subarray(nums: List[int]) -> int` that returns the maximum sum of any contiguous subarray within the list. A contiguous subarray is defined as a sequence of elements that are adjacent in the list. If the input list is emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_sum_subarray([-2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert find_max_sum_subarray([-1,-2,-3,-4]) == -1\", \"assert find_max_sum_subarray([1,2,3,4,5]) == 15\", \"assert find_max_sum_subarray([-1,1,-1,1,-1]) == 1\", \"assert find_max_sum_subarray([0,0,0,0]...
{ "split": "train", "index": 72677, "acecode_id": "bigcode_python_fns_42398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_objects(token: Optional[str], size: int) -> List[str]` that simulates retrieving a list of object names from a hypothetical storage system. The function will take two parameters: a string `token` which represents a continuation t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_objects(None, 5) == ['object_0', 'object_1', 'object_2', 'object_3', 'object_4']\", \"assert get_objects('', 3) == ['object_0', 'object_1', 'object_2']\", \"assert get_objects('object_0', 2) == ['object_1', 'object_2']\", \"assert get_objects('object_1',...
{ "split": "train", "index": 72678, "acecode_id": "bigcode_python_fns_26947", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a basic application interface. This function should take two boolean parameters, `has_sidebar` and `has_text_widget`, which indicate whether the application should include a sidebar and a text widget, respec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_app(True, True) == 'App with sidebar and text widget created.'\", \"assert create_app(True, False) == 'App with sidebar created.'\", \"assert create_app(False, True) == 'App with text widget created.'\", \"assert create_app(False, False) == 'App creat...
{ "split": "train", "index": 72679, "acecode_id": "bigcode_python_fns_24409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a simplified text editor. The editor should support inserting and deleting characters, as well as retrieving the current content of the text. Implement a function `text_editor(operations: List[str]) -> str` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert text_editor(['INSERT hello', 'INSERT world', 'DELETE 5']) == 'hello'\", \"assert text_editor(['INSERT hello', 'DELETE 10']) == ''\", \"assert text_editor(['INSERT abc', 'INSERT def', 'DELETE 2']) == 'abcd'\", \"assert text_editor(['INSERT a', 'INSERT b', 'IN...
{ "split": "train", "index": 72680, "acecode_id": "bigcode_python_fns_11058", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a value 'n'. Write a function that calculates the sum of all elements in the list which are greater than 'n', subtracts this sum by 'n', and returns the final result. If there are no elements greater than 'n', the function should return -n.\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_higher_than_n([1, 2, 3, 4, 5], 5) == -5\", \"assert sum_higher_than_n([100, 200, 300], 250) == 50\", \"assert sum_higher_than_n([], 10) == -10\", \"assert sum_higher_than_n([8, 9, 10], 10) == -10\", \"assert sum_higher_than_n([10, 20, 30, 40, 50], 45) ==...
{ "split": "train", "index": 72681, "acecode_id": "evol_5079", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an integer n, implement a function that returns the nth prime number. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. Your function should take an integer n as input and return the nth prime number. For e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_nth_prime(1) == 2\", \"assert find_nth_prime(2) == 3\", \"assert find_nth_prime(3) == 5\", \"assert find_nth_prime(4) == 7\", \"assert find_nth_prime(5) == 11\", \"assert find_nth_prime(6) == 13\", \"assert find_nth_prime(7) == 17\", \"assert find_nth_p...
{ "split": "train", "index": 72682, "acecode_id": "oss_30308", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple consists of two elements: a target value (0 or 1) and an attribute value (a string). Your task is to calculate the conditional probabilities of the target values given the attribute values. Specifically, you need to return a dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert conditional_probability([(0, 'A'), (1, 'A'), (1, 'B'), (0, 'B'), (1, 'C')]) == {'A': {0: 0.5, 1: 0.5}, 'B': {0: 0.5, 1: 0.5}, 'C': {0: 0.0, 1: 1.0}}\", \"assert conditional_probability([(0, 'X'), (0, 'X'), (1, 'Y')]) == {'X': {0: 1.0, 1: 0.0}, 'Y': {0: 0.0, ...
{ "split": "train", "index": 72683, "acecode_id": "bigcode_python_fns_18403", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given an input array of strings, implement a function that returns a new array containing only the strings that include the vowel 'e'. The function should be case-sensitive, meaning it should only consider lowercase 'e'.\nPlease reason step by step, then write a self-contained ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_words_with_e(['cat', 'dog', 'fish']) == []\", \"assert get_words_with_e(['eleven', 'twelve', 'thirteen']) == ['eleven', 'twelve', 'thirteen']\", \"assert get_words_with_e(['hello', 'world', 'python']) == ['hello']\", \"assert get_words_with_e(['there', '...
{ "split": "train", "index": 72684, "acecode_id": "evol_11574", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes in a dictionary representing a dataset and a separate dictionary for column mapping, and returns two lists: one containing the names of numeric feature columns and the other containing the names of categorical feature co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_feature_names({'feature1': [1, 2, 3], 'feature2': ['A', 'B', 'C'], 'feature3': [0.1, 0.2, 0.3]}, {'categorical_features': ['feature2']}) == (['feature1', 'feature3'], ['feature2'])\", \"assert extract_feature_names({'a': [1, 2], 'b': [3.5, 4.5], 'c':...
{ "split": "train", "index": 72685, "acecode_id": "oss_18714", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a target integer and a list of unique integers, implement a function that calculates the optimal combination of the integers that minimizes the absolute difference when their sum is subtracted from the specified target. The function should also consider permutations of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_best_combo(22, [3, 7, 12, 9, 4], 2) == [1, [12, 9]]\", \"assert find_best_combo(30, [10, 20, 30], 2) == [0, [10, 20]]\", \"assert find_best_combo(25, [5, 15, 20], 2) == [0, [5, 20]]\", \"assert find_best_combo(50, [25, 25, 50, 75], 2) == [0, [25, 25]]\"...
{ "split": "train", "index": 72686, "acecode_id": "evol_32942", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a value and a count, write a function `is_byte_array(value: tuple, count: int) -> bool` that checks if the given value is a byte array. A value is considered a byte array if it is a tuple of length `count`, and each element in the tuple is an integer between 0 and 255 (in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_byte_array((0, 255, 128), 3) == True\", \"assert is_byte_array((255, 0, 0), 3) == True\", \"assert is_byte_array((128, 128, 128), 3) == True\", \"assert is_byte_array((256, 0, 0), 3) == False\", \"assert is_byte_array((0, -1, 255), 3) == False\", \"assert...
{ "split": "train", "index": 72687, "acecode_id": "bigcode_python_fns_47863", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `caesar_cipher(message: str, key: int) -> str` that encrypts a given message using a Caesar Cipher. The function should take a string `message` and an integer `key` (1 <= key <= 26) as input arguments, and return the encrypted message. The encryption should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert caesar_cipher('Hello, World!', 3) == 'Khoor, Zruog!'\", \"assert caesar_cipher('abcd', 1) == 'bcde'\", \"assert caesar_cipher('xyz', 2) == 'zab'\", \"assert caesar_cipher('Caesar Cipher!', 2) == 'Ecguct Ekrjgt!'\", \"assert caesar_cipher('12345!@#', 10) == '...
{ "split": "train", "index": 72688, "acecode_id": "evol_8982", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function `compute_divisors_and_gcd_lcm(x: int, y: int) -> Tuple[List[int], List[int], int, int]` that takes two integers, x and y, as input and returns a tuple containing the following: a list of positive common divisors of x and y, the greatest common divisor (GCD) of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_divisors_and_gcd_lcm(12, 18) == ([1, 2, 3, 6], 6, 36)\", \"assert compute_divisors_and_gcd_lcm(8, 12) == ([1, 2, 4], 4, 24)\", \"assert compute_divisors_and_gcd_lcm(15, 5) == ([1, 5], 5, 15)\", \"assert compute_divisors_and_gcd_lcm(7, 14) == ([1, 7],...
{ "split": "train", "index": 72689, "acecode_id": "evol_21057", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string consisting of digits and underscores, write a function that validates whether the string adheres to specific formatting rules. The rules are as follows: 1) The string must not start or end with an underscore. 2) Two underscores must not appear consecutively. 3) A...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_string_format('123__456') == False\", \"assert validate_string_format('_123456') == False\", \"assert validate_string_format('123456_') == False\", \"assert validate_string_format('0_0_0') == False\", \"assert validate_string_format('') == False\", ...
{ "split": "train", "index": 72690, "acecode_id": "bigcode_python_fns_39959", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple logging function that simulates logging messages at different levels for a fictional company. Your function should accept a logger's name, a log level, and a message. Based on the provided log level, it should return a formatted string repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('test.logger', 'INFO', 'This is an info message') == '[test.logger] INFO: This is an info message'\", \"assert log_message('test.logger', 'DEBUG', 'This is a debug message') == ''\", \"assert log_message('test.logger', 'WARNING', 'This is a warni...
{ "split": "train", "index": 72691, "acecode_id": "oss_16934", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two 2D lists of integers, `x` and `y`, where each list represents a batch of feature vectors, return a 2D list where each element is the flattened outer product of the corresponding vectors in `x` and `y`. The input lists have the same number of vectors, and the length of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_flattened_outer_products([[1, 2], [3]], [[4, 5], [6, 7]]) == [[4, 5, 8, 10], [18, 21]]\", \"assert get_flattened_outer_products([[1]], [[2]]) == [[2]]\", \"assert get_flattened_outer_products([[1, 0], [0, 1]], [[0, 1], [1, 0]]) == [[0, 1, 0, 0], [0, 0, 1...
{ "split": "train", "index": 72692, "acecode_id": "bigcode_python_fns_48723", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a whimsical advertisement for a dungeon adventure. The advertisement should include the name of the character, the price to enter the dungeon, and a brief description of the adventure. The function should take three paramet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_advertisement('Alaveus', 10, 'treasure and glory await those who dare enter!') == 'I am Alaveus. For the meager price of 10 chalupas, I can transport you deep into the heart of a mythic dungeon where treasure and glory await those who dare enter!'\"...
{ "split": "train", "index": 72693, "acecode_id": "bigcode_python_fns_10269", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a Python function `smallest_difference(arr)` that finds the smallest difference between any pair of elements in a given array. The function should return the smallest difference along with the pair of elements that produce this difference. If the array has fewer than ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_difference([4, 2, 1, 3]) == (1, (1, 2))\", \"assert smallest_difference([-1, -3, -5, -2]) == (1, (-3, -2))\", \"assert smallest_difference([1, 5, 9, 10]) == (1, (9, 10))\", \"assert smallest_difference([0, 0, 0, 0]) == (0, (0, 0))\", \"assert smalle...
{ "split": "train", "index": 72694, "acecode_id": "evol_6535", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `quickselect_median(l: List[int], pivot_fn: Callable[[List[int]], int]) -> float` that returns the median of a list of integers. The function should utilize a pivot function to partition the list. If the length of the list is odd, return the middle element;...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quickselect_median([1, 2, 3, 4, 5], pivot_fn) == 3\", \"assert quickselect_median([1, 2, 3, 4], pivot_fn) == 2.5\", \"assert quickselect_median([5, 3, 1, 2, 4], pivot_fn) == 3\", \"assert quickselect_median([7, 8, 9], pivot_fn) == 8\", \"assert quickselect_m...
{ "split": "train", "index": 72695, "acecode_id": "evol_7149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a recursive function that receives a string as an argument, discards the characters positioned at even index locations, and keeps the characters at odd index spots while affixing them to a fresh string. Implement the function `modify_string(s: str) -> str` that returns t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_string('1234567890') == '24680'\", \"assert modify_string('') == ''\", \"assert modify_string('abcdefgh') == 'bdfh'\", \"assert modify_string('aabbccdd') == 'abcd'\", \"assert modify_string('1234') == '24'\", \"assert modify_string('xx') == 'x'\", \"a...
{ "split": "train", "index": 72696, "acecode_id": "evol_30245", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a bank account balance management system. Create a function `update_balance(amount: int) -> None` that updates the balance of a bank account. The function takes one parameter, `amount`, which represents the new balance. The function should raise...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_balance(100) == None\", \"assert update_balance(200) == None\", \"assert update_balance(150) == None\", \"assert update_balance(1) == None\", \"assert update_balance(500) == None\", \"assert update_balance(1000) == None\", \"assert update_balance(250)...
{ "split": "train", "index": 72697, "acecode_id": "oss_32764", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of fruits, implement a function `count_fruit_entities(fruit_list)` that returns a dictionary with the unique fruits as keys and their counts as values. The function should also raise a `ValueError` if any element in the list is not a string. The input list may cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_fruit_entities(['apple', 'banana', 'orange', 'apple', 'orange']) == {'apple': 2, 'banana': 1, 'orange': 2}\", \"assert count_fruit_entities(['apple', 'Apple', 'banana']) == {'apple': 1, 'Apple': 1, 'banana': 1}\", \"assert count_fruit_entities(['grape'...
{ "split": "train", "index": 72698, "acecode_id": "evol_2262", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of strings, `inputs` and `outputs`. Your task is to implement a function `validate_io_mapping(inputs: List[str], outputs: List[str]) -> bool` that checks if the provided `inputs` and `outputs` lists contain valid names for inputs and outputs. Valid names...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_io_mapping(['input', 'second_input'], ['output', 'sum']) == True\", \"assert validate_io_mapping(['input_1', 'input_2'], ['output_1', 'sum']) == True\", \"assert validate_io_mapping(['input', 'second input'], ['output', 'sum']) == False\", \"assert ...
{ "split": "train", "index": 72699, "acecode_id": "bigcode_python_fns_32184", "num_tests": 16 }