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": "Write a function that takes two strings as input and returns a tuple containing the shorter string first and the longer string second. If both strings have the same length, return them in the order they were provided.\nPlease reason step by step, then write a self-contained Pyt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_strings('hello', 'world') == ('hello', 'world')\", \"assert swap_strings('abc', 'defg') == ('abc', 'defg')\", \"assert swap_strings('short', 'longerstring') == ('short', 'longerstring')\", \"assert swap_strings('same', 'same') == ('same', 'same')\", \"a...
{ "split": "train", "index": 83000, "acecode_id": "evol_21573", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D matrix of integers with no duplicate rows, write a function that identifies the first row that is not sorted in ascending order. The function should return the index of this row, the index of the next row that can be swapped to obtain a sorted matrix, and the total n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert arrange_matrix([[3,2,1],[1,2,3],[2,1,3]]) == {'row_index': 0, 'rearrange_with': 1, 'total_rearrangements': 1}\", \"assert arrange_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == {'row_index': -1, 'rearrange_with': -1, 'total_rearrangements': 0}\", \"assert arra...
{ "split": "train", "index": 83001, "acecode_id": "evol_1684", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a 2D array of numerical values, write a function that computes the greatest overall interval between the maximum element and the minimum element present across all subarrays. Additionally, return the position of the maximum element and the minimum element as a tuple conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert array_interval([[10, 7, 15], [12, 2, 3], [14, 11, 9]]) == (13, [0, 2], [1, 1])\", \"assert array_interval([[1, 2], [3, 4]]) == (3, [1, 1], [0, 0])\", \"assert array_interval([[5]]) == (0, [0, 0], [0, 0])\", \"assert array_interval([[0, -1], [-2, -3]]) == (3,...
{ "split": "train", "index": 83002, "acecode_id": "evol_24459", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates index settings for a search engine. Your function should take a boolean parameter `create`. If `create` is set to True, the function should return a dictionary representing the settings and mappings needed to create an inde...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prepare_concepts_index(False) == {'settings': {'analysis': {'analyzer': {'folding': {'tokenizer': 'standard', 'filter': ['lowercase', 'asciifolding']}}}}, 'mappings': {'_doc': {'properties': {'top_concept': {'type': 'keyword'}, 'conceptid': {'type': 'keyword...
{ "split": "train", "index": 83003, "acecode_id": "bigcode_python_fns_25335", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a molecular structure represented as a list of atoms. Each atom can either be a standard atom or a query atom. Implement a function that checks if all atoms in the given molecular structure are query atoms. If they are, return 'True'; otherwise, return 'False'. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_all_query_atoms(['Q_H', 'Q_O', 'Q_C']) == True\", \"assert is_all_query_atoms(['H', 'Q_O', 'Q_C']) == False\", \"assert is_all_query_atoms(['Q_N', 'Q_S', 'Q_Cl']) == True\", \"assert is_all_query_atoms(['C', 'C', 'C']) == False\", \"assert is_all_query_at...
{ "split": "train", "index": 83004, "acecode_id": "bigcode_python_fns_48247", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `calculate_unique_permutations(lst)` that returns a list of all distinct permutations of the list. The permutations should be returned in lexicographical order. The input list may contain duplicates, and your function should ensure tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_unique_permutations([1, 2, 3]) == [(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)]\", \"assert calculate_unique_permutations([1, 1, 2]) == [(1, 1, 2), (1, 2, 1), (2, 1, 1)]\", \"assert calculate_unique_permutations([1]) == [(1,)]\...
{ "split": "train", "index": 83005, "acecode_id": "evol_32604", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether the current function is being called from the module level. The function should raise a RuntimeError if it is not called from a function context. Your function should return True if it is being called from the modu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_called_at_module_level() == True\", \"assert is_called_at_module_level() == True\", \"assert is_called_at_module_level() == True\", \"assert is_called_at_module_level() == True\", \"assert is_called_at_module_level() == True\", \"assert is_called_at_modul...
{ "split": "train", "index": 83006, "acecode_id": "bigcode_python_fns_27366", "num_tests": 16 }
acecode
[ { "role": "user", "content": "A chef has collected data on the `satisfaction` level of his `n` dishes. Chef can cook any dish in 1 unit of time. The like-time coefficient of a dish is defined as the time taken to cook that dish including previous dishes multiplied by its satisfaction level, i.e., `time[i]`*...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxSatisfaction([4,3,2], 0) == 20\", \"assert maxSatisfaction([-1,-4,-5], 3) == 0\", \"assert maxSatisfaction([10,20,30], 0) == 140\", \"assert maxSatisfaction([-10,-20,-30], 2) == 0\", \"assert maxSatisfaction([0,0,0], 1) == 0\", \"assert maxSatisfaction([-...
{ "split": "train", "index": 83007, "acecode_id": "evol_30901", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Design a Python function entitled 'gear_ratio' that calculates the gear ratio of a bicycle given the number of teeth on the front gear and the number of teeth on the rear gear. The function should take two integer parameters, 'front_teeth' and 'rear_teeth'. If the value of 'rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gear_ratio(40, 20) == 2.0\", \"assert gear_ratio(30, 10) == 3.0\", \"assert gear_ratio(50, 0) == 'Error - Division by Zero'\", \"assert gear_ratio(15, 5) == 3.0\", \"assert gear_ratio(24, 8) == 3.0\", \"assert gear_ratio(12, 4) == 3.0\", \"assert gear_ratio(...
{ "split": "train", "index": 83008, "acecode_id": "evol_31027", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a string as input and returns a dictionary. The keys of this dictionary should be the distinct alphabetic characters found in the input string (case insensitive), along with their respective frequencies. Additionally, the dictionary should inc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_char_freq('') == {'vowels': 0, 'consonants': 0}\", \"assert count_char_freq('1234!@#$') == {'vowels': 0, 'consonants': 0}\", \"assert count_char_freq('AABBBCC') == {'a': 2, 'b': 3, 'c': 2, 'vowels': 2, 'consonants': 5}\", \"assert count_char_freq('aaee...
{ "split": "train", "index": 83009, "acecode_id": "evol_32159", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a specified integer exists within a two-dimensional numerical array and returns its coordinates (row, column). If the integer does not exist in the array, return None. The array can be up to 100x100 in size.\nPlease reason step by step, then ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_integer([[1, 2], [3, 4]], 2) == (0, 1)\", \"assert find_integer([[1, 2], [3, 4]], 3) == (1, 0)\", \"assert find_integer([[1, 2], [3, 4]], 4) == (1, 1)\", \"assert find_integer([[1, 2], [3, 4]], 1) == (0, 0)\", \"assert find_integer([[1, 2], [3, 4]], 5) ...
{ "split": "train", "index": 83010, "acecode_id": "evol_20883", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that calculates the product of all the integers in the list. You need to return the resulting product. If the list is empty, return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final progra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply([1, 3, 5, 7]) == 105\", \"assert multiply([2, 4, 6]) == 48\", \"assert multiply([-1, 1]) == -1\", \"assert multiply([-2, -3, -4]) == -24\", \"assert multiply([0, 1, 2]) == 0\", \"assert multiply([5]) == 5\", \"assert multiply([]) == 1\", \"assert mu...
{ "split": "train", "index": 83011, "acecode_id": "evol_15649", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that removes all negative numbers from the list and returns a new list containing only the non-negative numbers sorted in ascending order. For example, given the input list [-5, -1, 2, 0, 4, 5, 9], the output should be [0, 2, 4, 5,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_numbers([-5, -1, 2, 0, 4, 5, 9]) == [0, 2, 4, 5, 9]\", \"assert process_numbers([3, -2, 1, -5, 0]) == [0, 1, 3]\", \"assert process_numbers([-10, -20, -30]) == []\", \"assert process_numbers([0, 0, 0]) == [0, 0, 0]\", \"assert process_numbers([5, 3, ...
{ "split": "train", "index": 83012, "acecode_id": "evol_7245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a fully qualified name for a database attribute. The function should take two parameters: `table_name` (a string) and `attr_name` (a string). The function should return the fully qualified name of the attribute, which i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_fully_qualified_name('users', 'id') == 'users.id'\", \"assert get_fully_qualified_name('products', 'name') == 'products.name'\", \"assert get_fully_qualified_name('', 'description') == 'description'\", \"assert get_fully_qualified_name('orders', 'total')...
{ "split": "train", "index": 83013, "acecode_id": "oss_8914", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of services, implement a function `select_service(services)` that randomly selects and returns one service from the provided list. The function should take a list of strings as input, where each string represents a service. Ensure that the function can handle an em...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_service(['Service A', 'Service B', 'Service C']) in ['Service A', 'Service B', 'Service C']\", \"assert select_service(['Database', 'Compute', 'Storage']) in ['Database', 'Compute', 'Storage']\", \"assert select_service(['AI', 'Machine Learning']) in ...
{ "split": "train", "index": 83014, "acecode_id": "evol_28780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer x, implement a function 'my_function' that returns x if it is less than or equal to 10. If x is greater than 10, return 11. The function should operate in constant time complexity O(1).\nPlease reason step by step, then write a self-contained Python solution. G...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert my_function(5) == 5\", \"assert my_function(10) == 10\", \"assert my_function(11) == 11\", \"assert my_function(15) == 11\", \"assert my_function(0) == 0\", \"assert my_function(7) == 7\", \"assert my_function(12) == 11\", \"assert my_function(20) == 11\", \...
{ "split": "train", "index": 83015, "acecode_id": "evol_11088", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a package manager's configuration file parser. The configuration file contains rules for masking (disabling) specific packages or package versions. The rules are defined using a specific syntax, and the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_config_file('mask', '*/*::repo') == '/etc/portage/package.mask/repo'\", \"assert get_config_file('mask', '*/pkg::repo') == '/etc/portage/package.mask/pkg'\", \"assert get_config_file('mask', 'cat/pkg') == '/etc/portage/package.mask/cat/pkg'\", \"assert g...
{ "split": "train", "index": 83016, "acecode_id": "oss_27747", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns the name of an experiment based on a given configuration dictionary. The configuration dictionary will contain a key called 'name' which holds the name of the experiment as a string. Your function should take this configurati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_experiment_name({'name': 'MyExperimentName'}) == 'MyExperimentName'\", \"assert get_experiment_name({'name': 'TestExperiment'}) == 'TestExperiment'\", \"assert get_experiment_name({'name': 'AnotherExperiment'}) == 'AnotherExperiment'\", \"assert get_expe...
{ "split": "train", "index": 83017, "acecode_id": "oss_27685", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing a body of text, implement a function that searches for a specified term within the list. The function should return a list of all the indices where the term is found, ignoring case sensitivity. If the term is not found, return -1. The search...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_word_indices(['hello', 'world', 'hello', 'Python'], 'hello') == [0, 2]\", \"assert find_word_indices(['apple', 'banana', 'cherry'], 'grape') == -1\", \"assert find_word_indices(['abcd', 'efgh', 'ijkl'], 'mnop') == -1\", \"assert find_word_indices(['a', ...
{ "split": "train", "index": 83018, "acecode_id": "evol_993", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of `NumberedCell` objects, each representing a cell in a grid. Each `NumberedCell` has the following attributes: `seq` (a unique sequence number for the cell), `r` (the row index of the cell), `c` (the column index of the cell), `a` (the value of the cell),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_missing_cells([NumberedCell(seq=2, r=1, c=2, a=0, d=4), NumberedCell(seq=3, r=1, c=3, a=0, d=9)]) == [1]\", \"assert find_missing_cells([NumberedCell(seq=1, r=1, c=2, a=0, d=1), NumberedCell(seq=2, r=1, c=3, a=0, d=1), NumberedCell(seq=4, r=1, c=4, a=0,...
{ "split": "train", "index": 83019, "acecode_id": "oss_7241", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of project instances, each associated with an owner who has a user account. Each project instance has an owner, and each owner has a user account. Your goal is to iterate through the list of project instances ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_usernames([Project(Owner(UserAccount('alice'))), Project(Owner(UserAccount('bob')))]) == ['alice', 'bob']\", \"assert get_usernames([Project(Owner(UserAccount('charlie'))), Project(Owner(UserAccount('david'))), Project(Owner(UserAccount('eve')))]) == ['c...
{ "split": "train", "index": 83020, "acecode_id": "oss_2448", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `start_programming_operation` that initiates a programming operation on a programmable integrated circuit (PIC). The function should accept a variable number of keyword arguments (`**options`). The function should handle the following...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_programming_operation(program_pe='no_pe') == 'Programming operation initiated without PE.'\", \"assert start_programming_operation(program_pe='some_value') == 'Programming operation initiated with PE.'\", \"assert start_programming_operation() == 'Prog...
{ "split": "train", "index": 83021, "acecode_id": "oss_10742", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, where each integer represents a unique user ID. You need to create a function that returns the ID of the user with the maximum value. If the list is empty, return -1. Implement the function `find_max_user_id(user_ids: List[int]) -> int` that ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_user_id([1, 2, 3, 4, 5]) == 5\", \"assert find_max_user_id([10, 20, 30]) == 30\", \"assert find_max_user_id([-1, -2, -3]) == -1\", \"assert find_max_user_id([99]) == 99\", \"assert find_max_user_id([]) == -1\", \"assert find_max_user_id([5, 5, 5]) =...
{ "split": "train", "index": 83022, "acecode_id": "bigcode_python_fns_8560", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with mapping nodes for a source:alias table file that contains information about genes and their corresponding types and taxids. Given a list of tuples where each tuple contains (n1, hint, ntype, taxid, n2, hint2, ntype2, taxid2, edge_type, weight), your goal is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_nodes([('n1', 'hint1', 'gene', '9606', 'n2', 'hint2', 'gene', '9606', 'edge_type', '1')]) == [('n1', 'n2', 'production', 'mapped')]\", \"assert map_nodes([('n1', 'hint1', 'gene', 'unknown', 'n2', 'hint2', 'gene', 'unknown', 'edge_type', '1')]) == [('n1',...
{ "split": "train", "index": 83023, "acecode_id": "bigcode_python_fns_27210", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of Chrome options based on a given executable path. The function should accept a single string parameter `executable_path`. If the `executable_path` is empty or None, the function should raise a ValueError with the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_chrome_options('path/to/chrome') == ['whitelisted-ips=\\\"\\\"', 'disable-xss-auditor', 'disable-web-security', 'allow-running-insecure-content', 'no-sandbox', 'disable-setuid-sandbox', 'disable-popup-blocking', 'allow-elevated-browser', 'verbose']\...
{ "split": "train", "index": 83024, "acecode_id": "bigcode_python_fns_29823", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `ternary_search(arr: List[int], l: int, r: int, x: int) -> int` that performs a ternary search to find the index of the element `x` in a sorted array `arr`. The function should return the index of `x` if it exists in the array, and -1 if it does not. The se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ternary_search([1, 2, 3, 4, 5], 0, 4, 3) == 2\", \"assert ternary_search([1, 2, 3, 4, 5], 0, 4, 1) == 0\", \"assert ternary_search([1, 2, 3, 4, 5], 0, 4, 5) == 4\", \"assert ternary_search([1, 2, 3, 4, 5], 0, 4, 6) == -1\", \"assert ternary_search([], 0, -1,...
{ "split": "train", "index": 83025, "acecode_id": "evol_17055", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer array 'nums' of length 'n' and an integer 'target'. Your task is to implement a function 'find_target' that returns True if 'target' exists in the array 'nums', and False otherwise. The function should handle arrays of varying lengths, including empty a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_target([1, 2, 3, 4, 5], 3) == True\", \"assert find_target([10, 20, 30, 40, 50], 25) == False\", \"assert find_target([], 1) == False\", \"assert find_target([-1, -2, -3, -4], -2) == True\", \"assert find_target([0, 0, 0, 0], 0) == True\", \"assert find...
{ "split": "train", "index": 83026, "acecode_id": "bigcode_python_fns_28930", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the command line interface for a device configuration. The function should take a single parameter, `options`, which is a list of strings representing command line options. If the `options` list is empty, the function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cli([]) == 'Using default config'\", \"assert cli(['--help']) == 'Using provided options: --help'\", \"assert cli(['-a']) == 'Using provided options: -a'\", \"assert cli(['--delete']) == 'Using provided options: --delete'\", \"assert cli(['-y']) == 'Using pr...
{ "split": "train", "index": 83027, "acecode_id": "bigcode_python_fns_36866", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given two lists, list1 and list2, write a function to_dict that transforms these lists into a dictionary. The elements from list1 should be used as keys and the corresponding elements from list2 should be used as values. If the lengths of list1 and list2 are not equal, the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_dict(['a', 'b', 'c'], [1, 2, 3]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert to_dict(['x', 'y'], [10, 20]) == {'x': 10, 'y': 20}\", \"assert to_dict([], []) == {}\", \"assert to_dict(['a'], [1]) == {'a': 1}\", \"assert to_dict(['key1', 'key2'], ['value1']) ==...
{ "split": "train", "index": 83028, "acecode_id": "evol_20223", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple in-memory cache system using Python. The cache should support the following operations: setting a key-value pair, checking if the cache has been modified, and removing a key and returning its corresponding value. Your task is to impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cache_operations([('set', 'a', 1), ('is_modified',), ('pop', 'a')]) == [None, True, 1]\", \"assert cache_operations([('set', 'key1', 'value1'), ('is_modified',), ('pop', 'key2')]) == [None, True, None]\", \"assert cache_operations([('is_modified',)]) == [Fal...
{ "split": "train", "index": 83029, "acecode_id": "oss_7614", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string representing a Kubernetes node label in the format 'key=value', implement a function that converts this string into a dictionary with the key and value as its respective entries. If the input string is empty or None, return an empty dictionary. Your function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kubernetes_node_label_to_dict('app=web') == {'app': 'web'}\", \"assert kubernetes_node_label_to_dict('env=production') == {'env': 'production'}\", \"assert kubernetes_node_label_to_dict('region=us-east-1') == {'region': 'us-east-1'}\", \"assert kubernetes_no...
{ "split": "train", "index": 83030, "acecode_id": "bigcode_python_fns_12198", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing stock performance data represented as a list of dictionaries. Each dictionary contains information about a specific date and the corresponding stock price. Write a function `get_average_price(data: List[Dict[str, Union[str, float]]]) -> float` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_average_price([{'date': '2023-01-01', 'price': 150.0}, {'date': '2023-01-02', 'price': 152.5}]) == 151.25\", \"assert get_average_price([{'date': '2023-01-01', 'price': 100.0}, {'date': '2023-01-02', 'price': 200.0}, {'date': '2023-01-03', 'price': 300.0...
{ "split": "train", "index": 83031, "acecode_id": "oss_12782", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of models, each represented by a dictionary containing 'ncomps' (number of components) and 'aic' (Akaike Information Criterion value). Your task is to select the model with the smallest AIC value from the list, ignoring any models that have 'ncomps' equal t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_best_model([{'ncomps': 2, 'aic': 100.0}, {'ncomps': 1, 'aic': 98.0}, {'ncomps': 3, 'aic': 99.0}]) == {'ncomps': 1, 'aic': 98.0}\", \"assert select_best_model([{'ncomps': 0, 'aic': 100.0}, {'ncomps': 0, 'aic': 98.0}, {'ncomps': 0, 'aic': 99.0}]) == Non...
{ "split": "train", "index": 83032, "acecode_id": "bigcode_python_fns_36315", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that validates a dictionary of results. The function should check if the provided input is a dictionary where all keys are strings and all values are either integers or floats. If the input is valid, return True; otherwise, return False. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_results({'metric1': 10, 'metric2': 20}) == True\", \"assert validate_results({'metric1': 10, 'metric2': 20.5}) == True\", \"assert validate_results({'metric1': 10, 'metric2': -5}) == True\", \"assert validate_results({'metric1': 0, 'metric2': 0}) ==...
{ "split": "train", "index": 83033, "acecode_id": "oss_8392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing thread information, where each string is in the format 'Thread {thread_id} (LWP {lwp}) {status}', write a function that extracts and returns two dictionaries. The first dictionary should map each LWP to its corresponding thread ID. The secon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_thread_info(['Thread 1 (LWP 101) running', 'Thread 2 (LWP 102) blocked mutexA', 'Thread 3 (LWP 103) running']) == ({101: 1, 102: 2, 103: 3}, {102: 'mutexA'})\", \"assert get_thread_info(['Thread 4 (LWP 201) blocked mutexB', 'Thread 5 (LWP 202) running', ...
{ "split": "train", "index": 83034, "acecode_id": "bigcode_python_fns_27972", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representation of a frequency, formatted as '<number><unit>', where <number> can be any non-negative integer (including no number, which should be treated as 1) and <unit> is a string representing the time unit (e.g., 'Min', 'Hour'). Write a function `par...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_frequency('5Min') == ('Min', 5)\", \"assert parse_frequency('Hour') == ('Hour', 1)\", \"assert parse_frequency('10Second') == ('Second', 10)\", \"assert parse_frequency('1Hour') == ('Hour', 1)\", \"assert parse_frequency('0Day') == ('Day', 0)\", \"asse...
{ "split": "train", "index": 83035, "acecode_id": "bigcode_python_fns_3235", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a two-dimensional list of length 'n', where each sublist is of length 'm', implement a function that sorts the main list in descending order according to the sum of the elements in each sublist. The function should take one parameter, the multi-dimensional list. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_problem([[3,2,1], [1,0,0], [9,8,7], [2,7,8]]) == [[9,8,7], [2,7,8], [3,2,1], [1,0,0]]\", \"assert solve_problem([[5,5,5], [1,1,1], [2,2,2]]) == [[5,5,5], [2,2,2], [1,1,1]]\", \"assert solve_problem([[10,20], [5,15], [30,10]]) == [[30,10], [10,20], [5,1...
{ "split": "train", "index": 83036, "acecode_id": "evol_3359", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `calculate_sum_of_odds` that returns the sum of all odd integers in the list. If there are no odd integers, the function should return 0. The function should handle both positive and negative integers. The input list can be empty. \n\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_of_odds([1, 2, 3, 4, 5]) == 9\", \"assert calculate_sum_of_odds([-1, -2, -3, -4, -5]) == -9\", \"assert calculate_sum_of_odds([0, 2, 4, 6]) == 0\", \"assert calculate_sum_of_odds([]) == 0\", \"assert calculate_sum_of_odds([10, 20, 30]) == 0\", ...
{ "split": "train", "index": 83037, "acecode_id": "bigcode_python_fns_12931", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a sharding index, implement a function that returns a sublist (or shard) from the original list based on the provided index and the number of shards. The list should be divided evenly into the specified number of shards. If the list cannot be evenly...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shard([1, 2, 3, 4, 5], 3, 3) == []\", \"assert shard([], 0, 1) == []\", \"assert shard([1, 2, 3], 0, 1) == [1, 2, 3]\", \"assert shard([1, 2, 3, 4], 0, 4) == [1]\", \"assert shard([1, 2, 3, 4], 1, 4) == [2]\", \"assert shard([1, 2, 3, 4], 2, 4) == [3]\", \"a...
{ "split": "train", "index": 83038, "acecode_id": "bigcode_python_fns_42470", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that sets the logging level and format based on user input parameters. The function takes a dictionary with two optional keys: 'quiet' and 'verbose'. The 'quiet' key can take values: 0 (no effect), 1 (ERROR level), 2 (CRITICAL level),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_logging_level({'quiet': 0, 'verbose': 0}) == 'WARNING'\", \"assert set_logging_level({'quiet': 1, 'verbose': 0}) == 'ERROR'\", \"assert set_logging_level({'quiet': 0, 'verbose': 1}) == 'INFO'\", \"assert set_logging_level({'quiet': 2, 'verbose': 0}) == '...
{ "split": "train", "index": 83039, "acecode_id": "bigcode_python_fns_48008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a logging function for a data processing application that processes events. Your goal is to create a function, `log_event`, which takes an event as input and logs the event's information to the console using Python's logging module. The logging ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_event('User logged in') == 'Event processed: User logged in'\", \"assert log_event('Data processed') == 'Event processed: Data processed'\", \"assert log_event('Error occurred') == 'Event processed: Error occurred'\", \"assert log_event('File uploaded') ...
{ "split": "train", "index": 83040, "acecode_id": "oss_10810", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of lists that represent sounders and their corresponding transducers, implement a function that finds the indices of a specific transducer in the list. The function should take two parameters: a 2D list 'sounders' where each sublist contains names of transducers as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_transducer([['TransducerA', 'TransducerB'], ['TransducerC']], 'TransducerA') == (0, 0)\", \"assert find_transducer([['TransducerA', 'TransducerB'], ['TransducerC']], 'TransducerC') == (1, 0)\", \"assert find_transducer([['TransducerA', 'TransducerB'], [...
{ "split": "train", "index": 83041, "acecode_id": "bigcode_python_fns_12884", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom error class called `ExtCommandError` that inherits from a base class `ProgramError`. The `ExtCommandError` class should represent errors that occur during the execution of external commands or processes. Your task is to define the `ExtComma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isinstance(ExtCommandError(), ExtCommandError)\", \"assert isinstance(ExtCommandError(), ProgramError)\", \"assert repr(ExtCommandError()) == 'ExtCommandError()'\", \"assert isinstance(ExtCommandError('An error occurred'), ExtCommandError)\", \"assert isinst...
{ "split": "train", "index": 83042, "acecode_id": "oss_32498", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `check_invalid_characters(input_string)` that takes a string as input and checks if it contains any invalid characters. Invalid characters are defined as any character that is not a lowercase or uppercase English letter (a-z, A-Z) or a space. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_invalid_characters('Hello World') == False\", \"assert check_invalid_characters('Hello@World') == True\", \"assert check_invalid_characters('123 Hello') == True\", \"assert check_invalid_characters('Hello#World') == True\", \"assert check_invalid_chara...
{ "split": "train", "index": 83043, "acecode_id": "evol_7375", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s, implement a function that finds the longest palindromic substring using Manacher's algorithm. You must not use any string manipulation functions other than necessary for the implementation of the algorithm. The function should return the longest palindromic su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_palindrome('a') == 'a'\", \"assert longest_palindrome('racecar') == 'racecar'\", \"assert longest_palindrome('cbbd') == 'bb'\", \"assert longest_palindrome('') == ''\", \"assert longest_palindrome('abba') == 'abba'\", \"assert longest_palindrome('abc...
{ "split": "train", "index": 83044, "acecode_id": "evol_10808", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `concatenate_elements` that accepts a list of strings and a string delimiter. The function should return a single string that is the concatenation of all the elements in the list, separated by the given delimiter. If the list is empty, the function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate_elements(['Hello', 'World'], '-') == 'Hello-World'\", \"assert concatenate_elements(['Python', 'is', 'fun'], ' ') == 'Python is fun'\", \"assert concatenate_elements(['Leet', 'Code'], ' ') == 'Leet Code'\", \"assert concatenate_elements([], '-') ...
{ "split": "train", "index": 83045, "acecode_id": "evol_23982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented as an adjacency list. Each edge in the graph represents a relationship between two nodes, where the nodes are indexed from 0 to n-1. Your task is to implement a function that checks if there exists a way to assign a real number in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_assign_values([[1], [2], []]) == True\", \"assert can_assign_values([[1, 2], [], []]) == True\", \"assert can_assign_values([[1], [2], [0]]) == False\", \"assert can_assign_values([[], [0], [1]]) == True\", \"assert can_assign_values([[1, 2], [2], [0]]) ...
{ "split": "train", "index": 83046, "acecode_id": "bigcode_python_fns_7142", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that determines if a list of integers can be considered 'flight-worthy'. An integer list is 'flight-worthy' if it satisfies the following conditions: it must be a palindrome, the sum of its elements must be less than or equal to a specified maximum weight '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert will_it_fly([1, 2], 5, 2) == False\", \"assert will_it_fly([3, 2, 3], 1, 2) == False\", \"assert will_it_fly([3, 2, 3], 9, 2) == True\", \"assert will_it_fly([3], 5, 1) == True\", \"assert will_it_fly([1, 2, 1], 5, 2) == True\", \"assert will_it_fly([0, 1, 0...
{ "split": "train", "index": 83047, "acecode_id": "evol_17827", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, implement a function called `fast_sum(n)` that returns the sum of all integers from 0 to n-1. The function should have an optimal time complexity and should not use loops or recursion.\nPlease reason step by step, then write a self-contained Pyth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fast_sum(0) == 0\", \"assert fast_sum(1) == 0\", \"assert fast_sum(2) == 1\", \"assert fast_sum(3) == 3\", \"assert fast_sum(4) == 6\", \"assert fast_sum(5) == 10\", \"assert fast_sum(10) == 45\", \"assert fast_sum(100) == 4950\", \"assert fast_sum(50) == 12...
{ "split": "train", "index": 83048, "acecode_id": "evol_21203", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python decorator that logs information about the functions it decorates. The decorator should log the function name, arguments, and return value when the decorated function is called. Implement a single function called `log_decorator` that takes a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_decorator(lambda x: x + 1)(2) == 3\", \"assert log_decorator(lambda x, y: x * y)(3, 4) == 12\", \"assert log_decorator(lambda: 'Hello, World!')() == 'Hello, World!'\", \"assert log_decorator(lambda a, b=2: a + b)(3) == 5\", \"assert log_decorator(lambda ...
{ "split": "train", "index": 83049, "acecode_id": "oss_19722", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a program to filter a list of strings representing various system components based on a specific prefix in their names. Write a function `filterComponents` that takes two parameters: a list of component names as a list of strings, and a prefix a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filterComponents(['Info', 'Infusion', 'InfusionParameter', 'Priming', 'Motor', 'DeviceReport', 'HistoryLog', 'InfusionSetting', 'Maintenance', 'SafetySetting'], 'Infusion') == ['Infusion', 'InfusionParameter', 'InfusionSetting']\", \"assert filterComponents(...
{ "split": "train", "index": 83050, "acecode_id": "oss_30063", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of (row, column) indices and a shape of a dense matrix, implement a function that creates a sparse matrix represented by a list of dictionaries. Each dictionary should represent a non-zero element in the sparse matrix, where the keys are 'row', 'column', and 'value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_sparse_matrix([(0, 0), (1, 2)], (3, 4)) == [{'row': 0, 'column': 0, 'value': 1}, {'row': 1, 'column': 2, 'value': 1}]\", \"assert create_sparse_matrix([(1, 1), (2, 2), (0, 0)], (3, 3)) == [{'row': 1, 'column': 1, 'value': 1}, {'row': 2, 'column': 2, '...
{ "split": "train", "index": 83051, "acecode_id": "bigcode_python_fns_8072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to log messages with varying severity levels. Define a function `log_message(message: str, severity: int) -> str` that simulates logging a message based on its severity level. The severity levels are defined as follows: 0 for DEBUG, 1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('Debug message', 0) == 'Severity: DEBUG, Message: Debug message'\", \"assert log_message('Info message', 1) == 'Severity: INFO, Message: Info message'\", \"assert log_message('Warning message', 2) == 'Severity: WARNING, Message: Warning message'\...
{ "split": "train", "index": 83052, "acecode_id": "oss_29981", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function that computes the surface area of multiple circular sectors. The function should take a list of pairs, where each pair consists of a radius and a central angle. If the central angle exceeds 360 degrees or is less than 0, the function should return None for that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sector_areas([(5, 0)]) == [0.0]\", \"assert calculate_sector_areas([(4, 400)]) == [None]\", \"assert calculate_sector_areas([(4, -10)]) == [None]\", \"assert calculate_sector_areas([(0, 90)]) == [0.0]\", \"assert calculate_sector_areas([(2, 390)]) ...
{ "split": "train", "index": 83053, "acecode_id": "evol_13916", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that generates a migration operation to add a new field to an existing model in a Django application. The function should take two parameters: the model name (a string) and the new field name (a string). The generated migration operatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_migration_operation('User', 'new_field') == {'dependencies': [('users', '0002_auto_20170613_2124')], 'operations': [{'model_name': 'User', 'name': 'new_field', 'field': {'type': 'CharField', 'max_length': 100}}]}\", \"assert generate_migration_opera...
{ "split": "train", "index": 83054, "acecode_id": "oss_24225", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that scales video clip dimensions. The function should take in the original x and y dimensions of a video clip, as well as a scaling factor, and return the new scaled x and y dimensions as integers. The function should be named `sc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_xy(1920, 1080, 1.0) == (1920, 1080)\", \"assert scale_xy(1920, 1080, 0.5) == (960, 540)\", \"assert scale_xy(1280, 720, 2.0) == (2560, 1440)\", \"assert scale_xy(640, 360, 3.5) == (2240, 1260)\", \"assert scale_xy(800, 600, 1.5) == (1200, 900)\", \"ass...
{ "split": "train", "index": 83055, "acecode_id": "oss_28746", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that calculates and returns the total distance between all occurrences of a specific element within a sorted array. The distance is defined as the sum of the differences in indices between consecutive occurrences of the element. If the element does not occur at...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_distance([1, 2, 2, 3, 4], 2) == 1\", \"assert calc_distance([1, 1, 1, 1], 1) == 3\", \"assert calc_distance([1, 2, 3, 4, 5], 6) == 0\", \"assert calc_distance([2, 2], 2) == 1\", \"assert calc_distance([], 3) == 0\", \"assert calc_distance([10, 10, 20], ...
{ "split": "train", "index": 83056, "acecode_id": "evol_29863", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a nested data structure that can contain dictionaries and lists, implement a function `nested_lookup(key, document)` that takes a string `key` and a nested `document` (which can be a dictionary or a list) and returns a list of all values associated with the given key. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nested_lookup('a', {'a': 1, 'b': 2}) == [1]\", \"assert nested_lookup('a', {'b': {'a': 3}, 'c': 4}) == [3]\", \"assert nested_lookup('a', [{'a': 1}, {'b': 2}, {'a': 3}]) == [1, 3]\", \"assert nested_lookup('x', {'a': 1, 'b': 2}) == []\", \"assert nested_look...
{ "split": "train", "index": 83057, "acecode_id": "bigcode_python_fns_16694", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a command string for showing the status of a network interface. The function should take a single parameter, `interface`, which can either be `None` or a string representing the name of the interface. If the `interface` par...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_command(None) == 'pfc show asymmetric'\", \"assert generate_command('eth0') == 'pfc show asymmetric eth0'\", \"assert generate_command('wan1') == 'pfc show asymmetric wan1'\", \"assert generate_command('lan2') == 'pfc show asymmetric lan2'\", \"asse...
{ "split": "train", "index": 83058, "acecode_id": "bigcode_python_fns_12536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that counts the number of occurrences of a specific byte pattern within a given list of bytes. The function should take two arguments: a list of integers representing the bytes (where each integer is in the range 0-255, inclusive) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_byte_pattern([0x12, 0x34, 0x56, 0x12, 0x34, 0x78, 0x12], [0x12, 0x34]) == 2\", \"assert count_byte_pattern([0x01, 0x02, 0x03, 0x04], [0x05]) == 0\", \"assert count_byte_pattern([], [0x12]) == 0\", \"assert count_byte_pattern([0x12, 0x12, 0x12], [0x12])...
{ "split": "train", "index": 83059, "acecode_id": "oss_8915", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes two dictionaries containing various commands and parameters. The function should execute different actions based on the provided input. The first dictionary, `a`, contains the keys 'tch' and 'username'. The secon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_command({'tch': 'dp-downloader', 'username': 'user1'}, {'tar_uname': 'target1'}, 'secretpass') == None\", \"assert process_command({'tch': 'DP-DOWNLOADER', 'username': 'user2'}, {'tar_uname': 'target2'}, 'mypassword') == None\", \"assert process_comm...
{ "split": "train", "index": 83060, "acecode_id": "oss_35480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a bearer token from a given string input. The function should take a single input parameter, which is a string representing the contents of a token file. Your function should return the string 'Authorization: Bearer <token>...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_bearer_token('my-secret-token') == 'Authorization: Bearer my-secret-token'\", \"assert get_bearer_token('abc123') == 'Authorization: Bearer abc123'\", \"assert get_bearer_token('sampleToken') == 'Authorization: Bearer sampleToken'\", \"assert get_bearer_...
{ "split": "train", "index": 83061, "acecode_id": "bigcode_python_fns_39399", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a classroom with a specified volume and temperature, and a number of students present at particular times. Write a function `calculate_exposure` that determines if the concentration of a virus in the classroom is above a certain threshold at specified intervals ba...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_exposure(160, [293, 295, 290], 0.3, 1, [(0, 2), (2.5, 4)], 0.5) == True\", \"assert calculate_exposure(200, [295, 290, 292], 0.4, 0, [(0, 1), (1.5, 2.5)], 0.3) == False\", \"assert calculate_exposure(150, [300, 301], 0.2, 2, [(0, 1), (1, 2)], 1.0) ...
{ "split": "train", "index": 83062, "acecode_id": "bigcode_python_fns_20439", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that synchronizes a list of remote catalogs. Each catalog is represented as a dictionary that contains information about the catalog such as its name and URL. The function should take a list of these catalog dictionaries and return a new l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sync_remote_catalogs([{'name': 'Catalog1', 'url': 'http://example.com'}, {'name': 'Catalog2', 'url': 'https://example.org'}, {'name': 'Catalog3', 'url': 'invalid_url'}]) == ['Catalog1', 'Catalog2']\", \"assert sync_remote_catalogs([{'name': 'CatalogA', 'url'...
{ "split": "train", "index": 83063, "acecode_id": "bigcode_python_fns_32139", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a specific user type identifier into a corresponding user type name in a calendar application. The mapping of user type identifiers to user type names is as follows: 0 -> 'Guest', 1 -> 'Member', 2 -> 'Admin', 3 -> 'SuperAdmi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cuTypeConverter(0) == ('userType', 'Guest')\", \"assert cuTypeConverter(1) == ('userType', 'Member')\", \"assert cuTypeConverter(2) == ('userType', 'Admin')\", \"assert cuTypeConverter(3) == ('userType', 'SuperAdmin')\", \"assert cuTypeConverter(4) == ('user...
{ "split": "train", "index": 83064, "acecode_id": "bigcode_python_fns_37380", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a dictionary as input and returns an object with three specific attributes: 'id', 'status', and 'title'. If the keys 'id', 'status', or 'title' are not present in the dictionary, the corresponding attributes of the object shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_object_from_dict({'id': 1, 'status': 'active', 'title': 'Task 1'}).id == 1\", \"assert create_object_from_dict({'id': 2, 'status': 'inactive'}).status == 'inactive'\", \"assert create_object_from_dict({'title': 'Task 2'}).title == 'Task 2'\", \"assert...
{ "split": "train", "index": 83065, "acecode_id": "oss_24570", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `move_two_balls(nums)` that checks if the numbers in the list can be sorted in ascending order with only two swaps. Additionally, the function should verify if all the even numbers are located at even indices and if half or more th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_two_balls([5, 4, 3, 2, 1]) == False\", \"assert move_two_balls([2, 4, 1, 3, 6]) == False\", \"assert move_two_balls([6, 3, 8, 1, 2]) == False\", \"assert move_two_balls([5, 4, 3, 6, 2]) == False\", \"assert move_two_balls([4, 2, 6, 1, 3]) == False\", \"...
{ "split": "train", "index": 83066, "acecode_id": "evol_33027", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of integers. Your goal is to write a function that filters out all the even numbers from the list, multiplies each remaining odd number by 3, and then returns the sum of these modified odd numbers. Implement the function `calculate_sum_of_m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_of_modified_odd_numbers([1, 2, 3, 4, 5, 6, 7, 8, 9]) == 75\", \"assert calculate_sum_of_modified_odd_numbers([2, 4, 6, 8]) == 0\", \"assert calculate_sum_of_modified_odd_numbers([0, 1, 2, 3]) == 12\", \"assert calculate_sum_of_modified_odd_numb...
{ "split": "train", "index": 83067, "acecode_id": "oss_23972", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a game board with cells labeled with either 'W' or 'B'. The grid is of size N x N, where N is a positive integer. Each cell is associated with a pair of coordinates (i, j), where 1 ≤ i, j ≤ N. The goal is to count the number of 'good' rectan...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_good_rectangles(['WW', 'WW']) == 0\", \"assert count_good_rectangles(['BB', 'BB']) == 0\", \"assert count_good_rectangles(['W']) == 0\", \"assert count_good_rectangles(['B']) == 0\", \"assert count_good_rectangles(['WWWWW', 'BBBBB', 'WWWWW', 'BBBBB', '...
{ "split": "train", "index": 83068, "acecode_id": "oss_25892", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of swimmer results from a swimming competition. Each result contains the swimmer's place, name, age, team, seed time, prelim time, and finals time. Your task is to implement a function that organizes this data into a structured format. The function should t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_results([(1, 'John Doe', 15, 'Team A', '00:55.00', '00:54.00', '00:53.00')]) == [{'place': 1, 'swimmer_name': 'John Doe', 'swimmer_age': 15, 'swimmer_team': 'Team A', 'seed_time': '00:55.00', 'prelim_time': '00:54.00', 'finals_time': '00:53.00'}]\",...
{ "split": "train", "index": 83069, "acecode_id": "bigcode_python_fns_7093", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string representing a linear alkane hydrocarbon composed of carbon ('C') atoms and hydrogen ('H') atoms. Your task is to implement a function that assigns atom types to each atom in the hydrocarbon based on the following rules: Each carbon atom ('C') can either ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assign_atoms('C') == ['c3']\", \"assert assign_atoms('CC') == ['c3', 'c3']\", \"assert assign_atoms('CCC') == ['c3', 'c2', 'c3']\", \"assert assign_atoms('CCCC') == ['c3', 'c2', 'c2', 'c3']\", \"assert assign_atoms('CCCCC') == ['c3', 'c2', 'c2', 'c2', 'c3']\...
{ "split": "train", "index": 83070, "acecode_id": "bigcode_python_fns_39437", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of materials needed for a project. Implement a function `update_shopping_list(project_materials: List[str]) -> List[str]` that takes in a list of strings `project_materials` representing the materials required for a project. The function should return a new...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_shopping_list(['wood', 'nails', 'paint', 'wood', 'screws']) == ['nails', 'paint', 'screws', 'wood']\", \"assert update_shopping_list(['screws', 'screws', 'screws']) == ['screws']\", \"assert update_shopping_list(['c', 'a', 'b']) == ['a', 'b', 'c']\", ...
{ "split": "train", "index": 83071, "acecode_id": "bigcode_python_fns_30587", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `toc` that represents a table of contents (TOC) where each line may contain a reference to a file. Your task is to implement a function `find_missing_files(toc: str) -> List[str]` that extracts file references from the TOC and returns a list of filenames ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_missing_files('file1.rst\\\\nfile2.rst\\\\n# comment\\\\nfile3.rst', ['file1.rst', 'file2.rst']) == ['file3.rst']\", \"assert find_missing_files('file1.rst\\\\n\\\\nfile2.rst\\\\n\\\\n', ['file1.rst', 'file2.rst']) == []\", \"assert find_missing_files('...
{ "split": "train", "index": 83072, "acecode_id": "bigcode_python_fns_16918", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the factorial of a given non-negative integer. The function should have the following signature: `def factorial(n: int) -> int:`. The input parameter `n` is a non-negative integer, and the function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 83073, "acecode_id": "oss_1141", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string of text, implement a function that splits the text into sentences and returns a dictionary. Each sentence should be saved as a separate entry in the dictionary where the key represents the order of the sentence in the text (starting from 1). Additionally, the dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_into_sentences('Hello! My name is John.') == {1: {'sentence': 'Hello!', 'word_count': 1}, 2: {'sentence': 'My name is John.', 'word_count': 4}}\", \"assert split_into_sentences('What is your name?') == {1: {'sentence': 'What is your name?', 'word_count...
{ "split": "train", "index": 83074, "acecode_id": "evol_2340", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a dictionary of environment variables and returns a specific output based on the value of the 'DEFAULT_SOURCE' key. If the 'DEFAULT_SOURCE' key is not present in the dictionary, or its value is 'undefined', the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_default_source({'DEFAULT_SOURCE': 'file'}) == 'Default source is file'\", \"assert process_default_source({'DEFAULT_SOURCE': 'database'}) == 'Default source is database'\", \"assert process_default_source({'DEFAULT_SOURCE': 'api'}) == 'Default source...
{ "split": "train", "index": 83075, "acecode_id": "oss_22565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `filter_values(data: List[Dict[str, Union[str, List[str]]]], filters: Dict[str, Union[str, List[str]]]) -> List[Dict[str, str]]` that filters a list of dictionaries based on specified criteria. Each dictionary in the input list repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_values([{'category': 'fruit', 'color': 'red'}, {'category': 'fruit', 'color': 'green'}, {'category': 'vegetable', 'color': 'green'}], {'category': 'fruit', 'color': 'red'}) == [{'category': 'fruit', 'color': 'red'}]\", \"assert filter_values([{'catego...
{ "split": "train", "index": 83076, "acecode_id": "bigcode_python_fns_46172", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a target integer. Write a function `find_pairs_with_sum(nums: List[int], target: int) -> List[Tuple[int, int]]` that returns a list of unique pairs of integers from the list that add up to the target. Each pair should be represented as a tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pairs_with_sum([1, 2, 3, 2, 1], 4) == [(1, 3), (2, 2)]\", \"assert find_pairs_with_sum([1, 1, 1, 1], 2) == [(1, 1)]\", \"assert find_pairs_with_sum([], 5) == []\", \"assert find_pairs_with_sum([0, 0, 0], 0) == [(0, 0)]\", \"assert find_pairs_with_sum([1...
{ "split": "train", "index": 83077, "acecode_id": "bigcode_python_fns_16647", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of names representing time series data. Your task is to implement a function that takes a list of names and returns a dictionary where each name in the list is a key, and the corresponding value is a string indicating that the data for that name is loaded. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_time_series(['temperature', 'humidity']) == {'temperature': 'Data for temperature loaded', 'humidity': 'Data for humidity loaded'}\", \"assert load_time_series(['pressure']) == {'pressure': 'Data for pressure loaded'}\", \"assert load_time_series([]) ==...
{ "split": "train", "index": 83078, "acecode_id": "bigcode_python_fns_23240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified event handling system in Python. The system should allow registering event handlers and triggering events. Your task is to create a function `event_system(operations)` that takes a list of operations and processes them accordingly. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert event_system([('register_event', 'event1', 'handler1'), ('trigger_event', 'event1', 'test argument')]) == ['Handler 1 called with argument: test argument']\", \"assert event_system([('register_event', 'event1', 'handler1'), ('register_event', 'event1', 'hand...
{ "split": "train", "index": 83079, "acecode_id": "oss_37225", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates sending an API call to a Kubernetes pod based on its IP address. The function `send_api_call` takes three parameters: `pod_ip` (a string representing the IP address of the pod), `data` (a dictionary containing the data ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_api_call('255.255.255.255', {}, 'test_resource') == 'API call to 255.255.255.255 with data {} on resource test_resource was successful.'\", \"assert send_api_call('192.168.0.256', {}, 'invalid_resource') == 'Invalid IP address'\", \"assert send_api_call...
{ "split": "train", "index": 83080, "acecode_id": "oss_2787", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that constructs a representation of a database table using its attributes. The function should take three string parameters: `name`, `verbose_name`, and `verbose_name_plural`. Your goal is to return a dictionary that contains these at...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_table_representation('user', 'User', 'Users') == {'name': 'user', 'verbose_name': 'User', 'verbose_name_plural': 'Users'}\", \"assert create_table_representation('product', 'Product', 'Products') == {'name': 'product', 'verbose_name': 'Product', 'verb...
{ "split": "train", "index": 83081, "acecode_id": "oss_12826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the reading of sensor data from a hardware interface. Write a function `get_sensor_packet` that simulates reading a sensor packet and returns it as a dictionary. The dictionary should contain two components: a `header` and `data`. The `header` sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sensor_packet() == {'header': {'sensor_id': 789, 'timestamp': '2022-02-01 14:30:00'}, 'data': {'sensor_reading': 78.9, 'sensor_status': 'Normal'}}\", \"assert get_sensor_packet() != {'header': {'sensor_id': 123, 'timestamp': '2022-01-01 12:00:00'}, 'data...
{ "split": "train", "index": 83082, "acecode_id": "oss_29839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with completing a Python package configuration file using the setuptools module. The configuration file must include specific settings and metadata for the package. Your job is to implement a function that takes the following parameters: author's name, maintainer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complete_config('Your Name', 'your_email@example.com', 'INRIA license - This is a license description.', 'A framework for XYZ') == {'name': 'deformetrica', 'version': '1.0.0', 'author': 'Your Name', 'maintainer': 'Deformetrica developers', 'maintainer_email'...
{ "split": "train", "index": 83083, "acecode_id": "oss_13026", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function that checks if a given list of strings is a palindrome. A list is considered a palindrome if it reads the same forward and backward. Implement the function `is_palindrome(lst)` where `lst` is a list of strings. The function should return `True` if the li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome(['cat', 'dog', 'pig', 'dog', 'cat']) == True\", \"assert is_palindrome(['hello', 'world', 'world', 'hello']) == True\", \"assert is_palindrome(['apple', 'banana', 'apple']) == True\", \"assert is_palindrome(['a', 'b', 'c', 'b', 'a']) == True\",...
{ "split": "train", "index": 83084, "acecode_id": "evol_10048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `get_facts(arr: List[int]) -> Tuple[Dict[str, int], List[str]]` that computes and returns a dictionary containing the following facts about the integers in the list: \n1. 'count': the total number of integers in the list. \n2. 'sum':...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_facts([-1, -2, -3]) == ({'count': 3, 'sum': -6, 'max': -1, 'min': -3}, ['All integers are negative'])\", \"assert get_facts([1, -1, 2]) == ({'count': 3, 'sum': 2, 'max': 2, 'min': -1}, [])\", \"assert get_facts([-1, -4, -5]) == ({'count': 3, 'sum': -10, ...
{ "split": "train", "index": 83085, "acecode_id": "bigcode_python_fns_26915", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Construct a function that computes the aggregate sum of all numerical entities encapsulated within a supplied list of tuples. This function must possess the ability to traverse nested tuple architectures and exclude any non-numeric elements. Furthermore, the function should be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_tuples([(1, 2), (3, 4)]) == 10\", \"assert aggregate_tuples([(1.5, 2.5), (3, 4)]) == 11.0\", \"assert aggregate_tuples([(1, 2), ('a', 'b'), (3, 4)]) == 10\", \"assert aggregate_tuples([()]) == 0\", \"assert aggregate_tuples([(1, (2, 3)), (4, (5, 'x...
{ "split": "train", "index": 83086, "acecode_id": "evol_17483", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `list_X` and `list_y`. Write a function that takes these two lists and returns a tuple containing two elements: the first element is a list containing the unique integers from `list_X`, and the second element is a list containing the unique ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_lists([1, 2, 2, 3], [3, 4, 4, 5]) == ([1, 2, 3], [3, 4, 5])\", \"assert unique_lists([], [1, 2, 3]) == ([], [1, 2, 3])\", \"assert unique_lists([1, 1, 1], []) == ([1], [])\", \"assert unique_lists([], []) == ([], [])\", \"assert unique_lists([1, 2, 3]...
{ "split": "train", "index": 83087, "acecode_id": "bigcode_python_fns_38415", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fizzbuzz_sequence(end: int) -> List[str]` that generates a FizzBuzz sequence from 1 to the given integer `end`. The rules are as follows: 1. For numbers divisible by 3, return 'Fizz'. 2. For numbers divisible by 5, return 'Buzz'. 3. For numbers divisible b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fizzbuzz_sequence(3) == ['1', '2', 'Fizz']\", \"assert fizzbuzz_sequence(5) == ['1', '2', 'Fizz', '4', 'Buzz']\", \"assert fizzbuzz_sequence(15) == ['1', '2', 'Fizz', '4', 'Buzz', 'Fizz', '7', '8', 'Fizz', 'Buzz', '11', 'Fizz', '13', '14', 'FizzBuzz']\", \"a...
{ "split": "train", "index": 83088, "acecode_id": "bigcode_python_fns_10911", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `S` consisting of '0's and '1's. Your task is to determine the minimum number of flips required to make `S` monotone increasing. A string is considered monotone increasing if it consists of some number of '0's (possibly 0) followed by some number of '1's ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minFlipsMonoIncr('111') == 0\", \"assert minFlipsMonoIncr('000') == 0\", \"assert minFlipsMonoIncr('000111') == 0\", \"assert minFlipsMonoIncr('0000111111') == 0\", \"assert minFlipsMonoIncr('110011') == 2\", \"assert minFlipsMonoIncr('0000000000') == 0\", \...
{ "split": "train", "index": 83089, "acecode_id": "evol_26284", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given an array of integers, rearrange the elements of the array such that the first element is the largest, the second element is the smallest, the third element is the second largest, the fourth element is the second smallest, and so on. The rearranged array should maintain th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange([1, 2, 3, 4, 5]) == [5, 1, 4, 2, 3]\", \"assert rearrange([1, 3, 2, 5, 4]) == [5, 1, 4, 2, 3]\", \"assert rearrange([10, 20, 30, 40, 50]) == [50, 10, 40, 20, 30]\", \"assert rearrange([5]) == [5]\", \"assert rearrange([1, 2]) == [2, 1]\", \"assert ...
{ "split": "train", "index": 83090, "acecode_id": "evol_28252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a dictionary representing a smart device and checks if it meets certain criteria. The dictionary will contain the following keys: 'device_id', 'ip_addr', 'mac_addr', 'name', 'state', 'remaining_time', 'auto_off_set', 'power_con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_device_status({'device_id': '1', 'ip_addr': '192.168.1.1', 'mac_addr': '00:1A:2B:3C:4D:5E', 'name': 'Device1', 'state': 'active', 'remaining_time': 10, 'auto_off_set': 5, 'power_consumption': 50, 'electric_current': 5, 'phone_id': '1234'}) == True\", \...
{ "split": "train", "index": 83091, "acecode_id": "bigcode_python_fns_26606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing posts, write a function that calculates the word count for each post. Then, categorize the posts into two classes: 'short' and 'long', using the median word count as the dividing point. Finally, return a dictionary summarizing the count of '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_posts(['SingleWord', 'AnotherSingleWord'] ) == {'short': 2, 'long': 0}\", \"assert categorize_posts([''] ) == {'short': 1, 'long': 0}\", \"assert categorize_posts([] ) == {'short': 0, 'long': 0}\", \"assert categorize_posts(['Just one more example...
{ "split": "train", "index": 83092, "acecode_id": "evol_31432", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of strings and returns a new list containing only the strings that have a length greater than a specified threshold. The function should be named `filter_long_strings`. The input parameters are a list of strings `tex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_long_strings(['apple', 'banana', 'kiwi', 'strawberry'], 5) == ['banana', 'strawberry']\", \"assert filter_long_strings(['hello', 'world'], 3) == ['hello', 'world']\", \"assert filter_long_strings(['a', 'ab', 'abc'], 2) == ['abc']\", \"assert filter_lo...
{ "split": "train", "index": 83093, "acecode_id": "oss_29534", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that retrieves the first answer from a list of answers provided in a quiz system. Implement the function `get_first_answer(answers: List[Union[str, int, bool]]) -> Union[str, int, bool]` that takes a list of answers as input and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_answer([]) == None\", \"assert get_first_answer(['A']) == 'A'\", \"assert get_first_answer(['A', 'B', 'C']) == 'A'\", \"assert get_first_answer([1, 'B', True, 3.14]) == 1\", \"assert get_first_answer(['D', 'E', 'F']) == 'D'\", \"assert get_first_an...
{ "split": "train", "index": 83094, "acecode_id": "oss_13697", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process and collect comments from a given input. The input consists of a dictionary `cs` containing comment strings, where the keys are identifiers and the values are the comment strings themselves. Your task is to implement the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_comments({'a': 'Comment 1'}) is None\", \"assert process_comments({'b': 'Comment 2', 'c': 'Comment 3'}) is None\", \"assert process_comments({'x': 'Single comment'}) is None\", \"assert process_comments({'key1': 'First comment', 'key2': 'Second comme...
{ "split": "train", "index": 83095, "acecode_id": "oss_19902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing an indication message from a network device. The indication message contains information about a traffic management queue. Your goal is to implement a function `extract_queue_info(indication)` that takes an `indication` object and returns a dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_queue_info(MockIndication(1, 'priority', 100)) == {'_object_type': 'tm_q_indication', '_sub_group_type': 'tm_q_indication', 'queue_id': 1, 'queue_type': 'priority', 'queue_depth': 100}\", \"assert extract_queue_info(MockIndication(2, 'regular', 200))...
{ "split": "train", "index": 83096, "acecode_id": "oss_24002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of daemons and a configuration dictionary. Your task is to simulate updating each daemon with the provided configuration settings. Each daemon can be represented as a string in the format 'client.rgw.<daemon_id>'. The configuration dictionary contains key-v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_daemons(['client.rgw.1', 'client.rgw.2'], {'agent': {'engine': 'engine1', 'auth': 'token', 'token_file': 'file1'}, 'url': 'http://url1'}) == ['ceph config set client.rgw.1 rgw_crypt_s3_kms_backend vault', 'ceph config set client.rgw.1 rgw_crypt_vault_...
{ "split": "train", "index": 83097, "acecode_id": "bigcode_python_fns_39460", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of lists of integers, implement the function `max_union(map_list: List[List[int]]) -> List[int]` that computes the element-wise maximum of all the sublists in the input list. The input list may contain sublists of varying lengths, and you should pad the shorter sub...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_union([[1, 2], [3, 4, 5], [0, 6]]) == [3, 6, 5]\", \"assert max_union([[1], [2], [3]]) == [3]\", \"assert max_union([[5, 1], [2, 3], [4]]) == [5, 3]\", \"assert max_union([[0, 0], [0, 0], [0, 0]]) == [0, 0]\", \"assert max_union([[1, 2, 3], [4, 5], [6]])...
{ "split": "train", "index": 83098, "acecode_id": "bigcode_python_fns_14387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `complex_square_and_cube` that takes two integers `real` and `imaginary` representing the real and imaginary parts of a complex number respectively. The function should return a dictionary with the original complex number, its square, and its cube, all repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_square_and_cube(0, 0) == {'original': '0 + 0i', 'square': '0 + 0i', 'cube': '0 + 0i'}\", \"assert complex_square_and_cube(1, 0) == {'original': '1 + 0i', 'square': '1 + 0i', 'cube': '1 + 0i'}\", \"assert complex_square_and_cube(2, 3) == {'original': ...
{ "split": "train", "index": 83099, "acecode_id": "evol_30443", "num_tests": 5 }