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 implementing a function that removes a node from a tree data structure. The tree is represented as a list of nodes, where each node is an integer. Given a list of integers representing the tree nodes and an integer representing the node to be removed, return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_node([1, 2, 3, 4, 5], 4) == [1, 2, 3, 5]\", \"assert remove_node([1, 2, 3, 4, 5], 6) == [1, 2, 3, 4, 5]\", \"assert remove_node([10, 20, 30], 20) == [10, 30]\", \"assert remove_node([7], 7) == []\", \"assert remove_node([], 1) == []\", \"assert remove...
{ "split": "train", "index": 63300, "acecode_id": "bigcode_python_fns_2967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `count_even_numbers` that takes a list of integers as input and returns the total count of even numbers in that list. For example, given the input list [1, 2, 3, 4, 5], the function should return 2, as there are two even numbers (2 and 4).\nPlease reason st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_even_numbers([1, 2, 3, 4, 5]) == 2\", \"assert count_even_numbers([1, 3, 5, 7]) == 0\", \"assert count_even_numbers([2, 4, 6, 8]) == 4\", \"assert count_even_numbers([10, 15, 20, 25]) == 2\", \"assert count_even_numbers([-2, -4, -6]) == 3\", \"assert c...
{ "split": "train", "index": 63301, "acecode_id": "evol_34183", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function for managing JSON Web Key (JWK) operations. A JSON Web Key is a JSON data structure representing a cryptographic key. Your task is to implement a function `generate_jwk(curve_name: str, key_operation: str) -> str` that takes two param...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_jwk('P-256', 'sign') == '{\\\"kty\\\": \\\"EC\\\", \\\"crv\\\": \\\"P-256\\\", \\\"use\\\": \\\"sign\\\"}'\", \"assert generate_jwk('P-384', 'verify') == '{\\\"kty\\\": \\\"EC\\\", \\\"crv\\\": \\\"P-384\\\", \\\"use\\\": \\\"verify\\\"}'\", \"asser...
{ "split": "train", "index": 63302, "acecode_id": "oss_32583", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that randomly selects a specified number of elements from the list and returns them as a new list. The selection should be done without replacement, meaning each selected element should be unique. Your function should take two paramete...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_random_elements([1, 2, 3], 0) == []\", \"assert select_random_elements([], 2) == []\", \"assert select_random_elements([1, 2, 3], 4) == []\", \"assert select_random_elements([5, 5, 5, 5], 1) in [[5]]\", \"assert select_random_elements([1], 1) == [1]\"...
{ "split": "train", "index": 63303, "acecode_id": "bigcode_python_fns_41292", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns a new list containing only the unique elements from the original list in the order they first appeared. The function should handle both positive and negative integers and maintain the o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([-1, -2, -1, -3]) == [-1, -2, -3]\", \"assert unique_elements([1, -1, 2, -1, 2]) == [1, -1, 2]\", \"assert unique_elements([]) == []\",...
{ "split": "train", "index": 63304, "acecode_id": "oss_30789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `provision_requirements` that simulates the provisioning of requirements for an application based on the provided domain. The function takes a single argument `domain`, which can either be 'system' or 'webapp'. If the domain is 'sy...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert provision_requirements('system') == 'Provisioning system requirements...'\", \"assert provision_requirements('webapp') == 'Provisioning webapp requirements...'\", \"assert provision_requirements('database') == 'Invalid domain'\", \"assert provision_requireme...
{ "split": "train", "index": 63305, "acecode_id": "bigcode_python_fns_44346", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of items sold each day in a store. Write a function `max_sales_days(sales: List[int]) -> int` that returns the maximum number of consecutive days the store has seen sales greater than zero. If there are no days with sales...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_sales_days([5, 3, 0, 1, 6, 7]) == 3\", \"assert max_sales_days([0, 0, 0, 0]) == 0\", \"assert max_sales_days([1, 2, 3, 4, 5]) == 5\", \"assert max_sales_days([0, 1, 2, 3, 0]) == 3\", \"assert max_sales_days([1, 0, 1, 0, 1]) == 1\", \"assert max_sales_day...
{ "split": "train", "index": 63306, "acecode_id": "bigcode_python_fns_24241", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a new list containing the same integers sorted in ascending order. The function should not modify the original list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_list([30, 10, 20, 40]) == [10, 20, 30, 40]\", \"assert sort_list([5, 1, 3, 2, 4]) == [1, 2, 3, 4, 5]\", \"assert sort_list([100, 50, 75, 25]) == [25, 50, 75, 100]\", \"assert sort_list([0, -1, 1]) == [-1, 0, 1]\", \"assert sort_list([3, 3, 2, 1]) == [1,...
{ "split": "train", "index": 63307, "acecode_id": "evol_25879", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `extract_kth_color(color_tuple: tuple, k: int) -> str` that takes an n-tuple of colors and a positive integer k. The function should return the k-th to the last item from the tuple. If k is out of bounds (greater than the length of the tuple), it should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_kth_color(('red', 'blue', 'green', 'yellow'), 1) == 'yellow'\", \"assert extract_kth_color(('red', 'blue', 'green', 'yellow'), 2) == 'green'\", \"assert extract_kth_color(('red', 'blue', 'green', 'yellow'), 3) == 'blue'\", \"assert extract_kth_color(...
{ "split": "train", "index": 63308, "acecode_id": "evol_752", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function that replaces all occurrences of the substring 'My website' with the substring 'John's website'. The function should also handle case sensitivity, meaning it should replace 'my website' as well. Your function should ensure that only complete ins...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_website('I have built My website from scratch.') == \\\"I have built John's website from scratch.\\\"\", \"assert replace_website('The speed of My website is optimised.') == \\\"The speed of John's website is optimised.\\\"\", \"assert replace_websit...
{ "split": "train", "index": 63309, "acecode_id": "evol_8566", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with verifying the integrity of an access profile in a system. An access profile is represented as a dictionary with the following keys: 'id', 'name', 'source', 'entitlements', 'entitlementCount', 'created', 'modified', 'synced', 'enabled', 'requestable', 'reques...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_access_profile({'id': '123', 'name': 'Profile A', 'source': 'Source X', 'entitlements': ['ent1'], 'entitlementCount': 1, 'created': '2023-01-01', 'modified': '2023-01-02', 'synced': '2023-01-03', 'enabled': True, 'requestable': False, 'requestComments...
{ "split": "train", "index": 63310, "acecode_id": "bigcode_python_fns_32997", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a package.json file, which contains two keys: 'dependencies' and 'devDependencies'. Each key maps to another dictionary where the keys are package names and the values are their version strings. Your task is to implement a function `extra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_local_packages({'dependencies': {'packageA': 'file:./packageA'}, 'devDependencies': {}}) == ({'packageA': 'file:./packageA'}, {})\", \"assert extract_local_packages({'dependencies': {}, 'devDependencies': {'packageB': 'file:./packageB'}}) == ({}, {'p...
{ "split": "train", "index": 63311, "acecode_id": "bigcode_python_fns_38545", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to identify stale nodes from a list based on their last update time. A node is considered stale if the difference between the current UTC time and the node's last update time exceeds a specified staleness period. Your function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_stale_nodes([Node(1631980000)], 3600) == [Node(1631980000)]\", \"assert remove_stale_nodes([Node(1632000000), Node(1632000001)], 0) == [Node(1632000000), Node(1632000001)]\", \"assert remove_stale_nodes([], 3600) == []\", \"assert remove_stale_nodes([...
{ "split": "train", "index": 63312, "acecode_id": "oss_31956", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages zone numbers for a transportation system. The zone numbers are represented as integers and have a maximum internal value of 6000. Your task is to implement a function called `manage_zones` which accepts a list of integers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_zones([1000, 2000, 3000]) == '1000:2000:3000'\", \"assert manage_zones([6000, 5000, 4000]) == '6000:5000:4000'\", \"assert manage_zones([0, 6000]) == '0:6000'\", \"assert manage_zones([]) == ''\", \"assert manage_zones([2500, 2500, 2500]) == '2500:250...
{ "split": "train", "index": 63313, "acecode_id": "oss_1795", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function `compare_binary_strings(string1: str, string2: str) -> Tuple[str, int]` that compares two binary strings of equal length. The function should return a tuple containing two elements: the first element is a binary string representation of the differences between ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_binary_strings('111000', '111111') == ('000111', 7)\", \"assert compare_binary_strings('00000', '11111') == ('11111', 31)\", \"assert compare_binary_strings('101010', '101010') == ('000000', 0)\", \"assert compare_binary_strings('1101101', '1011011')...
{ "split": "train", "index": 63314, "acecode_id": "evol_5158", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three integers x, y, and z, implement a function called find_sum that returns the sum of these three integers.\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 find_sum(1, 2, 3) == 6\", \"assert find_sum(-1, -2, -3) == -6\", \"assert find_sum(0, 0, 0) == 0\", \"assert find_sum(5, 10, 15) == 30\", \"assert find_sum(-5, 10, 5) == 10\", \"assert find_sum(100, 200, 300) == 600\", \"assert find_sum(1, -1, 0) == 0\", \"a...
{ "split": "train", "index": 63315, "acecode_id": "evol_35376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that will analyze an input array of floats to find pairs of numbers that add up to give the smallest sum. The function should return these pairs in a sequence starting from the pair with the lowest sum, followed by the next, each pair sorted with the smaller n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_smallest_sum_pairs([2.0, 2.0]) == [(2.0, 2.0)]\", \"assert find_smallest_sum_pairs([3.5, 1.5, 2.5]) == [(1.5, 2.5)]\", \"assert find_smallest_sum_pairs([0.5, 1.5, 1.0]) == [(0.5, 1.0)]\", \"assert find_smallest_sum_pairs([1.1, 2.2, 3.3, 4.4]) == [(1.1, ...
{ "split": "train", "index": 63316, "acecode_id": "evol_28346", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines the attributes for different types of cookies based on their type and a development mode flag. The function should accept a cookie type and a boolean indicating whether the application is in development mode, and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_cookie_attributes('session', True) == {'httponly': True, 'secure': False}\", \"assert get_cookie_attributes('session', False) == {'httponly': True, 'secure': True}\", \"assert get_cookie_attributes('XSRF', True) == {'httponly': False, 'secure': False}\",...
{ "split": "train", "index": 63317, "acecode_id": "oss_4694", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 'urn', your task is to implement a function that computes the hash of the string using a simple hashing algorithm. The hash is calculated by summing the ASCII values of each character in the string and then taking the modulo of that sum with 256. Implement the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_hash('abc') == 38\", \"assert simple_hash('') == 0\", \"assert simple_hash('a') == 97\", \"assert simple_hash('A') == 65\", \"assert simple_hash('123') == 150\", \"assert simple_hash('') == 0\"]}" }
{ "split": "train", "index": 63318, "acecode_id": "bigcode_python_fns_45022", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `prime_numbers(n)` that takes an integer `n` as input and returns a list of all prime numbers up to and including `n`. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_numbers(2) == [2]\", \"assert prime_numbers(3) == [2, 3]\", \"assert prime_numbers(4) == [2, 3]\", \"assert prime_numbers(5) == [2, 3, 5]\", \"assert prime_numbers(10) == [2, 3, 5, 7]\", \"assert prime_numbers(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"a...
{ "split": "train", "index": 63319, "acecode_id": "evol_9319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a memory management system for a quantum computing platform. The system needs to enforce memory limits for each host, ensuring that no host exceeds its allocated memory capacity. Your task is to write a function that checks whether a host can in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_memory_limits('host1', {'host1': 100, 'host2': 200}, {'host1': 50}) == True\", \"assert check_memory_limits('host1', {'host1': 100, 'host2': 200}, {'host1': 100}) == False\", \"assert check_memory_limits('host1', {'host1': 100, 'host2': 200}, {'host1':...
{ "split": "train", "index": 63320, "acecode_id": "oss_14410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the maximum product of any two distinct integers in the list. The function should handle lists with fewer than two integers by returning 0. You can assume that the input list may contain both positive and negative integers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product([1, 2, 3, 4]) == 12\", \"assert max_product([0, 0, 0, 0]) == 0\", \"assert max_product([1]) == 0\", \"assert max_product([]) == 0\", \"assert max_product([5, 10, 2, 3]) == 50\", \"assert max_product([1, 1, 1, 1]) == 1\", \"assert max_product([-1,...
{ "split": "train", "index": 63321, "acecode_id": "bigcode_python_fns_20544", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of lists containing integers, where each inner list represents a row of a 2D grid. The integers in each row are sorted in ascending order. Your task is to write a function that finds the median of all the integers in the 2D grid. If the total number of inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_median([[1, 3, 5], [2, 4, 6], [7, 8, 9]]) == 5\", \"assert find_median([[1, 2], [3, 4], [5, 6]]) == 3.5\", \"assert find_median([[1]]) == 1\", \"assert find_median([[1, 2], [3]]) == 2\", \"assert find_median([[1, 3, 5], [2, 4]]) == 3\", \"assert find_me...
{ "split": "train", "index": 63322, "acecode_id": "oss_8614", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of a gaming console's CPU. You need to implement a function that simulates the CPU's operation for a given number of cycles and keeps track of the total number of cycles consumed. The clock is a 32-bit unsigned integer that wraps arou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_cpu(100) == 100\", \"assert simulate_cpu(4294967295) == 4294967295\", \"assert simulate_cpu(1) == 1\", \"assert simulate_cpu(4294967296) == 0\", \"assert simulate_cpu(200) == 200\", \"assert simulate_cpu(300) == 300\", \"assert simulate_cpu(400) == ...
{ "split": "train", "index": 63323, "acecode_id": "oss_35275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with retrieving all unique DNS domains from a given list. The function `get_unique_dns_domains(domains: List[str]) -> List[str]` should take a list of DNS domain names, which may contain duplicates, and return a new list containing only unique domain names. The o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_dns_domains(['example.com', 'www.example.com', 'test.com', 'example.com', 'TEST.com']) == ['example.com', 'www.example.com', 'test.com']\", \"assert get_unique_dns_domains(['google.com', 'Google.com', 'yahoo.com', 'YAHOO.COM', 'bing.com']) == ['go...
{ "split": "train", "index": 63324, "acecode_id": "bigcode_python_fns_13301", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `is_valid_stack_name(stack_name: str) -> bool` that determines if a given stack name is valid according to specific criteria. A valid stack name must: 1) Be between 1 and 128 characters long. 2) Start with an uppercase letter. 3) Only cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_stack_name('MyStack') == True\", \"assert is_valid_stack_name('1InvalidStack') == False\", \"assert is_valid_stack_name('Valid-Stack-123') == True\", \"assert is_valid_stack_name('Invalid-Stack-') == False\", \"assert is_valid_stack_name('AnotherVal...
{ "split": "train", "index": 63325, "acecode_id": "bigcode_python_fns_42600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_random_string` that generates a random string containing exactly ten characters. The string should be composed of upper-case letters, lower-case letters, digits, and special characters. The function should not take any parameters and must return t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_random_string()) == 10\", \"assert all(c.islower() or c.isupper() or c.isdigit() or c in string.punctuation for c in generate_random_string())\", \"assert any(c.islower() for c in generate_random_string())\", \"assert any(c.isupper() for c in ge...
{ "split": "train", "index": 63326, "acecode_id": "evol_34148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, `A` and `B`, implement a function that checks if `A` can be transformed into `B` by performing a series of left shifts, where a left shift consists of moving the leftmost character of `A` to the rightmost position. If `A` can become `B`, return the minimum nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_string('abcde', 'cdeab') == (True, 2)\", \"assert rotate_string('abcde', 'abced') == (False, -1)\", \"assert rotate_string('abcdef', 'fabcde') == (True, 5)\", \"assert rotate_string('aaa', 'aaa') == (True, 0)\", \"assert rotate_string('a', 'a') == (Tr...
{ "split": "train", "index": 63327, "acecode_id": "evol_7534", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python extension module configuration using the `distutils` package for inter-process communication. Your task is to implement a function `create_ipc_extension_module()` that returns a dictionary containing the setup configuration for the extensio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_ipc_extension_module()['name'] == 'ipcbridge'\", \"assert create_ipc_extension_module()['version'] == '1.0'\", \"assert create_ipc_extension_module()['description'] == 'Python extension for inter-process communication'\", \"assert isinstance(create_ip...
{ "split": "train", "index": 63328, "acecode_id": "oss_35313", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `to_camel_case(phrase: str) -> str` that transforms a provided phrase into camel case. The phrase may include punctuation and numbers, which should be removed in the final output. The first letter of the output should be lowercase, while the first letter of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_camel_case('hello world!') == 'helloWorld'\", \"assert to_camel_case('make it camel case') == 'makeItCamelCase'\", \"assert to_camel_case('123 numbers are here!') == 'numbersAreHere'\", \"assert to_camel_case(' extra spaces ') == 'extraSpaces'\", ...
{ "split": "train", "index": 63329, "acecode_id": "evol_11075", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that takes two distinct hexadecimal strings, each consisting of digits from 0-9 and letters A-F, and performs a bitwise AND operation on these strings. The strings will have a length between 10^3 and 10^5 characters. The function should validate that the st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_and('A3F', 'B2E') == 'A2E'\", \"assert hex_and('FFFFFFFFFF', 'AAAAAAAAAA') == 'AAAAAAAAAA'\", \"assert hex_and('0000000000000001', '0000000000000001') == '0000000000000001'\", \"assert hex_and('A0A0A0A0A0', 'B0B0B0B0B0') == 'A0A0A0A0A0'\", \"assert hex_a...
{ "split": "train", "index": 63330, "acecode_id": "evol_7757", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function to calculate the Nth root of a given number Y, where N and Y are provided as inputs. The Nth root corresponds to the real number solution of the equation xⁿ = Y. Ensure that N is within the range 1<=N<=10 and Y is within the range -100000<=Y<=100000. If the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nth_root(1, 0) == 0.0\", \"assert nth_root(2, 4) == 2.0\", \"assert nth_root(3, 27) == 3.0\", \"assert nth_root(4, 16) == 2.0\", \"assert nth_root(5, 32) == 2.0\", \"assert nth_root(6, 64) == 2.0\", \"assert nth_root(2, 0) == 0.0\", \"assert nth_root(3, -8) ...
{ "split": "train", "index": 63331, "acecode_id": "evol_14872", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total number of employed individuals in a specific manufacturing sector for a given year. Your function should take the following parameters: a year (as an integer), a manufacturing sector code (as a string), and a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert employed(2017, '54', 'CA') == 200\", \"assert employed(2017, '62', 'NY') == 150\", \"assert employed(2017, '31', 'TX') == 100\", \"assert employed(2017, '99', 'FL') == 0\", \"assert employed(2017, '54', 'WA') == 200\", \"assert employed(2017, '62', 'IL') == ...
{ "split": "train", "index": 63332, "acecode_id": "bigcode_python_fns_32718", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sort_and_identify(arr: List[int]) -> Tuple[List[int], int, int]` that takes a list of integers and returns a tuple containing the sorted list, the index of the highest even number, and the index of the lowest odd number. If there are no even numbers, retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_identify([1, 3, 5, 7]) == ([1, 3, 5, 7], -1, 0)\", \"assert sort_and_identify([2, 4, 6, 8]) == ([2, 4, 6, 8], 3, -1)\", \"assert sort_and_identify([10, 15, 20, 25]) == ([10, 15, 20, 25], 2, 1)\", \"assert sort_and_identify([7]) == ([7], -1, 0)\", \"...
{ "split": "train", "index": 63333, "acecode_id": "evol_34420", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a user profile as a dictionary, a connection status represented as a boolean, and a message string. Your task is to create a function 'create_context' that takes three parameters: 'profile' (a dictionary containing user information), 'connection_ready' (a boolean ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_context({'name': 'Alice'}, True, 'Hello') == {'profile': {'name': 'Alice'}, 'connection_record': 'Connected', 'message': 'Hello'}\", \"assert create_context({'name': 'Bob'}, False, 'Goodbye') == {'profile': {'name': 'Bob'}, 'connection_record': 'Disco...
{ "split": "train", "index": 63334, "acecode_id": "bigcode_python_fns_16442", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a resource resolver's `put` operation. The function should take two parameters: `data`, which can be either a string or a file-like object, and `is_read_only`, a boolean indicating whether the resource is in read-only m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert put('sample data', False) == 'Data written successfully'\", \"assert put('another sample', False) == 'Data written successfully'\", \"assert put('', False) == 'Data written successfully'\", \"assert put(' ', False) == 'Data written successfully'\", \"assert ...
{ "split": "train", "index": 63335, "acecode_id": "oss_29908", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs a specific operation on a given list of integers. The function should take a list of integers as input and return the sum of all the elements in the list. If an index error occurs during the operation (for example, if th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operation([1, 2, 3, 4, 5]) == 15\", \"assert perform_operation([10, 20, 30]) == 60\", \"assert perform_operation([-1, -2, -3]) == -6\", \"assert perform_operation([]) == 0\", \"assert perform_operation([0, 0, 0]) == 0\", \"assert perform_operation([1...
{ "split": "train", "index": 63336, "acecode_id": "oss_23752", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the average income of a guardian based on their monthly incomes. Write a function called `calculate_average_income(income: List[float]) -> float` that takes in a list of monthly incomes for a guardian and returns the average income. If the list i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_income([3000, 3500, 3200, 4000]) == 3425.0\", \"assert calculate_average_income([1500, 2000, 2500]) == 2000.0\", \"assert calculate_average_income([1000]) == 1000.0\", \"assert calculate_average_income([]) == 0.0\", \"assert calculate_avera...
{ "split": "train", "index": 63337, "acecode_id": "oss_24866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and your task is to separate the list into two parts: non-negative integers (greater than or equal to zero) and negative integers. For each part, you need to compute the following metrics: mean and standard deviation. The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_metrics([0, 0, 0]) == {'non_negative': {'mean': 0.0, 'stddev': 0.0}, 'negative': {'mean': 'N/A', 'stddev': 'N/A'}}\", \"assert compute_metrics([1, 2, 3, 4, 5]) == {'non_negative': {'mean': 3.0, 'stddev': 1.4142135623730951}, 'negative': {'mean': 'N/A...
{ "split": "train", "index": 63338, "acecode_id": "bigcode_python_fns_49167", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a 2D list `accounts` where `accounts[i][j]` represents the amount of money that the `i`th client has in the `j`th bank. Write a function `maximumWealth(accounts)` that determines the maximum wealth among all clients. The wealth of a client is defined as the sum of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maximumWealth([[1,2,3],[3,2,1]]) == 6\", \"assert maximumWealth([[1,5],[7,3],[3,5]]) == 10\", \"assert maximumWealth([[2,8,7],[7,1,3],[1,9,5]]) == 17\", \"assert maximumWealth([[1],[2],[3],[4],[5]]) == 5\", \"assert maximumWealth([[0,0,0],[0,0,0],[0,0,0]]) =...
{ "split": "train", "index": 63339, "acecode_id": "evol_34499", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that computes statistics for a list of frequencies in Hertz. Your function, `frequency_statistics`, should take a list of frequencies as input and return a dictionary containing the total frequency, average frequency, and the highest ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert frequency_statistics([100, 200, 300, 400]) == {'total_frequency': 1000, 'average_frequency': 250.0, 'highest_frequency': 400}\", \"assert frequency_statistics([1.5, 2.5, 3.5]) == {'total_frequency': 7.5, 'average_frequency': 2.5, 'highest_frequency': 3.5}\",...
{ "split": "train", "index": 63340, "acecode_id": "oss_22955", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing transaction amounts. Your task is to implement a function `process_transactions(transactions: List[int]) -> str` that returns a string indicating if the transactions are valid or invalid. A transaction is considered valid if it is a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_transactions([100, 200, 300]) == 'All transactions are valid'\", \"assert process_transactions([100, 200, -50]) == 'Invalid transaction'\", \"assert process_transactions([-1, 100, 200]) == 'Invalid transaction'\", \"assert process_transactions([0, 50...
{ "split": "train", "index": 63341, "acecode_id": "bigcode_python_fns_24798", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that maps property type identifiers to their corresponding GraphQL scalar types. Given a dictionary that defines the mapping between the property type IDs and their GraphQL scalar types, as well as a property name and a property type ID, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_graphql_scalar_type('age', 1) == 'Int'\", \"assert get_graphql_scalar_type('name', 2) == 'String'\", \"assert get_graphql_scalar_type('isActive', 3) == 'Boolean'\", \"assert get_graphql_scalar_type('height', 4) == 'Float'\", \"assert get_graphql_scalar_t...
{ "split": "train", "index": 63342, "acecode_id": "bigcode_python_fns_24286", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are asked to implement a function that processes a list of submissions and categorizes them based on a given threshold. Each submission is represented as a tuple containing the submission content (a string) and its score (an integer). Your task is to create a function `cate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_submissions([], 5) == []\", \"assert categorize_submissions([('Submission 1', 10)], 5) == ['Accepted']\", \"assert categorize_submissions([('Submission 2', 3)], 5) == ['Rejected']\", \"assert categorize_submissions([('Submission 3', 5)], 5) == ['A...
{ "split": "train", "index": 63343, "acecode_id": "bigcode_python_fns_22403", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python class that represents a book. Each book has a title, an author, and a list of genres it belongs to. Your goal is to implement a method that checks if the book belongs to a specific genre. The method should return True if the genre is found ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Book('The Great Gatsby', 'F. Scott Fitzgerald', ['Classic', 'Fiction']).is_genre('Classic') == True\", \"assert Book('The Great Gatsby', 'F. Scott Fitzgerald', ['Classic', 'Fiction']).is_genre('Drama') == False\", \"assert Book('1984', 'George Orwell', ['Dys...
{ "split": "train", "index": 63344, "acecode_id": "oss_6158", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers and returns a new list containing only the even numbers from the original list. The order of the even numbers in the new list should be the same as their order in the original list. Implement a functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 21, 32, 43, 54]) == [10, 32, 54]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([0, -2, -4, 1, 3]) == [0, -2, -4]\", \"assert filter_even...
{ "split": "train", "index": 63345, "acecode_id": "oss_13892", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers, `time` and `period`, write a function `calculate_phase(time: int, period: int) -> float` that calculates the orbital phase of an object orbiting a star. The orbital phase is defined as the remainder of the division of `time` by `period`, divided by `period`....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_phase(10, 4) == 0.5\", \"assert calculate_phase(0, 5) == 0.0\", \"assert calculate_phase(15, 10) == 0.5\", \"assert calculate_phase(7, 0) == -1.0\", \"assert calculate_phase(20, 3) == 0.6666666666666666\", \"assert calculate_phase(9, 2) == 0.5\", \...
{ "split": "train", "index": 63346, "acecode_id": "bigcode_python_fns_24182", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function called `find_first_prime` that iterates through the list and returns the first prime number it encounters. If there are no prime numbers in the list, the function should return -1. A prime number is defined as a number greater than...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_prime([4, 6, 8, 18, 23, 14, 55, 76, 79, 81]) == 23\", \"assert find_first_prime([4, 6, 8, 18]) == -1\", \"assert find_first_prime([1, 2, 3, 4, 5]) == 2\", \"assert find_first_prime([20, 21, 22, 23]) == 23\", \"assert find_first_prime([9, 15, 21, 2...
{ "split": "train", "index": 63347, "acecode_id": "evol_35869", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes incoming data packets and extracts relevant information from them. The program should handle two types of data packets: one containing information about a visual effect and another containing an error message. \n\nTh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data_packet('RX 192.168.1.100:8080 Firework elapsed: 0123 beat: 0456 hue_med: 120 hue_dev: 030') == 'RX 192.168.1.100:8080 Firework elapsed: 0123 beat: 0456 hue_med: 120 hue_dev: 030'\", \"assert process_data_packet('RX 10.0.0...
{ "split": "train", "index": 63348, "acecode_id": "oss_20580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 's', implement a function that checks if the string is a palindrome. A palindrome is defined as a sequence that reads the same backward as forward, ignoring spaces, punctuation, and capitalization. Your function should return True if 's' is a palindrome and False...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('Hello, W...
{ "split": "train", "index": 63349, "acecode_id": "oss_12385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `aggregate_sum_even(n)` that takes an integer `n` as input and returns the sum of all even integers from 1 to `n` (inclusive).\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 aggregate_sum_even(10) == 30\", \"assert aggregate_sum_even(1) == 0\", \"assert aggregate_sum_even(2) == 2\", \"assert aggregate_sum_even(3) == 2\", \"assert aggregate_sum_even(4) == 6\", \"assert aggregate_sum_even(5) == 6\", \"assert aggregate_sum_even(6) ...
{ "split": "train", "index": 63350, "acecode_id": "evol_10271", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers `a` and `b`, and a string `operation` that can be one of 'plus', 'minus', 'times', or 'divide', implement a function that performs the operation on `a` and `b`. If the operation is 'plus', return the sum of `a` and `b`. If the operation is 'minus', return the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert operate(5, 3, 'plus') == 8\", \"assert operate(5, 3, 'minus') == 2\", \"assert operate(5, 3, 'times') == 15\", \"assert operate(5, 3, 'divide') == 1\", \"assert operate(5, 0, 'divide') == None\", \"assert operate(0, 3, 'plus') == 3\", \"assert operate(0, 3, ...
{ "split": "train", "index": 63351, "acecode_id": "bigcode_python_fns_621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, `a` and `b`, you need to determine if any cyclical permutation of string `b` exists as a consecutive subsequence within string `a`. The comparison should be case-insensitive and should ignore any non-alphanumeric characters. Implement a function `cycled_patte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cycled_pattern_search('Hello', 'ELl') == True\", \"assert cycled_pattern_search('Whas$sup', 'pSUs') == False\", \"assert cycled_pattern_search('aB!ab', 'BAa') == True\", \"assert cycled_pattern_search('EfEF', 'EeFf') == False\", \"assert cycled_pattern_searc...
{ "split": "train", "index": 63352, "acecode_id": "evol_27396", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a Dweet URL that controls an LED remotely. The URL follows the format: `dweetURL/dweet/for/dweetID?state=LED_STATE`, where `dweetURL` is the base URL of the Dweet platform, `dweetID` is a unique identifier for the device, and `LED_STATE` is the state of the LED co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_dweet_url('https://dweet.io/dweet/for/device123?state=ON') == 'ON'\", \"assert parse_dweet_url('https://dweet.io/dweet/for/device456?state=BLINK') == 'BLINK'\", \"assert parse_dweet_url('https://dweet.io/dweet/for/device789?state=OFF') == 'OFF'\", \"as...
{ "split": "train", "index": 63353, "acecode_id": "oss_12076", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_pascals_triangle(n: int) -> List[List[int]]` that generates the first n rows of Pascal's Triangle. Each row should be represented as a list of integers. Pascal's Triangle is defined such that each element at row 'r' and column 'c' is the sum of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_pascals_triangle(0) == []\", \"assert generate_pascals_triangle(1) == [[1]]\", \"assert generate_pascals_triangle(2) == [[1], [1, 1]]\", \"assert generate_pascals_triangle(3) == [[1], [1, 1], [1, 2, 1]]\", \"assert generate_pascals_triangle(4) == [[...
{ "split": "train", "index": 63354, "acecode_id": "evol_13785", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes an integer as input and returns the same integer. However, if the input is negative, the function should raise a ValueError with the message 'Input must be a non-negative integer'. Implement a function named `return_non_neg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert return_non_negative_integer(0) == 0\", \"assert return_non_negative_integer(1) == 1\", \"assert return_non_negative_integer(5) == 5\", \"assert return_non_negative_integer(10) == 10\", \"assert return_non_negative_integer(100) == 100\", \"assert return_non_n...
{ "split": "train", "index": 63355, "acecode_id": "bigcode_python_fns_45275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with checking if a given configuration for a database connection is valid. Implement a function `is_mysql_connection(config: dict, key: str) -> bool` that checks if the connection string for a MySQL database is present in the given configuration dictionary. The c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_mysql_connection({'db': 'mysql://localhost:3306'}, 'db') == True\", \"assert is_mysql_connection({'db': 'postgres://localhost:5432'}, 'db') == False\", \"assert is_mysql_connection({'db': 'mysql://user:pass@localhost:3306'}, 'db') == True\", \"assert is_m...
{ "split": "train", "index": 63356, "acecode_id": "bigcode_python_fns_42391", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of names and a dictionary that maps video IDs to their corresponding screen times in seconds, write a function that computes the total screen time for each name in minutes. The function should return a dictionary where each key is a name from the input list and the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_total_screen_time([], {'video1': 60}) == {}\", \"assert compute_total_screen_time(['Alice', 'Bob'], {'video1': 0, 'video2': 0}) == {'Alice': 0, 'Bob': 0}\", \"assert compute_total_screen_time(['Alice'], {'video1': 3660}) == {'Alice': 61}\", \"assert ...
{ "split": "train", "index": 63357, "acecode_id": "bigcode_python_fns_36181", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function `find_primes_up_to(n)` that takes an integer `n` as input and returns a list of all prime numbers less than or equal to `n`. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes_up_to(0) == []\", \"assert find_primes_up_to(1) == []\", \"assert find_primes_up_to(2) == [2]\", \"assert find_primes_up_to(3) == [2, 3]\", \"assert find_primes_up_to(4) == [2, 3]\", \"assert find_primes_up_to(5) == [2, 3, 5]\", \"assert find_pri...
{ "split": "train", "index": 63358, "acecode_id": "evol_31636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of user accounts from a system. Given a list of usernames, your function should return a list of usernames that were successfully deleted. For the purpose of this simulation, consider that all usernames in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_user_accounts(['alice', 'bob', 'charlie']) == ['alice', 'bob', 'charlie']\", \"assert delete_user_accounts(['user1']) == ['user1']\", \"assert delete_user_accounts(['admin', 'guest']) == ['admin', 'guest']\", \"assert delete_user_accounts([]) == []\",...
{ "split": "train", "index": 63359, "acecode_id": "bigcode_python_fns_45499", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of unique integers and three distinct target integers, write a function that checks if all three target integers are present in the array and form a consecutive sequence in either ascending or descending order. The function should return true if such a sequence e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_sequence([1, 2, 3, 4], 2, 3, 4) == True\", \"assert check_sequence([5, 1, 2, 3, 4], 1, 2, 3) == True\", \"assert check_sequence([1, 5, 3, 4, 2], 5, 4, 3) == True\", \"assert check_sequence([1, 2, 3, 5], 2, 4, 3) == False\", \"assert check_sequence([7, ...
{ "split": "train", "index": 63360, "acecode_id": "evol_20985", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given the length of a side of an equilateral triangle. Write a Python function `triangle_height(side)` that calculates the height of the triangle. The function should handle the following conditions: If the side length is less than or equal to 0, return 0. If the side l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triangle_height(10) == 8.66\", \"assert triangle_height(5) == 4.33\", \"assert triangle_height(0) == 0\", \"assert triangle_height(-1) == 0\", \"assert triangle_height(15) == 12.99\", \"assert triangle_height(2.5) == 2.17\", \"assert triangle_height(1) == 0....
{ "split": "train", "index": 63361, "acecode_id": "evol_13818", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that filters a list of items based on a specified title attribute. The function should take in a list of dictionaries, where each dictionary represents an item with various attributes, including a 'custom_title'. Your goal is to implement...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_items_by_title([{'custom_title': 'A'}, {'custom_title': 'B'}, {'custom_title': 'A'}], 'A') == [{'custom_title': 'A'}, {'custom_title': 'A'}]\", \"assert filter_items_by_title([{'custom_title': 'A'}, {'custom_title': 'B'}, {'custom_title': 'C'}], 'D') ...
{ "split": "train", "index": 63362, "acecode_id": "oss_11853", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing configuration settings for a Wi-Fi monitoring application. The application uses key-value pairs to represent settings, where each key is a string and each value is an integer. Write a function `manage_wifi_config` that takes a list of initial settin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_wifi_config([('threshold', 80), ('interval', 5)], [('threshold', 90)]) == {'threshold': 90, 'interval': 5}\", \"assert manage_wifi_config([('threshold', 80)], [('threshold', 90), ('interval', 10)]) == {'threshold': 90, 'interval': 10}\", \"assert mana...
{ "split": "train", "index": 63363, "acecode_id": "oss_10928", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a caching mechanism for a function that computes the nth Fibonacci number. Your goal is to create a cache decorator that can be applied to the Fibonacci function to cache its results. Your cache decorator should have the following features: 1. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2...
{ "split": "train", "index": 63364, "acecode_id": "oss_20789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings representing keys and returns a formatted string where each key is displayed on a new line prefixed by a bullet point. The function should be named `format_keys`. The input will be a list of keys (strings), an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_keys(['key1', 'key2', 'key3']) == '\\u2022 key1\\\\n\\u2022 key2\\\\n\\u2022 key3'\", \"assert format_keys(['keyA', 'keyB']) == '\\u2022 keyA\\\\n\\u2022 keyB'\", \"assert format_keys(['singleKey']) == '\\u2022 singleKey'\", \"assert format_keys([]) =...
{ "split": "train", "index": 63365, "acecode_id": "bigcode_python_fns_16117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that combines multiple transformations to a single input value. Write a function `combine_transformations(value: int, transform_funcs: List[Callable[[int], int]]) -> int` that takes an integer `value` and a list of transformation function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_transformations(5, [lambda x: x + 1]) == 6\", \"assert combine_transformations(5, [lambda x: x * 2]) == 10\", \"assert combine_transformations(5, [lambda x: x - 3]) == 2\", \"assert combine_transformations(5, [lambda x: x * 2, lambda x: x + 3]) == 13...
{ "split": "train", "index": 63366, "acecode_id": "bigcode_python_fns_22380", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of random points in a 2D space. The function should take an integer `n_randoms`, which represents the number of random points to generate, and a tuple `region_resolution` that defines the boundaries of the space as (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_random_points(0, (10.0, 10.0))) == 0\", \"assert len(generate_random_points(10, (1.0, 1.0))) == 10\", \"assert all(0 <= x < 1.0 and 0 <= y < 1.0 for x, y in generate_random_points(100, (1.0, 1.0)))\", \"assert all(0 <= x < 10.0 and 0 <= y < 10.0...
{ "split": "train", "index": 63367, "acecode_id": "bigcode_python_fns_42201", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_train_val_indexes(json_data: List[Dict[str, Union[float, int]]]) -> Tuple[List[int], List[int]]` that takes a list of dictionaries representing JSON data, where each dictionary has an 'isValidation' key. The function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_train_val_indexes([{'isValidation': 0}, {'isValidation': 0}, {'isValidation': 1}]) == ([0, 1], [2])\", \"assert get_train_val_indexes([{'isValidation': 1}, {'isValidation': 1}, {'isValidation': 1}]) == ([], [0, 1, 2])\", \"assert get_train_val_indexes([{...
{ "split": "train", "index": 63368, "acecode_id": "bigcode_python_fns_44854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a mathematical update expression, determine if the expression contains any incompatible operand types based on predefined mappings. The expression will use the '+' operator and will reference two operand types. Your task is to implement a function th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_operand_compatibility('SET ri = :val + :val2', {':val': 'S', ':val2': 'N'}) == ('S', '+')\", \"assert check_operand_compatibility('SET ri = :val + :val2', {':val': 'N', ':val2': 'N'}) == None\", \"assert check_operand_compatibility('SET ri = :val + :va...
{ "split": "train", "index": 63369, "acecode_id": "bigcode_python_fns_25705", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of tuples, where each tuple contains the name of a company and its corresponding URL. Your function should return a dictionary where the keys are the company names and the values are their respective URLs. If a company n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_company_dict([('Company A', 'http://company-a.com'), ('Company B', 'http://company-b.com'), ('Company A', 'http://company-a-new.com')]) == {'Company A': 'http://company-a-new.com', 'Company B': 'http://company-b.com'}\", \"assert generate_company_di...
{ "split": "train", "index": 63370, "acecode_id": "bigcode_python_fns_19904", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Compute the weighted mean of a given dataset and a corresponding set of weights. You are provided with two lists: one containing the data points and the other containing the weights for each data point. Write a function that takes these two lists as input and returns the weight...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mean([1, 2, 3], [0.5, 0.5, 0.0]) == 1.5\", \"assert mean([0, 0, 0], [1, 1, 1]) == 0.0\", \"assert mean([4], [1]) == 4.0\", \"assert mean([5, 5, 5], [0.1, 0.2, 0.7]) == 5.0\", \"assert mean([1, 2, 3, 4], [0.1, 0.1, 0.1, 0.7]) == 3.4\", \"assert mean([10, 10, ...
{ "split": "train", "index": 63371, "acecode_id": "evol_5817", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a list of equilibrium points, where each equilibrium point corresponds to a specific integer in the list. Your task is to create a function that adjusts each integer in the list by subtracting its corresponding equilibrium point. Write a fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_data([10, 20, 30], [1.0, 2.0, 3.0]) == [9.0, 18.0, 27.0]\", \"assert adjust_data([5, 15, 25], [0.5, 1.5, 2.5]) == [4.5, 13.5, 22.5]\", \"assert adjust_data([100, 200, 300], [10.0, 20.0, 30.0]) == [90.0, 180.0, 270.0]\", \"assert adjust_data([0], [0.0]...
{ "split": "train", "index": 63372, "acecode_id": "bigcode_python_fns_47218", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function to determine the minimum daily wage required to employ an individual for a specified duration, given an array of daily salary demands. The function should return the lowest salary demand from the array, as the individual must be employed for at least one day. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert least_daily_expense([200, 300, 150, 400, 250, 350]) == 150\", \"assert least_daily_expense([100, 200, 300]) == 100\", \"assert least_daily_expense([500, 400, 300, 200, 100]) == 100\", \"assert least_daily_expense([1, 2, 3, 4, 5]) == 1\", \"assert least_daily...
{ "split": "train", "index": 63373, "acecode_id": "evol_3386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a version control system for a software bundle management tool. The function, `copy_version`, takes two parameters: a `version` string and a `mode` string. The `mode` can either be 'keep' or 'new'. If the `mode` is 'kee...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy_version('1.0.0', 'keep') == '1.0.0'\", \"assert copy_version('1.0.0', 'new') == '1.0.1'\", \"assert copy_version('2.5.3', 'keep') == '2.5.3'\", \"assert copy_version('2.5.3', 'new') == '2.5.4'\", \"assert copy_version('10.0.0', 'keep') == '10.0.0'\", \"...
{ "split": "train", "index": 63374, "acecode_id": "oss_25977", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `caesar_cipher` that takes a string `message` and an integer `shift` as input. The function should return the encrypted version of the string using the Caesar cipher technique, where each letter in the message is shifted by the specified integer value. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert caesar_cipher('Hello, World!', 3) == 'Khoor, Zruog!'\", \"assert caesar_cipher('abc', 1) == 'bcd'\", \"assert caesar_cipher('xyz', 3) == 'abc'\", \"assert caesar_cipher('ABC', 2) == 'CDE'\", \"assert caesar_cipher('XYZ', 4) == 'BCD'\", \"assert caesar_cipher...
{ "split": "train", "index": 63375, "acecode_id": "evol_8465", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function that extracts and returns details of a student from a given XML string based on a specified attribute and its value. The function should be able to handle nested tags within the 'student' tag and return a hierarchical representation of the data. If no student m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_student('<student name=\\\"Jane\\\" roll_no=\\\"456\\\" course=\\\"Mathematics\\\" grade=\\\"A\\\"><address city=\\\"New York\\\" state=\\\"NY\\\" zip=\\\"10027\\\"/><parent name=\\\"John Doe\\\" contact=\\\"1234567890\\\"/></student>', 'name', 'Jane'...
{ "split": "train", "index": 63376, "acecode_id": "evol_26235", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of a series of buildings, write a function `max_visible_buildings(heights: List[int]) -> int` that returns the maximum number of buildings that can be seen from the left side. A building can be seen if it is taller than all the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_visible_buildings([3, 1, 4, 2, 5]) == 3\", \"assert max_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert max_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_buildings([1, 1, 1, 1, 1]) == 1\", \"assert max_visible_buildings([]) == 0\", ...
{ "split": "train", "index": 63377, "acecode_id": "bigcode_python_fns_38474", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the jumping behavior of a dinosaur character in a simple 2D platformer game. The dinosaur starts at a specified vertical position (y-coordinate) and has a jumping velocity. When the jump is initiated, the dinosaur moves...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_jump(0, 10, 0, 4) == 10\", \"assert simulate_jump(0, 10, 0, 6) == 0\", \"assert simulate_jump(5, 10, 5, 4) == 15\", \"assert simulate_jump(5, 10, 5, 6) == 5\", \"assert simulate_jump(10, 10, 10, 4) == 20\", \"assert simulate_jump(10, 10, 10, 6) == 1...
{ "split": "train", "index": 63378, "acecode_id": "oss_21261", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with designing a text processing application that manages word stems and their associated words. Implement a function `getMostFrequentStem(stems: List[str], words: List[str]) -> Tuple[str, List[str]]` which takes two lists: `stems`, a list of word stems, and `wor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getMostFrequentStem(['run', 'jump', 'run'], ['running', 'jumping', 'runs']) == ('run', ['running', 'runs'])\", \"assert getMostFrequentStem(['walk', 'run', 'jump', 'walk'], ['walking', 'running', 'jumping', 'walks']) == ('walk', ['walking', 'walks'])\", \"as...
{ "split": "train", "index": 63379, "acecode_id": "oss_16951", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a code snippet that includes import statements and function definitions. Write a Python function called `parse_code_snippet` that takes this code snippet as input and returns a dictionary with two keys: 'imported_modules' and 'defined_functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_code_snippet('from module import submodule\\\\ndef test_func(): pass') == {'imported_modules': ['module'], 'defined_functions': ['test_func']}\", \"assert parse_code_snippet('import module1\\\\nimport module2\\\\ndef func1(): pass\\\\ndef func2(): pass...
{ "split": "train", "index": 63380, "acecode_id": "oss_21405", "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 containing only the unique integers from the input list, preserving the order of their first occurrence. The function should take a list of integers as an input parameter and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1, 2, 3]) == [1, 2, 3]\", \"assert remove_duplicates([1, 1, 2]) == [1, 2]\", \"assert remove_duplicates([3, 3, 3]) == [3]\", \"assert remove_duplicates([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert re...
{ "split": "train", "index": 63381, "acecode_id": "oss_11222", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of program execution hours represented in a specific format. Each entry in the list contains the following details: program reference, allocated time, elapsed time, not charged time, partner time, and program time, all in string format. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_program_hours(['prog1,10,5,0,2,8', 'prog2,20,15,0,5,15']) == [{'prog_ref': 'prog1', 'alloc_time': 10, 'elaps_time': 5, 'notcharged_time': 0, 'partner_time': 2, 'prog_time': 8}, {'prog_ref': 'prog2', 'alloc_time': 20, 'elaps_time': 15, 'notcharged_tim...
{ "split": "train", "index": 63382, "acecode_id": "bigcode_python_fns_44974", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that encodes and decodes a given string using the ROT13 substitution cipher. The function should handle uppercase and lowercase letters while leaving non-alphabetical characters unchanged. The input string can contain any printable characters. Write a singl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rot13_coder_decoder('Hello world') == 'Uryyb jbeyq'\", \"assert rot13_coder_decoder('Uryyb jbeyq') == 'Hello world'\", \"assert rot13_coder_decoder('Python 3.9!') == 'Clguba 3.9!'\", \"assert rot13_coder_decoder('Clguba 3.9!') == 'Python 3.9!'\", \"assert ro...
{ "split": "train", "index": 63383, "acecode_id": "evol_19478", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates polling the status of agents in a continuous integration system. The function should take a string parameter `tree`, which can be either 'offline' or 'temporarilyOffline'. Based on the value of `tree`, the function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert poll_status('offline') == {'offline': False}\", \"assert poll_status('offline') == {'offline': True}\", \"assert poll_status('temporarilyOffline') == {'temporarilyOffline': True}\", \"assert poll_status('temporarilyOffline') == {'temporarilyOffline': False}\...
{ "split": "train", "index": 63384, "acecode_id": "oss_3244", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves layout configurations from a given list of layouts based on a specific category name. The function should take a list of layout dictionaries and a category string as inputs. Each layout dictionary contains 'name' (string), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_layout_names_by_category([{'name': 'Layout1', 'category': 'A', 'properties': {}}, {'name': 'Layout2', 'category': 'B', 'properties': {}}], 'A') == ['Layout1']\", \"assert get_layout_names_by_category([{'name': 'Layout1', 'category': 'A', 'properties': {}...
{ "split": "train", "index": 63385, "acecode_id": "bigcode_python_fns_36832", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer N, implement a function `count_integer_points(N)` that calculates the quantity of points with integer coordinates situated on a circle defined by the equation (x - N/2)^2 + (y - N/2)^2 = (N/2)^2. Your function should return the number of integer coordin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_integer_points(1) == 0\", \"assert count_integer_points(2) == 4\", \"assert count_integer_points(3) == 0\", \"assert count_integer_points(4) == 4\", \"assert count_integer_points(5) == 0\", \"assert count_integer_points(7) == 0\", \"assert count_intege...
{ "split": "train", "index": 63386, "acecode_id": "evol_33217", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple joke database. The function should accept a list of jokes, each joke being a dictionary containing a 'category' key (a string) and a 'joke' key (a string). Your goal is to return a dictionary that contains the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert joke_database([{'category': 'Pun', 'joke': 'A pun walks into a bar, ten people die.'}, {'category': 'Pun', 'joke': 'I used to be a baker, but I couldn\\\\'t make enough dough.'}]) == {'total_jokes': 2, 'jokes_by_category': {'pun': ['A pun walks into a bar, t...
{ "split": "train", "index": 63387, "acecode_id": "oss_8372", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a string representing the name of an artist or a band. Your task is to write a function that corrects the name based on a predefined mapping of common misspellings and variations. Implement the function `correct_artist_name(keyphrase: str) -> str`, where `keyphras...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_artist_name('The Beatles') == 'The Beatles'\", \"assert correct_artist_name('Beyonce') == 'Beyonc\\u00e9'\", \"assert correct_artist_name('Adele') == 'Adele'\", \"assert correct_artist_name('Coldplay') == 'Coldplay'\", \"assert correct_artist_name('D...
{ "split": "train", "index": 63388, "acecode_id": "bigcode_python_fns_49543", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to analyze student grades and provide corresponding remarks based on their average score. The program should take the average score as input and output the appropriate remark based on the following criteria: If the average score is less th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert grade_remarks(4.0) == 'REPROVADO com a m\\u00e9dia 4.0'\", \"assert grade_remarks(4.5) == 'REPROVADO com a m\\u00e9dia 4.5'\", \"assert grade_remarks(5.0) == 'EM RECUPERA\\u00c7\\u00c3O com a m\\u00e9dia 5.0'\", \"assert grade_remarks(6.0) == 'EM RECUPERA\\u...
{ "split": "train", "index": 63389, "acecode_id": "oss_19847", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a string and a character, and returns the number of times that character appears in the string. The function should ignore case sensitivity. Implement the function `count_character_occurrences(s: str, char: str) -> int`, whe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_character_occurrences('Hello World', 'o') == 2\", \"assert count_character_occurrences('Python Programming', 'p') == 2\", \"assert count_character_occurrences('OpenAI GPT', 'a') == 1\", \"assert count_character_occurrences('Test Case', 't') == 2\", \"a...
{ "split": "train", "index": 63390, "acecode_id": "bigcode_python_fns_45576", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that determines whether a given integer is a prime number. A prime number is defined as an integer greater than 1 that has no positive divisors other than 1 and itself. The function should take a single integer input and return True if the number is prime, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(1) == False\", \"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\", \"asser...
{ "split": "train", "index": 63391, "acecode_id": "evol_20902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of positive integers, denoted as `nums`, and another positive integer, referred to as `target`. Your task is to determine the smallest length of a contiguous subarray whose sum is greater than or equal to `target`. If no such subarray exists, your functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minSubArrayLen(7, [2,3,1,2,4,3]) == 2\", \"assert minSubArrayLen(4, [1,4,4]) == 1\", \"assert minSubArrayLen(11, [1,1,1,1,1,1,1,1]) == 0\", \"assert minSubArrayLen(15, [5,1,3,5,10,7,4,9,2,8]) == 2\", \"assert minSubArrayLen(9, [1,2,3,4,5]) == 2\", \"assert m...
{ "split": "train", "index": 63392, "acecode_id": "evol_4215", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that filters a list of internal server names. The function should accept a single list of server names and return a new list containing only the server names that start with the letter 'P' and have a length greater than 5 characters. Write...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_internal_servers(['ProxyServer', 'DatabaseServer', 'WebServer', 'ApplicationServer', 'MailServer']) == ['ProxyServer']\", \"assert filter_internal_servers(['ProdServer', 'TestServer', 'PyramidServer']) == ['ProdServer', 'PyramidServer']\", \"assert fi...
{ "split": "train", "index": 63393, "acecode_id": "oss_22572", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the covariance values of a signal, implement a function called `signal_average` that calculates the average of these values after applying a modulation factor based on their indices. The modulation factor is defined as the square of the ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert signal_average([1, 2, 3], False) == 2.0\", \"assert signal_average([0, 0, 0], True) == 0.0\", \"assert signal_average([5, 10, 15], False) == 10.0\", \"assert signal_average([], True) == 0.0\", \"assert signal_average([1], False) == 1.0\", \"assert signal_ave...
{ "split": "train", "index": 63394, "acecode_id": "bigcode_python_fns_7963", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a list of integers and returns a new list containing only the unique integers from the original list, preserving the order of their first appearance. Implement a function called `get_unique_integers(nums: List[int]) -> List[int]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_integers([1, 1, 1, 1]) == [1]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_integers([5, 5, 4, 4, 3, 3, 2, 2, 1, 1]) == [5, 4, 3, 2, 1]\", \"assert get_unique_inte...
{ "split": "train", "index": 63395, "acecode_id": "oss_27251", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary `bundle_data` that contains information about a software bundle. Each key in the dictionary represents a feature and its corresponding value represents the version of that feature. Your task is to implement a function `get_latest_version(bundle_data: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_latest_version({'feature1': '1.0.0', 'feature2': '2.1.2'}) == '2.1.2'\", \"assert get_latest_version({'featureA': '0.1.1', 'featureB': '0.1.0'}) == '0.1.1'\", \"assert get_latest_version({'libX': '3.2.1', 'libY': '3.2.0', 'libZ': '3.2.2'}) == '3.2.2'\", ...
{ "split": "train", "index": 63396, "acecode_id": "bigcode_python_fns_27875", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `move(row: int, col: int, player: int, size: int, rows: List[int], cols: List[int], diagonal: int, antiDiagonal: int) -> int` that simulates a move in a Tic Tac Toe game. The function should update the rows, columns, and diagonals based on the player's move...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move(0, 0, 1, 3, [0, 0, 0], [0, 0, 0], 0, 0) == 0\", \"assert move(0, 1, 1, 3, [1, 0, 0], [0, 0, 0], 0, 0) == 0\", \"assert move(1, 1, 2, 3, [1, 0, 0], [1, 0, 0], 0, 0) == 0\", \"assert move(1, 0, 1, 3, [1, 0, 0], [0, 0, 0], 0, 0) == 0\", \"assert move(1, 2,...
{ "split": "train", "index": 63397, "acecode_id": "evol_16225", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design a function to find the sum of all unique integers in the given array and multiply it by the factorial of the count of unique integers. Return None if the array is empty.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sum_mult_factorial([]) == None\", \"assert unique_sum_mult_factorial([1, 1, 1, 1, 1]) == 1\", \"assert unique_sum_mult_factorial([10, -10, 1, -1]) == 0\", \"assert unique_sum_mult_factorial([100]) == 100\", \"assert unique_sum_mult_factorial([0, 0, 0]...
{ "split": "train", "index": 63398, "acecode_id": "evol_33628", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a character sequence where words are separated by hyphens, implement a function that dismantles the sequence and returns a dictionary containing the frequencies of each unique word. The function should consider case sensitivity and handle potential edge cases such as mult...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_frequency('This-is-an-example-is-this-example-An') == {'This': 1, 'is': 2, 'an': 1, 'example': 2, 'this': 1, 'An': 1}\", \"assert calculate_frequency('word1-word2-word1-word3') == {'word1': 2, 'word2': 1, 'word3': 1}\", \"assert calculate_frequency...
{ "split": "train", "index": 63399, "acecode_id": "evol_3644", "num_tests": 16 }