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 counting the number of visible docked windows on a desktop interface. A window is considered 'docked' if its status is represented by a specific character in a given string. The first two entries in this string do not represent valid windows, so they should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countDockedWindows('XXDXXD') == 2\", \"assert countDockedWindows('DDDDD') == 3\", \"assert countDockedWindows('XXXXXX') == 0\", \"assert countDockedWindows('DXXD') == 1\", \"assert countDockedWindows('D') == 0\", \"assert countDockedWindows('DD') == 0\", \"a...
{ "split": "train", "index": 74400, "acecode_id": "bigcode_python_fns_15289", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a scheduling policy for a data management system. The function should allow you to set and retrieve different types of schedules: continuous, daily, monthly, and RPO (Recovery Point Objective). Each schedule type has sp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scheduling_policy(1, '08:00', 120, 15, '10:00', 60, 24) == {'continuous': 1, 'daily': ('08:00', 120), 'monthly': (15, '10:00', 60), 'rpo': 24}\", \"assert scheduling_policy(0.5, '09:30', 30, 1, '12:00', 45, 12) == {'continuous': 0.5, 'daily': ('09:30', 30), ...
{ "split": "train", "index": 74401, "acecode_id": "oss_21112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string of characters and rearranges them in alphabetical order. The input string may contain both uppercase and lowercase letters, and your output should also maintain the casing of the original letters. The function should return the sorted st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert alphabeticArrange('edcba') == 'abcde'\", \"assert alphabeticArrange('cBa') == 'Bac'\", \"assert alphabeticArrange('apple') == 'aelpp'\", \"assert alphabeticArrange('banana') == 'aaabnn'\", \"assert alphabeticArrange('123abc') == '123abc'\", \"assert alphabet...
{ "split": "train", "index": 74402, "acecode_id": "evol_32105", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers. The function should take a list of integers and return a new list that contains only the unique integers from the input list, maintaining the order of their first occurrence. Your task is to compl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3, 1]) == [1, 2, 3]\", \"assert remove_duplicates([4, 5, 6, 4, 5, 6, 7]) == [4, 5, 6, 7]\", \"assert remove_duplicates([1]) == [1]\", \"assert remove_duplicates([-1, -2, -3, -1, -2]) == [-1, -2, -3]\", \"assert remove_duplicates([...
{ "split": "train", "index": 74403, "acecode_id": "oss_27040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that takes a string of HTML tags as input, removes all HTML tags (including nested and unclosed tags), and returns the plain text string. The function should be able to handle various HTML structures accurately.\nPlease reason step by step, then write a self-c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_tags('<div>Hello</div>') == 'Hello'\", \"assert remove_tags('<p>This is a <strong>test</strong>.</p>') == 'This is a test.'\", \"assert remove_tags('<h1>Header <span>with <b>nested</b> tags</span></h1>') == 'Header with nested tags'\", \"assert remove...
{ "split": "train", "index": 74404, "acecode_id": "evol_30984", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing brackets (either curly braces '{' and '}' or square brackets '[' and ']'), write a function that processes the string to count the occurrences of each valid bracket sequence. The function should take two parameters: a string 'bracket_string' which cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_inner_brackets('[]', False) == {'[]': 1}\", \"assert process_inner_brackets('[{}]', True) == {'[]': 1, '{}': 1}\", \"assert process_inner_brackets('[[[]]]', False) == {'[]': 3}\", \"assert process_inner_brackets('[[[[]]]]', False) == {'[]': 4}\", \"a...
{ "split": "train", "index": 74405, "acecode_id": "evol_29717", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Develop a function in Python that accepts a 2D array of negative integers and identifies the least negative value in the entire 2D array. The function should return both the least negative value and its coordinates (row, column) as a tuple.\nPlease reason step by step, then wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_least_negative([[-1, -2], [-3, -4]]) == (-1, (0, 0))\", \"assert find_least_negative([[-5, -6, -7], [-8, -9, -2], [-3, -4, -5]]) == (-2, (1, 2))\", \"assert find_least_negative([[-10, -20], [-30, -1], [-40, -50]]) == (-1, (1, 1))\", \"assert find_least_...
{ "split": "train", "index": 74406, "acecode_id": "evol_1834", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a material request document based on a sales order and available stock. Write a function `calculate_material_request_qty(doc, i, stock)` that takes in the following parameters: \n- `doc`: a dictionary containing transaction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_material_request_qty({'transaction_date': '2023-05-15', 'name': 'SO001', 'set_warehouse': 'Warehouse-A'}, {'item_code_with_bq': 'Item-001-BQ', 'qty': 100, 'po_box_qty': 20, 'uom': 'Nos'}, [[30, 'Warehouse-A']]) == {'doctype': 'Material Request', 'm...
{ "split": "train", "index": 74407, "acecode_id": "oss_28361", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are provided with a list of integers representing scores achieved in a game. Your task is to implement a function `highest_score(scores: List[int]) -> int` that returns the highest score achieved. If the input list is empty, the function should return 0. For example, if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_score([42, 56, 78, 91, 64, 29, 83]) == 91\", \"assert highest_score([10, 20, 30, 40, 50]) == 50\", \"assert highest_score([5, 1, 3, 2, 4]) == 5\", \"assert highest_score([]) == 0\", \"assert highest_score([-1, -2, -3, -4]) == -1\", \"assert highest_s...
{ "split": "train", "index": 74408, "acecode_id": "oss_20711", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-empty list of integers, implement a function that calculates the sum of all prime numbers located at even index positions in the list. A prime number is defined as a natural number greater than 1 that is not a product of two smaller natural numbers. Your function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_solution([10, 15, 23, 42]) == 23\", \"assert correct_solution([4, 6, 10, 12]) == 0\", \"assert correct_solution([3, 5, 11, 13]) == 14\", \"assert correct_solution([29, 10, 31, 50]) == 60\", \"assert correct_solution([1, 1, 1, 1, 1]) == 0\", \"assert ...
{ "split": "train", "index": 74409, "acecode_id": "evol_478", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Design a function that simulates the interaction of various components of a computer motherboard. The function should take in a dictionary representing the motherboard configuration with keys for 'processor', 'ram', 'rom', 'bios', 'storageDeviceConnectors', 'expandableSlots', a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_motherboard_interaction({'processor': 'AMD Ryzen 5', 'ram': '8GB', 'rom': 'Legacy BIOS', 'bios': 'BIOS v2.0', 'storageDeviceConnectors': 'M.2', 'expandableSlots': 'PCI', 'ports': 'HDMI'}) == 'During startup, BIOS v2.0 initializes the AMD Ryzen 5 pro...
{ "split": "train", "index": 74410, "acecode_id": "evol_16133", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given the root of a binary tree where each node has a value of either 0 or 1. Each path from the root to a leaf node represents a binary number, with the most significant bit at the root. Your task is to implement a function that calculates the sum of the binary numbers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sumRootToLeaf(TreeNode(0)) == 0\", \"assert sumRootToLeaf(TreeNode(1)) == 1\", \"assert sumRootToLeaf(TreeNode(1, TreeNode(1))) == 3\", \"assert sumRootToLeaf(TreeNode(0, TreeNode(0), TreeNode(0))) == 0\", \"assert sumRootToLeaf(TreeNode(1, TreeNode(1, TreeN...
{ "split": "train", "index": 74411, "acecode_id": "evol_27194", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of exception handling in Python. The function 'handle_exception' should take two parameters: 'current_exception' which can be an exception object or None, and 'default_exception_class' which is a class repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_exception(RuntimeError('An error occurred'), ValueError) == 'An error occurred'\", \"assert handle_exception(None, ValueError) == 'default_message'\", \"assert handle_exception(Exception('Custom exception'), RuntimeError) == 'Custom exception'\", \"as...
{ "split": "train", "index": 74412, "acecode_id": "bigcode_python_fns_46453", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. Write a function `calculate_average_score(scores)` that takes in a list of integers `scores` (2 <= len(scores) <= 100) and returns the average score of the game, excluding the highest and lowest scores. The ave...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([10, 20, 30, 40, 50]) == 30.0\", \"assert calculate_average_score([5, 5, 5, 5, 5]) == 5.0\", \"assert calculate_average_score([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average_score([100, 200, 300]) == 200.0\", \"assert calculate_...
{ "split": "train", "index": 74413, "acecode_id": "oss_30541", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with building a configuration for a distributed file system. Given the following inputs: a list of slurm nodes, a list of metadata servers, a list of object storage servers, a filesystem name, a list of metadata devices, a list of object storage devices, an inter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_config(['node1', 'node2'], ['mds1'], ['oss1'], 'my_fs', ['mdt1'], ['ost1'], 'my_net', '/mnt', 0) == {'nodes': ['node1', 'node2'], 'device': None, 'mdt_device': ['mdt1'], 'ost_device': ['ost1'], 'mds_list': ['mds1'], 'oss_list': ['oss1'], 'client_list':...
{ "split": "train", "index": 74414, "acecode_id": "bigcode_python_fns_31741", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a given square matrix and performs a specific operation on it. Write a function `process_square_matrix(A, B)` that takes in two parameters: - `A`: a 2D list representing a square matrix of integers - `B`: a 2D li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_square_matrix([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[5, 12], [21, 32]]\", \"assert process_square_matrix([[0, 0], [0, 0]], [[1, 2], [3, 4]]) == [[0, 0], [0, 0]]\", \"assert process_square_matrix([[1]], [[2]] ) == [[2]]\", \"assert process_square_ma...
{ "split": "train", "index": 74415, "acecode_id": "oss_4436", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a dictionary that categorizes people based on the number of genes they are assumed to possess. The dictionary contains three keys: 'no_genes', 'one_gene', and 'two_genes'. Each key maps to a list of names. Write a function `countGenes(person, geneSetDictionary)` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countGenes('Alice', {'no_genes': ['Bob'], 'one_gene': ['Charlie'], 'two_genes': ['David']}) == 0\", \"assert countGenes('Charlie', {'no_genes': ['Bob'], 'one_gene': ['Charlie'], 'two_genes': ['David']}) == 1\", \"assert countGenes('David', {'no_genes': ['Bob...
{ "split": "train", "index": 74416, "acecode_id": "bigcode_python_fns_47671", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates transactions on a simple bank account. The function should accept a list of transactions, where each transaction is represented as a tuple with the first element being a string ('deposit' or 'withdraw') and the second e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_final_balance([('deposit', 100), ('withdraw', 50)]) == 50\", \"assert calculate_final_balance([('deposit', 200), ('deposit', -50), ('withdraw', 100)]) == 100\", \"assert calculate_final_balance([('withdraw', 100), ('deposit', 150)]) == 150\", \"ass...
{ "split": "train", "index": 74417, "acecode_id": "oss_9192", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a multi-dimensional array containing four inner arrays, each with three integer elements sorted in ascending order, write a function that rearranges all numbers in this multi-dimensional array to descending order and returns the modified multi-dimensional array. Each inne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_to_desc([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) == [[12, 11, 10], [9, 8, 7], [6, 5, 4], [3, 2, 1]]\", \"assert rearrange_to_desc([[13, 15, 17], [12, 14, 16], [9, 11, 10], [5, 8, 7]]) == [[17, 16, 15], [14, 13, 12], [11, 10, 9], [8, 7, 5]]\...
{ "split": "train", "index": 74418, "acecode_id": "evol_9530", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a social media post which contains a list of comments. Each comment has the following properties: 'author', 'comment', 'contentType', 'id', and 'published' (in ISO 8601 format). Write a function `extract_comments(post: Dict[str, Any]) -> ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_comments({'posts': [{'comments': [{'author': 'Alice', 'comment': 'Great post!', 'contentType': 'text', 'id': '1', 'published': '2023-01-01T12:00:00.000Z'}, {'author': 'Bob', 'comment': 'Thanks for sharing!', 'contentType': 'text', 'id': '2', 'publish...
{ "split": "train", "index": 74419, "acecode_id": "bigcode_python_fns_42589", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a command to delete a specific message from a list of messages. Write a function `delete_message(command, msgList, toDelete)` that takes in a command (string), a list of messages `msgList` (list of strings), and a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_message('delete 1', ['Hello', 'World'], []) == [1]\", \"assert delete_message('delete 2', ['Hello', 'World'], [1]) == [1, 2]\", \"assert delete_message('delete 1', ['Hello', 'World'], [1]) == [1]\", \"assert delete_message('delete 3', ['Hello', 'World...
{ "split": "train", "index": 74420, "acecode_id": "oss_6803", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of integers and returns the sum of all the prime numbers present in that list. If the list is empty or contains non-integer values, return a meaningful error message instead.\nPlease reason step by step, then write a self-contained Python solu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_primes_in_list([2, 3, 4, 5, 6]) == 10\", \"assert sum_primes_in_list([]) == 'The list is empty or contains non-integer values.'\", \"assert sum_primes_in_list([1, 4, 6, 8]) == 0\", \"assert sum_primes_in_list([7, 11, 13]) == 31\", \"assert sum_primes_in_...
{ "split": "train", "index": 74421, "acecode_id": "evol_20642", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two mutually exclusive integers as parameters and returns the product of these two integers. For example, given the integers 10 and 15, the function should return 150.\nPlease reason step by step, then write a self-contained Python solution. Give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply(10, 15) == 150\", \"assert multiply(0, 5) == 0\", \"assert multiply(-1, 1) == -1\", \"assert multiply(2, 3) == 6\", \"assert multiply(-4, -5) == 20\", \"assert multiply(7, 0) == 0\", \"assert multiply(100, 1) == 100\", \"assert multiply(-10, 2) == -...
{ "split": "train", "index": 74422, "acecode_id": "evol_24370", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with comparing two tuples element by element. Implement a function `tuple_compare_lt(left: Tuple[int], right: Tuple[int]) -> bool` that returns True if the first tuple is less than the second tuple according to the following rules: Compare the elements of the tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tuple_compare_lt((1, 2, 3), (1, 2, 4)) == True\", \"assert tuple_compare_lt((1, 2, 3), (1, 2, 3)) == False\", \"assert tuple_compare_lt((1, 2), (1, 2, 3)) == True\", \"assert tuple_compare_lt((1, 3), (1, 2)) == False\", \"assert tuple_compare_lt((2, 2, 2), (...
{ "split": "train", "index": 74423, "acecode_id": "bigcode_python_fns_40645", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a configuration dictionary for a web application. The dictionary contains settings for a Flask application, including database connection details and security configurations. Your function should check if all the req...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_config({'name': 'app', 'engine': 'sqlite', 'user': 'admin', 'SECRET_KEY': 'secret', 'SECURITY_REGISTERABLE': True, 'SECURITY_SEND_REGISTER_EMAIL': False, 'SECURITY_PASSWORD_SALT': 'salt', 'SECURITY_FLASH_MESSAGES': True, 'SECURITY_URL_PREFIX': '/sec...
{ "split": "train", "index": 74424, "acecode_id": "oss_2585", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers representing the prices of a stock on different days. Write a function that calculates the maximum profit that can be achieved by buying and selling the stock once. If no profit can be made, return 0. The function should take in a list of pric...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxProfit([7, 1, 5, 3, 6, 4]) == 5\", \"assert maxProfit([7, 6, 4, 3, 1]) == 0\", \"assert maxProfit([1, 2, 3, 4, 5]) == 4\", \"assert maxProfit([5, 4, 3, 2, 1]) == 0\", \"assert maxProfit([2, 1, 2, 1, 2]) == 1\", \"assert maxProfit([3, 2, 6, 5, 0, 3]) == 4\...
{ "split": "train", "index": 74425, "acecode_id": "evol_29083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the total amount of transactions for a given date range. You are given a list of transactions, where each transaction is represented as a string in the format 'date,amount' (e.g., '2022-01-01,100.50'). The date is i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_transactions(['2022-01-01,100.50', '2022-01-02,75.25', '2022-01-03,125.75', '2022-01-04,50.00'], '2022-01-02', '2022-01-03') == 201.00\", \"assert calculate_total_transactions(['2022-01-01,50.00', '2022-01-01,50.00', '2022-01-01,50.00'], '202...
{ "split": "train", "index": 74426, "acecode_id": "oss_27920", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `selection_sort(arr: List[int], ascending: bool) -> List[int]` that sorts an array of integers using the selection sort algorithm. The function should take two parameters: an array of integers `arr` and a boolean `ascending`. If `ascending` is True, the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert selection_sort([4, 1, 10, 8, 5], True) == [1, 4, 5, 8, 10]\", \"assert selection_sort([4, 1, 10, 8, 5], False) == [10, 8, 5, 4, 1]\", \"assert selection_sort([], True) == []\", \"assert selection_sort([], False) == []\", \"assert selection_sort([1, 1, 1], Tr...
{ "split": "train", "index": 74427, "acecode_id": "evol_22465", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a numerical array of distinct integers, write a function `get_first_n_elements(arr, n)` that returns the first `n` distinct elements from the array. If the array contains fewer than `n` elements, return 'Not enough elements in the array'.\nPlease reason step by step, then...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_n_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5) == [1, 2, 3, 4, 5]\", \"assert get_first_n_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert get_first_n_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 15) == 'Not...
{ "split": "train", "index": 74428, "acecode_id": "evol_28574", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that returns the maximum value found in the array. If the array is empty, return None.\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 findMax([8, 1, 2, -1, 4, 9]) == 9\", \"assert findMax([-5, -1, -2, -3]) == -1\", \"assert findMax([1, 2, 3, 4, 5]) == 5\", \"assert findMax([10]) == 10\", \"assert findMax([0, 0, 0]) == 0\", \"assert findMax([3, 1, 4, 1, 5, 9, 2]) == 9\", \"assert findMax([-...
{ "split": "train", "index": 74429, "acecode_id": "evol_13675", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array (matrix) of integers, implement a function that computes the minimum and maximum values of the elements in the array. The function should return these values in a dictionary with keys 'min' and 'max'. You can assume that the input array will always contain at l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_max([[1, 2, 3], [4, 5, 6]]) == {'min': 1, 'max': 6}\", \"assert find_min_max([[5, -1], [0, 3], [2, 4]]) == {'min': -1, 'max': 5}\", \"assert find_min_max([[7]]) == {'min': 7, 'max': 7}\", \"assert find_min_max([[1, 1], [1, 1]]) == {'min': 1, 'max': ...
{ "split": "train", "index": 74430, "acecode_id": "bigcode_python_fns_21808", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing static override features, where each dictionary contains a 'feature', 'location', and 'value', implement a function that extracts the feature override values into a nested dictionary. The output should be a dictionary where each key is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_feature_overrides([{'feature': 'A', 'location': 'X', 'value': 1}, {'feature': 'A', 'location': 'Y', 'value': 2}, {'feature': 'B', 'location': 'X', 'value': 3}]) == {'A': {'X': 1, 'Y': 2}, 'B': {'X': 3}}\", \"assert extract_feature_overrides([{'featur...
{ "split": "train", "index": 74431, "acecode_id": "bigcode_python_fns_31949", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function `convert_to_lowercase(strings: List[str]) -> List[str]` that converts all the strings in the list to lowercase. The function should return a new list containing the lowercase versions of the original strings. You may assume that the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_lowercase(['Hello', 'World']) == ['hello', 'world']\", \"assert convert_to_lowercase(['Python', 'Is', 'Fun']) == ['python', 'is', 'fun']\", \"assert convert_to_lowercase(['LeetCode', 'Challenges']) == ['leetcode', 'challenges']\", \"assert convert...
{ "split": "train", "index": 74432, "acecode_id": "bigcode_python_fns_35023", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_prime(n)` that determines if a number is a prime number. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function should return True for prime numbers and False for non-prime number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(6) == False\", \"assert is_prime(101) == True\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(9) == False\", \"assert is_prime(13) == True\", \"ass...
{ "split": "train", "index": 74433, "acecode_id": "evol_4760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `perform_operation` that takes three parameters: a string `operation` which can be 'addition', 'subtraction', 'multiplication', or 'division', and two complex numbers `a` and `b`. Each complex number is represented as a tuple of two integers (real part, ima...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operation('addition', (4, 3), (20, -5)) == (24, -2)\", \"assert perform_operation('subtraction', (4, 3), (20, -5)) == (-16, 8)\", \"assert perform_operation('addition', (0, 0), (0, 0)) == (0, 0)\", \"assert perform_operation('subtraction', (1, 1), (1...
{ "split": "train", "index": 74434, "acecode_id": "evol_33548", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `make_palindrome(string: str) -> str` that constructs the most succinct palindrome from the given input string. The function should first remove all non-alphanumeric characters and convert the string to lowercase. Then, it should detect the longest palindro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('@cat$') == 'catac'\", \"assert make_palindrome('race , car!') == 'racecar'\", \"assert make_palindrome('abc') == 'abcba'\", \"assert make_palindrome('abccba') == 'abccba'\", \"assert make_palindrome('123...
{ "split": "train", "index": 74435, "acecode_id": "evol_25980", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that takes as input two lists of integers, list1 and list2, and returns a new list that contains the sum of corresponding elements from both lists. If the lists are of different lengths, consider the missing elements in the shorter list as 0. Additionally, impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_lists([1, 2, 3], [4, 5, 6]) == [5, 7, 9]\", \"assert add_lists([1, 2], [3, 4, 5]) == [4, 6, 5]\", \"assert add_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert add_lists([1, 2, 3], []) == [1, 2, 3]\", \"assert add_lists([1], [2, 3, 4]) == [3, 3, 4]\", \"ass...
{ "split": "train", "index": 74436, "acecode_id": "evol_31510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of participants in a competition. Your task is to determine the minimum number of participants who scored at least the k-th highest score. Write a function `min_participants_scored_kth_highest` that takes in the number of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_participants_scored_kth_highest(5, 1, [1, 1, 1, 1, 1]) == 5\", \"assert min_participants_scored_kth_highest(7, 4, [10, 20, 20, 30, 30, 40, 50]) == 4\", \"assert min_participants_scored_kth_highest(3, 2, [15, 10, 20]) == 2\", \"assert min_participants_sco...
{ "split": "train", "index": 74437, "acecode_id": "oss_12525", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function that returns a dictionary of the least frequently used words in a given text along with the indices of their appearances. The function should also handle potential syntax errors in the input string. If the input is invalid, the function should return an empty d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert least_frequent_words('Hello world hello') == {'world': [1]}\", \"assert least_frequent_words('') == {}\", \"assert least_frequent_words('abc abc abc def ghi ghi') == {'def': [3]}\", \"assert least_frequent_words('abc! abc? abc. def, ghi; ghi:') == {'def': [3...
{ "split": "train", "index": 74438, "acecode_id": "evol_18823", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the daily activity count of a user over a period of days. Your task is to implement a function that calculates the total activity count over the last week (7 days). The function should take a list of integers as input and return a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_activity_count([1, 2, 3, 4, 5, 6, 7]) == 28\", \"assert total_activity_count([1, 2, 3]) == 6\", \"assert total_activity_count([5, 5, 5, 5, 5, 5, 5, 5]) == 35\", \"assert total_activity_count([1, 1, 1, 1, 1, 1, 1, 1, 1]) == 7\", \"assert total_activity_...
{ "split": "train", "index": 74439, "acecode_id": "bigcode_python_fns_18284", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts and validates the author's name and email from a given setup configuration dictionary. The setup configuration dictionary contains information about a Python package, including the author and author's email. Your func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_author_info({'author': 'John Doe', 'author_email': 'john.doe@example.com'}) == ('John Doe', True)\", \"assert validate_author_info({'author': 'Jane Smith', 'author_email': 'jane.smith@domain.co'}) == ('Jane Smith', True)\", \"assert validate_author_...
{ "split": "train", "index": 74440, "acecode_id": "oss_36940", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates cat names based on specific criteria. Write a function called `is_valid_cat_name(name: str) -> bool` that takes a string `name` as input and returns `True` if the name is valid and `False` otherwise. A valid cat name must m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_cat_name('Whiskers') == True\", \"assert is_valid_cat_name('Kitty') == True\", \"assert is_valid_cat_name('Max') == True\", \"assert is_valid_cat_name('Fluffy') == True\", \"assert is_valid_cat_name('') == False\", \"assert is_valid_cat_name('A very...
{ "split": "train", "index": 74441, "acecode_id": "oss_37", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings `a` and `b`, write a function `cyc_pattern_check(a: str, b: str) -> bool` that checks if any cyclic rotation of string `b` is a substring of string `a`. A cyclic rotation of a string is achieved by moving characters from the start of the string to the end. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cyc_pattern_check('hello world', 'orl') == True\", \"assert cyc_pattern_check('abcdef', 'cde') == True\", \"assert cyc_pattern_check('abcd', 'dabc') == True\", \"assert cyc_pattern_check('abc', 'abc') == True\", \"assert cyc_pattern_check('abc', 'abcd') == F...
{ "split": "train", "index": 74442, "acecode_id": "evol_23503", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a representation of user subscriptions to different channels in a messaging application. Each user can subscribe to multiple channels, and each channel has a specific purpose. You need to define a function `create_user_subscription(user: str, channe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user_subscription('Alice', ['nextevent', 'resources']) == {'user': 'Alice', 'channels_subscribe': ['nextevent', 'resources']}\", \"assert create_user_subscription('Bob', ['feedback', 'hire']) == {'user': 'Bob', 'channels_subscribe': ['feedback', 'hire...
{ "split": "train", "index": 74443, "acecode_id": "oss_33681", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that calculates the arithmetic mean of the numbers in the list and returns the integer that is closest to this mean. If there are two integers equally close to the mean, return the smaller integer. You may assume that the list will...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_closest_to_mean([4, 7, 15, 22, 30]) == 15\", \"assert find_closest_to_mean([1, 2, 3, 4, 5]) == 3\", \"assert find_closest_to_mean([10, 20, 30]) == 20\", \"assert find_closest_to_mean([1, 100]) == 1\", \"assert find_closest_to_mean([5, 5, 5, 5]) == 5\", ...
{ "split": "train", "index": 74444, "acecode_id": "evol_4905", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `determine_winner(player_choice: str, computer_choice: str) -> str` that simulates a single round of the game Rock, Paper, Scissors. The function takes in two parameters: `player_choice`, a string representing the player's choice whic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_winner('rock', 'scissors') == 'Player wins!'\", \"assert determine_winner('scissors', 'paper') == 'Player wins!'\", \"assert determine_winner('paper', 'rock') == 'Player wins!'\", \"assert determine_winner('rock', 'paper') == 'Computer wins!'\", \"...
{ "split": "train", "index": 74445, "acecode_id": "bigcode_python_fns_15971", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a class that contains two methods: one is an instance method and the other is a static method. Implement a function `call_methods` that takes an instance of the class and calls both methods in the specified order. The function should return a list containing the o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert call_methods(Test()) == ['Called method_one', 'Called method_two']\", \"assert call_methods(Test()) == ['Called method_one', 'Called method_two']\", \"assert call_methods(Test()) == ['Called method_one', 'Called method_two']\", \"assert call_methods(Test()) ...
{ "split": "train", "index": 74446, "acecode_id": "evol_24055", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that separates the harmonic components of the list by applying a harmonic separation algorithm. You need to implement the function `harmonic_separation` which takes in a list of integers representing audio samples and a margin value (d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert harmonic_separation([10, 5, 3, 1, 0], 3.0) == [7, 2, 0, 0, 0]\", \"assert harmonic_separation([3, 3, 3, 3, 3], 2.0) == [1, 1, 1, 1, 1]\", \"assert harmonic_separation([15, 10, 5, 20, 25], 5.0) == [10, 5, 0, 15, 20]\", \"assert harmonic_separation([0, 0, 0, 0...
{ "split": "train", "index": 74447, "acecode_id": "bigcode_python_fns_25238", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_process_state` that simulates the retrieval of the state of a debugged process. The function takes variable arguments which represent different parameters that could affect the state of the process. The function should return an inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_process_state('run') == 1\", \"assert get_process_state('pause') == 2\", \"assert get_process_state('terminate') == 3\", \"assert get_process_state() == 0\", \"assert get_process_state('process', 'is', 'running') == 1\", \"assert get_process_state('curre...
{ "split": "train", "index": 74448, "acecode_id": "bigcode_python_fns_43264", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing device information in the format 'Location: http://<ip_address>:<port>\\nl-devicename: <device_name>'. Your task is to implement a function that extracts the device names and their corresponding IP addresses from the input list and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_device_info(['Location: http://192.168.1.1:80\\\\nl-devicename: Living Room']) == {'Living Room': '192.168.1.1'}\", \"assert extract_device_info(['Location: http://192.168.1.2:80\\\\nl-devicename: Bedroom', 'Location: http://192.168.1.3:80\\\\nl-devi...
{ "split": "train", "index": 74449, "acecode_id": "bigcode_python_fns_47814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that can parse and extract information from C function declarations. The function declarations are written in a specific format and may span multiple lines. Your program should be able to identify the function name, its arguments, and the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_function_declaration('int add(int a, int b)') == {'function_name': 'add', 'return_type': 'int', 'arguments': ['int a', 'int b']}\", \"assert parse_function_declaration('void print_message(char* message)') == {'function_name': 'print_message', 'return_t...
{ "split": "train", "index": 74450, "acecode_id": "oss_23632", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `remove_last_item(lst)` that removes the last element from a given list of characters and returns the updated list. If the list is empty, it should return an empty list. For example, if the input is `['x', 'y', 'z']`, the output should be `['x', 'y']`.\nPlease ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_last_item(['a', 'b', 'c', 'd']) == ['a', 'b', 'c']\", \"assert remove_last_item(['x', 'y', 'z']) == ['x', 'y']\", \"assert remove_last_item(['p']) == []\", \"assert remove_last_item([]) == []\", \"assert remove_last_item(['m', 'n']) == ['m']\", \"asse...
{ "split": "train", "index": 74451, "acecode_id": "evol_8419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two linked lists, determine the values that are present in both lists (i.e., the intersection of the two lists). The function should return a list of these values while maintaining the order of their first appearance in the first list. The linked lists are unsorted and ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linked_list_intersection(ListNode(1), ListNode(2)) == []\", \"assert linked_list_intersection(ListNode(1), ListNode(1)) == [1]\", \"assert linked_list_intersection(ListNode(1), ListNode(1)) == [1]\", \"assert linked_list_intersection(ListNode(1, ListNode(2, ...
{ "split": "train", "index": 74452, "acecode_id": "evol_28760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `http_take_solver(request_data: dict) -> dict` that takes a dictionary `request_data` as input, which contains a key 'data' that maps to a list of integers. The function should process this list by returning a new dictionary containing the sum o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert http_take_solver({'data': [1, 2, 3, 4, 5]}) == {'sum': 15, 'average': 3.0}\", \"assert http_take_solver({'data': [10, 20, 30]}) == {'sum': 60, 'average': 20.0}\", \"assert http_take_solver({'data': [-1, -2, -3, -4]}) == {'sum': -10, 'average': -2.5}\", \"ass...
{ "split": "train", "index": 74453, "acecode_id": "bigcode_python_fns_49789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of words, write a function that checks if all words in the list are valid English words according to a predefined lexicon. The function should return true if all words are present in the lexicon, and false if any word is not recognized. The function signature is: d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_all_words_english(['hello', 'world', 'goodbye']) == True\", \"assert is_all_words_english(['hello', 'computer', 'python']) == True\", \"assert is_all_words_english(['hello', 'world', 'fksgks']) == False\", \"assert is_all_words_english(['python', 'java', ...
{ "split": "train", "index": 74454, "acecode_id": "evol_15124", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of distinct integers representing the heights of statues. A statue is considered to be a consecutive number if it is within a range of consecutive integers. Your task is to determine the minimum number of additional statues needed to make the statues cons...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert makeArrayConsecutive2([6, 2, 3, 8]) == 3\", \"assert makeArrayConsecutive2([0, 3]) == 2\", \"assert makeArrayConsecutive2([1, 2, 3, 4]) == 0\", \"assert makeArrayConsecutive2([5, 10]) == 4\", \"assert makeArrayConsecutive2([0, 20]) == 19\", \"assert makeArra...
{ "split": "train", "index": 74455, "acecode_id": "oss_37208", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a command line input as a string or a list of arguments. Your task is to determine if the command is valid or not. A command is considered valid if it is one of the predefined valid commands: ['start', 'stop', 'restart', 'status']. Implement a function `is_valid_c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_command('start') == True\", \"assert is_valid_command('stop') == True\", \"assert is_valid_command('restart') == True\", \"assert is_valid_command('status') == True\", \"assert is_valid_command('invalid_command') == False\", \"assert is_valid_comman...
{ "split": "train", "index": 74456, "acecode_id": "bigcode_python_fns_29138", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the ages of athletes participating in a competition. Your task is to implement a function that takes this list as input and returns a dictionary with the count of athletes in each age category. The age categories are defined as foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_athletes_by_age_category([10, 15, 25, 30, 40, 60, 70]) == {'0-12': 1, '13-19': 1, '20-39': 2, '40-59': 1, '60+': 2}\", \"assert count_athletes_by_age_category([]) == {'0-12': 0, '13-19': 0, '20-39': 0, '40-59': 0, '60+': 0}\", \"assert count_athletes_b...
{ "split": "train", "index": 74457, "acecode_id": "bigcode_python_fns_35007", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function called `can_it_fly` that determines if an object represented by a list of integers, `q`, can take flight based on two criteria: the list must be palindromic (the same forwards and backwards) and the sum of its elements must not exceed a maximum weight `w`. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_it_fly([1, 2, 1], 5) == True\", \"assert can_it_fly([1, 2, 3], 5) == False\", \"assert can_it_fly([5, 5, 5], 15) == True\", \"assert can_it_fly([1, 2, 3, 2, 1], 10) == True\", \"assert can_it_fly([1, 2, 3, 4, 5], 5) == False\", \"assert can_it_fly([1, 1,...
{ "split": "train", "index": 74458, "acecode_id": "evol_10391", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function that removes all duplicates and sorts the list alphabetically. The function should take a single parameter, a list of strings, and return a new list containing the unique strings sorted in alphabetical order.\nPlease reason step by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates_and_sort(['cat', 'dog', 'dog', 'horse', 'cat']) == ['cat', 'dog', 'horse']\", \"assert remove_duplicates_and_sort(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert remove_duplicates_and_sort(['zebra', 'lio...
{ "split": "train", "index": 74459, "acecode_id": "evol_33834", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that removes a specific `infohash` from a list of unique identifiers. The `infohash` is a string that uniquely identifies a piece of information. Your function should take a list of strings (infohashes) and a string (infohash) as inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_infohash(['hash1', 'hash2', 'hash3'], 'hash2') == ['hash1', 'hash3']\", \"assert remove_infohash(['hash1', 'hash2', 'hash3'], 'hash4') == ['hash1', 'hash2', 'hash3']\", \"assert remove_infohash([], 'hash1') == []\", \"assert remove_infohash(['hash1'],...
{ "split": "train", "index": 74460, "acecode_id": "oss_6883", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that generates a list containing the squared values of the first twenty odd integers and sorts this list in ascending order without using any built-in Python sorting functions. The first twenty odd integers are 1, 3, 5, ..., 39. Return the sorted list.\nPlease...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_list([1, 9, 25, 49, 81, 121, 169, 225, 289, 361, 441, 529, 625, 729, 841, 961, 1089, 1225, 1369, 1521]) == [1, 9, 25, 49, 81, 121, 169, 225, 289, 361, 441, 529, 625, 729, 841, 961, 1089, 1225, 1369, 1521]\", \"assert sorted_list([1, 9, 25, 49, 81, 121...
{ "split": "train", "index": 74461, "acecode_id": "evol_21070", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that cleans and converts a given string representation of a number by removing any commas. The input string is guaranteed to represent a valid integer with possible comma separators. Your function should return the integer value after the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_and_convert('1,234') == 1234\", \"assert clean_and_convert('12,345,678') == 12345678\", \"assert clean_and_convert('1') == 1\", \"assert clean_and_convert('100,000') == 100000\", \"assert clean_and_convert('10,000,000') == 10000000\", \"assert clean_an...
{ "split": "train", "index": 74462, "acecode_id": "bigcode_python_fns_1811", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of words and an integer `n`, and returns a list of words that have exactly `n` letters. The function should only return unique words, and the output list should be sorted in alphabetical order. If no words match the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_words_by_length(['apple', 'banana', 'pear', 'grape', 'kiwi'], 5) == ['apple', 'grape']\", \"assert filter_words_by_length(['dog', 'cat', 'bat', 'rat'], 3) == ['bat', 'cat', 'dog', 'rat']\", \"assert filter_words_by_length(['a', 'b', 'c', 'd', 'e'], 1)...
{ "split": "train", "index": 74463, "acecode_id": "bigcode_python_fns_39874", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the occurrence IDs of some events. Write a function `filter_occurrences(occurrences: List[int], last_id: int) -> Tuple[List[int], int]` that takes in a list of integers `occurrences` and an integer `last_id`. The function should fil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_occurrences([1, 3, 2, 5, 4], 2) == ([5, 4, 3], 5)\", \"assert filter_occurrences([1, 1, 1, 1, 1], 1) == ([], 1)\", \"assert filter_occurrences([], 5) == ([], 5)\", \"assert filter_occurrences([10, 20, 30, 40], 35) == ([40], 40)\", \"assert filter_occu...
{ "split": "train", "index": 74464, "acecode_id": "bigcode_python_fns_48175", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a consistent tensor represented as a list of floating point numbers, implement a function `to_local_tensor(tensor_list: List[float]) -> List[float]` that returns the local tensor as a list of the same floating point numbers. The input list will always represent a consiste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_local_tensor([0.5, 0.6, 0.7]) == [0.5, 0.6, 0.7]\", \"assert to_local_tensor([1.0, 2.0, 3.0]) == [1.0, 2.0, 3.0]\", \"assert to_local_tensor([-1.0, -2.0, -3.0]) == [-1.0, -2.0, -3.0]\", \"assert to_local_tensor([0.0]) == [0.0]\", \"assert to_local_tensor(...
{ "split": "train", "index": 74465, "acecode_id": "bigcode_python_fns_1238", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists representing the constraints of a robot's motion. The first list contains the velocity limits and the second list contains the acceleration limits. Your task is to determine whether the robot can maintain a non-negative velocity and acceleration across a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_robot_move([5, 10, 15], [2, 3, 4]) == True\", \"assert can_robot_move([0, 0, 0], [0, 0, 0]) == True\", \"assert can_robot_move([-1, 2, 3], [2, 3, 4]) == False\", \"assert can_robot_move([1, 2, 3], [-1, 2, 3]) == False\", \"assert can_robot_move([5, 10, 1...
{ "split": "train", "index": 74466, "acecode_id": "bigcode_python_fns_46134", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that simulates a simple text editor with find and replace functionality. Your goal is to implement a function `find_and_replace(text: str, word_to_find: str, replacement_word: str) -> Tuple[str, int]` that takes three parameters: \n- `text...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_and_replace('The quick brown fox', 'fox', 'cat') == ('The quick brown cat', 1)\", \"assert find_and_replace('Hello world', 'world', 'there') == ('Hello there', 1)\", \"assert find_and_replace('aaa aaa aaa', 'aaa', 'bbb') == ('bbb bbb bbb', 3)\", \"asser...
{ "split": "train", "index": 74467, "acecode_id": "oss_27422", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_gold_value_in_currency(weight: float, currency: str, gold_price_per_gram: float, exchange_rate: float) -> float` that calculates the market value of a given weight of gold in a specified currency. The function should take in the weight of gold in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_gold_value_in_currency(100, 'EUR', 50.0, 0.85) == 4250.0\", \"assert calculate_gold_value_in_currency(0, 'USD', 50.0, 1.0) == 0.0\", \"assert calculate_gold_value_in_currency(-10, 'USD', 50.0, 1.0) == 0.0\", \"assert calculate_gold_value_in_currenc...
{ "split": "train", "index": 74468, "acecode_id": "evol_4075", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a tuple that may contain integers, floats, booleans, strings, lists, dictionaries, and nested tuples, implement a function that returns a new tuple containing only the even integers, even floats, and strings that represent even integers. All other elements (including odd ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert purge_odd_and_nonnumeric((1, 2, 3, 4)) == (2, 4)\", \"assert purge_odd_and_nonnumeric((1.0, 2.0, 3.0, 4.0)) == (2.0, 4.0)\", \"assert purge_odd_and_nonnumeric((1, 2, '4', '5', 6.0, '7.0')) == (2, '4', 6.0)\", \"assert purge_odd_and_nonnumeric((True, False, 2...
{ "split": "train", "index": 74469, "acecode_id": "evol_4864", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `self_arranging_search(arr: List[int], target: int) -> bool` that simulates a self-arranging list. The function should take an array of integers and a target integer as input. If the target is found in the array, it should be moved to the front of the array...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert self_arranging_search([1, 2, 3, 4, 5], 3) == True\", \"assert self_arranging_search([5, 1, 2, 3, 4], 1) == True\", \"assert self_arranging_search([10, 20, 30, 40], 20) == True\", \"assert self_arranging_search([7, 8, 9], 5) == False\", \"assert self_arrangin...
{ "split": "train", "index": 74470, "acecode_id": "evol_35202", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tick marks, create a function that returns a dictionary representing an axis configuration for a bar plot. The dictionary should contain the 'min' and 'max' values, where 'min' is -0.75 and 'max' is the length of the ticks minus 0.25. The function should also in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_axis([0.1, 0.2, 0.3]) == {'min': -0.75, 'max': 2.75, 'ticks': [0.1, 0.2, 0.3]}\", \"assert generate_axis([1.0, 2.0, 3.0, 4.0]) == {'min': -0.75, 'max': 3.75, 'ticks': [1.0, 2.0, 3.0, 4.0]}\", \"assert generate_axis([]) == {'min': -0.75, 'max': -0.25...
{ "split": "train", "index": 74471, "acecode_id": "bigcode_python_fns_44411", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a serializer for a simple Tweet model in a Python application. The Tweet model has three fields: author, content, and likes, and you are required to implement a function that accepts a dictionary representation of a Tweet and returns a serialized ve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_tweet({'author': 'Alice', 'content': 'Hello World!', 'likes': 5}) == {'author': 'Alice', 'content': 'Hello World!'}\", \"assert serialize_tweet({'author': 'Bob', 'content': 'Python is great!', 'likes': 10}) == {'author': 'Bob', 'content': 'Python i...
{ "split": "train", "index": 74472, "acecode_id": "oss_1318", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function `generate_primes_in_range(start: int, end: int) -> List[int]` that returns a list of all prime numbers within a given range, inclusive of the start and end values. The function should take two integers, `start` and `end`, where 1 <= start <= end <= 100. The out...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes_in_range(20, 50) == [23, 29, 31, 37, 41, 43, 47]\", \"assert generate_primes_in_range(1, 10) == [2, 3, 5, 7]\", \"assert generate_primes_in_range(10, 20) == [11, 13, 17, 19]\", \"assert generate_primes_in_range(21, 30) == [23, 29]\", \"assert...
{ "split": "train", "index": 74473, "acecode_id": "evol_26686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a base key represented as a string and a dictionary that contains existing keys. Your task is to implement a function `next_key(basekey: str, keys: dict[str, Any]) -> str` that returns the next unused key for the given base key. The first attempt for the next key ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert next_key('key', {'key': 1}) == 'key-2'\", \"assert next_key('key', {'key': 1, 'key-2': 2}) == 'key-3'\", \"assert next_key('key', {}) == 'key'\", \"assert next_key('key', {'key': 1, 'key-3': 3}) == 'key-2'\", \"assert next_key('base', {'base': 1, 'base-2': 2...
{ "split": "train", "index": 74474, "acecode_id": "bigcode_python_fns_25597", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of an LED blinking based on given parameters. You need to implement a function `simulate_led_blinking(blink_duration: int, frequency: float) -> List[str]` that takes two parameters: `blink_duration` (an integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_led_blinking(0, 1) == []\", \"assert simulate_led_blinking(2, 0) == []\", \"assert simulate_led_blinking(-1, 1) == []\", \"assert simulate_led_blinking(1, 3) == ['Time 0: LED is ON']\", \"assert simulate_led_blinking(1, 5) == ['Time 0: LED is ON']\"...
{ "split": "train", "index": 74475, "acecode_id": "oss_15419", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple command line interface (CLI) that provides information about its functionality. Implement a function `cli_info()` that simulates the behavior of a CLI. The function should return a string that includes the message 'lazypredict.cli.main' and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cli_info() == 'lazypredict.cli.main\\\\n--help Show this message and exit.'\", \"assert cli_info() != ''\", \"assert 'lazypredict.cli.main' in cli_info()\", \"assert '--help Show this message and exit.' in cli_info()\", \"assert cli_info().count('\\\\n') =...
{ "split": "train", "index": 74476, "acecode_id": "bigcode_python_fns_28275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of floating-point numbers and sorts the list in descending order based solely on their fractional parts. Non-numerical values should be ignored during sorting. The function should return a new list with the sorted values. For example, give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fractional_sort([0.1, 0.2, 0.3, 0.4]) == [0.4, 0.3, 0.2, 0.1]\", \"assert fractional_sort([5.5, 5.1, 5.4, 5.9]) == [5.9, 5.5, 5.4, 5.1]\", \"assert fractional_sort([0.999, 0.001, 0.5]) == [0.999, 0.5, 0.001]\", \"assert fractional_sort([1.23, 2.34, None, 'te...
{ "split": "train", "index": 74477, "acecode_id": "evol_30290", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a string of text, write a function that tokenizes the text into individual words and builds a vocabulary dictionary where each unique word is a key and its index (the first occurrence in the list) is the value. Additionally, create a reverse vocabulary dictionary where th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_vocab('hello world') == ({'hello': 0, 'world': 1}, {0: 'hello', 1: 'world'})\", \"assert build_vocab('apple banana apple orange') == ({'apple': 0, 'banana': 1, 'orange': 3}, {0: 'apple', 1: 'banana', 3: 'orange'})\", \"assert build_vocab('one two three...
{ "split": "train", "index": 74478, "acecode_id": "oss_22395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `word` and a string `Input`, implement a function `CorrectOrWrong(Input: str, word: str) -> bool` that checks if the string `Input` is a substring of the string `word`. The function should return `True` if `Input` is found within `word`, and `False` otherwise. Bo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert CorrectOrWrong('cat', 'concatenation') == True\", \"assert CorrectOrWrong('dog', 'goodbye') == False\", \"assert CorrectOrWrong('hello', 'hello world') == True\", \"assert CorrectOrWrong('world', 'hello world') == True\", \"assert CorrectOrWrong('python', 'j...
{ "split": "train", "index": 74479, "acecode_id": "bigcode_python_fns_13081", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of words. Your task is to implement a function that groups these words by their first letter. The function should return a dictionary where the keys are the first letters of the words, and the values are lists of words that start with that letter. The words...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_words_by_first_letter(['apple', 'banana', 'avocado', 'blueberry', 'cherry', 'apricot']) == {'a': ['apple', 'avocado', 'apricot'], 'b': ['banana', 'blueberry'], 'c': ['cherry']}\", \"assert group_words_by_first_letter(['dog', 'cat', 'deer', 'bat', 'bear...
{ "split": "train", "index": 74480, "acecode_id": "bigcode_python_fns_37907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that implements the quick sort algorithm. The function should take a list of integers as input and return a new list that contains the sorted integers in ascending order. Include a multi-line comment that explains how the quick sort algorithm works in a general...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quick_sort([3, 2, 1]) == [1, 2, 3]\", \"assert quick_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert quick_sort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert quick_sort([]) == []\", \"assert quick_sort([2]) == [2]\", \"assert quick_sort([1, 2, 3, 4,...
{ "split": "train", "index": 74481, "acecode_id": "evol_33287", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that serializes a given Python object into a JSON string. The function should support custom serialization for objects of a specific type, which we'll call CustomType. If the object is of type CustomType, it should be serialized to a stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_object({'key': 'value'}) == '{\\\"key\\\": \\\"value\\\"}'\", \"assert serialize_object(CustomType(name='test', value=42)) == '{\\\"custom_name\\\": \\\"test\\\", \\\"custom_value\\\": 42}'\", \"assert serialize_object([1, 2, 3]) == '[1, 2, 3]'\", ...
{ "split": "train", "index": 74482, "acecode_id": "bigcode_python_fns_47545", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that returns the kth smallest prime number from the array. If there are fewer than k prime numbers in the array, return 'Not enough prime numbers in the array'.\nPlease reason step by step, then write a self-contained Python solution...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findKthSmallestPrime([10, 3, 5, 7, 11], 1) == 3\", \"assert findKthSmallestPrime([10, 3, 5, 7, 11], 2) == 5\", \"assert findKthSmallestPrime([10, 3, 5, 7, 11], 3) == 7\", \"assert findKthSmallestPrime([10, 3, 5, 7, 11], 4) == 11\", \"assert findKthSmallestPr...
{ "split": "train", "index": 74483, "acecode_id": "evol_8654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that filters a list of file paths based on inclusion and exclusion patterns. The function should take in a list of file paths, an inclusion pattern, and an exclusion pattern, and return a filtered list of file paths based on these ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_file_paths(['project/main.py', 'project/utils/helper.py', 'project/tests/test_main.py', 'project/config.ini'], 'project/*', ['project/tests/*', 'project/config.ini']) == ['project/main.py', 'project/utils/helper.py']\", \"assert filter_file_paths(['da...
{ "split": "train", "index": 74484, "acecode_id": "oss_13566", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D matrix of integers, write a function that returns a new 2D matrix where all prime numbers are replaced with 1 and all non-prime numbers are replaced with 0. The input matrix will have dimensions up to 100x100.\nPlease reason step by step, then write a self-contained ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert primes_in_matrix([[2, 3], [4, 5]]) == [[1, 1], [0, 1]]\", \"assert primes_in_matrix([[1, 0, -1], [7, 9, 10]]) == [[0, 0, 0], [1, 0, 0]]\", \"assert primes_in_matrix([[11, 13], [15, 17]]) == [[1, 1], [0, 1]]\", \"assert primes_in_matrix([[4, 6], [8, 9]]) == [...
{ "split": "train", "index": 74485, "acecode_id": "evol_2554", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `manage_database_session` that simulates the behavior of a database session manager. The function should accept a boolean parameter `should_raise`. If `should_raise` is set to True, it should simulate an exception during the database sessi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_database_session(False) == 'Session opened and closed successfully'\", \"assert manage_database_session(True) == 'Session failed due to an exception'\", \"assert manage_database_session(False) == 'Session opened and closed successfully'\", \"assert ma...
{ "split": "train", "index": 74486, "acecode_id": "oss_7477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of fixtures for a football league, where each fixture is represented as a dictionary containing the details of a match, including the 'gameweek', 'home_team', 'away_team', and 'date'. Implement a function `find_fixture(fixtures: List[Dict[str, Union[int, st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_fixture([{'gameweek': 1, 'home_team': 'Team A', 'away_team': 'Team B', 'date': '2023-01-01'}, {'gameweek': 1, 'home_team': 'Team C', 'away_team': 'Team A', 'date': '2023-01-02'}], 1, 'Team A', True) == {'gameweek': 1, 'home_team': 'Team A', 'away_team':...
{ "split": "train", "index": 74487, "acecode_id": "bigcode_python_fns_27320", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves information about bike availability in different postcodes. Your function should take a postcode as input and return a dictionary with two keys: 'postcode_info' and 'bike_availability'. The 'postcode_info' key should contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_bike_info('12345') == {'postcode_info': 'Downtown', 'bike_availability': 5}\", \"assert get_bike_info('54321') == {'postcode_info': 'Uptown', 'bike_availability': 0}\", \"assert get_bike_info('00000') == {'error': 'Postcode information not found'}\", \"a...
{ "split": "train", "index": 74488, "acecode_id": "oss_6726", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a given list of strings that represent variable names. Your function should take a list of strings, and for each string, it should return a new list where each string is transformed to a new key based on the following rules...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_variable_names(['_leading_underscore', 'trailing_underscore_', 'middle_underscore_']) == [' leading underscore', 'trailing underscore ', 'middle underscore ']\", \"assert transform_variable_names(['singleword', 'two_words_here']) == ['singleword', ...
{ "split": "train", "index": 74489, "acecode_id": "bigcode_python_fns_15598", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that takes an array of integers as input and returns a new array containing the elements of the input array in reverse order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_array([7, 5, 9, 1, 6, 4]) == [4, 6, 1, 9, 5, 7]\", \"assert reverse_array([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_array([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_array([0, -1, -2]) == [-2, -1, 0]\", \"assert reverse_array([]) ...
{ "split": "train", "index": 74490, "acecode_id": "evol_10552", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested list structure where each element can be either an integer or another nested list, write a function `count_occurrences(nested_list: List[Union[int, List]], target: int) -> int` that counts how many times the integer `target` appears in the entire structure. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_occurrences([1, [2, [1]], 1], 1) == 3\", \"assert count_occurrences([], 1) == 0\", \"assert count_occurrences([1, 2, 3, 4], 5) == 0\", \"assert count_occurrences([1, [1, [1]]], 1) == 3\", \"assert count_occurrences([1, [2, 3], [2, [2, 2]]], 2) == 4\", ...
{ "split": "train", "index": 74491, "acecode_id": "bigcode_python_fns_9652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `reset_device()` that simulates the reset of a computing device's state. This function should not take any parameters and should return a string indicating the device's state after the reset. The expected output should be 'Device rese...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_device() == 'Device reset successfully.'\", \"assert reset_device() == 'Device reset successfully.'\", \"assert reset_device() == 'Device reset successfully.'\", \"assert reset_device() == 'Device reset successfully.'\", \"assert reset_device() == 'Dev...
{ "split": "train", "index": 74492, "acecode_id": "bigcode_python_fns_32191", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a JSON object representing image annotations in a machine learning project. The object contains a list of regions, where each region has associated region attributes. Your task is to write a function that extracts the region attributes from each region and stores ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_region_attributes({'regions': [{'region_attributes': {'class': 'cat', 'color': 'black'}}, {'region_attributes': {'class': 'dog', 'color': 'brown'}}]}) == [{'class': 'cat', 'color': 'black'}, {'class': 'dog', 'color': 'brown'}]\", \"assert extract_reg...
{ "split": "train", "index": 74493, "acecode_id": "oss_17637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `compare_blank_index(ctc_blank_index: int, cfg_blank_index: int) -> None` that compares two integers representing the blank indices of a CTCBeamDecoder object and a protobuf configuration. The function should raise an AssertionError if the two indices are n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_blank_index(0, 0) is None\", \"assert compare_blank_index(1, 1) is None\", \"assert compare_blank_index(2, 2) is None\", \"assert compare_blank_index(3, 3) is None\", \"assert compare_blank_index(4, 4) is None\", \"assert compare_blank_index(5, 5) is...
{ "split": "train", "index": 74494, "acecode_id": "oss_32565", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a configuration dictionary for a web application. The configuration should include the application's title, description, and various settings for middleware, database connections, and other features. Write a function `creat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_config(True, 'My Project', 'This is a sample project.') == {'debug': True, 'title': 'My Project', 'description': 'This is a sample project.', 'docs_url': '/api/v1/docs', 'redoc_url': '/api/v1/redocs', 'openapi_url': '/api/v1/openapi.json', 'middleware...
{ "split": "train", "index": 74495, "acecode_id": "bigcode_python_fns_23378", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a data splitting algorithm for a dataset used in machine learning. Write a function `split_data` that takes the following parameters: \n- `data`: A list of tuples, where each tuple represents a data point and its corresponding label. \n- `train_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_data([(1, 'a'), (2, 'b'), (3, 'c')], 0.67, False) == ([(1, 'a'), (2, 'b')], [(3, 'c')])\", \"assert split_data([(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')], 0.5, False) == ([(1, 'a'), (2, 'b')], [(3, 'c'), (4, 'd')])\", \"assert split_data([(1, 'a'), (2, '...
{ "split": "train", "index": 74496, "acecode_id": "oss_4750", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the PEOE VSA (Partial Equalization of Orbital Electronegativities - Valence Surface Area) descriptors for a given molecule. The function will take a list of partial charges as input and return a dictionary where each key is a string representing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_peoe_vsa([-0.3]) == {'PEOEVSA0': -0.3}\", \"assert calculate_peoe_vsa([-0.25, 0.0]) == {'PEOEVSA0': -0.25, 'PEOEVSA1': 0.0}\", \"assert calculate_peoe_vsa([0.1, 0.2, 0.3]) == {'PEOEVSA0': 0.1, 'PEOEVSA1': 0.2, 'PEOEVSA2': 0.3}\", \"assert calculate...
{ "split": "train", "index": 74497, "acecode_id": "bigcode_python_fns_19515", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function that calculates the area of a triangle given its base length and height. The area can be calculated using the formula: area = 0.5 * base * height. The function should raise a ValueError if either the base or the height is less than or equal to zero. Implement t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triangle_area(5, 3) == 7.5\", \"assert triangle_area(10, 4) == 20.0\", \"assert triangle_area(1, 1) == 0.5\", \"assert triangle_area(0.5, 2) == 0.5\", \"assert triangle_area(6, 2) == 6.0\", \"assert triangle_area(7, 3.5) == 12.25\", \"assert triangle_area(12...
{ "split": "train", "index": 74498, "acecode_id": "evol_31936", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary tree represented as a list, where the element at index i has its left child at index 2*i + 1 and right child at index 2*i + 2, implement a function `find_matches(tree: List[int], target: int) -> List[int]` that returns a list of all the values in the tree that ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_matches([], 3) == []\", \"assert find_matches([1, 2, 3], 2) == [2]\", \"assert find_matches([1, 2, 3], 4) == []\", \"assert find_matches([5], 5) == [5]\", \"assert find_matches([10, 20, 30, 40], 20) == [20]\", \"assert find_matches([10, 20, 30, 40, 50],...
{ "split": "train", "index": 74499, "acecode_id": "bigcode_python_fns_24975", "num_tests": 16 }