data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "Write a function `generate_password()` that creates a random password consisting of exactly 8 characters. The password must include at least one uppercase letter, one lowercase letter, and one numerical digit. The remaining characters can be any combination of uppercase letters...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_password()) == 8\", \"assert any(c.isupper() for c in generate_password())\", \"assert any(c.islower() for c in generate_password())\", \"assert any(c.isdigit() for c in generate_password())\", \"assert all(c.isalnum() for c in generate_password...
{ "split": "train", "index": 1100, "acecode_id": "evol_1853", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings that represent events in a log file. Each event is formatted as 'event_type:index', where 'event_type' can either be 'on_epoch_begin', 'on_epoch_end', 'on_validation_period_begin', or 'on_validation_period_end'. The 'index' is a non-negative inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_event_indices(['on_epoch_begin:0', 'on_epoch_end:0', 'on_epoch_begin:1', 'on_epoch_end:1', 'on_validation_period_begin:0', 'on_validation_period_end:0', 'on_validation_period_begin:1', 'on_validation_period_end:1']) is None\", \"assert check_event_indi...
{ "split": "train", "index": 1101, "acecode_id": "bigcode_python_fns_23104", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that extracts the current step number from a given status string. The status string can be in one of two formats: 'Step X :' where X is a positive integer, or 'Step X/Y :' where X is a positive integer and Y is the total number of steps. W...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_current_step('Step 12 :') == 12\", \"assert extract_current_step('Step 4/13 :') == 4\", \"assert extract_current_step('Step 1 :') == 1\", \"assert extract_current_step('Step 5/10 :') == 5\", \"assert extract_current_step('Step 0/10 :') == 0\", \"asse...
{ "split": "train", "index": 1102, "acecode_id": "bigcode_python_fns_45441", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates basic stack operations. The function should accept a list of operations and return the results of the `pop`, `peek`, and `is_empty` operations. The operations will be represented as tuples where the first element is the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stack_operations([('push', 5), ('push', 10), ('peek', None), ('pop', None), ('is_empty', None), ('pop', None), ('is_empty', None)]) == [10, 10, False, 5, True]\", \"assert stack_operations([('is_empty', None), ('pop', None), ('peek', None)]) == [True, None, ...
{ "split": "train", "index": 1103, "acecode_id": "oss_22252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple notification system. Create a Python function `manage_notifications(actions: List[str]) -> List[str]` that takes a list of actions and returns a list of notifications based on the actions performed. Each action can be one of the followi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_notifications(['subscribe', 'notify', 'unsubscribe', 'notify']) == ['Subscribed', 'Notification sent', 'Unsubscribed']\", \"assert manage_notifications(['unsubscribe', 'notify']) == []\", \"assert manage_notifications(['subscribe', 'subscribe', 'notif...
{ "split": "train", "index": 1104, "acecode_id": "oss_8724", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two sorted lists of integers and merges them into a single sorted list without using any built-in sorting functions.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code bloc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([], []) == []\", \"assert merge_sorted_lists([1, 2, 3], []) == [1, 2, 3]\", \"assert merge_sorted_lists([], [4, 5, 6]) == [4, 5, 6]\", \"assert merge_sorted_lists([...
{ "split": "train", "index": 1105, "acecode_id": "evol_16157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that aggregates statistics from various sources. Each source is represented as a dictionary containing a unique identifier and another dictionary with key-value pairs representing different statistics. Your function should be able to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_statistics([{'source1': {'stat1': 10}}, {'source2': {'stat1': 5}}, {'source3': {'stat1': 7}}], 'SUM') == {'stat1': 22}\", \"assert aggregate_statistics([{'source1': {'stat1': 10}}, {'source2': {'stat1': 5}}, {'source3': {'stat1': 7}}], 'AVERAGE') =...
{ "split": "train", "index": 1106, "acecode_id": "oss_4329", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that removes all numbers that are exact multiples of 4 and replaces them with their respective prime number successors. The order of the original values in the list should remain unchanged. Return the modified list.\nPlease reason ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_problem([2, 4, 6, 10]) == [2, 5, 6, 10]\", \"assert solve_problem([4, 8, 12, 16]) == [5, 11, 13, 17]\", \"assert solve_problem([1, 2, 3, 4]) == [1, 2, 3, 5]\", \"assert solve_problem([8, 9, 10]) == [11, 9, 10]\", \"assert solve_problem([15, 16, 23, 24]...
{ "split": "train", "index": 1107, "acecode_id": "evol_30065", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers representing durations in minutes and returns a list containing only the durations that are greater than or equal to a specified threshold. Your function should be able to handle an empty list and should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_durations([40, 45, 50], 45) == [45, 50]\", \"assert filter_durations([], 10) == []\", \"assert filter_durations([60, 90, 120], 60) == [60, 90, 120]\", \"assert filter_durations([5, 15, 25], 15) == [15, 25]\", \"assert filter_durations([100, 200, 300],...
{ "split": "train", "index": 1108, "acecode_id": "oss_16818", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given string to extract and return all the sentences present in the string. A sentence is defined as a sequence of words ending with a punctuation mark (., !, or ?). The function should ignore any punctuation marks wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_sentences('Hello world. This is a test! Is it working?') == ['Hello world.', 'This is a test!', 'Is it working?']\", \"assert extract_sentences('One sentence here. Another one here.') == ['One sentence here.', 'Another one here.']\", \"assert extract...
{ "split": "train", "index": 1109, "acecode_id": "oss_7597", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of mixed data types that represent a person's information. The list contains the following elements in order: an integer `id`, a bytes object representing the `name`, a bytes object for the `img_url`, a bytes object for the `location`, and a bytes object co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_person([1, b'John Doe', b'http://example.com/image.jpg', b'San Francisco', b'red,green,blue']) == {'id': 1, 'name': 'John Doe', 'img_url': 'http://example.com/image.jpg', 'location': 'San Francisco', 'colors': ['red', 'green', 'blue']}\", \"assert g...
{ "split": "train", "index": 1110, "acecode_id": "bigcode_python_fns_31235", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a control command represented as a string along with a payload. Your task is to implement a function that interprets the command and performs different actions based on the provided command type. The command can be either 'DEVICE', 'KEY', or 'ADVHOP'. The payload ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_control_command('DEVICE', ' ') == 'Scan for devices'\", \"assert handle_control_command('DEVICE', 'Device1') == 'Follow device: Device1'\", \"assert handle_control_command('KEY', 'my_secret_key') == 'Set passkey or OOB: my_secret_key'\", \"assert hand...
{ "split": "train", "index": 1111, "acecode_id": "bigcode_python_fns_10430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a dictionary as input and returns a list of its keys sorted in descending order based on their associated values. For example, given the dictionary {'x': 10, 'y': 5, 'z': 8}, the function should return ['x', 'z', 'y'].\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_keys_based_on_values({'a': 3, 'b': 1, 'c': 2}) == ['a', 'c', 'b']\", \"assert sort_keys_based_on_values({'apple': 2, 'banana': 5, 'cherry': 1}) == ['banana', 'apple', 'cherry']\", \"assert sort_keys_based_on_values({'x': 10, 'y': 5, 'z': 8}) == ['x', 'z...
{ "split": "train", "index": 1112, "acecode_id": "evol_9443", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a city. Your task is to write a function `max_visible_buildings(heights: List[int]) -> int` that returns the maximum number of buildings that can be seen from the first building in the list, considering t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_visible_buildings([3, 7, 8, 3, 6, 1]) == 3\", \"assert max_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert max_visible_buildings([1, 3, 2, 5, 4]) == 3\", \"assert max_visible_buildings([2, 2, 2,...
{ "split": "train", "index": 1113, "acecode_id": "oss_21849", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple replay buffer used in reinforcement learning. Your task is to implement a function `create_replay_buffer(capacity, actions)` that simulates a replay buffer and performs the following operations: 1. Initializes the replay buffer with a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_replay_buffer(2, [(1, 1, 1, 1, False)], 1) == (1, [(1, 1, 1, 1, False)])\", \"assert create_replay_buffer(1, [(1, 2, 3, 4, False), (5, 6, 7, 8, True)], 1) == (1, [(5, 6, 7, 8, True)])\", \"assert create_replay_buffer(6, [(1, 2, 3, 4, False)], 1) == (1...
{ "split": "train", "index": 1114, "acecode_id": "oss_17636", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of integers and returns the sum of all the even numbers in the list. However, there is a catch - you are not allowed to use any conditional statements (if, else) or loops (for, while) in your solution. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5, 6]) == 12\", \"assert sum_even_numbers([1, 3, 5, 7]) == 0\", \"assert sum_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_even_numbers([]) == 0\", \"assert sum_even_numbers([-2, -4, -6]) == -12\", \"assert sum_even_numbers([...
{ "split": "train", "index": 1115, "acecode_id": "oss_29674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the area, classification, and perimeter of a triangle given the lengths of its three sides. The lengths must be natural numbers. If the lengths do not form a valid triangle, return -1. The triangle is classified as 'Equilateral' if all sides a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extended_area_triangle(3, 4, 5) == (6.00, 'Scalene', 12)\", \"assert extended_area_triangle(1, 2, 10) == -1\", \"assert extended_area_triangle(3, 3, 3) == (3.90, 'Equilateral', 9)\", \"assert extended_area_triangle(7, 8, 9) == (26.83, 'Scalene', 24)\", \"ass...
{ "split": "train", "index": 1116, "acecode_id": "evol_15110", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_prime(n: int) -> bool` that determines whether a given integer `n` is a prime number or not. The function should use bitwise operators instead of the modulus operator for its computations. Additionally, the function should handle large values of `n` eff...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser...
{ "split": "train", "index": 1117, "acecode_id": "evol_2545", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a report card based on a provided source data. The report card should include the student's name, their grades for various subjects, and the average grade. The input will be a dictionary where the keys are student names and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_report_cards({'Alice': {'Math': 90, 'Science': 80}, 'Bob': {'Math': 85, 'Science': 75}}) == ['Student Name: Alice Grades: [Math: 90, Science: 80] Average: 85.0', 'Student Name: Bob Grades: [Math: 85, Science: 75] Average: 80.0']\", \"assert generate...
{ "split": "train", "index": 1118, "acecode_id": "bigcode_python_fns_39980", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `is_action_valid(action: str, target: dict, creds: dict) -> bool` that determines if a given action is valid based on user credentials and the target object. The action is represented as a colon-separated string, where the first part is t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_action_valid('identity:list_users', {}, {'role': 'admin'}) == True\", \"assert is_action_valid('identity:list_users', {}, {'role': 'user'}) == False\", \"assert is_action_valid('identity:create_user', {}, {'role': 'editor'}) == True\", \"assert is_action_...
{ "split": "train", "index": 1119, "acecode_id": "bigcode_python_fns_15459", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the areas of different polygons and a scaling factor, write a function that generates a list of random points distributed across these areas. The number of random points for each area is calculated by dividing the area by the scaling factor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_points([10, 20, 30], 5) == [2, 4, 6]\", \"assert generate_random_points([0, 0, 0], 1) == [0, 0, 0]\", \"assert generate_random_points([15, 25, 35], 10) == [1, 2, 3]\", \"assert generate_random_points([8, 16, 24], 4) == [2, 4, 6]\", \"assert g...
{ "split": "train", "index": 1120, "acecode_id": "bigcode_python_fns_8928", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that converts a day of the year (1-366) into its corresponding date in the format DD-MMM-YYYY for the year 2020, taking into account the leap year scenario. The function should also incorporate a provided UTC offset (ranging from -12 to +14) that adjusts the ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert day_to_date(1, 0) == '01-Jan-2020'\", \"assert day_to_date(31, 0) == '31-Jan-2020'\", \"assert day_to_date(60, 0) == '29-Feb-2020'\", \"assert day_to_date(61, 0) == '01-Mar-2020'\", \"assert day_to_date(366, 0) == '31-Dec-2020'\", \"assert day_to_date(60, 5)...
{ "split": "train", "index": 1121, "acecode_id": "evol_26502", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing validation accuracies after one epoch for a series of configurations. Your task is to compute the average validation accuracy and the standard deviation of these accuracies. The output should be a string formatted as 'Average: X.XX,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_accuracy_stats([100, 90, 80, 70]) == 'Average: 85.00, Standard Deviation: 11.18'\", \"assert compute_accuracy_stats([50, 60, 70, 80, 90]) == 'Average: 70.00, Standard Deviation: 14.14'\", \"assert compute_accuracy_stats([100, 100, 100, 100]) == 'Aver...
{ "split": "train", "index": 1122, "acecode_id": "bigcode_python_fns_15421", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function `max_length_ncname(lst: List[str]) -> List[str]` that filters the list to return only those strings that are valid NCNames and have a maximum length of 5 characters. An NCName is defined as a non-colonized name conforming to XML naming ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_length_ncname(['name1', '_name', '1name', '-name', 'name-name']) == ['name1', '_name']\", \"assert max_length_ncname(['a', 'b', 'c', 'd', 'e']) == ['a', 'b', 'c', 'd', 'e']\", \"assert max_length_ncname(['valid1', 'valid2', 'valid3', 'valid4', 'valid5'])...
{ "split": "train", "index": 1123, "acecode_id": "bigcode_python_fns_38435", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `launch_nbshell()` that simulates launching an interactive shell session for a server command. The function should take no parameters and return a string that represents the command that would be executed to launch the shell. The comm...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert launch_nbshell() == 'nautobot-server nbshell'\", \"assert launch_nbshell() == 'nautobot-server nbshell'\", \"assert launch_nbshell() == 'nautobot-server nbshell'\", \"assert launch_nbshell() == 'nautobot-server nbshell'\", \"assert launch_nbshell() == 'nauto...
{ "split": "train", "index": 1124, "acecode_id": "bigcode_python_fns_25677", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing the title of a release item. Your task is to extract the volume, chapter, fragment, and postfix from the title according to the following rules: If the title contains the phrase 'preview', return None. If the title mentions 'The Black Knight ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_release_info('Preview of The Black Knight') == None\", \"assert extract_release_info('This is just a test title') == False\", \"assert extract_release_info('Another title preview') == None\", \"assert extract_release_info('Some random title') == Fals...
{ "split": "train", "index": 1125, "acecode_id": "bigcode_python_fns_21701", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of image filenames and a number representing the number of shards. Your task is to create a function that distributes these image filenames into the specified number of shards. Each shard should contain a contiguous block of filenames from the list. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert distribute_filenames(['image1.jpg', 'image2.jpg', 'image3.jpg', 'image4.jpg'], 2) == [['image1.jpg', 'image2.jpg'], ['image3.jpg', 'image4.jpg']]\", \"assert distribute_filenames(['image1.jpg', 'image2.jpg', 'image3.jpg'], 2) == [['image1.jpg', 'image2.jpg']...
{ "split": "train", "index": 1126, "acecode_id": "bigcode_python_fns_45790", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of notebook cell outputs and extracts the results from those that have been executed. Each output is represented as a dictionary containing an 'output_type' and 'data'. Your goal is to extract the 'text/plain' da...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_notebook_outputs([{'output_type': 'display_data', 'data': {'text/plain': ['Not an execute result']}}, {'output_type': 'execute_result', 'data': {'text/plain': ['Final Result']}}]) == [('', 'Final Result')]\", \"assert process_notebook_outputs([]) == ...
{ "split": "train", "index": 1127, "acecode_id": "oss_34850", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a sequence of bytecode instructions for a virtual machine that uses a stack-based architecture. The function should take in a script hash, an operation name, and a list of arguments. Your function must prepare the argum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert emit_dynamic_call_with_args(12345, 'add', [1, 2, 3]) == ['PUSH 3', 'PUSH 2', 'PUSH 1', 'PACK', 'PUSH_CALL_FLAGS', 'PUSH_OPERATION']\", \"assert emit_dynamic_call_with_args(67890, 'subtract', [10, 5]) == ['PUSH 5', 'PUSH 10', 'PACK', 'PUSH_CALL_FLAGS', 'PUSH_...
{ "split": "train", "index": 1128, "acecode_id": "oss_37304", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Create a function that takes two integer parameters, both between 1 and 1000, and returns a list containing those two numbers sorted in ascending order. The function should raise a ValueError if either of the integers is not within the specified range (1 to 1000).\nPlease reaso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_array(5, 10) == [5, 10]\", \"assert sorted_array(1000, 1) == [1, 1000]\", \"assert sorted_array(250, 100) == [100, 250]\", \"assert sorted_array(999, 500) == [500, 999]\", \"assert sorted_array(1, 1000) == [1, 1000]\", \"assert sorted_array(999, 999) ...
{ "split": "train", "index": 1129, "acecode_id": "evol_22345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates basic bank account operations. Your function should be named `bank_account_operations` and should take in three parameters: `initial_balance` (a float representing the starting balance of the account), `deposits` (a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_operations(1000.0, [], []) == 1000.0\", \"assert bank_account_operations(1000.0, [100.0], []) == 1100.0\", \"assert bank_account_operations(500.0, [], [600.0]) == 500.0\", \"assert bank_account_operations(300.0, [200.0], [100.0]) == 400.0\", \"a...
{ "split": "train", "index": 1130, "acecode_id": "oss_5796", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a non-negative integer `num`, write a function `factorial(num: int) -> int` that calculates the factorial of the given number. The factorial of a non-negative integer `n` is denoted as `n!` and is the product of all positive integers less than or equal to `n`. If `num` is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 1131, "acecode_id": "oss_6240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple represents the dimensions of an image in the format (height, width). Your task is to count the unique image sizes and return the count of each unique size as a dictionary, where the keys are the sizes (as tuples) and the values a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_image_sizes([(100, 200), (200, 100), (100, 200)]) == {(100, 200): 2, (200, 100): 1}\", \"assert count_unique_image_sizes([(640, 480), (640, 480), (1280, 720)]) == {(640, 480): 2, (1280, 720): 1}\", \"assert count_unique_image_sizes([(300, 400), ...
{ "split": "train", "index": 1132, "acecode_id": "bigcode_python_fns_39183", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a two-dimensional square matrix (list of lists) 'matrix', return a list containing the elements of the specified diagonal. The diagonal can be specified using an integer 'k'. If k is 0, return the main diagonal; if k is positive, return the diagonal above the main diagona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_diagonal([[1]], 0) == [1]\", \"assert get_diagonal([[1, 2], [3, 4]], 0) == [1, 4]\", \"assert get_diagonal([[1, 2], [3, 4]], 1) == [2]\", \"assert get_diagonal([[1, 2], [3, 4]], -1) == [3]\", \"assert get_diagonal([[5, 7, 9], [10, 12, 14], [15, 17, 19]],...
{ "split": "train", "index": 1133, "acecode_id": "bigcode_python_fns_6737", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a non-negative integer 'number' and a positive integer 'consecutive', write a function that returns the largest product of 'consecutive' consecutive digits in 'number'. If 'number' has fewer than 'consecutive' digits, return 0. The digits of 'number' are considered in the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_consecutive_product(123456, 2) == 30\", \"assert largest_consecutive_product(123456, 3) == 120\", \"assert largest_consecutive_product(987654321, 4) == 3024\", \"assert largest_consecutive_product(0, 2) == 0\", \"assert largest_consecutive_product(12...
{ "split": "train", "index": 1134, "acecode_id": "bigcode_python_fns_21968", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `transform_source_files` that simulates the behavior of a compiler for TypeScript files. The function should accept the following parameters: \n- `name` (string): the name for the target. \n- `srcs` (list of strings): a list of TypeScript...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_source_files('myCompiler', None, [], [], False, False, None, None) == {'name': 'myCompiler', 'srcs': ['default1.ts', 'default2.ts', 'default3.ts'], 'args': [], 'data': [], 'output_dir': False, 'source_maps': False, 'swcrc': None, 'out_dir': None}\"...
{ "split": "train", "index": 1135, "acecode_id": "bigcode_python_fns_40462", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a data parsing function that can handle different formats. The function `parse_data` takes two parameters: `data` and `format`. The `data` parameter is a string, and the `format` parameter specifies the format of the data. Your function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_data('{\\\"key\\\": \\\"value\\\"}', 'json') == {'key': 'value'}\", \"assert parse_data('name,age\\\\nAlice,30\\\\nBob,25', 'csv') == [['name', 'age'], ['Alice', '30'], ['Bob', '25']]\", \"assert parse_data('{\\\"foo\\\": \\\"bar\\\"}', 'json') == {'fo...
{ "split": "train", "index": 1136, "acecode_id": "oss_24655", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a triangle represented as a list of lists, where each inner list contains integers. Your task is to find the maximum sum path starting from the top of the triangle to the bottom. At each step, you may move to adjacent numbers in the row directly below. Write a fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_path([[1], [2, 3], [4, 5, 6]]) == 10\", \"assert find_max_path([[1], [2, 3], [4, 5, 6], [7, 8, 9, 10]]) == 20\", \"assert find_max_path([[1], [1, 1], [1, 1, 1], [1, 1, 1, 1]]) == 4\", \"assert find_max_path([[0], [0, 0], [0, 0, 0]]) == 0\", \"assert...
{ "split": "train", "index": 1137, "acecode_id": "bigcode_python_fns_20668", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You need to implement a function that simulates the behavior of an application management system. Each application is represented by its unique identifier, name, and version number. Your task is to create a function `create_application(identifier: str, name: str, version: str) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_application('app1', 'Application One', '1.0') == {'identifier': 'app1', 'name': 'Application One', 'version': '1.0'}\", \"assert create_application('app2', 'Application Two', '1.1') == {'identifier': 'app2', 'name': 'Application Two', 'version': '1.1'...
{ "split": "train", "index": 1138, "acecode_id": "oss_29813", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes patient queries based on different query engines. The function should handle different query engines represented by an enum and return an appropriate response based on the provided parameters. You need to impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert _process_patient_query(Runner.SPARK, 'data_source_1', 'code_system_1') == 'Processed Spark patient query with data_source_1 and code_system_1'\", \"assert _process_patient_query(Runner.BIG_QUERY, 'data_source_2', 'code_system_2') == 'Processed BigQuery patie...
{ "split": "train", "index": 1139, "acecode_id": "oss_14004", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a row in a CSV file. The first string in the list contains the column names, and the subsequent strings contain the data. Your task is to implement a function that converts this CSV representation into a dictionary wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert csv_to_dict(['Name,Age,City', 'Alice,30,New York', 'Bob,25,Los Angeles']) == {'Name': ['Alice', 'Bob'], 'Age': ['30', '25'], 'City': ['New York', 'Los Angeles']}\", \"assert csv_to_dict(['Product,Price,Quantity', 'Laptop,1000,5', 'Mouse,20,50']) == {'Product...
{ "split": "train", "index": 1140, "acecode_id": "bigcode_python_fns_32804", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that counts how many numbers in the list are greater than 100. The function should take a single parameter, a list of integers, and return the count of numbers exceeding 100.\nPlease reason step by step, then write a self-contained Pyt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_numbers_exceeding_100([101, 102, 99, 98, 105]) == 3\", \"assert count_numbers_exceeding_100([50, 20, 80, 150, 200]) == 2\", \"assert count_numbers_exceeding_100([100, 99, 98]) == 0\", \"assert count_numbers_exceeding_100([]) == 0\", \"assert count_numb...
{ "split": "train", "index": 1141, "acecode_id": "evol_7226", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a payload dictionary that contains a key called 'parameters'. The value of 'parameters' is a list of dictionaries, where each dictionary has a 'value' key. The 'value' key holds another dictionary that may contain the keys 'name' and 'type'. Your task is to implem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_info({'parameters': [{'value': {'name': 'age', 'type': 'int'}}, {'value': {'name': 'name', 'type': 'str'}}]}) == [('age', 'int'), ('name', 'str')]\", \"assert extract_info({'parameters': [{'value': {'name': 'height', 'type': 'float'}}, {'value': {'na...
{ "split": "train", "index": 1142, "acecode_id": "oss_16780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary where each key is a string and each value is either a string, an integer, or another dictionary, write a function `flatten_dict` that transforms this dictionary into a flat dictionary. The keys in the flattened dictionary should be the paths to the values in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_dict({'a': 1, 'b': {'c': 2}}) == {'a': 1, 'b.c': 2}\", \"assert flatten_dict({'a': {'b': 2}, 'a.b': 3}) == {'a.b': 3}\", \"assert flatten_dict({'x': 5, 'y': {'z': 10, 'a': {'b': 15}}}) == {'x': 5, 'y.z': 10, 'y.a.b': 15}\", \"assert flatten_dict({'fo...
{ "split": "train", "index": 1143, "acecode_id": "bigcode_python_fns_32872", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representation of a JSON object that contains key-value pairs. Write a function `extract_value(json_string: str, key: str) -> str` that takes in two arguments: a valid JSON string and a key. The function should return the corresponding value associated wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_value('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": \\\"30\\\"}', 'name') == 'Alice'\", \"assert extract_value('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": \\\"30\\\"}', 'age') == '30'\", \"assert extract_value('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\"...
{ "split": "train", "index": 1144, "acecode_id": "bigcode_python_fns_17111", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that converts a given string containing characters from the Ukrainian alphabet and other symbols into a string that only contains Latin characters and underscores. The conversion rules are as follows: Ukrainian characters will be transliterated ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_latin('\\u041f\\u0440\\u0438\\u0432\\u0456\\u0442, \\u0441\\u0432\\u0456\\u0442!') == 'Pryvit__svit_'\", \"assert to_latin('Hello, World!') == 'Hello__World_'\", \"assert to_latin('12345') == '12345'\", \"assert to_latin('') == ''\", \"assert to_latin('\\...
{ "split": "train", "index": 1145, "acecode_id": "bigcode_python_fns_16500", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of events where each event is represented as a tuple containing the start time, end time, and the number of attendees, implement a function called `max_overlapping_events(events)` that returns the maximum number of overlapping events and the total number of attende...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_overlapping_events([(1, 7, 100), (2, 5, 200), (3, 6, 50), (8, 10, 300)]) == (3, 350)\", \"assert max_overlapping_events([(5, 10, 50), (6, 8, 60), (7, 9, 70)]) == (3, 180)\", \"assert max_overlapping_events([(1, 5, 100), (5, 10, 100), (10, 15, 100)]) == (...
{ "split": "train", "index": 1146, "acecode_id": "evol_6100", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with processing EEG (electroencephalogram) channel names recorded using the international 10-20-placement system. You have two lists: one containing abbreviated channel names and another containing their corresponding full channel names with the reference 'REF' a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_channel_mapping(['A1', 'A2'], ['EEG A1-REF', 'EEG A2-REF']) == {'A1': 'EEG A1-REF', 'A2': 'EEG A2-REF'}\", \"assert create_channel_mapping(['FP1', 'FP2'], ['EEG FP1-REF', 'EEG FP2-REF']) == {'FP1': 'EEG FP1-REF', 'FP2': 'EEG FP2-REF'}\", \"assert crea...
{ "split": "train", "index": 1147, "acecode_id": "oss_31202", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file paths represented as strings. Each file path consists of directories and a filename. Your task is to implement a function that filters this list to return only the file paths that have a specific basename and extension. The basename and extension wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_file_paths(['dir1/file1.txt', 'dir2/file2.txt', 'dir1/file1.md'], 'file1', '.txt') == ['dir1/file1.txt']\", \"assert filter_file_paths(['dir1/file1.txt', 'dir2/file2.txt', 'dir3/file1.txt'], 'file1', '.txt') == ['dir1/file1.txt', 'dir3/file1.txt']\", ...
{ "split": "train", "index": 1148, "acecode_id": "bigcode_python_fns_41206", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing the versioning of software releases. Each release can be marked as a major release or a minor release. A major release should increment the major version number, while a minor release increments the minor version number. Implement a function `get_ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_new_version('1.2.3', True) == '2.0.0'\", \"assert get_new_version('1.2.3', False) == '1.3.0'\", \"assert get_new_version('2.0.0', True) == '3.0.0'\", \"assert get_new_version('2.1.5', False) == '2.2.0'\", \"assert get_new_version('0.1.0', True) == '1.0.0...
{ "split": "train", "index": 1149, "acecode_id": "bigcode_python_fns_8095", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing an IP address which can be either IPv4 or IPv6. Write a function that checks if the given IP address is valid according to the following rules: \n1. An IPv4 address consists of four decimal numbers separated by dots (.), where each number is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_ip('192.168.1.1') == 'Valid IPv4'\", \"assert validate_ip('255.255.255.255') == 'Valid IPv4'\", \"assert validate_ip('0.0.0.0') == 'Valid IPv4'\", \"assert validate_ip('256.100.50.25') == 'Invalid IP'\", \"assert validate_ip('192.168.1.256') == 'Inv...
{ "split": "train", "index": 1150, "acecode_id": "bigcode_python_fns_37056", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of rectangles, each represented by four integers (x1, y1, x2, y2), where (x1, y1) is the bottom-left corner and (x2, y2) is the top-right corner. Implement a function `pick_rectangle(rects: List[Tuple[int, int, int, int]]) -> List[int]` that randomly picks ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pick_rectangle([(1, 1, 3, 3), (2, 2, 4, 4)]) in [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3], [2, 4], [3, 4], [4, 2], [4, 3], [4, 4]]\", \"assert pick_rectangle([(0, 0, 2, 2)]) in [[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2...
{ "split": "train", "index": 1151, "acecode_id": "evol_24667", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the installation directory for a software package based on the operating system type. The function should accept a single argument, `os_type`, which is a string representing the operating system. If the `os_type` is 'RHEL'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_installation_directory('RHEL') == 'INSTALL_DIR'\", \"assert get_installation_directory('Ubuntu') == '/usr/'\", \"assert get_installation_directory('Fedora') == '/usr/'\", \"assert get_installation_directory('Debian') == '/usr/'\", \"assert get_installati...
{ "split": "train", "index": 1152, "acecode_id": "bigcode_python_fns_2736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a report of active servers by group. The function should take a list of server groups, where each group is represented by a dictionary with its name and the number of active servers. Your function should return two lists: o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_server_report([{'name': 'Group A', 'active_servers': 10}, {'name': 'Group B', 'active_servers': 20}]) == (['Group A', 'Group B'], [10, 20])\", \"assert generate_server_report([{'name': 'Group C', 'active_servers': 0}, {'name': 'Group D', 'active_ser...
{ "split": "train", "index": 1153, "acecode_id": "bigcode_python_fns_30209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates pushing a new stack frame onto a stack data structure. The function should take an optional parameter `retaddr` which represents the return address to be stored in the new stack frame. If `retaddr` is not provided, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert push_stack_frame() is None\", \"assert push_stack_frame(5) is None\", \"assert push_stack_frame(10) is None\", \"assert push_stack_frame('address_1') is None\", \"assert push_stack_frame() is None\", \"assert push_stack_frame(0) is None\", \"assert push_stac...
{ "split": "train", "index": 1154, "acecode_id": "bigcode_python_fns_15992", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `heap_sort` that takes a list of elements (which can be integers, strings, or floating-point numbers) and sorts the list in ascending order using the heap sort algorithm. The function should return the sorted list.\nPlease reason step by step, then write a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert heap_sort([8, 3, 6, 7, 1]) == [1, 3, 6, 7, 8]\", \"assert heap_sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert heap_sort([3.14, 2.71, 1.41, 0.57]) == [0.57, 1.41, 2.71, 3.14]\", \"assert heap_sort(['banana', 'apple', 'cherry', 'date']) == ['apple'...
{ "split": "train", "index": 1155, "acecode_id": "evol_1539", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of ray directions represented as 2D vectors, implement a function `compute_rays_length(rays_d)` that calculates the length of each ray. The input will be a list of tuples where each tuple contains two floating-point numbers representing the x and y components of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_rays_length([(3, 4), (1, 1), (0, 2)]) == [5.0, 1.4142, 2.0]\", \"assert compute_rays_length([(0, 0), (0, 0), (0, 0)]) == [0.0, 0.0, 0.0]\", \"assert compute_rays_length([(1, 2), (2, 2), (3, 1)]) == [2.2361, 2.8284, 3.1623]\", \"assert compute_rays_le...
{ "split": "train", "index": 1156, "acecode_id": "bigcode_python_fns_19521", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of phonon frequencies at Gamma points in a crystal structure, represented as a list of lists. Your task is to implement a function that modifies the frequencies based on two conditions: 1) If the index of the frequency is even, it should remain unchanged. 2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_frequencies([[0, 1, 2], [3, 4, 5]]) == [[0, 2, 2], [3, 8, 5]]\", \"assert modify_frequencies([[1.5, 2.5, 3.5], [4.5, 5.5]]) == [[1.5, 5.0, 3.5], [4.5, 11.0]]\", \"assert modify_frequencies([[0, 0, 0]]) == [[0, 0, 0]]\", \"assert modify_frequencies([[1...
{ "split": "train", "index": 1157, "acecode_id": "bigcode_python_fns_39089", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two arguments - list_1 and list_2. The function should return a new list that contains all unique elements from both lists, while maintaining the order of elements according to their first appearance in either of the lists. Note that both lists can h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_unique([1, 2, 3, 4, 5], [2, 4, 6, 8, 10]) == [1, 2, 3, 4, 5, 6, 8, 10]\", \"assert merge_unique([1, 2, 3], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_unique([], []) == []\", \"assert merge_unique([1, 2, 3], []) == [1, 2, 3]\", \"assert merge_unique([], ...
{ "split": "train", "index": 1158, "acecode_id": "evol_3304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a hello SMS message for a user based on their username and phone number. The function should take two inputs: a string `username` representing the user's username and a string `phone_number` representing the user's phon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_hello_sms('Alice', '1234567890') == 'Hello, Alice! Your SMS will be sent to 1234567890.'\", \"assert generate_hello_sms('Bob', '') == 'No phone number available for Bob.'\", \"assert generate_hello_sms('Charlie', '9876543210') == 'Hello, Charlie! Yo...
{ "split": "train", "index": 1159, "acecode_id": "oss_3529", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_efficiency(battery_capacity: float, avg_mileage: float) -> Union[float, str]` that calculates the battery usage efficiency of an electric vehicle. The efficiency is defined as the average mileage divided by the battery capacity. If the battery ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_efficiency(100, 220) == 2.2\", \"assert calculate_efficiency(150, 300) == 2.0\", \"assert calculate_efficiency(200, 350) == 1.75\", \"assert calculate_efficiency(0, 100) == 'Invalid: Battery capacity is zero'\", \"assert calculate_efficiency(50, 10...
{ "split": "train", "index": 1160, "acecode_id": "evol_19713", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer x and a base b (2 <= b <= 36), write a function that converts the integer x into its representation in the specified base b. The function should return the converted string. If x is negative, the output should be prefixed with a negative sign. The digits are re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert int2base(10, 2) == '1010'\", \"assert int2base(15, 16) == 'F'\", \"assert int2base(255, 16) == 'FF'\", \"assert int2base(100, 10) == '100'\", \"assert int2base(-10, 2) == '-1010'\", \"assert int2base(0, 10) == '0'\", \"assert int2base(36, 36) == '10'\", \"as...
{ "split": "train", "index": 1161, "acecode_id": "bigcode_python_fns_30092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that accepts two lists of numbers, which may contain None values, and returns a new list with the element-wise product of the input lists. The function should ignore any None values in the input lists during the multiplication. If both elements at a giv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_array_elements([None], [None]) == [None]\", \"assert multiply_array_elements([1], [None]) == [1]\", \"assert multiply_array_elements([None], [2]) == [2]\", \"assert multiply_array_elements([0, 0, 0], [5, 5, 5]) == [0, 0, 0]\", \"assert multiply_arra...
{ "split": "train", "index": 1162, "acecode_id": "evol_14591", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a string expression that represents a function definition in a programming language. The function definition may include arguments with attribute-like syntax (e.g., 'materials.color', 'data.value'). Your task is to implement a function `get_argument_names(expressi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_argument_names('a, b, c', True) == {'a', 'b', 'c'}\", \"assert get_argument_names('a, b, c', False) == {'a', 'b', 'c'}\", \"assert get_argument_names('x.y, z, a.b.c', False) == {'x.y', 'z', 'a.b.c'}\", \"assert get_argument_names('arg1, arg2.arg3, arg4',...
{ "split": "train", "index": 1163, "acecode_id": "bigcode_python_fns_10620", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an input list of integers, write a function in Python that returns a new list where each element is the square of the corresponding element in the input list. The function should be named `square_elements` and should take a single parameter, which is the input list of int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_elements([2, 7, 15]) == [4, 49, 225]\", \"assert square_elements([0, 1, -1]) == [0, 1, 1]\", \"assert square_elements([-2, -3, -4]) == [4, 9, 16]\", \"assert square_elements([10]) == [100]\", \"assert square_elements([]) == []\", \"assert square_eleme...
{ "split": "train", "index": 1164, "acecode_id": "evol_8784", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that represents a linear programming constraint. The function should take in a list of coefficients, a list of variable identifiers, a constraint type, and a right-hand side value. Your function should verify that the constraint type and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_constraint([1, 2, 3], ['x1', 'x2', 'x3'], 'LE', 5) == {'coefficients': [1, 2, 3], 'variables': ['x1', 'x2', 'x3'], 'type': 'LE', 'rhs': 5}\", \"assert create_constraint([4, 5], ['y1', 'y2'], 'GE', 10) == {'coefficients': [4, 5], 'variables': ['y1', 'y...
{ "split": "train", "index": 1165, "acecode_id": "oss_34662", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that performs the following transformations: invert the case of each alphabetic character (uppercase to lowercase and vice versa), replace each odd digit with its succeeding even digit, and duplicate any special symbols. Return the modified ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert case_inversion_and_alteration('Test1@') == 'tEST2@@'\", \"assert case_inversion_and_alteration('A1B2C3') == 'a2b2c4'\", \"assert case_inversion_and_alteration('Python3!') == 'pYTHON4!!'\", \"assert case_inversion_and_alteration('abcde') == 'ABCDE'\", \"asser...
{ "split": "train", "index": 1166, "acecode_id": "evol_20566", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a byte stream representing an image, write a function `validate_image_format(stream)` that checks if the image is in a valid format. The function should read the first 512 bytes of the stream to determine the image format. If the format is valid, return the image format a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_image_format(io.BytesIO(b'\\\\x89PNG\\\\r\\\\n\\\\x1a\\\\n')) == '.png'\", \"assert validate_image_format(io.BytesIO(b'\\\\xff\\\\xd8\\\\xff')) == '.jpg'\", \"assert validate_image_format(io.BytesIO(b'GIF89a')) == '.gif'\", \"assert validate_image_f...
{ "split": "train", "index": 1167, "acecode_id": "bigcode_python_fns_42777", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a 2D grid represented as a list of lists, where 0 represents open cells and 1 represents walls. Write a function `find_path(grid: List[List[int]]) -> List[Tuple[int, int]]` that determines whether there is a path from the top-left corner of the grid (0, 0) to the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_path([[0, 0], [0, 0]]) == [(0, 0), (0, 1), (1, 1)]\", \"assert find_path([[0, 1], [0, 0]]) == [(0, 0), (1, 0), (1, 1)]\", \"assert find_path([[0, 0, 0], [1, 1, 0], [0, 0, 0]]) == [(0, 0), (0, 1), (0, 2), (1, 2), (2, 2)]\", \"assert find_path([[1, 1], [1...
{ "split": "train", "index": 1168, "acecode_id": "bigcode_python_fns_5614", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a string `text`. Your task is to determine whether the string looks like a PEM (Privacy-Enhanced Mail) encoding. A valid PEM encoding starts with '-----BEGIN ' followed by some content and ends with a line containing '-----END ' after the content. Write a function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert looks_like_PEM('-----BEGIN CERTIFICATE-----\\\\nMIIDXTCCAkWgAwIBAgIJAL0Q...\\\\n-----END CERTIFICATE-----') == True\", \"assert looks_like_PEM('This is just a random text.') == False\", \"assert looks_like_PEM('-----BEGIN ENCRYPTED MESSAGE-----\\\\nEncrypted...
{ "split": "train", "index": 1169, "acecode_id": "bigcode_python_fns_25953", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that processes a dictionary of books, where the keys are book titles and the values are tuples containing six float values: the book's price, rating, number of pages, year of publication, number of sold copies, and average reviews. The function should filte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_and_sort_books({}, 10, 4, 100, 2000, 50, 3) == 'No books to process'\", \"assert filter_and_sort_books({'Book A': (10.0, 4.5, 150, 2010, 100, 4.0)}, 5, 4, 100, 2000, 50, 3) == [('Book A', (10.0, 4.5, 150, 2010, 100, 4.0))]\", \"assert filter_and_sort_...
{ "split": "train", "index": 1170, "acecode_id": "evol_20563", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with developing a Python function that simulates a power distribution system. The function should retrieve the names of all zone end elements from a predefined list of zone end elements. Implement a function called `get_zone_end_elements` that returns the names o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_zone_end_elements() == ['ZoneEnd1', 'ZoneEnd2', 'ZoneEnd3', 'ZoneEnd4', 'ZoneEnd5']\", \"assert get_zone_end_elements() == ['ZoneEnd1', 'ZoneEnd2', 'ZoneEnd3', 'ZoneEnd4', 'ZoneEnd5']\", \"assert get_zone_end_elements() != ['ZoneEnd6', 'ZoneEnd7']\", \"a...
{ "split": "train", "index": 1171, "acecode_id": "oss_21419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `find_package_data()` that returns a dictionary representing the structure of a package named 'jupyterlab'. The dictionary should have the key 'jupyterlab', which maps to a list of strings. This list should include the following fixed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_package_data() == {'jupyterlab': ['build/*', '*.js', 'package.app.json', 'yarn.lock', 'yarn.app.lock', '.yarnrc', 'themes/dark/*', 'themes/light/*', 'themes/colorful/*', 'schemas/default/*', 'schemas/custom/*'] }\", \"assert find_package_data()['jupyter...
{ "split": "train", "index": 1172, "acecode_id": "bigcode_python_fns_6894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing values that need to be transferred into a virtual machine's infeed queue. Your task is to implement a function that accepts this list and returns a new list where each value from the input list has been doubled. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_infeed_values([1, 2, 3]) == [2, 4, 6]\", \"assert double_infeed_values([0]) == [0]\", \"assert double_infeed_values([-1, -2, -3]) == [-2, -4, -6]\", \"assert double_infeed_values([100, 200, 300]) == [200, 400, 600]\", \"assert double_infeed_values([-1...
{ "split": "train", "index": 1173, "acecode_id": "bigcode_python_fns_4015", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a grid of size n x m, where n represents the number of rows and m represents the number of columns. Each cell in the grid contains a non-negative integer value. Your task is to find the maximum sum of integers that can be obtained by traversing from the top-left c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxSumPath([[1]]) == 1\", \"assert maxSumPath([[0]]) == 0\", \"assert maxSumPath([[1, 0, 2], [0, 1, 0], [2, 0, 1]]) == 4\", \"assert maxSumPath([[0, 0], [0, 0]]) == 0\", \"assert maxSumPath([[1, 10, 1], [1, 1, 1], [1, 1, 1]]) == 14\", \"assert maxSumPath([[1...
{ "split": "train", "index": 1174, "acecode_id": "oss_23511", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to compare simulation results from three different power system simulation tools: ANDES, TSAT, and PSS/E. The function should take in the variable to be plotted and the results from ANDES, TSAT, and PSS/E, and it should return a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_simulation_results('power', [100, 200, 150], [90, 210, 160], [95, 205, 155]) == ['ANDES', 'TSAT', 'TSAT']\", \"assert compare_simulation_results('frequency', [60, 60, 60], [60, 60, 60], [60, 60, 60]) == ['Tie', 'Tie', 'Tie']\", \"assert compare_simul...
{ "split": "train", "index": 1175, "acecode_id": "oss_26021", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. Optimize your implementation to improve its performance, especially for larger values ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2...
{ "split": "train", "index": 1176, "acecode_id": "evol_7072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a representation of a channel name in the form of a tree structure where each node can either be an 'Identifier' or an 'Index'. Implement a function `channame_to_python_format_string(node)` that converts the channel name represented by this tree structure into a P...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert channame_to_python_format_string({'type': 'Identifier', 'children': ['chan1'], 'leaf': None}) == (True, 'chan1')\", \"assert channame_to_python_format_string({'type': 'Identifier', 'children': ['chan8'], 'leaf': None}) == (True, 'chan8')\", \"assert channame...
{ "split": "train", "index": 1177, "acecode_id": "bigcode_python_fns_32856", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a message sender in a communication system. The function should generate messages at regular intervals, specifically every 5 seconds. Each message should contain the current timestamp (in seconds) when the message was s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_messages(1) == ['Sender sent this at 0']\", \"assert generate_messages(2) == ['Sender sent this at 0', 'Sender sent this at 5']\", \"assert generate_messages(3) == ['Sender sent this at 0', 'Sender sent this at 5', 'Sender sent this at 10']\", \"ass...
{ "split": "train", "index": 1178, "acecode_id": "bigcode_python_fns_25185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function `extract_integer` that takes a float input and returns the largest integer less than or equal to the given number. The function should handle negative numbers, zero, and should return an error message for very large numbers (greater than 1e308 or less than -1e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_integer(4.7) == 4\", \"assert extract_integer(-3.2) == -4\", \"assert extract_integer(0) == 0\", \"assert extract_integer(1.7e308) == 'Error: Number too large.'\", \"assert extract_integer(-1.7e308) == 'Error: Number too large.'\", \"assert extract_i...
{ "split": "train", "index": 1179, "acecode_id": "evol_22065", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representation of a time duration and a date object representing 'today'. The time duration specifies a number of days, weeks, or months to subtract from 'today'. Your task is to implement a function `get_adj_date(time: str, today: datetime.date) -> str` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_adj_date('5 days', datetime.date(2023, 10, 10)) == '2023-10-05'\", \"assert get_adj_date('2 weeks', datetime.date(2023, 10, 10)) == '2023-09-26'\", \"assert get_adj_date('1 month', datetime.date(2023, 10, 10)) == '2023-09-10'\", \"assert get_adj_date('Po...
{ "split": "train", "index": 1180, "acecode_id": "bigcode_python_fns_35705", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `create_u2f_instance(data: Dict[str, Any]) -> U2F` that takes a dictionary containing credential parameters and returns an instance of the U2F class constructed from that dictionary. The dictionary `data` will contain string keys and values of any type. Ensure...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_u2f_instance({'key1': 'value1', 'key2': 'value2'}) == U2F.from_dict({'key1': 'value1', 'key2': 'value2'})\", \"assert create_u2f_instance({'credential': 'abc123', 'user': 'user1'}) == U2F.from_dict({'credential': 'abc123', 'user': 'user1'})\", \"asser...
{ "split": "train", "index": 1181, "acecode_id": "bigcode_python_fns_36137", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes a string of ASCII characters, converts each character to its equivalent decimal value considering the characters case insensitive, and computes the XOR of these decimal values. The function should ignore whitespace characters. Implement the function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ascii_to_dec('') == 0\", \"assert ascii_to_dec(' ') == 0\", \"assert ascii_to_dec('a') == 97\", \"assert ascii_to_dec('A') == 97\", \"assert ascii_to_dec('abc') == 97 ^ 98 ^ 99\", \"assert ascii_to_dec('ABC') == 97 ^ 98 ^ 99\", \"assert ascii_to_dec('Hello W...
{ "split": "train", "index": 1182, "acecode_id": "evol_30052", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes an event loop for asynchronous programming. The function should attempt to import a module named 'uvloop'. If the module is successfully imported, the function should set the event loop policy to 'uvloop.EventLoopPolicy()...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_event_loop() is not None\", \"assert isinstance(initialize_event_loop(), asyncio.AbstractEventLoop)\", \"assert initialize_event_loop().is_running() == False\", \"assert initialize_event_loop().is_closed() == False\", \"assert initialize_event_loo...
{ "split": "train", "index": 1183, "acecode_id": "bigcode_python_fns_12149", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings. Your task is to implement a function `canSeeSunset(heights: List[int]) -> bool` that determines whether the last building in the list can see the sunset. A building can see the sunset if there are no taller...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert canSeeSunset([3, 5, 4, 2]) == False\", \"assert canSeeSunset([1, 2, 3]) == True\", \"assert canSeeSunset([2, 3, 1, 5]) == True\", \"assert canSeeSunset([1, 3, 2, 4]) == True\", \"assert canSeeSunset([1]) == True\", \"assert canSeeSunset([1, 2]) == True\", \"...
{ "split": "train", "index": 1184, "acecode_id": "bigcode_python_fns_46044", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string `s`, write a function `check_palindrome` that returns `True` if the string is a palindrome, and `False` otherwise. A palindrome is defined as a sequence of characters that reads the same backward as forward, ignoring spaces, punctuation, and capitalization. For e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_palindrome('A man, a plan, a canal, Panama') == True\", \"assert check_palindrome('racecar') == True\", \"assert check_palindrome('hello') == False\", \"assert check_palindrome('') == True\", \"assert check_palindrome('No lemon, no melon') == True\", \...
{ "split": "train", "index": 1185, "acecode_id": "oss_4824", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that takes a positive integer `n` as input and returns the `n`-th Fibonacci number. The Fibonacci sequence is defined as follows: the first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of the two preced...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(1) == 0\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 1\", \"assert fibonacci(4) == 2\", \"assert fibonacci(5) == 3\", \"assert fibonacci(6) == 5\", \"assert fibonacci(7) == 8\", \"assert fibonacci(8) == 13\", \"assert fibonacci(9) == 2...
{ "split": "train", "index": 1186, "acecode_id": "evol_1361", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that removes an integer from a list if it exists. Specifically, you need to write a function `remove_number(num: int, numbers: List[int]) -> List[int]` that takes two parameters: an integer `num` and a list of integers `numbers`. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_number(3, [1, 2, 3, 4]) == [1, 2, 4]\", \"assert remove_number(5, [5, 5, 5]) == [5, 5]\", \"assert remove_number(10, [1, 2, 3]) == [1, 2, 3]\", \"assert remove_number(0, [0, 1, 0, 2]) == [1, 0, 2]\", \"assert remove_number(1, []) == []\", \"assert rem...
{ "split": "train", "index": 1187, "acecode_id": "bigcode_python_fns_9792", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `bi_directional_stream_response` that simulates a bi-directional communication stream. When this function is called with a message, it must return `None`, indicating that an empty message is yielded in response. The function should ac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bi_directional_stream_response(Message()) is None\", \"assert bi_directional_stream_response(Message()) is None\", \"assert bi_directional_stream_response(Message()) is None\", \"assert bi_directional_stream_response(Message()) is None\", \"assert bi_directi...
{ "split": "train", "index": 1188, "acecode_id": "oss_28365", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `fib(n)` that takes an integer `n` as input and returns a list containing the first `n` elements of the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two precedi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(1) == [0]\", \"assert fib(2) == [0, 1]\", \"assert fib(3) == [0, 1, 1]\", \"assert fib(4) == [0, 1, 1, 2]\", \"assert fib(5) == [0, 1, 1, 2, 3]\", \"assert fib(6) == [0, 1, 1, 2, 3, 5]\", \"assert fib(7) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fib(8) == [0,...
{ "split": "train", "index": 1189, "acecode_id": "evol_23203", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing temperatures measured over a period of days. Your task is to implement a function that updates the temperature records to ensure that each temperature is non-negative. If a temperature is negative, it should be replaced with zero. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_temperatures([-1, 2, -3, 4]) == [0, 2, 0, 4]\", \"assert update_temperatures([-5, -2, -1, 0]) == [0, 0, 0, 0]\", \"assert update_temperatures([1, 2, 3]) == [1, 2, 3]\", \"assert update_temperatures([0, 0, 0]) == [0, 0, 0]\", \"assert update_temperatur...
{ "split": "train", "index": 1190, "acecode_id": "bigcode_python_fns_35706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_string(k: int) -> str` that generates a random alphabetical string of length k using lowercase letters from 'a' to 'z'. The function should be called with a positive integer k, and it should return a string of exactly k characters. Note that the o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_string(5)) == 5\", \"assert len(generate_string(1)) == 1\", \"assert len(generate_string(10)) == 10\", \"assert len(generate_string(3)) == 3\", \"assert len(generate_string(4)) == 4\", \"assert len(generate_string(7)) == 7\", \"assert len(genera...
{ "split": "train", "index": 1191, "acecode_id": "evol_15473", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that verifies whether a list of hostnames contains exactly one valid hostname. The function should take in a list of strings representing hostnames and return a boolean value. If the list is empty or contains more than one hostname, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_single_hostname([]) == False\", \"assert verify_single_hostname(['host1']) == True\", \"assert verify_single_hostname(['host1', 'host2']) == False\", \"assert verify_single_hostname(['host1', 'host2', 'host3']) == False\", \"assert verify_single_hostn...
{ "split": "train", "index": 1192, "acecode_id": "bigcode_python_fns_6493", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple online electricity consumption monitoring system. The function should be able to track the electricity consumption of different households and provide functionality to calculate the total electricity consumptio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_electricity_consumption([(1, 0), (2, 0)]) == 0.0\", \"assert total_electricity_consumption([(1, 10.0), (2, 20.0), (3, 30.0)]) == 60.0\", \"assert total_electricity_consumption([(1, 5.5), (2, 15.5)]) == 21.0\", \"assert total_electricity_consumption([(1...
{ "split": "train", "index": 1193, "acecode_id": "oss_28483", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_date(date_string: str) -> bool` that checks if the given date string adheres to the format of MM/DD/YYYY and validates whether it represents a legitimate date (e.g., check for nonexistent dates like 02/30/2020). The function should return True for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_date('01/01/2020') == True\", \"assert validate_date('02/29/2020') == True\", \"assert validate_date('02/30/2020') == False\", \"assert validate_date('04/31/2020') == False\", \"assert validate_date('12/31/2020') == True\", \"assert validate_date('0...
{ "split": "train", "index": 1194, "acecode_id": "evol_32084", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a request to a hypothetical cloud service. Write a function `mock_cloud_request` that takes an action string and a set of parameters as keyword arguments. The function should return a response based on the action and parameters. If the action is '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mock_cloud_request('DummyAction', DummyString='test', DummyNumber=0, DummyList=['item1', 'item2']) == {'DummyResponse': 0}\", \"assert mock_cloud_request('DummyAction', DummyString='hello', DummyNumber=5, DummyList=['value1']) == {'DummyResponse': 0}\", \"as...
{ "split": "train", "index": 1195, "acecode_id": "bigcode_python_fns_40754", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `calculate_pairwise_sums` that computes all possible pairwise sums of the integers in the list and returns a list of tuples representing these sums, where each tuple contains the two integers that were summed and their corresponding su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_pairwise_sums([1, 2, 3]) == [(1, 2, 3), (1, 3, 4), (2, 3, 5)]\", \"assert calculate_pairwise_sums([5, 10, 15]) == [(5, 10, 15), (5, 15, 20), (10, 15, 25)]\", \"assert calculate_pairwise_sums([0, 0, 0]) == [(0, 0, 0), (0, 0, 0), (0, 0, 0)]\", \"asse...
{ "split": "train", "index": 1196, "acecode_id": "bigcode_python_fns_39163", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of integers and returns a new list containing only the unique integers from the original list, in the order they first appeared. Implement the function `unique_integers(arr: List[int]) -> List[int]:` where `arr` is a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 3, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([5, 5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3]) == [1, 2, 3]\", \"assert unique_integers([1, 2, 1, 2, 1, 2]) == [1, 2]\...
{ "split": "train", "index": 1197, "acecode_id": "bigcode_python_fns_29927", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a command-line interface for a fictional tool called 'Otter'. The function `run_otter` takes an optional list of strings as input, representing command-line arguments. The function should parse these arguments and deter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert run_otter(['assign']) == 'assign'\", \"assert run_otter(['check']) == 'check'\", \"assert run_otter(['export']) == 'export'\", \"assert run_otter(['generate']) == 'generate'\", \"assert run_otter(['grade']) == 'grade'\", \"assert run_otter([]) == 'You must s...
{ "split": "train", "index": 1198, "acecode_id": "bigcode_python_fns_38968", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether a series of financial operations result in the account balance going below zero. The function should accept a list of operations, where each operation is represented as a tuple consisting of a string indicating the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert below_zero([('deposit', 100), ('withdrawal', 50)], case_insensitive=False) == False\", \"assert below_zero([('deposit', 100), ('withdrawal', 150)], case_insensitive=False) == True\", \"assert below_zero([('withdrawal', 50)], case_insensitive=False) == True\"...
{ "split": "train", "index": 1199, "acecode_id": "evol_15527", "num_tests": 16 }