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 that rotates a given list by a specified number of positions to the right. The function should take two arguments: a list of integers and an integer representing the number of positions to rotate. The rotation should be circular, meaning that elements that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_list([1, 2, 3, 4, 5], 3) == [3, 4, 5, 1, 2]\", \"assert rotate_list([1, 2, 3, 4, 5], 5) == [1, 2, 3, 4, 5]\", \"assert rotate_list([1, 2, 3, 4, 5], 6) == [5, 1, 2, 3, 4]\", \"assert rotate_list([1], 1) == [1]\", \"assert rotate_list([1, 2], 1) == [2, ...
{ "split": "train", "index": 69500, "acecode_id": "evol_8020", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string contains a label in the format 'BILU_label-some_suffix'. Your task is to write a function that removes the 'BILU_label-' prefix from each string and returns a dictionary mapping each modified label to its corresponding original ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_bilu_prefix(['BILU_label1-suffix1', 'BILU_label2-suffix2']) == {'label1-suffix1': ('BILU_label1-suffix1', 0), 'label2-suffix2': ('BILU_label2-suffix2', 1)}\", \"assert remove_bilu_prefix(['BILU_test1-suffix', 'BILU_test2-suffix']) == {'test1-suffix': ...
{ "split": "train", "index": 69501, "acecode_id": "bigcode_python_fns_33242", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary with string keys and values that can be strings, lists, or integers, implement a function `get_processed_string` that takes an input string containing keys enclosed in curly braces (e.g., '{key}') and returns the corresponding value from the dictionary. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_processed_string({'ctx1': 'ctxvalue1', 'ctx2': 'ctxvalue2', 'ctx3': [0, 1, 3], 'ctx4': 'ctxvalue4'}, '{ctx3}') == [0, 1, 3]\", \"assert get_processed_string({'ctx1': 'ctxvalue1'}, '{ctx1}') == 'ctxvalue1'\", \"assert get_processed_string({'ctx1': 'ctxval...
{ "split": "train", "index": 69502, "acecode_id": "bigcode_python_fns_9946", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `check_string` that takes a single string `s` as input and returns a boolean indicating whether the string contains at least one semi-colon (';') symbol. The string can be of any length (up to a maximum length of 500), can contain different symbols a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_string('Hello; world!') == True\", \"assert check_string('This is a test string without a semi-colon') == False\", \"assert check_string('Valid; string; with; multiple; semi-colons') == True\", \"assert check_string('No brackets here but; still valid')...
{ "split": "train", "index": 69503, "acecode_id": "evol_35139", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a dataset that contains information about different scenarios, strategies, confidence levels, deciles, and user costs. Your goal is to create a function that takes a list of dictionaries as input, where each dictionary represents a record with key...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_data([{'scenario': 'A', 'strategy': 'X', 'confidence': 0.9, 'decile': 1, 'cost_user': 100}, {'scenario': 'A', 'strategy': 'X', 'confidence': 0.9, 'decile': 1, 'cost_user': 150}, {'scenario': 'A', 'strategy': 'X', 'confidence': 0.9, 'decile': 2, 'co...
{ "split": "train", "index": 69504, "acecode_id": "bigcode_python_fns_42684", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given dictionary into a binary search tree (BST). The function should take a dictionary as input, where keys are unique integers and values are strings. The resulting BST should allow for efficient search operations. The function should not ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dict_to_bst({1: 'A', 2: 'B', 3: 'C', 4: 'D', 5: 'E'}) is not None\", \"assert dict_to_bst({10: 'J', 5: 'E', 15: 'O', 3: 'C', 7: 'G'}) is not None\", \"assert dict_to_bst({1: 'A'}) is not None\", \"assert dict_to_bst({5: 'E', 3: 'C'}) is not None\", \"assert ...
{ "split": "train", "index": 69505, "acecode_id": "evol_31605", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `coin_toss()` that simulates a coin toss experiment. The function should randomly return either 'Heads' or 'Tails'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert coin_toss() in ['Heads', 'Tails']\", \"assert coin_toss() in ['Heads', 'Tails']\", \"assert coin_toss() in ['Heads', 'Tails']\", \"assert coin_toss() in ['Heads', 'Tails']\", \"assert coin_toss() in ['Heads', 'Tails']\", \"assert coin_toss() in ['Heads', 'Ta...
{ "split": "train", "index": 69506, "acecode_id": "evol_13698", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fine_tune_model(data: List[Dict[str, List[str]]]) -> Dict[str, float]` that simulates the fine-tuning of a named entity recognition model. The input `data` is a list of dictionaries, where each dictionary contains two keys: 'text' (a list of strings repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fine_tune_model([{'text': ['Hello', 'world'], 'tags': [['Greeting', 'O']]}]) == {'accuracy': 0.85, 'precision': 0.80, 'recall': 0.75, 'f1': 0.77}\", \"assert fine_tune_model([{'text': ['Python', 'is', 'great'], 'tags': [['O', 'O', 'O']]}]) == {'accuracy': 0....
{ "split": "train", "index": 69507, "acecode_id": "evol_32878", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a table with a unique identifier and a list of predictions. Your task is to implement a function that adds a new key 'triples' to each dictionary, which should contain a list of tuples. Each tuple should be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_triples([{'id': 1, 'predictions': ['a', 'b', 'c']}]) == [{'id': 1, 'predictions': ['a', 'b', 'c'], 'triples': [('a', 'b'), ('a', 'c'), ('b', 'c')]}]\", \"assert generate_triples([{'id': 2, 'predictions': ['x', 'y']}, {'id': 3, 'predictions': []}]) =...
{ "split": "train", "index": 69508, "acecode_id": "bigcode_python_fns_16631", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that generates a unique, 9-character long alphanumeric identifier using only the characters available in the hexadecimal numeral system (0-9, A-F). The identifier should be randomly generated each time the function is called.\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_hexadecimal_identifier() != generate_hexadecimal_identifier()\", \"assert len(generate_hexadecimal_identifier()) == 9\", \"assert all(c in '0123456789ABCDEF' for c in generate_hexadecimal_identifier())\", \"assert generate_hexadecimal_identifier() !...
{ "split": "train", "index": 69509, "acecode_id": "evol_33513", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of URIs and a mapping of selectors. Each selector has a method `has_license(uri)` that determines if a specific URI has an associated license, and a method `by_uri(uri)` that returns the license for that URI if it exists. Implement a function `pick_license(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pick_license('http://example.com/license1', {'selector1': selector1, 'selector2': selector2}) == 'License1'\", \"assert pick_license('http://example.com/license2', {'selector1': selector1, 'selector2': selector2}) == 'License2'\", \"assert pick_license('http...
{ "split": "train", "index": 69510, "acecode_id": "bigcode_python_fns_33416", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `negative_even_list(numbers)` that takes a list of integers as input and returns a new list containing only the negative even numbers from the input list. You must use list comprehensions to achieve this.\nPlease reason step by step, then write a self-contained...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert negative_even_list([-1, -2, -3, -4]) == [-2, -4]\", \"assert negative_even_list([1, 2, 3, 4]) == []\", \"assert negative_even_list([0, -2, 2, -4]) == [-2, -4]\", \"assert negative_even_list([-1, -3, -5]) == []\", \"assert negative_even_list([]) == []\", \"as...
{ "split": "train", "index": 69511, "acecode_id": "evol_14107", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a collection of 3D blocks in a space. Each block is represented by its starting and ending coordinates in 3D space: (x1, y1, z1) and (x2, y2, z2). You will implement a function `count_active_blocks(blocks)` that takes a list of blocks and returns th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_active_blocks([{'x1': 0, 'y1': 0, 'z1': 0, 'x2': 1, 'y2': 1, 'z2': 1, 'on': True}]) == 1\", \"assert count_active_blocks([{'x1': 0, 'y1': 0, 'z1': 0, 'x2': 1, 'y2': 1, 'z2': 1, 'on': False}]) == 0\", \"assert count_active_blocks([{'x1': 0, 'y1': 0, 'z1...
{ "split": "train", "index": 69512, "acecode_id": "oss_27933", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates saving content to a file based on certain parameters. Your function should take the following inputs: a string 'content' which represents the content to be saved, a string 'filename' representing the name of the file, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_content('Hello, World!', 'example.txt', False, False) == 'Hello, World!'\", \"assert save_content('Goodbye, World!', 'example.txt', False, False) == 'Goodbye, World!'\", \"assert save_content('New Content', 'example.txt', False, True) == 'New Content'\"...
{ "split": "train", "index": 69513, "acecode_id": "bigcode_python_fns_9737", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a lattice represented by a list of edges, each defined by two vertices, implement a function that takes the lattice and a list of colors. The function should return a new list where each edge is represented as a dictionary containing its vertices and the corresponding col...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_lattice_edges([(0, 1), (1, 2), (2, 0)], ['red', 'green', 'blue'], [0, 1]) == [{'vertices': (0, 1), 'color': 'red'}, {'vertices': (1, 2), 'color': 'green'}]\", \"assert process_lattice_edges([(0, 1), (1, 2), (2, 0)], [], [0, 1]) == [{'vertices': (0, 1...
{ "split": "train", "index": 69514, "acecode_id": "bigcode_python_fns_14119", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function called `multiply(lst)` that takes a list of integers `lst` and returns the product of all odd numbers located at even indices that are also divisible by 3. If no such numbers exist, the function should return 1. The input list may contain both positive and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply([3, 5, 7, 8, 9]) == 27\", \"assert multiply([3, 6, 9, 12]) == 27\", \"assert multiply([0, 1, 2, 3, 4, 5]) == 1\", \"assert multiply([3, 7, 5, 9]) == 3\", \"assert multiply([5, 2, 7, 2, 9]) == 9\", \"assert multiply([-3, 2, 5, 8, 9]) == -27\", \"asse...
{ "split": "train", "index": 69515, "acecode_id": "evol_31375", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a 2D list (matrix) composed of integers, write a function `column_sum(matrix)` that returns a list containing the sum of each column in the matrix. The output list should have a length equal to the number of columns in the matrix, and each element should represent the sum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert column_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [12, 15, 18]\", \"assert column_sum([[1, -1], [2, -2], [3, -3]]) == [6, -6]\", \"assert column_sum([[5], [10], [15]]) == [30]\", \"assert column_sum([[]]) == []\", \"assert column_sum([[1, 2, 3], [0, 0, 0]]) =...
{ "split": "train", "index": 69516, "acecode_id": "evol_13864", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of alarm records and returns a summary of the alarms. Each alarm record is represented as a dictionary containing keys: 'alarm_device', 'alarm_level', and 'hostname'. Your function should take a list of these alarm r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_alarm_records([]) == {'total': 0, 'critical_total': 0, 'warning_total': 0, 'devices': [], 'message': 'No alarms found'}\", \"assert process_alarm_records([{'alarm_device': 'Device1', 'alarm_level': 'critical', 'hostname': 'Host1'}]) == {'total': 1, '...
{ "split": "train", "index": 69517, "acecode_id": "bigcode_python_fns_21287", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a utility function to convert a given date and time string from one format to another. The function should be able to handle both standard and fractional date-time formats. The date and time string will be in the format specified by the constant...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_date_time_format('2022-01-15T12:30:00Z') == '2022-01-15T12:30:00.000000Z'\", \"assert convert_date_time_format('2022-01-15T12:30:00.000000Z') == '2022-01-15T12:30:00Z'\", \"assert convert_date_time_format('2023-05-22T09:15:30Z') == '2023-05-22T09:15:...
{ "split": "train", "index": 69518, "acecode_id": "oss_33176", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a series of buildings. Your task is to implement a function that calculates the maximum area of a rectangle that can be formed using these buildings as the base. The rectangle's height is determined by the shortest bu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_rectangle_area([2, 4]) == 4\", \"assert max_rectangle_area([1, 1, 1, 1]) == 4\", \"assert max_rectangle_area([1, 2, 3, 4]) == 6\", \"assert max_rectangle_area([0, 2, 0]) == 2\", \"assert max_rectan...
{ "split": "train", "index": 69519, "acecode_id": "bigcode_python_fns_39442", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple to-do list. The function should accept a list of commands that can either add a task, remove a task, or display the current tasks. Each command is represented as a string, and the function should return the fin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_todo_list(['add task1', 'add task2', 'display']) == ['task1', 'task2']\", \"assert manage_todo_list(['add task1', 'remove task1', 'display']) == []\", \"assert manage_todo_list(['add task1', 'add task2', 'remove task2', 'display']) == ['task1']\", \"a...
{ "split": "train", "index": 69520, "acecode_id": "oss_22246", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a description of a bear based on its size, color, and the weather conditions. Your function should take in three parameters: 'bear_size' (a string representing the size of the bear, such as 'small', 'medium', or 'large'), '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_bear_description('small', 'brown', 'sunny') == 'A small brown bear in a sunny day.'\", \"assert generate_bear_description('medium', 'white', 'cloudy') == 'A medium white bear in a cloudy day.'\", \"assert generate_bear_description('large', 'black', ...
{ "split": "train", "index": 69521, "acecode_id": "bigcode_python_fns_22150", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `sum_of_ceiling_squares` that takes a list of numerical values and returns the sum of the squares of the ceiling values of the absolute values of the numbers in the list. The ceiling value is the smallest integer greater than or equal to the absolute...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_ceiling_squares([2, -3, 4]) == 29\", \"assert sum_of_ceiling_squares([-1.7, 2, 2]) == 12\", \"assert sum_of_ceiling_squares([0, 0, 0]) == 0\", \"assert sum_of_ceiling_squares([2.2, 3.3, 4.4]) == 50\", \"assert sum_of_ceiling_squares([1, 2, 3]) == 14\"...
{ "split": "train", "index": 69522, "acecode_id": "evol_9033", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function `is_html_tag(test_string: str) -> bool` that determines whether a given string is a well-formed HTML tag. A well-formed HTML tag is defined as one that has a matching opening and closing tag, and may contain attributes. The input string will be in the format of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_html_tag('<div>Hello</div>') == True\", \"assert is_html_tag('<span class=\\\"test\\\">Content</span>') == True\", \"assert is_html_tag('<a href=\\\"url\\\">Link</a>') == True\", \"assert is_html_tag('<img src=\\\"image.jpg\\\">') == False\", \"assert is_...
{ "split": "train", "index": 69523, "acecode_id": "evol_31240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `matched_hs_ions` and `all_hyp_ions`, and an integer `N_spectra`, write a function `frac_ion_score(matched_hs_ions: List[int], all_hyp_ions: List[int], N_spectra: int) -> float` that calculates the fraction score based on the number of matched ions ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert frac_ion_score([1, 2, 3], [1, 2, 3, 4, 5], 2) == 0.3\", \"assert frac_ion_score([1], [1, 2], 1) == 0.5\", \"assert frac_ion_score([], [1, 2, 3], 3) == 0.0\", \"assert frac_ion_score([1, 2, 3, 4], [1, 2, 3, 4, 5], 1) == 0.8\", \"assert frac_ion_score([], [], ...
{ "split": "train", "index": 69524, "acecode_id": "bigcode_python_fns_32128", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple bank account. The function should allow for depositing and withdrawing funds, and it should return the current balance and the transaction history. The input will be a list of tuples where each tuple contains a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_simulation([('deposit', 100), ('withdraw', 50)]) == (50, [{'output_hidden_states': True}, {'output_hidden_states': True}])\", \"assert bank_account_simulation([('withdraw', 30)]) == (0, [])\", \"assert bank_account_simulation([('deposit', 200), ...
{ "split": "train", "index": 69525, "acecode_id": "oss_22309", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of employee records and retrieves specific fields from each record. Each record is represented as a dictionary containing the keys 'id', 'name', and 'department'. Your function should take a list of these empl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_employee_data([{'id': 1, 'name': 'Alice', 'department': 'Sales'}, {'id': 2, 'name': 'Bob', 'department': 'Marketing'}, {'id': 3, 'name': 'Charlie', 'department': 'Engineering'}], ['id', 'name']) == [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}...
{ "split": "train", "index": 69526, "acecode_id": "oss_5714", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with unloading multiple configuration entries for a device management system. Implement a function `unload_entries(entries: List[str], platforms: List[str]) -> bool` that takes in two parameters: a list of configuration entry IDs and a list of supported platforms...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unload_entries(['entry1', 'entry2'], ['platform1', 'platform2']) == True\", \"assert unload_entries(['entry3'], ['platform1']) == True\", \"assert unload_entries(['fail_entry'], ['platform1']) == False\", \"assert unload_entries(['entry1', 'fail_entry'], ['p...
{ "split": "train", "index": 69527, "acecode_id": "bigcode_python_fns_10957", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a network port validation. The function should take an `address` (string) and a `port` (integer) as input parameters and return a message indicating whether the connection to the given address and port was successful or fai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_port('example.com', 80) == 'Checking port example.com:80 - OK'\", \"assert validate_port('example.com', 443) == 'Checking port example.com:443 - OK'\", \"assert validate_port('localhost', 80) == 'Checking port localhost:80 - OK'\", \"assert validate...
{ "split": "train", "index": 69528, "acecode_id": "oss_3139", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `rock_paper_scissors(user_choice)` that simulates a single round of the rock-paper-scissors game. The function takes a string `user_choice` as input, which represents the user's choice (either 'rock', 'paper', or 'scissors'). The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock') in ['You win!', 'Computer wins!', \\\"It's a tie!\\\"]\", \"assert rock_paper_scissors('paper') in ['You win!', 'Computer wins!', \\\"It's a tie!\\\"]\", \"assert rock_paper_scissors('scissors') in ['You win!', 'Computer wins!', \...
{ "split": "train", "index": 69529, "acecode_id": "oss_21149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the total size of a collection of files and symbolic links. You should implement a function `calculate_total_size(files)` that takes a list of tuples, where each tuple contains two elements: a string `file_name` rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_size([('file1.txt', 100), ('symlink_to_file2.txt', 0), ('file4.txt', 300)]) == 400\", \"assert calculate_total_size([('file1.txt', 0), ('symlink_to_file1.txt', 100)]) == 100\", \"assert calculate_total_size([('file1.txt', 50), ('file2.txt', 1...
{ "split": "train", "index": 69530, "acecode_id": "oss_104", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a default filename and the content of a feature model as a string. Implement a function `get_default_feature_model()` that when called, returns a tuple containing the filename 'piccolo-simple-pregen.fm.json' and the string 'F...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_default_feature_model() == ('piccolo-simple-pregen.fm.json', 'Feature Model Content: This represents the default feature model.')\", \"assert get_default_feature_model()[0] == 'piccolo-simple-pregen.fm.json'\", \"assert get_default_feature_model()[1] == ...
{ "split": "train", "index": 69531, "acecode_id": "bigcode_python_fns_34735", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries representing product attributes and their types. Each dictionary contains the 'name' of the attribute and its 'type'. Your task is to write a Python function that takes this list as input and returns a new list containing only the names of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_float_attributes([{'name': 'height', 'type': 'float'}, {'name': 'width', 'type': 'int'}, {'name': 'length', 'type': 'float'}]) == ['height', 'length']\", \"assert filter_float_attributes([{'name': 'weight', 'type': 'float'}, {'name': 'color', 'type': ...
{ "split": "train", "index": 69532, "acecode_id": "oss_13914", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified key-value store function in Python. Your goal is to create a function called `key_value_operations(operations: List[Tuple[str, str]]) -> List[str]`, which processes a list of operations on key-value pairs. The operations can be one ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert key_value_operations([('set', 'name', 'Alice'), ('set', 'age', '25'), ('get', 'name'), ('get', 'age'), ('delete', 'age'), ('get', 'age')]) == ['Alice', '25', 'Key not found']\", \"assert key_value_operations([('set', 'city', 'New York'), ('get', 'city'), ('d...
{ "split": "train", "index": 69533, "acecode_id": "oss_8152", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates the first n numbers of the Fibonacci sequence and returns them as a list of integers. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should take an integer n as input, wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_sequence(0) == []\", \"assert fibonacci_sequence(1) == [0]\", \"assert fibonacci_sequence(2) == [0, 1]\", \"assert fibonacci_sequence(3) == [0, 1, 1]\", \"assert fibonacci_sequence(4) == [0, 1, 1, 2]\", \"assert fibonacci_sequence(5) == [0, 1, 1, 2...
{ "split": "train", "index": 69534, "acecode_id": "evol_9075", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the playing of musical instruments. The function should take a string representing the name of the instrument and return a message indicating the instrument being played. Write a function named `play_instrument` that accept...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert play_instrument('guitar') == 'Playing the guitar'\", \"assert play_instrument('piano') == 'Playing the piano'\", \"assert play_instrument('drum') == 'Playing the drum'\", \"assert play_instrument('violin') == 'Playing the violin'\", \"assert play_instrument(...
{ "split": "train", "index": 69535, "acecode_id": "oss_25708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `primes_up_to_n(n)` that generates a list of the first `n` prime numbers. The function should take an integer `n` (1 <= n <= 1000) as input and return a list of the first `n` prime numbers. You can use any algorithm of your choice to generate the prime numbers....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert primes_up_to_n(1) == [2]\", \"assert primes_up_to_n(2) == [2, 3]\", \"assert primes_up_to_n(3) == [2, 3, 5]\", \"assert primes_up_to_n(4) == [2, 3, 5, 7]\", \"assert primes_up_to_n(5) == [2, 3, 5, 7, 11]\", \"assert primes_up_to_n(6) == [2, 3, 5, 7, 11, 13]\...
{ "split": "train", "index": 69536, "acecode_id": "evol_19614", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that checks if two input strings are equivalent. The function should return True if both strings are identical, and False otherwise. For example, given the inputs 'hello' and 'hello', the function should return True. Write a function named 'are_strings_equi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_strings_equivalent('abc', 'abc') == True\", \"assert are_strings_equivalent('hello', 'hello') == True\", \"assert are_strings_equivalent('test', 'Test') == False\", \"assert are_strings_equivalent('Python', 'Python') == True\", \"assert are_strings_equiv...
{ "split": "train", "index": 69537, "acecode_id": "evol_16284", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `prep` that processes a given string. The function should perform the following operations on the input string `line`: remove any leading and trailing whitespace, convert the string to lowercase, and replace any occurrence of the subs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prep(' Python programming is fun! ') == 'programming programming is fun!'\", \"assert prep(' PYTHON is great! ') == 'programming is great!'\", \"assert prep('I love python and Python!') == 'i love programming and programming!'\", \"assert prep(' He...
{ "split": "train", "index": 69538, "acecode_id": "oss_33528", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `most_frequent_char(string: str) -> str` that takes a string as input and returns the alphabetic character that appears with the greatest frequency in the string. The function should ignore case and non-alphabetic characters. If there is a tie between character...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_frequent_char('Hello world!') == 'l'\", \"assert most_frequent_char('A man a plan a canal Panama') == 'a'\", \"assert most_frequent_char('No lemon, no melon') == 'n'\", \"assert most_frequent_char('abcdabc') == 'a'\", \"assert most_frequent_char('abcABC...
{ "split": "train", "index": 69539, "acecode_id": "evol_6762", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `sort_list(arr)` in Python that sorts this list in ascending order using a sorting algorithm of your choice that is NOT built-in Python sort or sorted functions. Your function should handle all sorts of input lists, including empty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_list([4, 2, 3, 5, 1]) == [1, 2, 3, 4, 5]\", \"assert sort_list([-1, -3, 0, 5, 2]) == [-3, -1, 0, 2, 5]\", \"assert sort_list([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\", \"assert sort_list([]) == []\", \"assert sort_list([1]) == [1]\", \"assert sort_list([-...
{ "split": "train", "index": 69540, "acecode_id": "evol_10063", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates heart rate data points. A valid heart rate must be a positive integer between 1 and 254, inclusive. Write a function `is_valid_heartrate(heart_rate: int) -> bool` that takes an integer heart rate as input and returns Tr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_heartrate(0) == False\", \"assert is_valid_heartrate(-1) == False\", \"assert is_valid_heartrate(1) == True\", \"assert is_valid_heartrate(254) == True\", \"assert is_valid_heartrate(255) == False\", \"assert is_valid_heartrate(256) == False\", \"as...
{ "split": "train", "index": 69541, "acecode_id": "bigcode_python_fns_28805", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of news articles, each represented as a dictionary with keys 'title', 'link', 'author', 'published_at', 'source', and 'rank'. The function should return a list of articles sorted first by 'rank' in descending order and then by 'published_a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_news_articles([{'title': 'Article A', 'link': 'linkA', 'author': 'Author A', 'published_at': '2023-10-01T10:00:00Z', 'source': 'Source A', 'rank': 1}, {'title': 'Article B', 'link': 'linkB', 'author': 'Author B', 'published_at': '2023-10-01T09:00:00Z', ...
{ "split": "train", "index": 69542, "acecode_id": "evol_15666", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two strings, `a` and `b`, both composed solely of lowercase letters. Your task is to determine the least number of operations required to modify either `a` or `b` such that one of the following conditions is met: 1. Every character in `a` is alphabetically strictl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minimumOperations('aba', 'caa') == 2\", \"assert minimumOperations('dabadd', 'cda') == 3\", \"assert minimumOperations('a', 'b') == 0\", \"assert minimumOperations('aaa', 'aaa') == 0\", \"assert minimumOperations('abc', 'def') == 0\", \"assert minimumOperati...
{ "split": "train", "index": 69543, "acecode_id": "evol_22102", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with validating a dataset that contains various columns related to policing operations. The dataset should only contain specific valid columns. Implement a function `check_valid_columns(observation: dict) -> Tuple[bool, str]` that takes a dictionary `observation`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_valid_columns({'observation_id': 1, 'Type': 'A', 'Date': '2023-01-01', 'Part of a policing operation': 'Operation X', 'Latitude': 40.7128, 'Longitude': -74.0060, 'Gender': 'M', 'Age range': '18-24', 'Officer-defined ethnicity': 'White', 'Legislation': ...
{ "split": "train", "index": 69544, "acecode_id": "bigcode_python_fns_40455", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that processes a list of strings representing lines from a configuration file and extracts key-value pairs. Each line can be in the format 'key = value' or it may be a comment starting with '#'. Your task is to write a function that takes ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_key_value_pairs(['# Config', 'user = admin', 'password = 1234']) == ['user = admin', 'password = 1234']\", \"assert extract_key_value_pairs(['# Comment', 'setting1 = true', '# Another comment', 'setting2 = false']) == ['setting1 = true', 'setting2 = ...
{ "split": "train", "index": 69545, "acecode_id": "oss_37709", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the creation of two types of background subtraction algorithms commonly used in video processing: MOG2 (Mixture of Gaussians 2) and KNN (K-nearest neighbors). The function should take a string input representing the alg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_background_subtractor('MOG2') == 'MOG2 background subtractor created'\", \"assert create_background_subtractor('KNN') == 'KNN background subtractor created'\", \"assert create_background_subtractor('MOG') == 'Invalid algorithm'\", \"assert create_back...
{ "split": "train", "index": 69546, "acecode_id": "oss_18877", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a multiline string, return a list of the last words from each line that starts with a lowercase letter. The last word should be stripped of any trailing exclamation marks (!) or periods (.). If a line does not start with a lowercase letter, it should be ignored. The input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert slice_and_dice('line one.\\\\nline two!\\\\nLine three.') == ['one', 'two']\", \"assert slice_and_dice('1st line\\\\n2nd line') == []\", \"assert slice_and_dice('\\\\n\\\\n\\\\nhello.') == ['hello']\", \"assert slice_and_dice('A B C!\\\\nD E F.') == []\", \"...
{ "split": "train", "index": 69547, "acecode_id": "bigcode_python_fns_29998", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates user registration data provided in a dictionary format. The registration data should contain the following fields: 'username', 'password', and 'email'. The 'username' must be at least 3 characters long and can only contain ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_registration_data({'username': 'user1', 'password': 'pass123', 'email': 'user1@example.com'}) == ({'username': 'user1', 'password': 'pass123', 'email': 'user1@example.com'}, {})\", \"assert validate_registration_data({'username': 'user1', 'password'...
{ "split": "train", "index": 69548, "acecode_id": "oss_5134", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that checks if all integers in a given list share the same orientation on the number line. Specifically, the function should return True if all integers are either positive or negative. If there is at least one integer that does not match the orientation of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_same_orientation([]) == True\", \"assert check_same_orientation([-2, -4, -7, -9]) == True\", \"assert check_same_orientation([2, 4, 7, 9]) == True\", \"assert check_same_orientation([-1, -5, -10]) == True\", \"assert check_same_orientation([1, 5, 10]) ...
{ "split": "train", "index": 69549, "acecode_id": "evol_1658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class `Gaussian1D` that models a one-dimensional Gaussian function. Implement a function `evaluate_gaussian(x: float, amplitude: float, mean: float, stddev: float) -> float` that calculates the value of the Gaussian function at a given point `x`. The Gaussian fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_gaussian(1.0, 1.0, 0.0, 1.0) == 0.6065306597126334\", \"assert evaluate_gaussian(2.0, 1.0, 1.0, 1.0) == 0.6065306597126334\", \"assert evaluate_gaussian(0.0, 0.0, 0.0, 1.0) == 0.0\", \"assert evaluate_gaussian(1.0, 0.0, 0.0, 1.0) == 0.0\", \"assert ...
{ "split": "train", "index": 69550, "acecode_id": "bigcode_python_fns_28601", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given the `root` of a binary tree, implement a function `maximumAverageSubtree(root)` that identifies the subtree within that binary tree that possesses the highest average value. A subtree of a tree includes any node of that tree along with all its progeny. The average value o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maximumAverageSubtree(TreeNode(5, TreeNode(6), TreeNode(1))) == 6.00000\", \"assert maximumAverageSubtree(TreeNode(1)) == 1.00000\", \"assert maximumAverageSubtree(TreeNode(0)) == 0.00000\", \"assert maximumAverageSubtree(TreeNode(10, TreeNode(10, TreeNode(1...
{ "split": "train", "index": 69551, "acecode_id": "evol_23691", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given an input string and a pattern, find all the starting indices of the pattern in the string and return them in an array. The output should be in the order of their appearance in the string. Implement the function `find_pattern(input_str: str, pattern: str) -> List[int]`.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pattern('abcabcabc', 'abc') == [0, 3, 6]\", \"assert find_pattern('hello world', 'world') == [6]\", \"assert find_pattern('a quick brown fox', 'cat') == []\", \"assert find_pattern('abababab', 'abab') == [0, 2, 4]\", \"assert find_pattern('aaaaaa', 'aa'...
{ "split": "train", "index": 69552, "acecode_id": "evol_4492", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simplified version of a database migration tool. Your function will take a list of database migration commands and execute them in the specified order. Each command can be one of the following types: 'create_table(table_n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_migration_commands([\\\"create_table('users')\\\", \\\"create_table('posts')\\\", \\\"drop_table('posts')\\\", \\\"create_table('comments')\\\"]) == ['users', 'comments']\", \"assert execute_migration_commands([\\\"create_table('products')\\\", \\\"c...
{ "split": "train", "index": 69553, "acecode_id": "oss_10204", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of positive numerical data, implement a function that applies a logarithmic transformation to each element in the list and returns a new list containing the transformed values. The input list will only contain positive numbers.\nPlease reason step by step, then wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_transform([1, 10, 100]) == [0.0, 2.302585092994046, 4.605170185988092]\", \"assert log_transform([2, 3, 4]) == [0.6931471805599453, 1.0986122886681098, 1.3862943611198906]\", \"assert log_transform([7, 14, 21]) == [1.9459101490553132, 2.6390573296152584,...
{ "split": "train", "index": 69554, "acecode_id": "evol_11487", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the Euclidean distance between two 2D points represented by their coordinates. The function should take in four integers, x1, y1, x2, and y2, which represent the coordinates of the two points (x1, y1) and (x2, y2). The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance(3, 4, 0, 0) == 5.0\", \"assert calculate_distance(1, 1, 1, 1) == 0.0\", \"assert calculate_distance(0, 0, 3, 4) == 5.0\", \"assert calculate_distance(-1, -1, 1, 1) == 2.8284271247461903\", \"assert calculate_distance(1, 2, 4, 6) == 5.0\", ...
{ "split": "train", "index": 69555, "acecode_id": "oss_29722", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given list of service providers is valid. A valid list is defined as one that contains at least one active provider. Each provider is represented by a dictionary with two keys: 'name' (a string) and 'is_active' (a bo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_provider_list([{'name': 'Provider A', 'is_active': False}, {'name': 'Provider B', 'is_active': True}]) == True\", \"assert is_valid_provider_list([{'name': 'Provider A', 'is_active': False}, {'name': 'Provider B', 'is_active': False}]) == False\", \...
{ "split": "train", "index": 69556, "acecode_id": "oss_33543", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a list of characters and returns a string with the characters concatenated together in the order they appear in the list. For example, given the input ['A', 'B', 'C', 'D'], the function should return 'ABCD'.\nPlease reason step by step, then wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate_characters(['A', 'B', 'C', 'D']) == 'ABCD'\", \"assert concatenate_characters(['a', 'b', 'c']) == 'abc'\", \"assert concatenate_characters(['1', '2', '3']) == '123'\", \"assert concatenate_characters(['!', '@', '#']) == '!@#'\", \"assert concaten...
{ "split": "train", "index": 69557, "acecode_id": "evol_29786", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that converts a given number of bytes into a human-readable format. The function should take the following parameters: an integer `size` representing the number of bytes, a string `unit` representing the unit of measurement (default is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nice_size(500) == '500 bytes'\", \"assert nice_size(1024) == '1 KB'\", \"assert nice_size(2048) == '2 KB'\", \"assert nice_size(1048576) == '1 MB'\", \"assert nice_size(1073741824) == '1 GB'\", \"assert nice_size(1099511627776) == '1 TB'\", \"assert nice_siz...
{ "split": "train", "index": 69558, "acecode_id": "bigcode_python_fns_19465", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given two lists of complex numbers, `a` and `b`, each containing exactly two elements, return a list containing the product of the corresponding elements from `a` and `b`, followed by their sum. The output should be in the form of a list where the first element is the product o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_products_and_sum([1+2j, 3+4j], [5+6j, 7+8j]) == [(1+2j)*(5+6j), (3+4j)*(7+8j), ((1+2j)*(5+6j) + (3+4j)*(7+8j))]\", \"assert compute_products_and_sum([0, 0], [0, 0]) == [0, 0, 0]\", \"assert compute_products_and_sum([1, 2], [3, 4]) == [3, 8, 11]\", \"...
{ "split": "train", "index": 69559, "acecode_id": "bigcode_python_fns_8868", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `mode_indices` and `swp_indices`. Your task is to create a function that generates a new list containing the sums of all pairs of elements from `mode_indices`, along with the sums of each element from `mode_indices` with each element from `s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_sums([1, 1], [1]) == [2]\", \"assert generate_unique_sums([1, 2, 3], []) == []\", \"assert generate_unique_sums([], [1, 2, 3]) == []\", \"assert generate_unique_sums([], []) == []\", \"assert generate_unique_sums([0, 0], [0, 0]) == [0]\", \"a...
{ "split": "train", "index": 69560, "acecode_id": "bigcode_python_fns_2994", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a string input, write a function that determines whether the input string represents a boolean True value. The valid string representations for True are 'true', 'yes', '1', and 'on' (case-insensitive). If the input string is None or an empty string, return False. If the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_true('true') == True\", \"assert is_true('TRUE') == True\", \"assert is_true('Yes') == True\", \"assert is_true('yes') == True\", \"assert is_true('1') == True\", \"assert is_true('On') == True\", \"assert is_true('on') == True\", \"assert is_true('false'...
{ "split": "train", "index": 69561, "acecode_id": "bigcode_python_fns_28893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string s, which may contain lowercase letters, uppercase letters, digits, and special characters. Your task is to implement a function `is_valid_identifier(s: str) -> bool` that checks if the given string is a valid Python identifier. A valid identifier in Pytho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_identifier('validIdentifier') == True\", \"assert is_valid_identifier('_validIdentifier') == True\", \"assert is_valid_identifier('1invalidIdentifier') == False\", \"assert is_valid_identifier('invalid-identifier') == False\", \"assert is_valid_iden...
{ "split": "train", "index": 69562, "acecode_id": "bigcode_python_fns_32982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of configurations where each configuration is a dictionary that includes a repository URL, a commit identifier, and optional parameters for building a project. Write a function `validate_configurations(configurations: List[Dict[str, Union[str, List[str]]]])...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_configurations([{ 'repo_url': 'https://github.com/example/repo.git', 'commit': 'HEAD' }]) == True\", \"assert validate_configurations([{ 'repo_url': 'https://github.com/example/repo.git', 'commit': '' }]) == False\", \"assert validate_configurations...
{ "split": "train", "index": 69563, "acecode_id": "bigcode_python_fns_18417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `verify_key(pin: str, serial: str, udp: str) -> str` that verifies if a given key is valid based on its serial number and pin input. The function should handle different scenarios based on the input pin and serial, returning specific ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_key('', 'any_serial', 'any_udp') == 'PIN required!'\", \"assert verify_key('valid_pin', 'unknown_serial', 'any_udp') == 'Invalid key.'\", \"assert verify_key('valid_pin', 'invalid_serial', 'any_udp') == 'Invalid key.'\", \"assert verify_key('valid_pin...
{ "split": "train", "index": 69564, "acecode_id": "bigcode_python_fns_35033", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given the log-likelihood score of eQTL occurrences for a specific gene, a list of predicted Transcription Factor Binding Sites (TFBS), and a list of converted eQTLs with their corresponding positions and scores. Your task is to calculate the total weight score for eQTLs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert eqtl_weights_summing(0.5, [10, 20], [(5, 15, 0.1), (30, 40, 0.3)], {0.1: 1.0, 0.3: 2.0}) == 1.5\", \"assert eqtl_weights_summing(1.0, [10, 20], [(5, 15, 0.2), (25, 35, 0.4)], {0.2: 1.5, 0.4: 2.5}) == 2.5\", \"assert eqtl_weights_summing(2.0, [10, 20], [(10, ...
{ "split": "train", "index": 69565, "acecode_id": "bigcode_python_fns_17243", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an integer representing a BrickLink color number, write a function `bricklinkColorToLEGO(colornum)` that returns a dictionary containing the LEGO equivalent of that color number if it exists. The dictionary should have the following keys: 'name' (a string representing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bricklinkColorToLEGO(1) == {'name': 'Red', 'Lego': 1, 'BrickLink': 1}\", \"assert bricklinkColorToLEGO(2) == {'name': 'Blue', 'Lego': 2, 'BrickLink': 2}\", \"assert bricklinkColorToLEGO(3) == {'name': 'Green', 'Lego': 3, 'BrickLink': 3}\", \"assert bricklink...
{ "split": "train", "index": 69566, "acecode_id": "bigcode_python_fns_43041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a non-negative whole number n and returns a dictionary containing all unique prime factors of numbers less than n as keys and their frequency count as values. The keys in the dictionary should represent the prime factors and the corresponding values ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorize_below_with_frequency(0) == {}\", \"assert factorize_below_with_frequency(1) == {}\", \"assert factorize_below_with_frequency(2) == {}\", \"assert factorize_below_with_frequency(3) == {2: 1}\", \"assert factorize_below_with_frequency(7) == {2: 4, 3:...
{ "split": "train", "index": 69567, "acecode_id": "evol_9451", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `binary_group(N: int, M: int) -> str` that takes two integers, N (1 <= N <= 10^5) and M (0 <= M <= 10^10). The function should convert the integer M into an 8-bit binary representation, split this binary representation into groups of size N, and return a st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_group(3, 10) == '001 010'\", \"assert binary_group(1, 255) == '1 1 1 1 1 1 1 1'\", \"assert binary_group(8, 255) == '11111111'\", \"assert binary_group(4, 16) == '0001 0000'\", \"assert binary_group(8, 0) == '00000000'\", \"assert binary_group(1, 10) ...
{ "split": "train", "index": 69568, "acecode_id": "evol_27703", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that takes a list of books and a list of authors, and establishes a many-to-many relationship between them based on given pairs. The function should return a dictionary where each book title is a key and its corresponding value is a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert establish_relationship(['Book A', 'Book B', 'Book C'], ['Author 1', 'Author 2'], [('Book A', 'Author 1'), ('Book A', 'Author 2'), ('Book B', 'Author 1')]) == {'Book A': ['Author 1', 'Author 2'], 'Book B': ['Author 1'], 'Book C': []}\", \"assert establish_rel...
{ "split": "train", "index": 69569, "acecode_id": "oss_15159", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given checkpoint value. The function should accept an integer as input. If the input value is provided, the function should return that value. If no value is provided (indicated by passing None), the function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_checkpoint_value(5) == 5\", \"assert get_checkpoint_value(-10) == -10\", \"assert get_checkpoint_value(0) == 0\", \"assert get_checkpoint_value(None) == -1\", \"assert get_checkpoint_value(100) == 100\", \"assert get_checkpoint_value(-1) == -1\", \"asser...
{ "split": "train", "index": 69570, "acecode_id": "oss_19028", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that selects the minimum of three numbers. Implement a function `min_of_three(a: int, b: int, c: int) -> int` that returns the smallest of the three integers. The function should handle both positive and negative integers. For example, if the input is (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_of_three(1, 2, 3) == 1\", \"assert min_of_three(3, 2, 1) == 1\", \"assert min_of_three(1, 1, 1) == 1\", \"assert min_of_three(-1, -2, -3) == -3\", \"assert min_of_three(-1, 0, 1) == -1\", \"assert min_of_three(5, 5, 5) == 5\", \"assert min_of_three(0, 0,...
{ "split": "train", "index": 69571, "acecode_id": "bigcode_python_fns_37031", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings. Your task is to write a Python function that takes this list as input and returns a dictionary containing the count of occurrences of each unique string in the list. The function signature is: `def count_string_occurrences(strings: List[str]) ->...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_string_occurrences(['apple', 'banana', 'apple', 'orange', 'banana', 'apple']) == {'apple': 3, 'banana': 2, 'orange': 1}\", \"assert count_string_occurrences(['cat', 'dog', 'cat', 'mouse']) == {'cat': 2, 'dog': 1, 'mouse': 1}\", \"assert count_string_oc...
{ "split": "train", "index": 69572, "acecode_id": "oss_1052", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the ages of a group of people. Your task is to create a function that takes this list as input and returns the average age of the group. If the input list is empty, return 0. The function should be named `average_age(ages)` and shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_age([30, 25, 35, 40]) == 32.50\", \"assert average_age([18, 22, 19]) == 19.67\", \"assert average_age([45]) == 45.00\", \"assert average_age([60, 70, 80]) == 70.00\", \"assert average_age([]) == 0\", \"assert average_age([10, 20, 30, 40, 50]) == 30.0...
{ "split": "train", "index": 69573, "acecode_id": "oss_3133", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that checks if a given URL ends with '.net', includes at least one subdomain, and does not contain any hyphens or numbers. The function should return True if the URL meets all these criteria, and False otherwise.\nPlease reason step by step, then write a self-c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match_url('https://sub.example.net') == True\", \"assert match_url('https://another.subdomain.net') == True\", \"assert match_url('https://my.site.net') == True\", \"assert match_url('https://example.net') == False\", \"assert match_url('http://example.com')...
{ "split": "train", "index": 69574, "acecode_id": "evol_16402", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `verify_code(code: str) -> bool` that checks whether a given secret code meets the following criteria: the code must be exactly 10 characters long, must contain at least one lowercase letter, at least one uppercase letter, at least one digit, at least one s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_code('abcde1234') == False\", \"assert verify_code('ABCDE!@#$') == False\", \"assert verify_code('1234567890') == False\", \"assert verify_code('!@#ABcde12') == True\", \"assert verify_code('!@#$%^&*()') == False\", \"assert verify_code('abcd!@#XYZ') ...
{ "split": "train", "index": 69575, "acecode_id": "evol_33550", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that converts a given string to an integer without using the int() function or any built-in parsing functions. The function should handle possible leading and trailing spaces, as well as positive and negative signs. For example, ' -12345 ' should be converted...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert str_to_int(' -12345 ') == -12345\", \"assert str_to_int('42') == 42\", \"assert str_to_int(' +6789') == 6789\", \"assert str_to_int(' 0 ') == 0\", \"assert str_to_int('-0') == 0\", \"assert str_to_int(' +0 ') == 0\", \"assert str_to_int(' -1') == -...
{ "split": "train", "index": 69576, "acecode_id": "evol_17718", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to manage a list of books in a library. Each book is represented as a dictionary with keys 'title' and 'author'. Implement a function called `library_operations(operations)` that takes a list of operations and performs the following: \n- ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert library_operations([{'operation': 'add', 'title': 'The Great Gatsby', 'author': 'F. Scott Fitzgerald'}, {'operation': 'add', 'title': 'To Kill a Mockingbird', 'author': 'Harper Lee'}, {'operation': 'total_books'}]) == 2\", \"assert library_operations([{'oper...
{ "split": "train", "index": 69577, "acecode_id": "oss_7963", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a DNA sequence represented as a string and a region represented as a tuple of two integers (start, end), write a function that extracts the subsequence from the DNA sequence based on the specified region. The subsequence should include the characters from the start index ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_subsequence('ATCGATCG', (0, 3)) == 'ATCG'\", \"assert extract_subsequence('ATCGATCG', (2, 5)) == 'CGAT'\", \"assert extract_subsequence('ATCGATCG', (1, 1)) == 'T'\", \"assert extract_subsequence('ATCGATCG', (0, 7)) == 'ATCGATCG'\", \"assert extract_s...
{ "split": "train", "index": 69578, "acecode_id": "bigcode_python_fns_7212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing words, implement a function that tags each word with a polarity score based on predefined values. The function should return a dictionary where each key is a word and the value is a list containing the polarity score and the frequency of tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tag_words(['happy', 'sad', 'happy', 'excited']) == {'happy': [1, 2], 'sad': [-1, 1], 'excited': [2, 1]}\", \"assert tag_words(['neutral', 'angry', 'happy']) == {'happy': [1, 1], 'angry': [-2, 1]}\", \"assert tag_words(['happy', 'neutral', 'neutral', 'sad', '...
{ "split": "train", "index": 69579, "acecode_id": "bigcode_python_fns_4902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple check management system for a monitoring agent. The system should allow registering checks with a time-to-live (TTL) value and retrieving the registered checks along with their associated TTLs. You need to implement a function `manage_c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_checks([('register', 'check1', '10s'), ('register', 'check2', '5m'), ('get_checks')]) == {'check1': '10s', 'check2': '5m'}\", \"assert manage_checks([('register', 'check1', '1h'), ('get_checks')]) == {'check1': '1h'}\", \"assert manage_checks([('get_c...
{ "split": "train", "index": 69580, "acecode_id": "oss_30557", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple logging system. The function should take a list of log messages and a log filename as input. Your function should write each log message to the specified log file, each on a new line. If the file already exists...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert write_logs(['Log entry 1', 'Log entry 2'], 'test_log.txt') is None\", \"assert write_logs([], 'empty_log.txt') is None\", \"assert write_logs(['Single log message'], 'single_log.txt') is None\", \"assert write_logs(['First entry', 'Second entry'], 'existing_...
{ "split": "train", "index": 69581, "acecode_id": "oss_23469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of IP addresses and returns a sorted list of tuples containing the IP address and its corresponding device type. The device type is determined by a predefined mapping of IP addresses to device types. If an IP address is not found in the ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted(get_device_types(['192.168.1.1', '192.168.1.3', '192.168.1.2'])) == [('192.168.1.1', 'Router'), ('192.168.1.2', 'Laptop'), ('192.168.1.3', 'Unknown')]\", \"assert sorted(get_device_types(['192.168.1.4', '192.168.1.5'])) == [('192.168.1.4', 'Smartphone...
{ "split": "train", "index": 69582, "acecode_id": "evol_6921", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a specific window object from a given application named 'Maya'. The function should take a string input representing the window name and return a string indicating the status of the window retrieval. If the window exists, r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_window_status('MayaWindow') == 'Window Found'\", \"assert get_window_status('RenderView') == 'Window Found'\", \"assert get_window_status('AttributeEditor') == 'Window Found'\", \"assert get_window_status('Timeline') == 'Window Found'\", \"assert get_win...
{ "split": "train", "index": 69583, "acecode_id": "bigcode_python_fns_35319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, return the maximum 1 to 9 pandigital 9-digit number that can be constructed as the concatenated product of n with the sequence (1, 2, ..., k) where k is greater than 1. A pandigital number uses each digit from 1 to 9 exactly once. If no such pandigital numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenated_pandigital(192) == 192384576\", \"assert concatenated_pandigital(9) == 918273645\", \"assert concatenated_pandigital(10) == 0\", \"assert concatenated_pandigital(100) == 0\", \"assert concatenated_pandigital(1000) == 0\", \"assert concatenated_p...
{ "split": "train", "index": 69584, "acecode_id": "evol_1605", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns a string indicating whether the sum of the integers is even or odd. Write a Python function `sum_even_or_odd` with the following signature: `def sum_even_or_odd(numbers: List[int]) -> s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_even_or_odd([1, 2, 3]) == 'Even'\", \"assert sum_even_or_odd([1, 1, 1]) == 'Odd'\", \"assert sum_even_or_odd([0]) == 'Even'\", \"assert sum_even_or_odd([-1, -1, -1]) == 'Odd'\", \"assert sum_even_or_odd([2, 4, 6]) == 'Even'\", \"assert sum_even_or_odd([1...
{ "split": "train", "index": 69585, "acecode_id": "oss_24477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `nth_fibonacci(n: int) -> int` that returns the Nth Fibonacci number in the Fibonacci series, where N is a non-negative integer. The Fibonacci series is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. If N is less than 0, the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nth_fibonacci(0) == 0\", \"assert nth_fibonacci(1) == 1\", \"assert nth_fibonacci(2) == 1\", \"assert nth_fibonacci(3) == 2\", \"assert nth_fibonacci(4) == 3\", \"assert nth_fibonacci(5) == 5\", \"assert nth_fibonacci(6) == 8\", \"assert nth_fibonacci(7) == ...
{ "split": "train", "index": 69586, "acecode_id": "evol_35384", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `numberCase` that takes a single parameter `x` and returns a string representing the type of `x`. The function should handle the following cases: if `x` is a positive integer, return 'Positive integer'; if `x` is a negative integer, return 'Negative ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numberCase(10) == 'Positive integer'\", \"assert numberCase(-10) == 'Negative integer'\", \"assert numberCase(0) == 'Zero'\", \"assert numberCase(10.5) == 'Positive decimal number'\", \"assert numberCase(-10.5) == 'Negative decimal number'\", \"assert number...
{ "split": "train", "index": 69587, "acecode_id": "evol_1915", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, 'subscribers' and 'blog_posts'. The 'subscribers' list contains email addresses represented as strings. The 'blog_posts' list contains dictionaries, each representing a blog post with 'title', 'photo_url', and 'content'. Your task is to impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_data(['test@example.com', 'user@domain.com'], [{'title': 'First Post', 'photo_url': 'http://image.com/photo1.jpg', 'content': 'Content of the first post.'}, {'title': 'Second Post', 'photo_url': 'http://image.com/photo2.jpg', 'content': 'Content of ...
{ "split": "train", "index": 69588, "acecode_id": "oss_20212", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that identifies and removes all outliers from the list based on the standard deviation. An outlier is defined as any integer that is more than 'k' times the standard deviation away from the mean of the list,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_outliers([10, 20, 30, 40, 50, 100], 2) == [10, 20, 30, 40, 50]\", \"assert remove_outliers([1, 2, 3, 4, 5], 3) == [1, 2, 3, 4, 5]\", \"assert remove_outliers([5, 6, 7, 8, 9, 10, 1000], 2) == [5, 6, 7, 8, 9, 10]\", \"assert remove_outliers([], 1) == []...
{ "split": "train", "index": 69589, "acecode_id": "bigcode_python_fns_32788", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the execution of a shell command with retry logic. Implement a function `execute_command` that takes in the following parameters: a string `cmd` representing the shell command to run, an optional integer `timeout_time` spec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_command('sleep 1', timeout_time=2) == 'Command executed successfully'\", \"assert execute_command('echo test', timeout_time=1) == 'Command executed successfully'\", \"assert execute_command('echo retry', retry_count=1) == 'Command executed successful...
{ "split": "train", "index": 69590, "acecode_id": "bigcode_python_fns_33318", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function to calculate the Cholesky decomposition of a given positive definite matrix. The Cholesky decomposition factorizes a positive definite matrix into the product of a lower triangular matrix and its conjugate transpose. Implement ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert chol([[4, 12, -16], [12, 37, -43], [-16, -43, 98]]) == [[2.0, 0.0, 0.0], [6.0, 1.0, 0.0], [-8.0, 5.0, 3.0]]\", \"assert chol([[1, 2], [2, 5]]) == [[1.0, 0.0], [2.0, 1.0]]\", \"assert chol([[2, -1], [-1, 2]]) == [[1.4142135623730951, 0.0], [-0.707106781186547...
{ "split": "train", "index": 69591, "acecode_id": "oss_24197", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a given list of tuples representing chat messages. Each tuple contains a chat ID (string) and a message text (string). Your function should extract the chat ID and message text from the first tuple in the list, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_chat_messages([('123', 'Hello there!')]) == ('123', 'Hello there!')\", \"assert process_chat_messages([('456', 'How are you?')]) == ('456', 'How are you?')\", \"assert process_chat_messages([('789', 'Good morning!')]) == ('789', 'Good morning!')\", \...
{ "split": "train", "index": 69592, "acecode_id": "oss_22412", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the prediction of a basic machine learning model. The function should take in a list of feature values as input and return a prediction based on a simple linear regression model defined by the coefficients provided. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict([1.0, 2.0], [0.5, 1.5]) == 3.5\", \"assert predict([0.0, 0.0], [1.0, 1.0]) == 0.0\", \"assert predict([1.0], [2.0]) == 2.0\", \"assert predict([1.0, 1.0], [2.0, 2.0]) == 4.0\", \"assert predict([], []) == 0.0\", \"assert predict([5.0, 0.0], [0.1, 0.2...
{ "split": "train", "index": 69593, "acecode_id": "evol_4962", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `tor_connection_failed(data: bytes) -> bool` that handles a connection failure for a Tor service. The function takes a byte string parameter `data` which contains information about the connection failure. The function should return `T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tor_connection_failed(b'Connection failed') == False\", \"assert tor_connection_failed(b'Failed to connect: Bootstrap') == True\", \"assert tor_connection_failed(b'Error: no route to host') == False\", \"assert tor_connection_failed(b'Successful connection')...
{ "split": "train", "index": 69594, "acecode_id": "oss_11664", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `traverse_dict(d: dict) -> dict` that takes a multi-layered dictionary and returns a dictionary containing paths from the root to each leaf node in the form of strings. Each key in the output dictionary should represent a path (e.g., 'level1.level2a.level3a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert traverse_dict({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}\", \"assert traverse_dict({'level1': {'level2': {'level3': 10}}}) == {'level1.level2.level3': 10}\", \"assert traverse_dict({'level1': {'level2': {'level3a': 1, 'level3b': 2}}}) == {'level1.level2.level3a':...
{ "split": "train", "index": 69595, "acecode_id": "evol_7652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that constructs a list of every triadic sequence originating from a given sequence of integers. A triadic sequence consists of three consecutive elements from the input list. The function should return a list of lists, where each inner list contains three elem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triadic([1, 2, 3]) == [[1, 2, 3]]\", \"assert triadic([5, 6, 7, 8, 9]) == [[5, 6, 7], [6, 7, 8], [7, 8, 9]]\", \"assert triadic([10]) == []\", \"assert triadic([]) == []\", \"assert triadic([3, 5, 2, 8]) == [[3, 5, 2], [5, 2, 8]]\", \"assert triadic([0, 1, 2...
{ "split": "train", "index": 69596, "acecode_id": "evol_24142", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing HTML content from a search engine results page and a keyword string. Your task is to extract search results from the HTML content. Each search result should include the keyword, rank (starting from 1), title of the result, link to the result,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_search_results('<div class=\\\"g\\\"><a href=\\\"#\\\"><h3>Title 2</h3></a></div>', 'test') == []\", \"assert extract_search_results('<div class=\\\"g\\\"></div>', 'test') == []\", \"assert extract_search_results('<div class=\\\"g\\\"><a href=\\\"htt...
{ "split": "train", "index": 69597, "acecode_id": "bigcode_python_fns_20084", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an initial point `(sx, sy)` and a destination point `(tx, ty)`, determine if it's possible to reach the destination point from the initial point using the following transformation rules: from point `(x, y)`, you can move to `(x, x+y)` or `(x+y, y)`. Return `True` if the d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reachingPoints(1, 1, 3, 5) == True\", \"assert reachingPoints(1, 1, 2, 2) == False\", \"assert reachingPoints(1, 1, 1, 1) == True\", \"assert reachingPoints(1, 1, 1, 1000000000) == True\", \"assert reachingPoints(10, 20, 30, 50) == True\", \"assert reachingP...
{ "split": "train", "index": 69598, "acecode_id": "evol_1688", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple task management system that can handle tasks and their dependencies. Implement a function `manage_tasks(tasks: List[str], list_tasks: bool = False, version: bool = False, file: str = 'build.py') -> Union[List[str], str]` that takes the foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_tasks([], False, False) == ''\", \"assert manage_tasks(['task1'], False, False) == ''\", \"assert manage_tasks([], True, False) == []\", \"assert manage_tasks(['task1'], True, False) == ['task1']\", \"assert manage_tasks(['task1', 'task2'], True, Fals...
{ "split": "train", "index": 69599, "acecode_id": "bigcode_python_fns_43593", "num_tests": 14 }