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": "Given a data layout type as a string, implement a function that returns a specific implementation name for a bitserial convolution operation based on the provided layout. The input will be a string 'layout' which can be either 'NCHW', 'NHWC', or any other string indicating an u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_bitserial_conv2d_implementation('NCHW') == 'bitserial_conv2d_nchw.hls'\", \"assert get_bitserial_conv2d_implementation('NHWC') == 'bitserial_conv2d_nhwc.hls'\", \"assert get_bitserial_conv2d_implementation('NHWC') == 'bitserial_conv2d_nhwc.hls'\", \"asse...
{ "split": "train", "index": 73700, "acecode_id": "bigcode_python_fns_14842", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `contains_negative_integer(numbers)` that takes a list of numerical entities and returns `True` if there is at least one negative whole number in the list, and `False` otherwise. A whole number is defined as an integer without a fractional part.\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_negative_integer([10, -5, 4, 20]) == True\", \"assert contains_negative_integer([1, 2, 3, 4]) == False\", \"assert contains_negative_integer([-1, 0, 1]) == True\", \"assert contains_negative_integer([]) == False\", \"assert contains_negative_integer...
{ "split": "train", "index": 73701, "acecode_id": "evol_28288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of room numbers in a building and a set of room numbers that have already been visited. Your task is to write a function `count_unvisited_rooms(all_rooms, visited_rooms)` that takes in the list `all_rooms`, which contains the room numbers, and the set `visi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unvisited_rooms([101, 102, 103, 104, 105], {102, 104}) == 3\", \"assert count_unvisited_rooms([1, 2, 3, 4, 5], {2, 3}) == 3\", \"assert count_unvisited_rooms([10, 20, 30, 40, 50], {10, 20, 30}) == 2\", \"assert count_unvisited_rooms([7, 8, 9], set()) =...
{ "split": "train", "index": 73702, "acecode_id": "oss_25637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a program to process a list of tasks concurrently. Each task is represented by a function that takes no arguments and returns a result. Your goal is to design a solution that efficiently utilizes multiple threads to execute these tasks in parall...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_tasks([lambda: 1, lambda: 2, lambda: 3], 2) == [1, 2, 3]\", \"assert execute_tasks([lambda: 5, lambda: 10, lambda: 15], 1) == [5, 10, 15]\", \"assert execute_tasks([lambda: 10, lambda: 20, lambda: 30, lambda: 40], 2) == [10, 20, 30, 40]\", \"assert e...
{ "split": "train", "index": 73703, "acecode_id": "oss_31803", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of voxel sizes in millimeters, write a function that calculates the average voxel size. The input will be a list of positive integers representing the sizes of individual voxels. Return the average size rounded to two decimal places. If the list is empty, return 0....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_voxel_size([10, 20, 30]) == 20.00\", \"assert average_voxel_size([5, 15, 25, 35]) == 20.00\", \"assert average_voxel_size([1, 2, 3, 4, 5]) == 3.00\", \"assert average_voxel_size([9]) == 9.00\", \"assert average_voxel_size([100, 200]) == 150.00\", \"a...
{ "split": "train", "index": 73704, "acecode_id": "bigcode_python_fns_15551", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates the reversal of a transaction in a simplified system. The function should take a list of transactions and a transaction ID to revert. Each transaction is represented as a dictionary with keys 'id', 'is_reverted', 'balance_ch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert revert_transaction([{'id': 1, 'is_reverted': False, 'balance_change': 50, 'client_balance': 100, 'item': {'is_quantifiable': True, 'quantity': 5}, 'client': {'balance': 100}}, {'id': 2, 'is_reverted': False, 'balance_change': 30, 'client_balance': 40, 'item'...
{ "split": "train", "index": 73705, "acecode_id": "bigcode_python_fns_39244", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that sends a message to a list of recipients using a messaging protocol. The function should take the following parameters: a sender's identifier (string), a password (string), a list of receivers (list of strings), the message body (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_message('john', 'password123', ['alice', 'bob'], 'Hello!') == 2\", \"assert send_message('jane@domain.com', 'mypassword', ['charlie@domain.com'], 'Hi there!') == 1\", \"assert send_message('user', 'pass', [], 'Empty receivers should return 0') == 0\", \...
{ "split": "train", "index": 73706, "acecode_id": "bigcode_python_fns_8276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that receives a non-empty array of positive integers and returns all unique integers that satisfy the following conditions: 1) The frequency of the integer in the array surpasses half of the integer's value. 2) The frequency is a prime number. 3) The array ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert distinctive_elements([1, 1, 1, 1, 2, 3]) == []\", \"assert distinctive_elements([1, 2, 3, 5, 8]) == []\", \"assert distinctive_elements([1, 1, 1, 3, 3, 3, 5, 5]) == []\", \"assert distinctive_elements([5, 5, 5, 5, 5, 14]) == []\", \"assert distinctive_elemen...
{ "split": "train", "index": 73707, "acecode_id": "evol_32955", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a set of points in a 2D space and a boundary defined by unit vectors and distances from the origin, determine if each point lies inside or outside the defined boundary. You will receive two inputs: a list of points `check_points` where each point is represented as a tuple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contour_check([(1, 2), (2, 1)], [ [(0, 1), (1, 0)], [1, 1], (0, 0)]) == [True, True]\", \"assert contour_check([(5, 3), (3, 5)], [ [(1, 0), (0, 1)], [4, 4], (0, 0)]) == [False, False]\", \"assert contour_check([(2, 0), (0, 2)], [ [(1, 0), (0, 1)], [2, 2], (0...
{ "split": "train", "index": 73708, "acecode_id": "bigcode_python_fns_40318", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of filenames representing model checkpoints in the format 'address/$NAME_acc_XX.YY_ppl_XX.YY_eZZ.pt', write a function that retrieves valid model information based on specific criteria. The criteria for a valid model name are: the name must start with a specific pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_valid_models(['test_acc_0.75_ppl_0.3_e5.pt', 'example_acc_0.78_ppl_0.4_e12.pt'], 'test', 0.8) == ['test']\", \"assert retrieve_valid_models(['sample_acc_0.95_ppl_0.5_e3.pt'], 'sample', 1.0) == ['sample']\", \"assert retrieve_valid_models(['example_a...
{ "split": "train", "index": 73709, "acecode_id": "bigcode_python_fns_27342", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that extracts the list of class names defined within a given module. The module is represented as a string containing class definitions and an `__all__` list that specifies the classes to be exported. Your function should parse...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_exported_classes(\\\"class ClassA: pass\\\\n\\\\nclass ClassB: pass\\\\n\\\\n__all__ = ['ClassA', 'ClassB']\\\") == ['ClassA', 'ClassB']\", \"assert extract_exported_classes(\\\"class ClassX: pass\\\\n\\\\nclass ClassY: pass\\\\n\\\\n__all__ = ['Clas...
{ "split": "train", "index": 73710, "acecode_id": "oss_30524", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array `A` of positive integers, write a function that calculates the sum of the digits of the minimum and maximum elements in the array. Let `S` be the sum of the digits of the minimal element and `M` be the sum of the digits of the maximum element. Return 0 if `S` is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sumOfDigits([9,18,27]) == 3\", \"assert sumOfDigits([1]) == 3\", \"assert sumOfDigits([55,55,55]) == 2\", \"assert sumOfDigits([10,11,12]) == 3\", \"assert sumOfDigits([22,33,44]) == 2\", \"assert sumOfDigits([8,8,8]) == 2\"]}" }
{ "split": "train", "index": 73711, "acecode_id": "evol_35483", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a string representation of a timestamp in the format 'YYYY-MM-DD HH:MM:SS', write a function that encodes this timestamp into a specific dictionary format. The function should return a dictionary with the following structure: {'__kind__': 'timestamp', 'class': 'Timestamp'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_timestamp('2023-10-01 12:30:00') == {'__kind__': 'timestamp', 'class': 'Timestamp', 'args': ['2023-10-01 12:30:00'], 'kwargs': {'freq': None}}\", \"assert encode_timestamp('2022-01-15 08:45:00') == {'__kind__': 'timestamp', 'class': 'Timestamp', 'args...
{ "split": "train", "index": 73712, "acecode_id": "bigcode_python_fns_43468", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary with three key-value pairs where the keys are strings and the values are integers. Write a function `update_values(d: dict, operation: str, operand: int) -> None` that updates the values in the dictionary based on the specified mathematical operation....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_values({'a': 1, 'b': 2, 'c': 3}, 'multiply', 2) == None and {'a': 2, 'b': 4, 'c': 6} == {'a': 2, 'b': 4, 'c': 6}\", \"assert update_values({'x': 10, 'y': 20, 'z': 30}, 'divide', 10) == None and {'x': 1, 'y': 2, 'z': 3} == {'x': 1, 'y': 2, 'z': 3}\", \...
{ "split": "train", "index": 73713, "acecode_id": "evol_9510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given three inputs: a list of 3D tensors called `verify_predictions`, a list of scalar probabilities called `evidence_predictions`, and a list of validation examples called `val_examples`. Each tensor in `verify_predictions` represents prediction probabilities for a cla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert partition_preds_by_scrape_type([[[0.1, 0.9]], [[0.2, 0.8]]], [0.7, 0.5], [{'metadata': '{\\\"scrape_type\\\": \\\"type1\\\"}'}, {'metadata': '{\\\"scrape_type\\\": \\\"type2\\\"}'}]) == ({'type1': [[[0.1, 0.9]]], 'type2': [[[0.2, 0.8]]]}, {'type1': [0.7], 't...
{ "split": "train", "index": 73714, "acecode_id": "bigcode_python_fns_328", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers, write a function `find_max_row_sum(arr)` that returns a tuple containing two elements: the row with the maximum sum and a list of the sums of each row in the array. If two or more rows have the same maximum sum, return the first one found. The inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_row_sum([[2, 5, 6, 8], [4, 1, 3, 5], [5, 9, 0, 7], [7, 1, 2, 0]]) == ([2, 5, 6, 8], [21, 13, 21, 10])\", \"assert find_max_row_sum([[1, 2], [3, 4], [5, 6]]) == ([5, 6], [3, 7, 11])\", \"assert find_max_row_sum([[10, 20], [30, 40], [20, 20]]) == ([30...
{ "split": "train", "index": 73715, "acecode_id": "evol_15844", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that processes a list of incident records and returns a summary of the incidents with their respective severity levels. Each incident record is represented as a dictionary containing the keys 'name', 'severity', and 'rawJSON'. Your functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_incidents([{'name': 'Incident A', 'severity': 1, 'rawJSON': '{}'}, {'name': 'Incident B', 'severity': 2, 'rawJSON': '{}'}]) == [{'name': 'Incident A', 'severity': 1}, {'name': 'Incident B', 'severity': 2}]\", \"assert summarize_incidents([{'name': ...
{ "split": "train", "index": 73716, "acecode_id": "bigcode_python_fns_48538", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that replaces elements with a specified replacement value based on their frequency in the list. If an element appears more than a given threshold times, it should be replaced with the replacement value. The function should return a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_frequent_elements([1, 1, 1, 2, 3, 3, 4], 1, 9) == [9, 9, 9, 2, 9, 9, 4]\", \"assert replace_frequent_elements([10, 10, 10, 10, 20, 20], 3, 99) == [99, 99, 99, 99, 20, 20]\", \"assert replace_frequent_elements([1, 2, 3, 4, 5], 2, -1) == [1, 2, 3, 4, 5...
{ "split": "train", "index": 73717, "acecode_id": "bigcode_python_fns_46465", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with calculating product statistics based on an array of product objects. Each product has the following attributes: 'name' (string), 'price' (number), and 'category' (string). Your task is to implement a function that takes a list of these product objects and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_product_statistics([{ 'name': 'Laptop', 'price': 1200, 'category': 'Electronics' }, { 'name': 'Headphones', 'price': 150, 'category': 'Electronics' }, { 'name': 'T-shirt', 'price': 25, 'category': 'Clothing' }, { 'name': 'Jeans', 'price': 50, 'cate...
{ "split": "train", "index": 73718, "acecode_id": "oss_31677", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `insert_words(words: List[str]) -> Set[str]` that takes a list of strings and returns a set of unique strings that have been successfully inserted into a data structure representing a catalogue. The function should ensure that duplicate strings are not coun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_words(['apple', 'banana', 'apple', 'orange']) == {'apple', 'banana', 'orange'}\", \"assert insert_words(['hello', 'world', 'hello']) == {'hello', 'world'}\", \"assert insert_words(['python', 'java', 'c++', 'python']) == {'python', 'java', 'c++'}\", \"...
{ "split": "train", "index": 73719, "acecode_id": "evol_20551", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that merges two strings together without using any built-in functions. The function should take two strings as input and return a single string that contains the characters of both strings concatenated in the order they appear. The function should be def...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_strings('abc', 'def') == 'abcdef'\", \"assert merge_strings('Hello', 'World') == 'HelloWorld'\", \"assert merge_strings('', 'NonEmpty') == 'NonEmpty'\", \"assert merge_strings('NonEmpty', '') == 'NonEmpty'\", \"assert merge_strings('', '') == ''\", \"a...
{ "split": "train", "index": 73720, "acecode_id": "evol_35267", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even integers from the original list, in the same order they appeared. Write a function named `filter_even_numbers` that accomplishes this task. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numb...
{ "split": "train", "index": 73721, "acecode_id": "bigcode_python_fns_42267", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of expenses represented as tuples, where each tuple contains the (id, amount, category), implement a function that returns the total amount spent in a specified category. If the category does not exist in the expenses, return 0. The function signature should be: de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_spent_in_category([(1, 50.0, 'Food'), (2, 20.0, 'Transport'), (3, 30.0, 'Food')], 'Food') == 80.0\", \"assert total_spent_in_category([(1, 50.0, 'Food'), (2, 20.0, 'Transport')], 'Transport') == 20.0\", \"assert total_spent_in_category([(1, 50.0, 'Food...
{ "split": "train", "index": 73722, "acecode_id": "bigcode_python_fns_28224", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing an observation dataset. Each dataset is represented as a key-value pair where the key is a string and the value is another dictionary containing various attributes. Your task is to implement a function that checks if the dataset contains ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_labels_pred({'obs': {'labels_pred': [1, 2, 3]}}) == True\", \"assert check_labels_pred({'obs': {}}) == False\", \"assert check_labels_pred({'obs': {'other_key': [1, 2, 3]}}) == False\", \"assert check_labels_pred({'obs': {'labels_pred': 'some_value'}})...
{ "split": "train", "index": 73723, "acecode_id": "bigcode_python_fns_12823", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of integers and calculates the sum of all the even numbers in the list. The function should handle both positive and negative integers and should ignore any non-integer inputs. If there are no even numbers in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_even_sum([1, 2, 3, 4, 5, 6]) == 12\", \"assert calculate_even_sum([1, 3, 5, 7]) == 0\", \"assert calculate_even_sum([-2, -4, -6]) == -12\", \"assert calculate_even_sum([2, 4, 6, 8]) == 20\", \"assert calculate_even_sum([1, 2, 'a', 'b', 3]) == 2\", ...
{ "split": "train", "index": 73724, "acecode_id": "oss_32236", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines the effective principals for a given request. The effective principals are the set of users or groups that have access to a particular resource. Your function should take a dictionary `request` as input, which may or m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert effective_principals({'credentials': {'login': 'User1'}}) == ['Everyone', 'User1']\", \"assert effective_principals({'credentials': {'login': 'Admin'}}) == ['Everyone', 'Admin']\", \"assert effective_principals({'credentials': {'login': 'Guest'}}) == ['Every...
{ "split": "train", "index": 73725, "acecode_id": "oss_29251", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the management of a WebSocket server's connections. Your function should take a list of socket IDs that represent index sockets and another list of socket IDs that represent control sockets. The function will return a d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_sockets(['socket1', 'socket2'], ['socketA', 'socketB']) == {'index_sockets': {'socket1', 'socket2'}, 'control_sockets': {'socketA', 'socketB'}}\", \"assert manage_sockets(['socket1', 'socket1'], ['socketA', 'socketA']) == {'index_sockets': {'socket1'}...
{ "split": "train", "index": 73726, "acecode_id": "oss_3799", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers that may contain adjacent duplicate values. Write a function `remove_adjacent_duplicates(values: List[int]) -> List[int]` that takes this list as input and returns a new list containing the values of the original list, but with all adjacent dupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_adjacent_duplicates([1, 1, 2, 3, 3, 2, 1]) == [1, 2, 3, 2, 1]\", \"assert remove_adjacent_duplicates([1, 2, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_adjacent_duplicates([5, 5, 5, 5, 5]) == [5]\", \"assert remove_adjacent_duplicates([])...
{ "split": "train", "index": 73727, "acecode_id": "bigcode_python_fns_11861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `generate_colorbar_label` that takes in two parameters: `standard_name` (string) and `units` (string). The function should return a formatted colorbar label based on the provided standard name and units, following the format 'Standard Name (Units)'.\nPle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_colorbar_label('Temperature', '\\u00b0C') == 'Temperature (\\u00b0C)'\", \"assert generate_colorbar_label('Salinity', 'PSU') == 'Salinity (PSU)'\", \"assert generate_colorbar_label('Pressure', 'hPa') == 'Pressure (hPa)'\", \"assert generate_colorbar...
{ "split": "train", "index": 73728, "acecode_id": "oss_13200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a command-line tool that can perform various operations based on the provided arguments. Your task is to implement a feature that allows the tool to display its version when a specific argument is provided. You need to implement a function `display_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert display_version('1.0.0', True) == '1.0.0'\", \"assert display_version('2.5.1', True) == '2.5.1'\", \"assert display_version('0.9.8', False) == ''\", \"assert display_version('3.3.3', False) == ''\", \"assert display_version('4.1.2', True) == '4.1.2'\", \"ass...
{ "split": "train", "index": 73729, "acecode_id": "oss_10321", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string consisting of consecutive lowercase letters, implement a function that generates all possible unique permutations of that string and returns them as a list sorted in lexicographical order. The input string will contain only unique characters. Write a function `ge...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_permutations('abcd') == ['abcd', 'abdc', 'acbd', 'acdb', 'adbc', 'adcb', 'bacd', 'badc', 'bcad', 'bcda', 'bdac', 'bdca', 'cabd', 'cadb', 'cbad', 'cbda', 'cdab', 'cdba', 'dabc', 'dacb', 'dbac', 'dbca', 'dcab', 'dcba']\", \"assert generate_permutation...
{ "split": "train", "index": 73730, "acecode_id": "evol_4651", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple stack data structure. The stack should support the following operations: 1. 'push(item)': Add an item to the top of the stack. 2. 'pop()': Remove and return the item at the top of the stack. 3. 'peek()': Return the item at the top of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_stack_operations([('push', 1), ('push', 2), ('pop', None)]) == [2]\", \"assert simple_stack_operations([('push', 3), ('peek', None)]) == [3]\", \"assert simple_stack_operations([('push', 4), ('is_empty', None), ('pop', None)]) == [4]\", \"assert simpl...
{ "split": "train", "index": 73731, "acecode_id": "oss_26032", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a string as an input parameter and checks if the string contains the term 'Python' (case-sensitive). The function should return True if the term is found and False otherwise.\nPlease reason step by step, then write a self-contained Python solut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_python('Python is a programming language') == True\", \"assert contains_python('I love coding in Python!') == True\", \"assert contains_python('I prefer java over python') == False\", \"assert contains_python('The word Python is present here') == Tr...
{ "split": "train", "index": 73732, "acecode_id": "evol_22544", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `populate_song_templates(songs: List[List[str]]) -> str` that takes a list of songs, where each song is represented as a list of strings (numerals of the song), and returns a string indicating the result of populating a simulated data...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert populate_song_templates([['1', '2'], ['3', '4'], ['5']]) == 'DB Populated with 3 song(s).'\", \"assert populate_song_templates([['a', 'b', 'c'], ['d']]) == 'DB Populated with 2 song(s).'\", \"assert populate_song_templates([['1'], ['2'], ['3'], ['4'], ['5'],...
{ "split": "train", "index": 73733, "acecode_id": "bigcode_python_fns_38433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function called `find_second_smallest_unique` that takes a list of integers as input and returns the second smallest unique number in the list. If there is no such number, the function should return the string 'Invalid input: at least two unique numbers are required.'. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_second_smallest_unique([3, 1, 2]) == 2\", \"assert find_second_smallest_unique([1, 1, 1, 1]) == 'Invalid input: at least two unique numbers are required.'\", \"assert find_second_smallest_unique([]) == 'Invalid input: at least two unique numbers are req...
{ "split": "train", "index": 73734, "acecode_id": "evol_5291", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that returns the first element in a given iterable that satisfies a specific condition. If no such element is found, the function should return a specified default value. Implement a Python function named `custom_search` that takes th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_search([1, 2, 3, 4, 5], lambda x: x > 3, 'Not found') == 4\", \"assert custom_search(['apple', 'banana', 'cherry'], lambda x: 'a' in x, 'Not found') == 'apple'\", \"assert custom_search([], lambda x: x < 0, 'Empty') == 'Empty'\", \"assert custom_searc...
{ "split": "train", "index": 73735, "acecode_id": "oss_11762", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with managing a tree structure of tokens, where each token may have child tokens. Each token is represented by a unique string identifier. Implement a function called `delete_token_and_children(token: str, token_tree: Dict[str, List[str]]) -> List[str]` that take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_token_and_children('token3', {'token1': ['token2', 'token3'], 'token2': ['token4'], 'token3': []}) == ['token3']\", \"assert delete_token_and_children('token5', {'token1': ['token2', 'token3'], 'token2': ['token4'], 'token3': []}) == []\", \"assert de...
{ "split": "train", "index": 73736, "acecode_id": "bigcode_python_fns_46718", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a list of calculations stored in a cache. Each calculation is represented as a dictionary with the following keys: 'is_finished_ok' (a boolean indicating if the calculation finished successfully), 'extras' (a dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_cached([{'is_finished_ok': False, 'extras': {'cached_from': 1, '_aiida_hash': 'hash1'}, 'files': ['file1', 'file2']}]) == False\", \"assert validate_cached([{'is_finished_ok': True, 'extras': {'cached_from': 1, '_aiida_hash': 'wrong_hash'}, 'files':...
{ "split": "train", "index": 73737, "acecode_id": "bigcode_python_fns_31292", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a player's action in a game. The function should take in a player name (a string) and return a tuple containing the player's name repeated twice, an empty dictionary, and a list containing a specific message: 'Action co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unknown_action('Alice') == ('Alice', 'Alice', {}, ['Action could not be resolved, type better next time'])\", \"assert unknown_action('Bob') == ('Bob', 'Bob', {}, ['Action could not be resolved, type better next time'])\", \"assert unknown_action('Charlie') ...
{ "split": "train", "index": 73738, "acecode_id": "bigcode_python_fns_24903", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a variable `c` that has not been previously defined. Write a function `increment_variable()` that initializes `c` to 0 and then increments it by 1. The function should return the value of `c` after the increment. What value should the function return?\nPlease reas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment_variable() == 1\", \"assert increment_variable() == 1\", \"assert increment_variable() == 1\", \"assert increment_variable() == 1\", \"assert increment_variable() == 1\", \"assert increment_variable() == 1\", \"assert increment_variable() == 1\", \...
{ "split": "train", "index": 73739, "acecode_id": "oss_5533", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple form validation function for a course management system. The function should accept the details of a course, including its title (a string), a list of tags (strings), a list of instructors (strings), and a release date (in the format 'YYYY-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_course_form('Python 101', ['programming', 'python'], ['Alice', 'Bob'], '2023-10-01') == True\", \"assert validate_course_form('', ['programming', 'python'], ['Alice', 'Bob'], '2023-10-01') == False\", \"assert validate_course_form('Python 101', [], ...
{ "split": "train", "index": 73740, "acecode_id": "oss_20658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the average time taken by different smoothers for a numerical simulation based on given parameters. Implement a function `average_time_per_smoother` that takes the following parameters: \n- `R`: An integer parameter related to the simulation. \n-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_time_per_smoother(1, 2, 3, 4, ['Precond1', 'Precond2'], ['Element1'], ['Data1']) == {'Smoother1': 10.5, 'Smoother2': 12.3, 'Smoother3': 11.8}\", \"assert average_time_per_smoother(0, 0, 0, 0, [], [], []) == {'Smoother1': 10.5, 'Smoother2': 12.3, 'Smo...
{ "split": "train", "index": 73741, "acecode_id": "oss_29713", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that takes two lists as input parameters and combines the elements of the lists into a single dictionary. If the lists have different lengths, the shorter list should be dynamically resized by repeatedly cycling through its elements until it matches the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_lists(['a', 'b'], [1, 2]) == {'a': 1, 'b': 2}\", \"assert combine_lists(['a', 'b', 'c'], [1]) == {'a': 1, 'b': 1, 'c': 1}\", \"assert combine_lists(['a'], [1, 2, 3]) == {'a': 1}\", \"assert combine_lists(['x', 'y', 'z'], [100, 200, 300]) == {'x': 100...
{ "split": "train", "index": 73742, "acecode_id": "evol_3184", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a line of JSON data. Your task is to create a function that extracts the 'data' field from each JSON string, aggregates them into a list of dictionaries, and returns the JSON representation of this list. The input lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_data(['{\\\"data\\\": {\\\"id\\\": 1, \\\"text\\\": \\\"Hello\\\"}}', '{\\\"data\\\": {\\\"id\\\": 2, \\\"text\\\": \\\"World\\\"}}']) == '[{\\\"data\\\": {\\\"id\\\": 1, \\\"text\\\": \\\"Hello\\\"}}, {\\\"data\\\": {\\\"id\\\": 2, \\\"text\\\": \\\...
{ "split": "train", "index": 73743, "acecode_id": "bigcode_python_fns_2552", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a lazy import mechanism for Python modules. The function, `simulate_lazy_import`, should take three parameters: `module_name` (a string representing the name of the module to be imported), `symbol` (a string representing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_lazy_import('math', 'math_module', deprecation=100) is not None\", \"assert simulate_lazy_import('os', 'os_module') is not None\", \"assert simulate_lazy_import('sys', 'sys_module', deprecation=200) is not None\", \"assert simulate_lazy_import('json...
{ "split": "train", "index": 73744, "acecode_id": "oss_14803", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the effect of Pauli operators on a quantum state represented as a list of binary values. Implement a function `compute_action(basis_state, pauli_term, length)` that takes three parameters: 1. `basis_state` (list of integers): The initial quantum s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_action([0, 1, 0], 'sX', 3) == ([0, 1, 1], 1)\", \"assert compute_action([0, 0, 0], 'sZ', 3) == ([0, 0, 0], 1)\", \"assert compute_action([1, 1, 0], 'sX', 3) == ([1, 1, 1], 1)\", \"assert compute_action([0], 'sZ', 1) == ([0], 1)\", \"assert compute_ac...
{ "split": "train", "index": 73745, "acecode_id": "oss_13486", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `format_version` that takes two arguments: a tuple representing a version number and a tuple of integers representing extra version numbers. The version number tuple consists of three integers: (major, minor, patch). The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_version((1, 0, 0), (2,)) == 'miniirc v1.0.0 / miniirc_extras v2'\", \"assert format_version((2, 5, 3), (4,)) == 'miniirc v2.5.3 / miniirc_extras v4'\", \"assert format_version((0, 0, 1), (1,)) == 'miniirc v0.0.1 / miniirc_extras v1'\", \"assert format...
{ "split": "train", "index": 73746, "acecode_id": "oss_7795", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` consisting of lowercase English letters, write a function that finds the index of the first non-repeating character in the string. If there are no non-repeating characters, return -1. For example: Given the input \"leetcode\", the output should be 0, as the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert firstUniqChar('leetcode') == 0\", \"assert firstUniqChar('loveleetcode') == 2\", \"assert firstUniqChar('aabbcc') == -1\", \"assert firstUniqChar('abcde') == 0\", \"assert firstUniqChar('abca') == 1\", \"assert firstUniqChar('a') == 0\", \"assert firstUniqCh...
{ "split": "train", "index": 73747, "acecode_id": "oss_7803", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a version string for a custom integration manifest. Given a version string, your goal is to implement a function that checks if the version string is valid. A valid version string is defined as a non-empty string that contains only digits. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_version('1') == '1'\", \"assert validate_version('2.0') == 'Invalid'\", \"assert validate_version('lorem_ipsum') == 'Invalid'\", \"assert validate_version('') == 'Invalid'\", \"assert validate_version('1234') == '1234'\", \"assert validate_version('...
{ "split": "train", "index": 73748, "acecode_id": "bigcode_python_fns_31800", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary represents the frequency of words in a document (e.g., {'word1': count1, 'word2': count2}), write a function that merges these dictionaries into a single dictionary that contains the total frequency of each word across all docu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_vocabs([{'apple': 2, 'banana': 3}, {'banana': 2, 'orange': 1}], 3) == {'banana': 5, 'apple': 2, 'orange': 1}\", \"assert merge_vocabs([{'a': 1, 'b': 2}, {'b': 1, 'c': 3}], None) == {'b': 3, 'c': 3, 'a': 1}\", \"assert merge_vocabs([{'dog': 4}, {'cat': ...
{ "split": "train", "index": 73749, "acecode_id": "bigcode_python_fns_44894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing galaxy indices and a list of subpixel indices. Your task is to return a list of integers that contain the indices of galaxies whose indices are present in the subpixel indices list. If the subpixel indices list is empty, return all ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_galaxy_indices([1, 2, 3, 4, 5], [2, 4]) == [2, 4]\", \"assert get_galaxy_indices([10, 20, 30, 40, 50], [10]) == [10]\", \"assert get_galaxy_indices([7, 14, 21, 28], [14, 28]) == [14, 28]\", \"assert get_galaxy_indices([0, 1, 2, 3], []) == [0, 1, 2, 3]\",...
{ "split": "train", "index": 73750, "acecode_id": "bigcode_python_fns_22149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an entity represented as a dictionary with the fields 'name', 'age', and 'sex', implement a function `classify_entity(entity)` that classifies the entity based on their age into one of the following categories: 'Teenager' (age < 20), 'Young Adult' (20 <= age < 30), 'Adult...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_entity({'name': 'Alice', 'age': 15, 'sex': 'female'}) == 'Teenager'\", \"assert classify_entity({'name': 'Bob', 'age': 22, 'sex': 'male'}) == 'Young Adult'\", \"assert classify_entity({'name': 'Charlie', 'age': 35, 'sex': 'male'}) == 'Adult'\", \"as...
{ "split": "train", "index": 73751, "acecode_id": "evol_23022", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `contains_negative(numbers)` that takes a list of integers as input and returns `True` if there is at least one negative integer in the list, otherwise return `False`. The input list can contain both positive and negative integers, as well as zero.\nPlease ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_negative([1, 2, 3, 4]) == False\", \"assert contains_negative([-1, 2, 3, 4]) == True\", \"assert contains_negative([0, 1, 2, 3]) == False\", \"assert contains_negative([1, 0, -3, 4]) == True\", \"assert contains_negative([-10, -5, -1]) == True\", \"...
{ "split": "train", "index": 73752, "acecode_id": "evol_4015", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a configuration string and extracts the list of plugins specified in the 'DEFAULTS' section. The configuration string follows a simple format where each plugin is listed under the 'DEFAULTS' section, formatted as 'pl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_plugins('[DEFAULTS]\\\\nplugins = sanitizer, logger, validator') == ['sanitizer', 'logger', 'validator']\", \"assert extract_plugins('[DEFAULTS]\\\\nplugins = pluginA, pluginB') == ['pluginA', 'pluginB']\", \"assert extract_plugins('[DEFAULTS]\\\\npl...
{ "split": "train", "index": 73753, "acecode_id": "oss_18072", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of fuel stations represented by dictionaries containing the keys 'brand', 'e5', 'e10', 'diesel', and 'distance'. Write a function `get_fuel_station_info(stations: List[Dict[str, Union[str, float]]]) -> List[str]` that returns a list of formatted strings for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_fuel_station_info([]) == []\", \"assert get_fuel_station_info([{'brand': 'Esso', 'e5': 1.52, 'e10': 1.47, 'diesel': 1.57, 'distance': 3.3}, {'brand': 'Chevron', 'e5': 1.58, 'e10': 1.54, 'diesel': 1.62, 'distance': 2.1}]) == ['Brand: Esso, E5: 1.52, E10: ...
{ "split": "train", "index": 73754, "acecode_id": "bigcode_python_fns_36930", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a uniform distribution defined over a continuous range from 'l' to 'l + w', where 'l' is a real number and 'w' is a positive number. Implement a function `calculate_probabilities(l: float, w: float) -> Tuple[float, float]` that calculates the probabilities of a ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_probabilities(0, 1) == (0, 0)\", \"assert calculate_probabilities(-5, 10) == (0, 0)\", \"assert calculate_probabilities(1, 0) == (0, 0)\", \"assert calculate_probabilities(2.5, 3.5) == (0, 0)\", \"assert calculate_probabilities(-10, 5) == (0, 0)\",...
{ "split": "train", "index": 73755, "acecode_id": "bigcode_python_fns_47351", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function in Python that takes a list of elements (which may include integers, strings, or other data types) as input and identifies the maximum integer value from the list. If the input list is not well formatted (contains non-integer elements), your program should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum([2, 3, 5, 1]) == 5\", \"assert find_maximum([1, 2, 'a', 4]) == 4\", \"assert find_maximum([None, 'text', 5, 7]) == 7\", \"assert find_maximum([]) == None\", \"assert find_maximum([1.5, 2.5, '3.5', 4]) == 4\", \"assert find_maximum(['five', 5, 10...
{ "split": "train", "index": 73756, "acecode_id": "evol_15362", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a group of students in a test. Your task is to implement a function that calculates the average score, the maximum score, and the minimum score from the list. The function should return these three values in a tuple fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_scores([80, 90, 100]) == (90.0, 100, 80)\", \"assert calculate_scores([70, 85, 90, 95]) == (85.0, 95, 70)\", \"assert calculate_scores([60]) == (60.0, 60, 60)\", \"assert calculate_scores([100, 100, 100]) == (100.0, 100, 100)\", \"assert calculate_...
{ "split": "train", "index": 73757, "acecode_id": "bigcode_python_fns_15470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates random dad jokes from a predefined list. The function should return a random dad joke each time it is called. You are provided with a list of dad jokes and your goal is to implement a single function called `get_random_dad_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_random_dad_joke(['I told my wife she was drawing her eyebrows too high. She looked surprised.']) == 'I told my wife she was drawing her eyebrows too high. She looked surprised.'\", \"assert get_random_dad_joke(['Why did the scarecrow win an award? Becaus...
{ "split": "train", "index": 73758, "acecode_id": "oss_19374", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array of shape (m, n) representing a set of training data points, along with two 1D arrays `xmins` and `xmaxs` of shape (n,) that represent the minimum and maximum values for each feature, implement a function that performs unit scaling on the training data. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unit_scale_traindata([[1, 2], [3, 4]], [0, 0], [4, 5]) == [[0.25, 0.4], [0.75, 0.8]]\", \"assert unit_scale_traindata([[1, 1], [1, 1]], [1, 1], [1, 1]) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert unit_scale_traindata([[0, 0], [0, 0]], [0, 0], [0, 0]) == [[0.0, 0...
{ "split": "train", "index": 73759, "acecode_id": "bigcode_python_fns_8905", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of an actor system in Python. An actor is an entity that can receive and process messages asynchronously. Your goal is to create a function `process_messages(actors: List[str], messages: List[Tuple[str, str]]) -> Dict[str, L...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_messages(['Alice', 'Bob'], [('Alice', 'Hello Alice'), ('Bob', 'Hello Bob')]) == {'Alice': ['Hello Alice'], 'Bob': ['Hello Bob']}\", \"assert process_messages(['Alice', 'Bob'], [('Charlie', 'Hello Charlie')]) == {'Alice': [], 'Bob': []}\", \"assert pr...
{ "split": "train", "index": 73760, "acecode_id": "oss_31998", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the distance between two points in a 3D space. The points are represented as tuples of three coordinates (x, y, z). The distance between two points is calculated using the Euclidean distance formula: √((x2 - x1)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance({'pointA': (1, 2, 3), 'pointB': (4, 5, 6)}, 'pointA', 'pointB') == 5.196152422706632\", \"assert calculate_distance({'pointA': (-1, -1, -1), 'pointB': (1, 1, 1)}, 'pointA', 'pointB') == 3.4641016151377544\", \"assert calculate_distance({'p...
{ "split": "train", "index": 73761, "acecode_id": "oss_27784", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two strings 'a' and 'b', implement a function `cyc_pattern_check(a: str, b: str) -> bool` that checks whether string 'b' can be found as a substring of string 'a' or if any of the strings that can be formed by swapping adjacent characters in 'b' up to 3 times can be found...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cyc_pattern_check('abcde', 'cde') == True\", \"assert cyc_pattern_check('abcdef', 'def') == True\", \"assert cyc_pattern_check('hello', 'ell') == True\", \"assert cyc_pattern_check('rat', 'tar') == True\", \"assert cyc_pattern_check('abcd', 'xyz') == False\"...
{ "split": "train", "index": 73762, "acecode_id": "evol_23129", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `count_numerals(data)` that takes a single argument `data`, which can be a string or a nested data structure containing strings (like lists, tuples, sets, or dictionaries). The function should return a dictionary where the keys are unique numerical characte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_numerals('abc123') == {'1': 1, '2': 1, '3': 1}\", \"assert count_numerals(['test456', 'sample789']) == {'4': 1, '5': 1, '6': 1, '7': 1, '8': 1, '9': 1}\", \"assert count_numerals({ 'a': '1a2b', 'b': ['3', '4'] }) == {'1': 1, '2': 1, '3': 1, '4': 1}\", ...
{ "split": "train", "index": 73763, "acecode_id": "evol_7337", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a signal handler when a user interrupts a program using Ctrl+C. Write a function `handle_interrupt()` that takes no parameters. When this function is called, it should print a message indicating that the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_interrupt() == 'Program exited gracefully'\", \"assert handle_interrupt() == 'Program exited gracefully'\", \"assert handle_interrupt() == 'Program exited gracefully'\", \"assert handle_interrupt() == 'Program exited gracefully'\", \"assert handle_int...
{ "split": "train", "index": 73764, "acecode_id": "bigcode_python_fns_22966", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `verify_string(s: str) -> bool` that checks if a given string `s` starts with a special character from the set {'@', '#', '$'}, followed by exactly 3 letters (either lower case or upper case), contains at least one symbolic character from the set {'%', '^',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_string('@ABC%123') == True\", \"assert verify_string('#abc^1A2B3') == True\", \"assert verify_string('$XYZ&abcd') == True\", \"assert verify_string('@abc^12345') == True\", \"assert verify_string('#ABC$123456') == False\", \"assert verify_string('@abC...
{ "split": "train", "index": 73765, "acecode_id": "evol_29699", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that accepts a string input and uses a regular expression to find and return the exact phrase 'hello people' if it exists in the input string. If the phrase is not found, the function should return None.\nPlease reason step by step, then write a self-contained ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_phrase('Say hello people of the world!') == 'hello people'\", \"assert find_phrase('hello people') == 'hello people'\", \"assert find_phrase('Greetings hello people!') == 'hello people'\", \"assert find_phrase('Say hi to hello people!') == 'hello people...
{ "split": "train", "index": 73766, "acecode_id": "evol_21329", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a sequence of integers based on a list of step-type codes and a specified number of data points per step. Each step-type code corresponds to a specific integer value. Given a list of tuples where each tuple contains a cycle number and a step type ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_step_data([(1, 'A')], 3) == [1, 1, 1]\", \"assert generate_step_data([(1, 'B')], 2) == [2, 2]\", \"assert generate_step_data([(1, 'C')], 1) == [3]\", \"assert generate_step_data([(1, 'A'), (2, 'B')], 2) == [1, 1, 2, 2]\", \"assert generate_step_data...
{ "split": "train", "index": 73767, "acecode_id": "bigcode_python_fns_2838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of checking for an application installation status. The function should take a single argument, `is_installed`, which is a boolean indicating whether the application is installed or not. If the application is i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_app_installation(True) == {'status': 'installed', 'errors': {}}\", \"assert check_app_installation(False) == {'status': 'not_installed', 'errors': {'base': 'app_not_installed'}}\", \"assert check_app_installation(True) == {'status': 'installed', 'error...
{ "split": "train", "index": 73768, "acecode_id": "bigcode_python_fns_6195", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string representation of an HTML page and returns a list of all the links (anchor tags) present in the page. The function should only consider valid anchor tags with an 'href' attribute. If there are no links, return an empty list.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_links('<html><body><a href=\\\"http://example.com\\\">Example</a></body></html>') == ['http://example.com']\", \"assert fetch_links('<html><body></body></html>') == []\", \"assert fetch_links('<html><body><a href=\\\"#\\\">Link</a></body></html>') == [...
{ "split": "train", "index": 73769, "acecode_id": "evol_21041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the value of a player's hand in a card game. The value of each card is determined as follows: Cards 2 to 10 have a value equal to their respective numbers. Face cards (Jack, Queen, King) each have a value of 10. Aces can have a value of either 1 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hand_value([2, 3, 4]) == 9\", \"assert hand_value([10, 11, 12]) == 30\", \"assert hand_value([14, 3]) == 14\", \"assert hand_value([14, 14]) == 12\", \"assert hand_value([14, 5, 5]) == 21\", \"assert hand_value([9, 8, 14]) == 18\", \"assert hand_value([7, 7,...
{ "split": "train", "index": 73770, "acecode_id": "oss_27720", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a list of numeric values that represent signal data. Your goal is to implement a function that checks for inconsistencies in this data. Specifically, your function should identify and return a list of indices where the values are either NaN (not a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_signal_data([1.0, 2.0, float('nan'), 4.0]) == [2]\", \"assert check_signal_data([float('inf'), 1.0, 2.0, -float('inf')]) == [0, 3]\", \"assert check_signal_data([1.0, 2.0, 3.0]) == []\", \"assert check_signal_data([float('nan'), float('nan'), float('na...
{ "split": "train", "index": 73771, "acecode_id": "bigcode_python_fns_15769", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to analyze time travel data. The time travel data is represented as a list of tuples, where each tuple contains three elements: the traveler's name (a string), the time of departure (an integer), and the time of arrival (an integer). ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze([('Charlie', 0, 60), ('Charlie', 60, 120)]) == {'Charlie': 120}\", \"assert analyze([('Alice', 0, 5)]) == {'Alice': 5}\", \"assert analyze([]) == {}\", \"assert analyze([('Hank', 0, 10), ('Hank', 10, 20), ('Hank', 20, 30)]) == {'Hank': 30}\", \"asser...
{ "split": "train", "index": 73772, "acecode_id": "oss_20033", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function `find_prime_factors(n)` that returns a list of all unique prime factors of n in ascending order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." }...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_prime_factors(1) == []\", \"assert find_prime_factors(2) == [2]\", \"assert find_prime_factors(3) == [3]\", \"assert find_prime_factors(4) == [2]\", \"assert find_prime_factors(5) == [5]\", \"assert find_prime_factors(6) == [2, 3]\", \"assert find_prime...
{ "split": "train", "index": 73773, "acecode_id": "evol_11837", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that takes this list as input and returns a new list containing only the even integers from the original list, preserving the order. If there are no even integers, return an empty list.\nPlease reason step by step, then write a self-co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even([7, 9, 11]) == []\", \"assert filter_even([0, 1, 2]) == [0, 2]\", \"assert filter_even([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even([10, 15, 20, 25]) == [10, 20]\", \"assert fil...
{ "split": "train", "index": 73774, "acecode_id": "bigcode_python_fns_19028", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two strings, `text1` and `text2`. Your task is to identify the characters that are present in `text1` but not in `text2` and vice versa. Return a list of unique characters that are present in either of the strings but not in both. The result should be sorted in as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_characters('abc', 'def') == ['a', 'b', 'c', 'd', 'e', 'f']\", \"assert find_unique_characters('', 'abc') == ['a', 'b', 'c']\", \"assert find_unique_characters('abc', '') == ['a', 'b', 'c']\", \"assert find_unique_characters('aaa', 'a') == []\", \...
{ "split": "train", "index": 73775, "acecode_id": "bigcode_python_fns_22204", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `clip_values` that truncates each element in the list to a specified minimum and maximum range. The function should take three parameters: a list of integers `values`, an integer `min_value`, and an integer `max_value`. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clip_values([1, 5, 10], 3, 8) == [3, 5, 8]\", \"assert clip_values([-5, 0, 5, 10], -2, 8) == [-2, 0, 5, 8]\", \"assert clip_values([100, 50, 30, 0], 20, 80) == [80, 50, 30, 20]\", \"assert clip_values([5, 8, 3, 10, 15], 5, 10) == [5, 8, 5, 10, 10]\", \"asser...
{ "split": "train", "index": 73776, "acecode_id": "bigcode_python_fns_3470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, `norm_array`. Your task is to implement a function `process_array(norm_array)` that performs the following operations: 1. Initialize `shift_len` to the length of `norm_array`. 2. Check if there is at least one occurrence of both 1 and -1 in `no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_array([0, 1, 2, -1, 3]) == True\", \"assert process_array([-1, 0, 1, 2]) == True\", \"assert process_array([0, 0, 1, 0, -1]) == True\", \"assert process_array([-2, -1, 0, 1, 2]) == True\", \"assert process_array([1, 0, 0, -1, 0]) == True\", \"assert ...
{ "split": "train", "index": 73777, "acecode_id": "oss_29803", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that constructs and returns a formatted string representation of a list of key-value pairs. The function should take a list of tuples, where each tuple contains a key (string) and a value (string), and return a string representing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_key_value_pairs([('Accept', 'application/json'), ('Content-Type', 'application/xml')]) == 'Accept: application/json\\\\nContent-Type: application/xml\\\\n'\", \"assert format_key_value_pairs([('User-Agent', 'Mozilla/5.0'), ('Host', 'www.example.com')]...
{ "split": "train", "index": 73778, "acecode_id": "oss_12828", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a sorted array that can be circularly shifted, implement a function that searches for a specific element in the array. The function should return the index of the element if it is found, or -1 if it is not present in the array.\nPlease reason step by step, then write a se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert circularArraySearch([4, 5, 6, 7, 0, 1, 2], 0) == 4\", \"assert circularArraySearch([4, 5, 6, 7, 0, 1, 2], 3) == -1\", \"assert circularArraySearch([1, 2, 3, 4, 5], 1) == 0\", \"assert circularArraySearch([1, 2, 3, 4, 5], 5) == 4\", \"assert circularArraySear...
{ "split": "train", "index": 73779, "acecode_id": "evol_17488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `advanced_monotonic(l: list, strict: bool = False) -> bool` that checks if the elements of the input list `l` are monotonically increasing or decreasing. The function should ignore any non-numeric elements (including strings and None). If the `strict` param...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_monotonic([1, 2, 3, 4]) == True\", \"assert advanced_monotonic([4, 3, 2, 1]) == True\", \"assert advanced_monotonic([1, 2, 2, 3], strict=False) == True\", \"assert advanced_monotonic([3, 2, 2, 1], strict=False) == True\", \"assert advanced_monotonic...
{ "split": "train", "index": 73780, "acecode_id": "evol_34212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given three boolean values representing the states of three checkboxes: permutations, combinations, and repeat. Each checkbox can either be checked (1) or unchecked (0). Your task is to implement a function `check_selection(permutations: int, combinations: int, repeat: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_selection(0, 0, 0) == 'User Error: Please select Combinations or Permutations!'\", \"assert check_selection(1, 0, 0) == 'Selection is valid'\", \"assert check_selection(0, 1, 0) == 'Selection is valid'\", \"assert check_selection(0, 0, 1) == 'Selection...
{ "split": "train", "index": 73781, "acecode_id": "bigcode_python_fns_17381", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a fact based on provided parameters. The function, `create_fact`, should accept the following parameters: 1. `fact_type`: A string representing the type of fact to be created (e.g., 'mentions'). 2. `source_type`: A string rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_fact('mentions', 'report', 'xyz', 'fqdn', 'test.com') == \\\"mentions from report 'xyz' to fqdn 'test.com'\\\"\", \"assert create_fact('links', 'article', '123', 'url', 'http://example.com') == \\\"links from article '123' to url 'http://example.com'\...
{ "split": "train", "index": 73782, "acecode_id": "oss_18752", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, you need to find the maximum sum of any contiguous subarray within the array. Implement a function `max_sequence(arr)` that takes in a list of integers `arr` and returns the maximum sum of any contiguous subarray in that list. If the input array is e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_sequence([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_sequence([-2, -3, 4, -1, -2, 1, 5, -3]) == 7\", \"assert max_sequence([1, 2, 3, 4, 5]) == 15\", \"assert max_sequence([5]) == 5\", \"assert max_sequence([]) == 0\", \"assert max_sequence([0, ...
{ "split": "train", "index": 73783, "acecode_id": "oss_19526", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `vgg19(pretrained: bool) -> str` that simulates the initialization of a VGG 19-layer model. If the `pretrained` parameter is set to `True`, the function should return the string 'VGG 19-layer model initialized with pre-trained weights'. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vgg19(True) == 'VGG 19-layer model initialized with pre-trained weights'\", \"assert vgg19(False) == 'VGG 19-layer model initialized without pre-trained weights'\", \"assert vgg19(True) == 'VGG 19-layer model initialized with pre-trained weights'\", \"assert...
{ "split": "train", "index": 73784, "acecode_id": "bigcode_python_fns_39522", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_max(a, b, c)` that takes three integer parameters and returns the maximum among them. If two or more parameters are equal and are the maximum, return that value.\nPlease reason step by step, then write a self-contained Python solution. Give your final...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max(1, 2, 3) == 3\", \"assert find_max(3, 2, 1) == 3\", \"assert find_max(1, 1, 1) == 1\", \"assert find_max(5, 5, 3) == 5\", \"assert find_max(-1, -2, -3) == -1\", \"assert find_max(0, 0, 0) == 0\", \"assert find_max(10, 10, 10) == 10\", \"assert find_...
{ "split": "train", "index": 73785, "acecode_id": "evol_4680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a bearer token for authentication. Your function should take in a service account file and an audience string, and return a string that represents the bearer token in the format 'Bearer {token}', where {token} is a unique s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_bearer_token('service_account.json', 'example.com') == 'Bearer service_account.json-example.com'\", \"assert generate_bearer_token('account.json', 'test.org') == 'Bearer account.json-test.org'\", \"assert generate_bearer_token('my_service.json', 'ap...
{ "split": "train", "index": 73786, "acecode_id": "bigcode_python_fns_14819", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_first_n_primes(n: int) -> List[int]` that takes an integer `n` as input and returns a list of the first `n` prime numbers. Ensure that the function verifies each number's primality before including it in the list. The input `n` will be a positive ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_first_n_primes(1) == [2]\", \"assert generate_first_n_primes(2) == [2, 3]\", \"assert generate_first_n_primes(3) == [2, 3, 5]\", \"assert generate_first_n_primes(4) == [2, 3, 5, 7]\", \"assert generate_first_n_primes(5) == [2, 3, 5, 7, 11]\", \"asse...
{ "split": "train", "index": 73787, "acecode_id": "evol_32010", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a shipping telephone number based on the user's billing and shipping information. The function `validate_shipping_telephone` should take two parameters: `is_shipping_different` (a boolean indicating if the shipping informat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_shipping_telephone(True, '123-456-7890') == 'Valid'\", \"assert validate_shipping_telephone(True, '') == 'This value cannot be left blank.'\", \"assert validate_shipping_telephone(True, None) == 'This value cannot be left blank.'\", \"assert validat...
{ "split": "train", "index": 73788, "acecode_id": "oss_33944", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates the properties of a SlotSetAction object. The function should perform the following checks: 1. Ensure that the 'name' property is not empty after stripping leading and trailing whitespaces and converting to lowercase. 2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate(SlotSetAction(name='Valid Name', set_slots=['slot1'], bot='Bot1', user='User1', timestamp=datetime(2023, 10, 1, 12, 0, 0), status=True)) is None\", \"assert validate(SlotSetAction(name=' another valid name ', set_slots=['slot1'], bot='Bot1', user='U...
{ "split": "train", "index": 73789, "acecode_id": "oss_4176", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that finds the longest string in a provided list that starts with a specific prefix and ends with a specified suffix. Additionally, compute the cumulative sum of all characters within this longest string, where 'a'=1, 'b'=2, ..., 'z'=26. If there are multip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_longest_string_sum([], ('a', 'z')) == ('', 0)\", \"assert find_longest_string_sum(['hello', 'world'], ('h', 'd')) == ('', 0)\", \"assert find_longest_string_sum(['cat', 'bat', 'rat'], ('c', 't')) == ('cat', 24)\", \"assert find_longest_string_sum(['sing...
{ "split": "train", "index": 73790, "acecode_id": "evol_32156", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a file handler module. In this function, you need to create a custom class named `MissingModule` that accepts a module name and an urgency level. If the module name is 'filehandler', the urgency level should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_file_module('filehandler') == MissingModule('filehandler', 1)\", \"assert handle_file_module('filehandler', 5) == MissingModule('filehandler', 5)\", \"assert handle_file_module('some_other_module') == MissingModule('some_other_module', 0)\", \"assert ...
{ "split": "train", "index": 73791, "acecode_id": "oss_15549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_nearest(nums: List[int], target: int, k: int) -> List[int]` that returns the k nearest integers from the list `nums` to the specified `target` value. In cases where there are multiple closest values, use the following priority rules: if values are on ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_nearest([3, 6, 9, 12, 15], 10, 3) == [6, 9, 12]\", \"assert find_nearest([1, 2, 3], 2, 5) == [1, 2, 3]\", \"assert find_nearest([10, 20, 30, 40], 25, 2) == [20, 30]\", \"assert find_nearest([5, 7, 8, 10], 6, 2) == [5, 7]\", \"assert find_nearest([1, 4, ...
{ "split": "train", "index": 73792, "acecode_id": "evol_4413", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that finds all occurrences of a specific pattern within a given text. The function should return a list of indices where the pattern is found in the text. The pattern matching should be case-sensitive. Write a function `find_all(patte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_all('abc', 'abcdabceabcfabc') == [0, 4, 8, 12]\", \"assert find_all('xyz', 'abcdefg') == []\", \"assert find_all('foo', 'foo foo foo') == [0, 4, 8]\", \"assert find_all('bar', 'barbarbar') == [0, 3, 6]\", \"assert find_all('case', 'CaseSensitive') == []...
{ "split": "train", "index": 73793, "acecode_id": "oss_17685", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of names and checks if each name contains the word 'Silva' in it. The function should take a list of names as input and return a list of strings formatted as 'Name: [name], Contains Silva: [True/False]' for ea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_names(['Ana Silva', 'Maria', 'Jo\\u00e3o da Silva', 'Carlos', 'Silvana Silva']) == ['Name: Ana Silva, Contains Silva: True', 'Name: Maria, Contains Silva: False', 'Name: Jo\\u00e3o da Silva, Contains Silva: True', 'Name: Carlos, Contains Silva: False',...
{ "split": "train", "index": 73794, "acecode_id": "oss_5858", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total profit from a list of financial transactions. Each transaction is represented as an object with two attributes: `amount`, a float representing the transaction amount, and `type`, a string that can either be 'income' or 'expense'. Write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_profit([Transaction(amount=1000.0, type='income'), Transaction(amount=500.0, type='expense')]) == 500.0\", \"assert calculate_total_profit([Transaction(amount=200.0, type='income'), Transaction(amount=100.0, type='expense'), Transaction(amoun...
{ "split": "train", "index": 73795, "acecode_id": "oss_3172", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples representing water indices in the format (identifier, index), write a function `track_water_indices(water_indices: List[Tuple[str, int]]) -> List[str]` that returns a list of strings formatted as 'Identifier: Index' for each tuple in the input list. The o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert track_water_indices([('A', 2334), ('A', 2451)]) == ['A: 2334', 'A: 2451']\", \"assert track_water_indices([('B', 100), ('C', 200), ('D', 300)]) == ['B: 100', 'C: 200', 'D: 300']\", \"assert track_water_indices([]) == []\", \"assert track_water_indices([('X',...
{ "split": "train", "index": 73796, "acecode_id": "bigcode_python_fns_47982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to write a function that takes a list of integers and returns a new list containing the squares of each integer from the input list. The function should handle both positive and negative integers, and the output list should maintain the same order as the input list. Im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"assert square_numbers([-1, 0, 1]) == [1, 0, 1]\", \"assert square_numbers([0, 2, -2]) == [0, 4, 4]\", \"assert square_numbers([]) == []\", \"assert square_numbers([-3, -2, -1]) == [9, 4, 1]\", \"assert square_numbe...
{ "split": "train", "index": 73797, "acecode_id": "oss_33618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of city information represented as strings. Each string contains tab-separated values where the first value is the city ID (an integer), the second value is the city name (a string), and the third and fourth values are the latitude and long...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_cities(['1\\tCityA\\t34.05\\t-118.25', '2\\tCityB\\t40.71\\t-74.00']) == (2, {1: ('CityA', ('34.05', '-118.25')), 2: ('CityB', ('40.71', '-74.00'))})\", \"assert process_cities(['1\\tCityA\\t34.05\\t-118.25', '2\\tCityB']) == (1, {1: ('CityA', ('34.0...
{ "split": "train", "index": 73798, "acecode_id": "oss_34554", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `calculate_balance(transactions)` that calculates the final balance based on a list of financial transactions. Each transaction is represented as a tuple containing an amount and a flag indicating whether it is a credit ('+') or debit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_balance([(200, '+'), (100, '-')]) == 100\", \"assert calculate_balance([(50, '-'), (50, '+')]) == 0\", \"assert calculate_balance([(10, '+'), (20, '+'), (5, '-')]) == 25\", \"assert calculate_balance([(500, '-'), (100, '-')]) == -600\", \"assert ca...
{ "split": "train", "index": 73799, "acecode_id": "oss_2345", "num_tests": 16 }