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": "Implement a function `handle_message` that takes a message in the form of a dictionary with two keys: 'type' and 'content'. The 'type' can be one of three values: 'schedule', 'deactivate', or 'association'. Based on the 'type', the function should return a corresponding string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_message({'type': 'schedule', 'content': 'Meeting at 10 AM'}) == 'Scheduled: Meeting at 10 AM'\", \"assert handle_message({'type': 'deactivate', 'content': 'Notification 123'}) == 'Deactivated: Notification 123'\", \"assert handle_message({'type': 'ass... | {
"split": "train",
"index": 82200,
"acecode_id": "oss_33198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string consisting of lowercase letters. Write a function that determines if the string can be rearranged to form a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward. Return True if the st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_form_palindrome('civic') == True\", \"assert can_form_palindrome('ivicc') == True\", \"assert can_form_palindrome('hello') == False\", \"assert can_form_palindrome('a') == True\", \"assert can_form_palindrome('aa') == True\", \"assert can_form_palindrome... | {
"split": "train",
"index": 82201,
"acecode_id": "bigcode_python_fns_9182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing game titles. Your task is to implement a function that removes a specified game title from the list. If the game title exists in the list, remove the first occurrence of that title and return True. If the game title does not exist in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_game(['Minecraft', 'Call of Duty', 'Fortnite'], 'fortnite') == True\", \"assert remove_game(['Minecraft', 'Call of Duty', 'Fortnite'], 'League of Legends') == False\", \"assert remove_game(['Halo', 'Half-Life', 'Counter-Strike'], 'HALO') == True\", \"... | {
"split": "train",
"index": 82202,
"acecode_id": "bigcode_python_fns_14096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a star graph represented by a 2D integer array `edges`, where each `edges[i] = [ui, vi]` signifies an edge between nodes `ui` and `vi`. A star graph has a single central node connected to all other nodes. Your task is to implement a function that returns the centr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findCenter([[1,2],[2,3],[4,2]]) == 2\", \"assert findCenter([[1,2],[5,1],[1,3],[1,4]]) == 1\", \"assert findCenter([[1,3],[2,3],[4,3]]) == 3\", \"assert findCenter([[1,5],[2,5],[3,5],[4,5]]) == 5\", \"assert findCenter([[1,2],[1,3],[1,4],[1,5]]) == 1\", \"as... | {
"split": "train",
"index": 82203,
"acecode_id": "evol_12966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of workloads based on specific criteria. Each workload is represented by a dictionary containing a 'href' key and a 'label_keys' key (which is a list of strings). Your function should check if the workload does not... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_workloads([{'href': 'instance1', 'label_keys': ['role'], 'app': 'Development'}, {'href': 'instance2', 'label_keys': ['role']}, {'href': 'instance3', 'label_keys': ['role'], 'app': 'Quarantine'}]) == [{'href': 'instance1', 'label_keys': ['role'], 'app'... | {
"split": "train",
"index": 82204,
"acecode_id": "oss_10420",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of pairs, where each pair consists of a key and a value, implement a function `add_dependencies(pairs: List[Tuple[str, str]]) -> Dict[str, List[str]]` that organizes the values under their keys. If a key appears multiple times with different values, ensure that the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_dependencies([('a', 'b'), ('a', 'c'), ('b', 'a'), ('a', 'b')]) == {'a': ['b', 'c'], 'b': ['a']}\", \"assert add_dependencies([('x', 'y'), ('x', 'z'), ('x', 'y')]) == {'x': ['y', 'z']}\", \"assert add_dependencies([('p', 'q'), ('p', 'q'), ('r', 's'), ('r'... | {
"split": "train",
"index": 82205,
"acecode_id": "bigcode_python_fns_21919",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and determines if the string is a palindrome. A palindrome is a sequence that reads the same backward as forward. The function should return True if the input string is a palindrome, and False otherwise.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('kite') == False\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('level') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('A man a plan a canal Panama') == False\", \"assert is_palindrome('no... | {
"split": "train",
"index": 82206,
"acecode_id": "evol_31053",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `arr` and an integer `d`, you can start jumping from any index of the array. In one step, you can jump from index `i` to index: `i + x` (where `i + x < arr.length` and `0 < x <= d`) or `i - x` (where `i - x >= 0` and `0 < x <= d`). You can only jump t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxJumps([10, 9, 8, 7, 6], 3) == 5\", \"assert maxJumps([1], 1) == 1\", \"assert maxJumps([1, 1, 1, 1], 2) == 1\", \"assert maxJumps([100, 99, 98, 97, 96], 4) == 5\", \"assert maxJumps([4, 3, 2, 4, 5], 3) == 4\", \"assert maxJumps([3, 1, 2, 2, 1], 2) == 3\"]... | {
"split": "train",
"index": 82207,
"acecode_id": "evol_25190",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You have been given a JSON string that represents an attachment from a multi-dimensional measurement. The structure of the JSON string is as follows: it contains a 'name', 'dimensions' (which is a list of dictionaries with keys 'uom_suffix' and 'uom_code'), and 'value' (a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_attachment_to_measurement('{\\\"name\\\":\\\"TestMeasurement\\\",\\\"dimensions\\\":[{\\\"uom_suffix\\\":\\\"m\\\",\\\"uom_code\\\":\\\"length\\\"}],\\\"value\\\":[[1,2,3,4]]}') == {'name': 'TestMeasurement', 'units': None, 'dimensions': [{'uom_suffi... | {
"split": "train",
"index": 82208,
"acecode_id": "bigcode_python_fns_3409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `complex_flatten(nested_list)` that takes a nested list as input and returns a flattened version of that list. If the input is not a list, the function should return a message indicating the type of the input that is not a list. The function should maintain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_flatten([1, [2, [3]], 4]) == [1, 2, 3, 4]\", \"assert complex_flatten([1, 'a', [2, [3, 'b']], 4]) == [1, 'a', 2, 3, 'b', 4]\", \"assert complex_flatten([True, [False], [1, [2.5, 'test']]]) == [True, False, 1, 2.5, 'test']\", \"assert complex_flatten(... | {
"split": "train",
"index": 82209,
"acecode_id": "evol_20481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing HTML code. Your task is to implement a function that checks whether a specific HTML tag is present in that string. The function should take three parameters: the HTML string, the tag to search for (without angle brackets), and a section name. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_html_tag('<b>MNE-Python is AWESOME</b>', 'b', 'html_section') == True\", \"assert contains_html_tag('<b>MNE-Python is AWESOME</b>', 'B', 'html_section') == False\", \"assert contains_html_tag('<div>Content</div>', 'div', 'html_section') == True\", \... | {
"split": "train",
"index": 82210,
"acecode_id": "bigcode_python_fns_20533",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a context dictionary containing key-value pairs and a nested dictionary representing file format configurations. The function should take this context dictionary as input and return a new dictionary with the following modif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_context({'k1': 'v1', 'k2': 'v2', 'fileFormatToml': {'in': './input/file.toml', 'out': './output/file.toml'}}) == {'k1': 'v1', 'k2': 'v2', 'fileFormatToml': {'in': 'input_path', 'out': 'output_path'}}\", \"assert process_context({'k1': 'test', 'fileFo... | {
"split": "train",
"index": 82211,
"acecode_id": "bigcode_python_fns_760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that calculates the total memory usage of a specific process on a GPU, given a list of GPU processes. Each process is represented as a list containing the following elements: [gpu_index, pid, process_type, process_name, memory_usage_mb]. Y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_gpu_memory_usage([[0, 1234, 'type1', 'processA', 256], [1, 1234, 'type2', 'processB', 128], [0, 5678, 'type1', 'processC', 512]], 1234) == 384\", \"assert total_gpu_memory_usage([[0, 1234, 'type1', 'processA', 256], [1, 5678, 'type2', 'processB', 128],... | {
"split": "train",
"index": 82212,
"acecode_id": "bigcode_python_fns_31602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three lists: 'params', 'lower_params', and 'upper_params'. Each list contains integers, where 'params' represents a list of parameter values, and 'lower_params' and 'upper_params' represent the corresponding lower and upper bounds for each parameter. Your task is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_params_out_of_range([0, 3, 8], [1, 3, 7], [5, 5, 10]) == [0]\", \"assert get_params_out_of_range([2, 4, 6], [2, 3, 5], [5, 5, 7]) == []\", \"assert get_params_out_of_range([1, 2, 3], [1, 2, 3], [3, 2, 4]) == []\", \"assert get_params_out_of_range([2, 4, ... | {
"split": "train",
"index": 82213,
"acecode_id": "bigcode_python_fns_47815",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified text translator. Your goal is to create a function called `simple_translate` that takes an input string and a list of translations, and outputs the final translated text. The function should perform the following: 1. The input strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simple_translate('Hello World', [('World', 'Universe')]) == 'Hello Universe'\", \"assert simple_translate('Goodbye World', [('Goodbye', 'Farewell'), ('World', 'Earth')]) == 'Farewell Earth'\", \"assert simple_translate('Python is great', [('Python', 'Java'),... | {
"split": "train",
"index": 82214,
"acecode_id": "oss_21978",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries. Your task is to merge these dictionaries into a single dictionary. If there are duplicate keys, the values from the later dictionaries should overwrite the values from the earlier ones. Implement a function `merge_dicts(dicts: List[Dict[str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_dicts([{ 'a': 1 }, { 'b': 2 }, { 'c': 3 }]) == { 'a': 1, 'b': 2, 'c': 3 }\", \"assert merge_dicts([{ 'a': 1 }, { 'a': 2, 'b': 2 }]) == { 'a': 2, 'b': 2 }\", \"assert merge_dicts([{ 'x': 1 }, { 'x': 2 }, { 'y': 3 }]) == { 'x': 2, 'y': 3 }\", \"assert me... | {
"split": "train",
"index": 82215,
"acecode_id": "bigcode_python_fns_47672",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the tracking of various species pools in an ecosystem. You are provided with two lists: `phytoindex` and `pocindex`, which contain indices for phytoplankton species and particulate organic carbon species, respectively. Each... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert track_species_pools([0], [], [MockSpecies(1.0, 2.0, 3.0)]) == [1.0, 2.0]\", \"assert track_species_pools([0], [0], [MockSpecies(0.1, 0.2, 0.3)]) == [0.1, 0.2, 0.3]\", \"assert track_species_pools([2], [2], [MockSpecies(1.0, 1.1, 1.2), MockSpecies(2.0, 2.1, 2... | {
"split": "train",
"index": 82216,
"acecode_id": "oss_3033",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Develop a function in Python called 'check_parity_combined' that takes two integer input parameters, x and y. The function should return a boolean outcome based on the combined value of x and y. If the combined value (addition, subtraction, or product) of the two integers exhib... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_parity_combined(1, 1) == True\", \"assert check_parity_combined(2, 2) == True\", \"assert check_parity_combined(4, 6) == True\", \"assert check_parity_combined(2, 3) == True\", \"assert check_parity_combined(12, 8) == True\", \"assert check_parity_comb... | {
"split": "train",
"index": 82217,
"acecode_id": "evol_21793",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a directed graph in the dot format. Your task is to implement a function that takes this dot string as input and returns a list of tuples representing the edges of the graph. Each tuple should contain two elements: the source node and th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_edges('A -> B; C -> D;') == [('A', 'B'), ('C', 'D')]\", \"assert extract_edges('X -> Y; Y -> Z; Z -> X;') == [('X', 'Y'), ('Y', 'Z'), ('Z', 'X')]\", \"assert extract_edges('A -> B;') == [('A', 'B')]\", \"assert extract_edges('') == []\", \"assert ext... | {
"split": "train",
"index": 82218,
"acecode_id": "bigcode_python_fns_8291",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that sorts the array in ascending order and returns the sorted array. The input array may contain both positive and negative integers as well as zero. For example, if the input is [1, 5, -3, 0, 8], the output should be [-3, 0, 1,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_array([1, 5, -3, 0, 8]) == [-3, 0, 1, 5, 8]\", \"assert sort_array([10, -1, 2, 5]) == [-1, 2, 5, 10]\", \"assert sort_array([0, 0, 0]) == [0, 0, 0]\", \"assert sort_array([]) == []\", \"assert sort_array([-5, -3, -1, 0, 1, 2, 3, 5]) == [-5, -3, -1, 0, 1... | {
"split": "train",
"index": 82219,
"acecode_id": "evol_3301",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a Python dictionary, write a function `convert_dict_to_json(input_dict)` that converts the dictionary to a JSON string. The function should handle potential exceptions gracefully by returning `None` if the input cannot be converted. The function should also ensure that Un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_dict_to_json({'name': 'John', 'age': 30}) == '{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}'\", \"assert convert_dict_to_json({'city': 'New York', 'country': 'USA'}) == '{\\\"city\\\": \\\"New York\\\", \\\"country\\\": \\\"USA\\\"}'\", \"assert conv... | {
"split": "train",
"index": 82220,
"acecode_id": "evol_26918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function `get_satellite_count(planet_name: str) -> int` that retrieves the number of natural satellites for a given planet in the solar system. The function should return the satellite count for known planets: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_satellite_count('Mercury') == 0\", \"assert get_satellite_count('Venus') == 0\", \"assert get_satellite_count('Earth') == 1\", \"assert get_satellite_count('Mars') == 2\", \"assert get_satellite_count('Jupiter') == 79\", \"assert get_satellite_count('Ura... | {
"split": "train",
"index": 82221,
"acecode_id": "evol_12014",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that accepts two parameters: an integer `a` and a list of floating-point numbers `v`. The function should return a string representation of the list of floating-point numbers formatted to two decimal places, preceded by the integer `a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_values(5, [3.14159, 2.71828]) == '5, 3.14, 2.72'\", \"assert format_values(1, [0.0, 10.5, -5.5]) == '1, 0.00, 10.50, -5.50'\", \"assert format_values(10, []) == '10'\", \"assert format_values(0, [1.2345, 2.3456]) == '0, 1.23, 2.35'\", \"assert format_... | {
"split": "train",
"index": 82222,
"acecode_id": "bigcode_python_fns_39776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a user is authenticated based on their authentication status. You will receive a boolean value indicating whether the user is authenticated or not. If the user is authenticated, return 'Access granted'; otherwise, retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_authentication(True) == 'Access granted'\", \"assert check_authentication(False) == 'Redirect to login'\", \"assert check_authentication(True) == 'Access granted'\", \"assert check_authentication(False) == 'Redirect to login'\", \"assert check_authenti... | {
"split": "train",
"index": 82223,
"acecode_id": "oss_29229",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical values representing some measurements. Your task is to calculate the average of these measurements. If the average is zero, return zero. Otherwise, return the average rounded to two decimal places. Implement a function named `calculate_average(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1.0, 2.0, 3.0]) == 2.0\", \"assert calculate_average([-1.0, -2.0, -3.0]) == -2.0\", \"assert calculate_average([0.0, 0.0, 0.0]) == 0.0\", \"assert calculate_average([1.5, 2.5, 3.5]) == 2.5\", \"assert calculate_average([-1.5, 1.5]) == 0.0\... | {
"split": "train",
"index": 82224,
"acecode_id": "bigcode_python_fns_34172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `manage_queue` that simulates the operations of a message queue. The function should accept three parameters: `queue` (a list of messages), `operation` (a string that can be 'add', 'remove', or 'list'), and `message` (a string for the message to be ad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_queue([], 'add', 'Hello') == ['Hello']\", \"assert manage_queue(['Hello'], 'remove', 'Hello') == []\", \"assert manage_queue(['Hello'], 'remove', 'World') == ['Hello']\", \"assert manage_queue(['Hello'], 'add', 'World') == ['Hello', 'World']\", \"asse... | {
"split": "train",
"index": 82225,
"acecode_id": "evol_15159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a function that returns a dictionary where the keys are the unique elements from the input list and the values are the number of times each element appears in that list. The function should handle both positive and negativ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_frequency([1, 2, 2, 3, 3, 3, 4, 4, 4, 4]) == {1: 1, 2: 2, 3: 3, 4: 4}\", \"assert count_frequency([]) == {}\", \"assert count_frequency([5, 5, 5, 5]) == {5: 4}\", \"assert count_frequency([1, -1, 1, -1, 0]) == {1: 2, -1: 2, 0: 1}\", \"assert count_freq... | {
"split": "train",
"index": 82226,
"acecode_id": "oss_184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that simulates fetching the names of cloud functions from a predefined list. Write a function named `fetch_function_names` that returns a string containing the names of the cloud functions concatenated with a comma and a space between t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_function_names() == 'functionA, functionB, functionC, functionD'\", \"assert fetch_function_names() != 'functionA'\", \"assert fetch_function_names() != 'functionA, functionB'\", \"assert fetch_function_names() != 'functionC, functionD'\", \"assert fet... | {
"split": "train",
"index": 82227,
"acecode_id": "bigcode_python_fns_2046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a command-line argument parser for a hypothetical protocol buffer compiler (protoc). The function, `simulate_protoc_command`, takes in a list of arguments as input and returns a string that represents the command to be exec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_protoc_command(['--language', 'cpp']) == 'Error: Missing required arguments'\", \"assert simulate_protoc_command(['--plugin-path', 'path/to/plugin']) == 'Error: Missing required arguments'\", \"assert simulate_protoc_command(['--plugin-path', 'path/... | {
"split": "train",
"index": 82228,
"acecode_id": "bigcode_python_fns_1372",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given two sorted arrays of integers. Write a function that merges the two arrays into a single sorted array, ensuring that the resulting array does not contain any duplicate numbers. The function should operate in linear time complexity O(n + m), where n is the size of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_arrays([1, 2, 3], [2, 3, 4]) == [1, 2, 3, 4]\", \"assert merge_arrays([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_arrays([5, 6, 7], []) == [5, 6, 7]\", \"assert merge_arrays([1, 2, 3, 4], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_arrays([1, ... | {
"split": "train",
"index": 82229,
"acecode_id": "evol_2744",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of points representing a line segment between two points in a 2D space. The function should take four parameters: the x-coordinate of the first point (x1), the y-coordinate of the first point (y1), the x-coordinate o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert line_segment(0, 0, 3, 3) == [(0, 0), (1, 1), (2, 2), (3, 3)]\", \"assert line_segment(0, 0, 0, 5) == [(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5)]\", \"assert line_segment(0, 0, 5, 0) == [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0)]\", \"assert line_se... | {
"split": "train",
"index": 82230,
"acecode_id": "oss_25468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `check_incrementing_matrix(matrix: List[List[int]]) -> bool` that examines a given bi-dimensional matrix to verify whether each element follows a strictly increasing sequence. The function should check this condition both horizontally across each row and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_incrementing_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == True\", \"assert check_incrementing_matrix([[1, 2], [3, 4]]) == True\", \"assert check_incrementing_matrix([[1]]) == True\", \"assert check_incrementing_matrix([]) == True\", \"assert check_incr... | {
"split": "train",
"index": 82231,
"acecode_id": "evol_34980",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a message based on the response from a hypothetical API. The function should process the response and return a dictionary with specific fields. The function should take in the following parameters: \n- `response`: a diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_message({'status_code': 200, 'text': 'OK'}) == {'status': 'success', 'message': 'API request successful'}\", \"assert generate_message({'status_code': 404, 'text': 'Not Found'}) == {'status': 'error', 'code': 404, 'message': 'Not Found'}\", \"assert... | {
"split": "train",
"index": 82232,
"acecode_id": "oss_36386",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a sequence of XML elements. Your task is to implement a function that translates the content of these XML elements using a provided callback function. If the input string is empty or invalid XML, the function should return the original str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert xml_translate(lambda x: x.upper(), '<root><child>hello</child></root>') == '<root><child>HELLO</child></root>'\", \"assert xml_translate(lambda x: x[::-1], '<data><item>test</item></data>') == '<data><item>tset</item></data>'\", \"assert xml_translate(lambda... | {
"split": "train",
"index": 82233,
"acecode_id": "bigcode_python_fns_17641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple timer. The timer should have the following functionalities: 1. Start the timer, 2. Stop the timer, 3. Reset the timer to 0, 4. Get the elapsed time since the timer started. Implement a function `simulate_timer(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_timer(['start', 'stop', 'get_elapsed_time']) == [1.0]\", \"assert simulate_timer(['start', 'start', 'stop', 'get_elapsed_time']) == [1.0]\", \"assert simulate_timer(['start', 'stop', 'reset', 'get_elapsed_time']) == [0.0]\", \"assert simulate_timer(... | {
"split": "train",
"index": 82234,
"acecode_id": "oss_27622",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Design a function in Python that, given two integer arrays, returns all the unique elements in the first array that are divisible by any element in the second array. The function should return those numbers in the first array that are evenly divisible by at least one number in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_divisible([3, 8, 15, 20, 7], [2, 3, 5]) == [3, 8, 15, 20]\", \"assert find_divisible([10, 15, 30, 25, 40], [1, 2, 5]) == [10, 15, 30, 25, 40]\", \"assert find_divisible([1, 2, 3, 4, 5], [10, 20]) == []\", \"assert find_divisible([12, 15, 18], [3, 6]) ==... | {
"split": "train",
"index": 82235,
"acecode_id": "evol_6055",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string consisting of alphanumeric characters and returns the string with its characters inverted. The function should handle both uppercase and lowercase letters, as well as numbers, and should maintain the same character casing in the output.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert invert_sequence('abc123') == '321cba'\", \"assert invert_sequence('HelloWorld') == 'dlroWolleH'\", \"assert invert_sequence('Python3.8') == '8.3nohtyP'\", \"assert invert_sequence('12345') == '54321'\", \"assert invert_sequence('') == ''\", \"assert invert_s... | {
"split": "train",
"index": 82236,
"acecode_id": "evol_11777",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to verify whether a given token is present in a specified blocklist. The blocklist is represented as a set of strings, each string being a token. Your function should return a boolean value: `True` if the token is in the blocklist, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_token_in_blocklist('valid_token', {'blocked_token', 'another_blocked_token'}) == False\", \"assert check_token_in_blocklist('blocked_token', {'blocked_token', 'another_blocked_token'}) == True\", \"assert check_token_in_blocklist('example_token', {'exa... | {
"split": "train",
"index": 82237,
"acecode_id": "oss_30534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple inventory management representation. Implement a function `create_inventory_item(inventory_number: str, supplier: str, user_id: int, is_adjustment: bool) -> str` that takes the following parameters: \n- `inventory_number` (str): A unique id... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_inventory_item('INV001', 'Supplier A', 1, False) == 'Inventory Item INV001, Supplier: Supplier A, User ID: 1, Adjustment: False'\", \"assert create_inventory_item('INV002', 'Supplier B', -1, True) == 'Inventory Item INV002, Supplier: Supplier B, User ... | {
"split": "train",
"index": 82238,
"acecode_id": "oss_22327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string and a delimiter, write a function that splits the string into substrings based on the given delimiter. For each substring, check if every word (ignoring words that end with punctuation) begins and ends with the same letter. The function should return a list of bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_words('a b c d,e f', ',') == [True, True]\", \"assert check_words('racecar level eye, 12321', ',') == [True, True]\", \"assert check_words('test', ',') == [True]\", \"assert check_words('madam noon; noon', ';') == [True, True]\", \"assert check_words('... | {
"split": "train",
"index": 82239,
"acecode_id": "evol_7157",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a simplex matrix based on given mean values and standard deviations. Implement a function `simplex_creation(mean_value: List[float], sigma_variation: List[float]) -> List[List[float]]` that takes in two lists: `mean_value`, which represents the me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(simplex_creation([1.0, 2.0], [0.5, 0.5])) == 3\", \"assert len(simplex_creation([0.0], [1.0])) == 2\", \"assert round(simplex_creation([1.0, 1.0], [1.0, 1.0])[1][0], 4) != round(simplex_creation([1.0, 1.0], [1.0, 1.0])[2][0], 4)\", \"assert round(simplex... | {
"split": "train",
"index": 82240,
"acecode_id": "bigcode_python_fns_45667",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, where each inner list may contain different numbers of integers. Your task is to return a new list of lists where each inner list contains integers from the input lists, but with their indices aligned. If an inner list does not have a value at a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert align_lists([[1, 2, 3], [4, 5], [6]]) == [[1, 4, 6], [2, 5, None], [3, None, None]]\", \"assert align_lists([[1, 2], [3], [4, 5, 6]]) == [[1, 3, 4], [2, None, 5], [None, None, 6]]\", \"assert align_lists([[1], [2], [3]]) == [[1, 2, 3]]\", \"assert align_list... | {
"split": "train",
"index": 82241,
"acecode_id": "bigcode_python_fns_35830",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that encrypts and decrypts a given message using a simple substitution cipher. The function should take in a string message and return a tuple containing the encrypted message and the decrypted message. The substitution cipher will... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substitution_cipher('abc') == ('def', 'abc')\", \"assert substitution_cipher('xyz') == ('abc', 'xyz')\", \"assert substitution_cipher('hello') == ('khoor', 'hello')\", \"assert substitution_cipher('python') == ('sbwkrq', 'python')\", \"assert substitution_ci... | {
"split": "train",
"index": 82242,
"acecode_id": "oss_1193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and you need to determine if the list is sorted in non-decreasing order. A list is considered sorted in non-decreasing order if for every pair of consecutive elements, the first element is less than or equal to the second element. Write a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_sorted([1, 2, 3, 4]) == True\", \"assert is_sorted([1, 1, 1]) == True\", \"assert is_sorted([5]) == True\", \"assert is_sorted([]) == True\", \"assert is_sorted([3, 3, 3, 3]) == True\", \"assert is_sorted([1, 2, 2, 3]) == True\", \"assert is_sorted([1, 2,... | {
"split": "train",
"index": 82243,
"acecode_id": "oss_9773",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_heatmap_data(salience_scores: List[float], salience_scores_2: Optional[List[float]] = None, normalized: bool = True) -> Tuple[List[List[float]], Optional[List[List[float]]]]` that generates heatmap data for visualization. The function takes a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_heatmap_data([0.5, 0.6, 0.7]) == ([[0.5, 0.6, 0.7]], None)\", \"assert generate_heatmap_data([0.5, 0.6, 1.2], normalized=True) == ([[0.5, 0.6, 1]], None)\", \"assert generate_heatmap_data([-1.2, -0.5, 0.0], normalized=True) == ([[-1, -0.5, 0.0]], No... | {
"split": "train",
"index": 82244,
"acecode_id": "bigcode_python_fns_15391",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists, where each inner list represents a table of food items, write a function `combinations(tables)` that returns all possible combinations of food items, ensuring that each combination includes at least one item from each table. The order of the food items in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combinations([['burger', 'fries'], ['pizza', 'bbq chicken'], ['steak', 'lobster', 'pasta']]) == [['burger', 'pizza', 'steak'], ['burger', 'pizza', 'lobster'], ['burger', 'pizza', 'pasta'], ['burger', 'bbq chicken', 'steak'], ['burger', 'bbq chicken', 'lobste... | {
"split": "train",
"index": 82245,
"acecode_id": "evol_19035",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a nested structure that can contain integers, lists, tuples, or dictionaries. Your task is to implement a function that takes this structure as input and converts all the integers within it to their corresponding float values. The function should return a new stru... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_float(5) == 5.0\", \"assert convert_to_float(3.14) == 3.14\", \"assert convert_to_float([1, 2, 3]) == [1.0, 2.0, 3.0]\", \"assert convert_to_float((4, 5)) == (4.0, 5.0)\", \"assert convert_to_float({'a': 1, 'b': 2}) == {'a': 1.0, 'b': 2.0}\", \"as... | {
"split": "train",
"index": 82246,
"acecode_id": "bigcode_python_fns_9716",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer, implement a function that counts the frequency of the numeral '0' in its hexadecimal representation. The hexadecimal representation should be in uppercase and should not include the '0x' prefix. Write a function `count_zeros_in_hexadecimal(num)` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_zeros_in_hexadecimal(0) == 1\", \"assert count_zeros_in_hexadecimal(1) == 0\", \"assert count_zeros_in_hexadecimal(16) == 1\", \"assert count_zeros_in_hexadecimal(255) == 0\", \"assert count_zeros_in_hexadecimal(256) == 2\", \"assert count_zeros_in_hex... | {
"split": "train",
"index": 82247,
"acecode_id": "evol_24260",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, implement a function `first_order_forward(n: int) -> List[List[float]]` that returns a list of lists representing a forward finite difference operator matrix of size (n+1) x n. The first row should consist of n ones, and the subsequent rows should represent ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_order_forward(2) == [[1.0, 1.0], [1.0, -1.0], [0.0, 1.0]]\", \"assert first_order_forward(3) == [[1.0, 1.0, 1.0], [1.0, -1.0, 0.0], [0.0, 1.0, -1.0], [0.0, 0.0, 1.0]]\", \"assert first_order_forward(4) == [[1.0, 1.0, 1.0, 1.0], [1.0, -1.0, 0.0, 0.0], [... | {
"split": "train",
"index": 82248,
"acecode_id": "bigcode_python_fns_41069",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates and initializes a list of monitors based on a given configuration dictionary. The configuration is expected to contain a key 'monitors' which should map to a list of monitor details. Each monitor detail is represented a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_monitors({'monitors': [{'id': 1, 'name': 'Monitor1'}, {'id': 2, 'name': 'Monitor2'}]}) == [{'id': 1, 'name': 'Monitor1'}, {'id': 2, 'name': 'Monitor2'}]\", \"assert initialize_monitors({'monitors': []}) == []\", \"assert initialize_monitors({'moni... | {
"split": "train",
"index": 82249,
"acecode_id": "oss_30455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing values measured over time. Write a function `total_value(values: List[int]) -> int` that computes the sum of these values. The input list may contain both positive and negative integers. Your task is to return the total sum of these... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_value([1, 2, 3, 4]) == 10\", \"assert total_value([-1, -2, -3, -4]) == -10\", \"assert total_value([0, 0, 0, 0]) == 0\", \"assert total_value([5, 10, 15, 20]) == 50\", \"assert total_value([-5, 10, -15, 20]) == 10\", \"assert total_value([1, -1, 2, -2]... | {
"split": "train",
"index": 82250,
"acecode_id": "bigcode_python_fns_27753",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of effects, write a function that determines if each effect in the list is a propositional effect. A propositional effect is defined as either an 'add' effect or a 'delete' effect. The effects are represented as strings: 'add' for an add effect and 'delete' for a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_propositional_effects(['add', 'delete', 'update', 'remove']) == [True, True, False, False]\", \"assert is_propositional_effects(['add', 'add', 'delete']) == [True, True, True]\", \"assert is_propositional_effects(['update', 'modify', 'delete']) == [False,... | {
"split": "train",
"index": 82251,
"acecode_id": "bigcode_python_fns_31356",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a monitoring system for a network of nodes. Each node in the network has a monitor object that provides various metrics and status information. One of the metrics provided by the monitor is the throughput, which measures the amount of data trans... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Monitor(0).isMasterDegraded() is False\", \"assert Monitor(1).isMasterDegraded() is False\", \"assert Monitor(0).isMasterDegraded() is False\", \"assert Monitor(1).isMasterDegraded() is False\", \"assert Monitor(2).isMasterDegraded() is False\"]}"
} | {
"split": "train",
"index": 82252,
"acecode_id": "oss_24278",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `counting_sort(arr: List[int]) -> List[int]` that sorts an array of integers using a counting sort algorithm. The function should handle negative numbers and duplicates in the input array. The input array can contain any integers, and the output should be a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert counting_sort([-5, -2, -2, 0, 4, 5, 5, 7, 8, 9]) == [-5, -2, -2, 0, 4, 5, 5, 7, 8, 9]\", \"assert counting_sort([3, -1, 0, 2, -2, 2]) == [-2, -1, 0, 2, 2, 3]\", \"assert counting_sort([1, 3, 2, 2, 1, 0]) == [0, 1, 1, 2, 2, 3]\", \"assert counting_sort([]) ==... | {
"split": "train",
"index": 82253,
"acecode_id": "evol_29076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to clean a given string by removing any leading whitespace and trailing parentheses from each line, and then joining the cleaned lines together to form the final cleaned string. Write a function `clean_line(line: str) -> str` that tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_line(' )') == ''\", \"assert clean_line(' )') == ''\", \"assert clean_line(' test)') == 'test'\", \"assert clean_line(' test') == 'test'\", \"assert clean_line(' (test') == '(test'\", \"assert clean_line('') == ''\", \"assert clean_line(... | {
"split": "train",
"index": 82254,
"acecode_id": "oss_9328",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that returns the length of the longest palindromic subsequence and the count of such longest subsequences found in the string. For example, for the string 'racecarprogramming', the function should return (7, 1) as the longest palindromic sub... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_palindromic_subsequence('racecarprogramming') == (7, 1)\", \"assert longest_palindromic_subsequence('a') == (1, 1)\", \"assert longest_palindromic_subsequence('ab') == (1, 2)\", \"assert longest_palindromic_subsequence('aaa') == (3, 1)\", \"assert lo... | {
"split": "train",
"index": 82255,
"acecode_id": "evol_33264",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of real numbers and a mean (mu) and variance (var) of a Gaussian distribution, write a function that calculates the probability density of each number in the list based on the Gaussian distribution defined by mu and var. The function should take three parameters: a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(GAU_pdf([0, 1, 2], 0, 1)[0] - 0.3989422804014337) < 1e-9\", \"assert abs(GAU_pdf([0, 1, 2], 0, 1)[1] - 0.24197072451914337) < 1e-9\", \"assert abs(GAU_pdf([0, 1, 2], 0, 1)[2] - 0.05399096651318806) < 1e-9\", \"assert abs(GAU_pdf([-1, 0, 1], 0, 1)[0] - 0.... | {
"split": "train",
"index": 82256,
"acecode_id": "bigcode_python_fns_25485",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_exponent(base: int, exponent: int) -> int` that takes two integers, `base` and `exponent`, and returns the result of raising the `base` to the power of `exponent`. You may assume that the base is a non-negative integer and the exponent is a non-n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_exponent(3, 7) == 2187\", \"assert calculate_exponent(2, 10) == 1024\", \"assert calculate_exponent(5, 0) == 1\", \"assert calculate_exponent(0, 5) == 0\", \"assert calculate_exponent(1, 100) == 1\", \"assert calculate_exponent(4, 3) == 64\", \"ass... | {
"split": "train",
"index": 82257,
"acecode_id": "evol_24984",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a target sum, write a function `find_combinations(candidates, target)` that returns all unique combinations of the integers in the list that sum up to the target. Each number in the list can be used multiple times in the combination. The order of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_combinations([1, 2, 3], 4) == [[1, 1, 1, 1], [1, 1, 2], [1, 3], [2, 2]]\", \"assert find_combinations([1], 1) == [[1]]\", \"assert find_combinations([2], 1) == []\", \"assert find_combinations([1, 2, 3, 4], 5) == [[1, 1, 1, 1, 1], [1, 1, 1, 2], [1, 1, 3... | {
"split": "train",
"index": 82258,
"acecode_id": "evol_18732",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a data structure similar to defaultdict that allows for storing key-value associations. This structure should include a method to return a sorted version of the data based on keys and another method to return a sorted version based on values. The sorting should mainta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert SortedDefaultDict({'b': 2, 'a': 1}).sorted_by_key() == [('a', 1), ('b', 2)]\", \"assert SortedDefaultDict({'c': 3, 'a': 1, 'b': 2}).sorted_by_value() == [('a', 1), ('b', 2), ('c', 3)]\", \"assert SortedDefaultDict({'key1': 5, 'key2': 1, 'key3': 3}).sorted_by... | {
"split": "train",
"index": 82259,
"acecode_id": "evol_34211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a binary file name based on a given base directory name and a specified tag. The function should take the following parameters: \n- `base_dir`: A string representing the base directory name. \n- `tag`: A string that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_binary_file_name('test_dir', 'v1.0', True) == 'test_dir_v1.0.bin'\", \"assert generate_binary_file_name('example', 'latest', True) == 'example_latest.bin'\", \"assert generate_binary_file_name('data', 'build', False) == 'data.bin'\", \"assert genera... | {
"split": "train",
"index": 82260,
"acecode_id": "oss_8388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating a character in a bitmap font represented by an ASCII code. Implement a function `update_character(ascii_code: int, font_x: int, font_y: int, x: int, y: int) -> str` that simulates updating the character's position in the font. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_character(65, 0, 0, 5, 10) == 'Character 65 updated at (0, 0) with image offset (5, 10)'\", \"assert update_character(66, 1, 1, 10, 20) == 'Character 66 updated at (1, 1) with image offset (10, 20)'\", \"assert update_character(67, 2, 2, 15, 25) == 'C... | {
"split": "train",
"index": 82261,
"acecode_id": "bigcode_python_fns_15873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string may contain a mix of alphanumeric characters and special characters. Your task is to implement a function that takes this list of strings and concatenates all the strings into a single string, but only includes the alphanumeric ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_alphanumeric(['abc', '123', '!@#', 'def']) == 'abc123def'\", \"assert concatenate_alphanumeric(['hello', 'world', '!!!']) == 'helloworld'\", \"assert concatenate_alphanumeric(['123', '456', '789']) == '123456789'\", \"assert concatenate_alphanume... | {
"split": "train",
"index": 82262,
"acecode_id": "bigcode_python_fns_33275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that appends an item to a mutable sequence. Your function should take a dictionary `context` containing two keys: 'sequence' and 'item'. The value of 'sequence' will be a mutable sequence (like a list) to which the 'item' should be ap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_step({'sequence': [], 'item': 5}) == None\", \"assert run_step({'sequence': [1, 2, 3], 'item': 4}) == None\", \"assert run_step({'sequence': ['apple', 'banana'], 'item': 'cherry'}) == None\", \"assert run_step({'sequence': bytearray(), 'item': 1}) == Non... | {
"split": "train",
"index": 82263,
"acecode_id": "oss_31370",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that filters a list of enrollments based on a specific external key, enrollment type, state, and associated actions. The function should take in the following parameters:\n- `external_key` (string): The external key to filter enrol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_enrollments('key456', 'type2', 'inactive', ['cancel']) == [{'id': 2, 'type': 'type2', 'key': 'key456', 'recipient': 'recipient2@example.com', 'enrolled_user': ''}]\", \"assert filter_enrollments('key789', 'type3', 'active', ['complete']) == []\", \"as... | {
"split": "train",
"index": 82264,
"acecode_id": "oss_20363",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` and an integer `k`, remove all occurrences of any character that appears consecutively `k` or more times in the string. Return the modified string after all such characters have been removed. If no characters remain, return an empty string. For example, given... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_consecutive_characters('aaabbbcc', 3) == 'cc'\", \"assert remove_consecutive_characters('abc', 2) == 'abc'\", \"assert remove_consecutive_characters('aabbcc', 2) == ''\", \"assert remove_consecutive_characters('aabbaa', 3) == 'aabbaa'\", \"assert remo... | {
"split": "train",
"index": 82265,
"acecode_id": "bigcode_python_fns_6189",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, return `true` if it is possible to split the string `s` into three non-empty palindromic substrings without any repeating characters. Otherwise, return `false`. A string is said to be palindrome if it reads the same forwards and backwards. Each of the three ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkPartitioning('abcbdd') == False\", \"assert checkPartitioning('bcbddxy') == False\", \"assert checkPartitioning('abcabc') == False\", \"assert checkPartitioning('aabbcc') == False\", \"assert checkPartitioning('aabaaac') == False\", \"assert checkPartit... | {
"split": "train",
"index": 82266,
"acecode_id": "evol_24199",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `every_n_steps(n: int, steps: List[int]) -> List[bool]` that takes an integer `n` and a list of integers `steps`. The function should return a list of boolean values where each boolean indicates whether the corresponding step in the input list is a multiple of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert every_n_steps(3, [1, 2, 3, 4, 5, 6]) == [False, False, True, False, False, True]\", \"assert every_n_steps(2, [2, 4, 6, 8, 10]) == [True, True, True, True, True]\", \"assert every_n_steps(5, [1, 2, 3, 4, 5]) == [False, False, False, False, True]\", \"assert ... | {
"split": "train",
"index": 82267,
"acecode_id": "bigcode_python_fns_7459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string in JSON format that contains information about different backgrounds for a graphical user interface (GUI) application. Each background is represented as a dictionary with keys such as 'type', 'name', and 'title'. Write a function `extract_background_names... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_background_names('{\\\"backgrounds\\\": []}') == []\", \"assert extract_background_names('{\\\"backgrounds\\\": [{\\\"type\\\": \\\"Background\\\", \\\"name\\\": \\\"bgExample1\\\", \\\"title\\\": \\\"Example Background 1\\\"}]}') == [\\\"bgExample1\... | {
"split": "train",
"index": 82268,
"acecode_id": "oss_27085",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns a tuple containing two lists: the first list should contain the unique even numbers from the input list, and the second list should contain the unique odd numbers from the input list. The order of the numbers in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert separate_numbers([1, 2, 3, 4, 5]) == ([2, 4], [1, 3, 5])\", \"assert separate_numbers([10, 21, 32, 43, 54, 21]) == ([10, 32, 54], [21, 43])\", \"assert separate_numbers([1, 1, 2, 2, 3, 3]) == ([2], [1, 3])\", \"assert separate_numbers([]) == ([], [])\", \"as... | {
"split": "train",
"index": 82269,
"acecode_id": "evol_8709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a textual sequence and a pattern of symbols defined by you, write a function that retrieves the middle lexical unit from the trio of lexical units that match the provided pattern within the sequence. The function should discard the smallest and largest lexical unit in tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert middle_lexical_unit('A B C D E', r'B C D') == 'C'\", \"assert middle_lexical_unit('A B C A B C', r'A B C') == 'B'\", \"assert middle_lexical_unit('X Y Z X Y Z', r'Y Z X') == 'Z'\", \"assert middle_lexical_unit('A B C D E F G', r'D E F') == 'E'\", \"assert mi... | {
"split": "train",
"index": 82270,
"acecode_id": "evol_1282",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a PDB ID (a string representing a protein structure) and a data type (either 'pdb' or 'xray'). Your function should return the corresponding file name based on the input PDB ID and data type. If the input PDB ID is invalid or if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_file_name('1A1X', 'pdb') == '1A1X.pdb'\", \"assert get_file_name('1A1X', 'xray') == '1A1X.xray'\", \"assert get_file_name('INVALID_ID', 'pdb') == ''\", \"assert get_file_name('INVALID_ID', 'xray') == ''\", \"assert get_file_name('2B2Y', 'pdb') == '2B2Y.p... | {
"split": "train",
"index": 82271,
"acecode_id": "bigcode_python_fns_10761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a date of birth in the format 'DD MM YYYY', implement a function that returns the name of the day of the week for that date. The function should take one parameter, a string representing the date of birth. For example, the date '3 5 1985' should return 'Friday'.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_day('1 1 2000') == 'Saturday'\", \"assert find_day('2 2 2002') == 'Saturday'\", \"assert find_day('15 8 1947') == 'Friday'\", \"assert find_day('25 12 2021') == 'Saturday'\", \"assert find_day('29 2 2004') == 'Sunday'\", \"assert find_day('31 12 1999') ... | {
"split": "train",
"index": 82272,
"acecode_id": "evol_35065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of mixed data types, your task is to select the first element from the list that matches a specified order of data types. The order is a list of type identifiers, where 'T' represents a string, 'O' represents an object, 'N' represents a number (integer or float), a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_first_element(None) == None\", \"assert select_first_element([]) == None\", \"assert select_first_element(['hello', 42], ['T', 'N']) == 'hello'\", \"assert select_first_element(['hello', 42], ['N', 'T']) == 42\", \"assert select_first_element([42, 'he... | {
"split": "train",
"index": 82273,
"acecode_id": "bigcode_python_fns_8465",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `collect_iterable` that takes an iterable as input and returns a dictionary containing the iterable converted into four different types: a list, a set, a tuple, and a dictionary (if the input is a dictionary). The keys of the r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collect_iterable([1, 2, 3]) == {'list': [1, 2, 3], 'set': {1, 2, 3}, 'tuple': (1, 2, 3), 'dict': []}\", \"assert collect_iterable((1, 2, 3)) == {'list': [1, 2, 3], 'set': {1, 2, 3}, 'tuple': (1, 2, 3), 'dict': []}\", \"assert collect_iterable({}) == {'list':... | {
"split": "train",
"index": 82274,
"acecode_id": "oss_15600",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts and organizes documentation comments from a given string representing Lua and XML content. The function should be able to parse Lua block comments (denoted by `--[[ ... ]]`) and XML comments (denoted by `<!-- ... -->`). Your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_comments('Some text --[[ Lua comment 1 ]] more text --[[ Lua comment 2 ]] and <!-- XML comment 1 -->') == {'lua_comments': ['Lua comment 1', 'Lua comment 2'], 'xml_comments': ['XML comment 1']}\", \"assert extract_comments('No comments here') == {'lu... | {
"split": "train",
"index": 82275,
"acecode_id": "oss_15067",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of monitors, where each monitor is represented as a dictionary with the following keys: 'hr' (horizontal resolution), 'vr' (vertical resolution), 'ho' (horizontal offset), 'vo' (vertical offset), and 'name' (the screen name). Your task is to implement a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_monitors([{'hr': 1366, 'vr': 768, 'ho': 0, 'vo': 914, 'name': 'eDP-1-1'}, {'hr': 2560, 'vr': 1440, 'ho': 1366, 'vo': 0, 'name': 'HDMI-1-1'}]) == [{'hr': 1366, 'vr': 768, 'ho': 0, 'vo': 914, 'name': 'eDP-1-1'}, {'hr': 2560, 'vr': 1440, 'ho': 1366, 'vo': ... | {
"split": "train",
"index": 82276,
"acecode_id": "bigcode_python_fns_26022",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple function to simulate a server management system. The function will take a port number as input and return a string indicating the server status. If the port number is within the range of 1024 to 65535, the server is considered to be sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_server(8000) == 'Server Started on port 8000'\", \"assert manage_server(1024) == 'Server Started on port 1024'\", \"assert manage_server(65535) == 'Server Started on port 65535'\", \"assert manage_server(8080) == 'Server Started on port 8080'\", \"ass... | {
"split": "train",
"index": 82277,
"acecode_id": "oss_14180",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simplified middleware execution system for a web framework. Your goal is to implement a function `execute_middlewares` that takes a list of middleware functions and a request object. The function should execute each middleware function in sequence... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_middlewares([lambda req: Request({'key': 'value1'}), lambda req: Request({'key': 'value2', 'new_key': 'new_value'})], Request({'initial_key': 'initial_value'})).data == {'key': 'value2', 'new_key': 'new_value'}\", \"assert execute_middlewares([], Req... | {
"split": "train",
"index": 82278,
"acecode_id": "oss_2833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the absolute differences between two lists of numerical values. Each list contains exactly 5 integer elements ranging from 1 to 50. The function should return a list containing the absolute differences for each corresponding pair of numbers ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_absolute_differences([10, 20, 30, 40, 50], [5, 15, 25, 35, 45]) == [5, 5, 5, 5, 5]\", \"assert calculate_absolute_differences([1, 2, 3, 4, 5], [5, 4, 3, 2, 1]) == [4, 2, 0, 2, 4]\", \"assert calculate_absolute_differences([10, 20, 30, 40, 50], [10,... | {
"split": "train",
"index": 82279,
"acecode_id": "evol_16526",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of entries read from various files. Your task is to implement a function that calculates the average number of entries read per second over a specified time interval. The function should take two parameters: a list of int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_entries_per_second([10, 20, 30], 5) == 12.0\", \"assert average_entries_per_second([5, 15, 25], 0) == 0.0\", \"assert average_entries_per_second([0, 0, 0], 3) == 0.0\", \"assert average_entries_per_second([1, 1, 1], 1) == 3.0\", \"assert average_entr... | {
"split": "train",
"index": 82280,
"acecode_id": "bigcode_python_fns_2437",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 3D projection matrix P and a list of 3D points X in Cartesian coordinates. Write a function `project_points(P: List[List[float]], X: List[List[float]]) -> List[List[float]]` that applies the projection matrix P to the 3D points X and returns the resulting 2D poi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert project_points([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0]], [[3, 3, 1], [4, 4, 1]]) == [[3.0, 3.0], [4.0, 4.0]]\", \"assert project_points([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0]], [[-1, -1, 1], [-2, -2, 1]]) == [[-1.0, -1.0], [-... | {
"split": "train",
"index": 82281,
"acecode_id": "bigcode_python_fns_35587",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Create a function that calculates the variance of all numeric elements in a given array. The variance is defined as the average of the squared differences from the mean. Implement a function called `calculate_variance` that takes a list of integers or floats and returns the var... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_variance([1, 2, 3, 4, 5]) == 2.0\", \"assert calculate_variance([5, 5, 5, 5, 5]) == 0.0\", \"assert calculate_variance([0, 0, 0, 0, 0]) == 0.0\", \"assert calculate_variance([-1, -2, -3, -4]) == 1.25\", \"assert calculate_variance([1.5, 2.5, 3.5]) ... | {
"split": "train",
"index": 82282,
"acecode_id": "evol_17008",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of strings, where each string represents a proteome accession, and returns a list of unique proteome accessions after removing any duplicates. The input list may contain proteome accessions in various formats, including l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_proteomes(['A12345', 'A12345 ', ' A12345']) == ['A12345']\", \"assert get_unique_proteomes(['B54321', 'C12345', 'B54321']) == ['B54321', 'C12345']\", \"assert get_unique_proteomes(['D67890', 'D67890', 'E54321', 'E54321']) == ['D67890', 'E54321']\"... | {
"split": "train",
"index": 82283,
"acecode_id": "bigcode_python_fns_33106",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_alphabetical(input_string: str) -> bool` that determines if the input string consists solely of alphabetical characters from the English language (a-z, A-Z). The function should return `True` if the string contains only alphabetical characters and `F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_alphabetical('HelloWorld') == True\", \"assert check_alphabetical('HelloWorld123') == False\", \"assert check_alphabetical('') == False\", \"assert check_alphabetical('123456') == False\", \"assert check_alphabetical('abc') == True\", \"assert check_al... | {
"split": "train",
"index": 82284,
"acecode_id": "evol_4235",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user IDs and a specific user ID to check. Your task is to determine if the specified user ID is the same as the current user's ID. If it is, return an error message indicating that the current user cannot change their own account type. If the user ID doe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_account_type(1, 1, [1, 2, 3]) == 'You cannot change the type of your own account.'\", \"assert change_account_type(2, 1, [1, 2, 3]) == 'Account type change is permissible.'\", \"assert change_account_type(3, 1, [1, 2, 3]) == 'Account type change is pe... | {
"split": "train",
"index": 82285,
"acecode_id": "bigcode_python_fns_5189",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_prime(n: int) -> bool` that determines whether the given integer `n` is a prime number. A prime number is defined as a number greater than 1 that has no divisors other than 1 and itself. If `n` is less than 2, the function should return False. If `n` is 2, ... | 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": 82286,
"acecode_id": "evol_7454",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root node of a tree data structure, implement a function `traverse_tree(node)` that recursively traverses the tree and returns a list of the values in the order they were visited. Each node has a `value` and a list of `children` nodes.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert traverse_tree(Node('root', [Node('child_1'), Node('child_2')])) == ['root', 'child_1', 'child_2']\", \"assert traverse_tree(Node('A', [Node('B'), Node('C', [Node('D'), Node('E')])])) == ['A', 'B', 'C', 'D', 'E']\", \"assert traverse_tree(Node('1', [Node('2',... | {
"split": "train",
"index": 82287,
"acecode_id": "evol_29609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates basic banking operations. The function should accept three parameters: an initial balance, a list of deposit amounts, and a list of withdrawal amounts. The function should return the final balance after processing all depos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_bank_account(100, [50, 50], [30, 20]) == 150\", \"assert simulate_bank_account(200, [30, 20], [50, 30]) == 170\", \"assert simulate_bank_account(50, [10, 20], [100]) == 80\", \"assert simulate_bank_account(150, [0], [0]) == 150\", \"assert simulate_... | {
"split": "train",
"index": 82288,
"acecode_id": "oss_7680",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `even_odd_count(num)` that takes an integer `num` as input and returns a tuple containing the total count of even and odd digits in the absolute value of that integer. The function should correctly handle negative integers. For example, `even_odd_count(-12)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even_odd_count(-12) == (1, 1)\", \"assert even_odd_count(123) == (1, 2)\", \"assert even_odd_count(0) == (1, 0)\", \"assert even_odd_count(-2468) == (4, 0)\", \"assert even_odd_count(13579) == (0, 5)\", \"assert even_odd_count(-13579) == (0, 5)\", \"assert e... | {
"split": "train",
"index": 82289,
"acecode_id": "evol_29853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a message processing system. The system receives a message containing various attributes such as `bodyVariable`, `headers`, `method`, `queryParams`, and `path`. Your goal is to write a function `process_message` that take... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_message({'bodyVariable': 'key1', 'headers': {'Content-Type': 'application/json'}, 'method': 'GET', 'queryParams': {'param1': 'value1'}, 'path': '/api/resource'}) == ('Body retrieved', {'Content-Type': 'application/json'}, 'GET', {'param1': 'value1'},... | {
"split": "train",
"index": 82290,
"acecode_id": "oss_35249",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers, a target integer, and a boolean flag as input. The function should return the index of the target integer in the list. If the boolean flag is set to True, the function should return the index of the last occurrence of the targ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_index([1, 7, 9, 8, 5, 9], 9, True) == 5\", \"assert find_index([1, 2, 3, 4, 5], 3, False) == 2\", \"assert find_index([1, 2, 3, 4, 5], 3, True) == 2\", \"assert find_index([1, 2, 3, 2, 1], 2, False) == 1\", \"assert find_index([1, 2, 3, 2, 1], 2, True) ... | {
"split": "train",
"index": 82291,
"acecode_id": "evol_878",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple substitution cipher encryption function. The function will take two inputs: a key and a plaintext string. The key is a string of characters that will be used for the substitution cipher. Your task is to implement a function `encrypt_text(ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encrypt_text('abc', 'abc') == 'abc'\", \"assert encrypt_text('abc', 'def') == 'def'\", \"assert encrypt_text('abc', 'a') == 'a'\", \"assert encrypt_text('abc', 'b') == 'b'\", \"assert encrypt_text('abc', 'c') == 'c'\", \"assert encrypt_text('abc', 'd') == 'd... | {
"split": "train",
"index": 82292,
"acecode_id": "oss_9031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, determine if they are equal after sorting both lists. Two lists are considered equal if they contain the same integers in the same quantity, regardless of their original order. Implement a function `are_lists_equal(list1: List[int], list2: List[int]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_lists_equal([1, 2, 3], [3, 2, 1]) == True\", \"assert are_lists_equal([4, 5, 6], [6, 5, 4]) == True\", \"assert are_lists_equal([1, 1, 1], [1, 1, 1]) == True\", \"assert are_lists_equal([1, 2, 3], [1, 2, 2]) == False\", \"assert are_lists_equal([], []) =... | {
"split": "train",
"index": 82293,
"acecode_id": "bigcode_python_fns_46671",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `lint_repo(fail_on_missing_sub_src: bool, exclude_lint: List[str], warn_lint: List[str]) -> str` that simulates the linting process of a repository. The function takes three parameters: a boolean `fail_on_missing_sub_src` indicating if th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lint_repo(False, ['rule1'], ['warn1', 'warn2']) == 'Linting passed, but produced some warnings. warn1, warn2'\", \"assert lint_repo(False, ['rule1'], []) == 'Linting passed with no issues.'\", \"assert lint_repo(False, [], ['warn1', 'warn2', 'warn3']) == 'Li... | {
"split": "train",
"index": 82294,
"acecode_id": "bigcode_python_fns_7814",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `reverse_stack(stack: List[Any]) -> List[Any]` that takes a list representing a stack (where the last element is the top of the stack) and returns a new list with the elements in reversed order, effectively reversing the stack. The input list will not be em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_stack([1, 2, 3]) == [3, 2, 1]\", \"assert reverse_stack(['a', 'b', 'c']) == ['c', 'b', 'a']\", \"assert reverse_stack([True, False]) == [False, True]\", \"assert reverse_stack([5]) == [5]\", \"assert reverse_stack([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\... | {
"split": "train",
"index": 82295,
"acecode_id": "evol_2704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where each key is a string representing a class name, and each value is a list of strings representing the attributes of that class, write a function `generate_class_definitions(metadata: Dict[str, List[str]]) -> List[str]` that returns a list of strings, whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_class_definitions({'Person': ['name', 'age'], 'Car': ['make', 'model']}) == ['class Person:\\\\n def __init__(self, name, age):\\\\n self.name = name\\\\n self.age = age', 'class Car:\\\\n def __init__(self, make, model):\\\\n ... | {
"split": "train",
"index": 82296,
"acecode_id": "bigcode_python_fns_19936",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given the coordinates of two points in a 3D space, `pt1` and `pt2`, and a radius `Rayon`, write a function `can_form_circle(pt1: Tuple[float, float, float], pt2: Tuple[float, float, float], Rayon: float) -> bool` that determines whether a circle can be formed with the given rad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_form_circle((0, 0, 0), (0, 1, 0), 0.5) == True\", \"assert can_form_circle((3, 4, 5), (3, 4, 7), 2) == True\", \"assert can_form_circle((-1, -2, -3), (1, 2, 3), 5) == True\", \"assert can_form_circle((2, 2, 2), (2, 3, 2), 0.5) == True\", \"assert can_for... | {
"split": "train",
"index": 82297,
"acecode_id": "bigcode_python_fns_7436",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `update_dashboard_name(dashboard_slug: str, new_name: str) -> Tuple[str, Union[str, Dict]]`. This function simulates the updating of a dashboard's name in a system. The function takes in two parameters: a `dashboard_slug`, which is a uniq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_dashboard_name('dashboard1', 'New Dashboard') == ('Success', {'name': 'New Dashboard', 'slug': 'dashboard1'})\", \"assert update_dashboard_name('dashboard1', '') == ('Error', 'Name is required.')\", \"assert update_dashboard_name('nonexistent_dashboar... | {
"split": "train",
"index": 82298,
"acecode_id": "bigcode_python_fns_8467",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of image filters and their corresponding parameters. Each filter is represented as a dictionary with the following possible keys: 'type' (string), 'size' (integer), 'strength' (float), 'color' (string), 'remove_b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_filters([{ 'type': 'blur', 'size': 3 }, { 'type': 'sharpen', 'strength': 2.5 }]) == ['Applied blur with size 3', 'Applied sharpen with strength 2.5']\", \"assert apply_filters([{ 'type': 'edge_detection' }, { 'type': 'color_manipulation', 'color': 'sep... | {
"split": "train",
"index": 82299,
"acecode_id": "oss_23225",
"num_tests": 15
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.