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 `fibonacci(n: int) -> List[int]` that returns the Fibonacci sequence up to the nth ordinal position, where n is a non-negative integer. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. If n is 0, r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 78100, "acecode_id": "evol_14742", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage a collection of damage skins in a game. A damage skin is a cosmetic item that changes the appearance of damage numbers displayed when attacking enemies. You need to create a function `manageDamageSkins(skin_ids: List[int]) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manageDamageSkins([1, 2, 3]) == None\", \"assert manageDamageSkins([4, 5, 6]) == None\", \"assert manageDamageSkins([7, 8, 9]) == None\", \"assert manageDamageSkins([10, 11, 12]) == None\", \"assert manageDamageSkins([13, 14, 15]) == None\", \"assert manageD...
{ "split": "train", "index": 78101, "acecode_id": "oss_3265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of a dependency injection container in Python. Dependency injection is a design pattern in which the dependencies of a class are provided from the outside rather than created within the class itself. Your task is to implemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert container.get(Application) is not None\", \"assert isinstance(container.get(Application), Application)\", \"assert isinstance(container.get(Logger), Logger)\", \"assert isinstance(container.get(Database), Database)\", \"assert isinstance(container.get(Applic...
{ "split": "train", "index": 78102, "acecode_id": "oss_25153", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of coin denominations and a target amount. Your task is to write a function to determine the minimum number of coins needed to make up that amount. If the amount cannot be made up by any combination of the given coins, return -1. Write a function `minCoinsN...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minCoinsNeeded([1, 2, 5], 11) == 3\", \"assert minCoinsNeeded([2, 3, 5], 7) == 2\", \"assert minCoinsNeeded([1, 5, 10], 8) == 4\", \"assert minCoinsNeeded([5, 10], 3) == -1\", \"assert minCoinsNeeded([1], 0) == 0\", \"assert minCoinsNeeded([1, 2, 3], 4) == 2...
{ "split": "train", "index": 78103, "acecode_id": "oss_8038", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting an amount of water consumed from milliliters to liters. Write a function `convert_to_liters` that takes an integer `milliliters` (0 <= milliliters <= 10^6) as input and returns a string representing the amount of water consumed in liters, rounded ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_liters(0) == '0.000'\", \"assert convert_to_liters(100) == '0.100'\", \"assert convert_to_liters(500) == '0.500'\", \"assert convert_to_liters(1000) == '1.000'\", \"assert convert_to_liters(1500) == '1.500'\", \"assert convert_to_liters(2000) == '...
{ "split": "train", "index": 78104, "acecode_id": "oss_10594", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that formats log messages. The function should take three parameters: `log_level`, `message`, and `timestamp`. The `log_level` is a string that can be one of the following: 'DEBUG', 'INFO', 'WARNING', 'ERROR', or 'CRITICAL'. The `mess...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_log_message('DEBUG', 'This is a debug message', '2023-10-01 12:00:00') == '[2023-10-01 12:00:00] - DEBUG - This is a debug message'\", \"assert format_log_message('INFO', 'This is an info message', '2023-10-01 12:01:00') == '[2023-10-01 12:01:00] - IN...
{ "split": "train", "index": 78105, "acecode_id": "oss_29781", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a translation object into a structured dictionary. The translation object is represented as a dictionary with two keys: 'title' (a string representing the title of the object) and 'permalink' (a string representing the permal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_translation({'title': 'Event One', 'permalink': 'event-one'}, 'event') == {'title': 'Event One', 'url': 'https://example.com/event-one', 'type': 'event'}\", \"assert format_translation({'title': 'Page One', 'permalink': 'page-one'}, 'page') == {'title...
{ "split": "train", "index": 78106, "acecode_id": "bigcode_python_fns_13549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of character data. Each character data entry is formatted as a string containing a character ID followed by a character name, separated by a comma (e.g., '1,Hero'). Your function should take a list of such strings as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_character_data(['1,Hero', '2,Villain', '3,Sidekick']) == {'Hero': 1, 'Villain': 2, 'Sidekick': 3}\", \"assert process_character_data(['10,Warrior', '20,Mage']) == {'Warrior': 10, 'Mage': 20}\", \"assert process_character_data(['1,Alice', '2,Bob', '3,...
{ "split": "train", "index": 78107, "acecode_id": "bigcode_python_fns_25536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_auth_token()` that generates a one-time use, cryptographically secure authentication token consisting of 10 distinct alphanumeric characters. The token must contain at least one uppercase letter, one lowercase letter, and at least three digits. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum(c.isdigit() for c in generate_auth_token()) >= 3\", \"assert len(set(generate_auth_token())) == 10\", \"assert all(c in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' for c in generate_auth_token())\", \"assert generate_auth_token() is ...
{ "split": "train", "index": 78108, "acecode_id": "evol_18406", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks for duplicate elements in a list of integers. Your function should take a list of integers as input and return True if there are any duplicates in the list; otherwise, it should return False. Implement a function called `has_d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_duplicates([1, 2, 3, 4, 5]) == False\", \"assert has_duplicates([1, 2, 2, 3, 4]) == True\", \"assert has_duplicates([]) == False\", \"assert has_duplicates([7]) == False\", \"assert has_duplicates([1, 3, 5, 7, 9, 1]) == True\", \"assert has_duplicates([0...
{ "split": "train", "index": 78109, "acecode_id": "bigcode_python_fns_41822", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representation of XML that contains sentences and their respective tokens. Your task is to implement a function `parse_xml(xml: str) -> str` that extracts tokens from the XML structure and formats them into a slash-separated string for each sentence, with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_xml('<sentences><sentence><chunk><word attr1=\\\"value1\\\" attr2=\\\"value2\\\"/></chunk></sentence><sentence><chunk><word attr1=\\\"value3\\\" attr2=\\\"value4\\\"/></chunk></sentence></sentences>') == 'value1/value2\\\\nvalue3/value4'\", \"assert pa...
{ "split": "train", "index": 78110, "acecode_id": "bigcode_python_fns_21362", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that sorts a given array in ascending order without using any built-in sort functions. The function should also return a second array that contains the counts of each distinct element in the sorted array. The function should take a list of integers as input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_sort_and_count([1, 1, 1, 1]) == ([1], [4])\", \"assert count_sort_and_count([4, 4, 4, 4, 4]) == ([4], [5])\", \"assert count_sort_and_count([2, 2, 1, 1, 0]) == ([0, 1, 2], [1, 2, 2])\", \"assert count_sort_and_count([3, 2, 1, 0]) == ([0, 1, 2, 3], [1, ...
{ "split": "train", "index": 78111, "acecode_id": "evol_991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the nth term of the Jacobsthal-Lucas sequence, which is defined recursively as follows: J(0) = 2, J(1) = 1, and for n > 1, J(n) = 2 * J(n - 1) + J(n - 2). Your function should take two parameters: a positive integer n, and a positive integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert jacobsthal_lucas(2, 1) == 0\", \"assert jacobsthal_lucas(3, 1) == 0\", \"assert jacobsthal_lucas(4, 1) == 0\", \"assert jacobsthal_lucas(5, 1) == 0\", \"assert jacobsthal_lucas(1, 2) == 1\", \"assert jacobsthal_lucas(2, 2) == 0\", \"assert jacobsthal_lucas(3...
{ "split": "train", "index": 78112, "acecode_id": "evol_14965", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `bubbleSort(arr: List[int]) -> List[int]` that takes a list of 10 integers and sorts them in ascending order using the bubble sort algorithm. The function should return the sorted list. The input list will always contain exactly 10 integers.\nPlease reason ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubbleSort([5, 1, 4, 2, 8, 0, 3, 9, 7, 6]) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert bubbleSort([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert bubbleSort([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]...
{ "split": "train", "index": 78113, "acecode_id": "evol_29350", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers a and b, and a positive integer n, implement a function that returns a list of n Chebyshev nodes on the interval [a, b]. A Chebyshev node is defined as T_k = 1/2 * ((a + b) + (b - a) * cos((2*k - 1) * π / (2*n))) for k from 1 to n. The function should raise a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert chebyshev_nodes(0, 1, 1) == [0.5]\", \"assert chebyshev_nodes(-1, 1, 1) == [0.0]\", \"assert chebyshev_nodes(2, 5, 1) == [3.5]\", \"assert chebyshev_nodes(-5, 5, 1) == [0.0]\", \"assert chebyshev_nodes(0, 10, 1) == [5.0]\", \"assert chebyshev_nodes(10, 20, 1...
{ "split": "train", "index": 78114, "acecode_id": "bigcode_python_fns_35476", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of template file names that can be used for saving and loading actions. Implement a function `get_next_template(templates: List[str]) -> str` that returns the first non-empty template file name from the list. If all the file names in the list are empty, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_next_template(['', 'template1.txt', '', 'template2.txt']) == 'template1.txt'\", \"assert get_next_template(['templateA.txt', '', 'templateB.txt']) == 'templateA.txt'\", \"assert get_next_template(['', '']) == ''\", \"assert get_next_template(['template.t...
{ "split": "train", "index": 78115, "acecode_id": "bigcode_python_fns_34851", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates if a given value is an integer within a specified inclusive range. The function should take four parameters: 'value' (the value to be validated), 'min' (the minimum allowable value), 'max' (the maximum allowable value), and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_integer('10', 1, 20, 'test') == 10\", \"assert validate_integer('5', 1, 10, 'age') == 5\", \"assert validate_integer('0', 0, 100, 'score') == 0\", \"assert validate_integer('100', 0, 100, 'percentage') == 100\", \"assert validate_integer('25', 10, 3...
{ "split": "train", "index": 78116, "acecode_id": "bigcode_python_fns_7057", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of regions, each with a corresponding spatial diffusion value, and a dictionary that contains the disaggregated fuel consumption for different sectors (residential, service, and industry) in each region. Your task is to write a function that calculates the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_normalized_diffusion_factors(['RegionA', 'RegionB', 'RegionC'], {'RegionA': 0.0, 'RegionB': 0.0, 'RegionC': 0.0}) == {'RegionA': 0.0, 'RegionB': 0.0, 'RegionC': 0.0}\", \"assert calculate_normalized_diffusion_factors(['RegionA', 'RegionB'], {'Regio...
{ "split": "train", "index": 78117, "acecode_id": "bigcode_python_fns_22187", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the execution of a simple command language. The function `execute_command(command: str) -> str` takes a string `command` as input, which represents a command that can be executed. The command may include the following opera...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_command('RUN') == 'Executing...'\", \"assert execute_command('STOP') == 'Stopped.'\", \"assert execute_command('RESET') == 'Resetting...'\", \"assert execute_command('RUN') == 'Executing...'\", \"assert execute_command('STOP') == 'Stopped.'\", \"asse...
{ "split": "train", "index": 78118, "acecode_id": "bigcode_python_fns_8336", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage a resource allocation system. The system has a fixed number of resource units that can be allocated to different entities. You need to implement the function `manage_resources(max_unit: int, min_unit: int, reserved: int, ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_resources(100, 5, 10, 1, 80, 'allocate', 20) == True\", \"assert manage_resources(100, 5, 10, 1, 80, 'allocate', 100) == False\", \"assert manage_resources(100, 5, 10, 1, 80, 'deallocate', 10) == False\", \"assert manage_resources(100, 5, 10, 1, 80, '...
{ "split": "train", "index": 78119, "acecode_id": "oss_17658", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of URL paths and returns a dictionary containing the unique endpoints and their corresponding handler functions. Each URL path is represented as a string in the format `path('endpoint/', handler_function),` wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_endpoints([\\\"path('change_card/', change_class_card)\\\", \\\"path('export_class_table/', export_one_class_card)\\\"]) == {'change_card': 'change_class_card', 'export_class_table': 'export_one_class_card'}\", \"assert extract_endpoints([\\\"path('l...
{ "split": "train", "index": 78120, "acecode_id": "oss_26875", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers n1 and n2 representing two consecutive numbers in a Fibonacci series, implement a function `next_fib` that returns the next number in the series. The Fibonacci series is defined such that F(0) = 0, F(1) = 1, and each subsequent number is the sum of the two pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert next_fib(0, 1) == 1\", \"assert next_fib(1, 1) == 2\", \"assert next_fib(1, 2) == 3\", \"assert next_fib(2, 3) == 5\", \"assert next_fib(3, 5) == 8\", \"assert next_fib(5, 8) == 13\", \"assert next_fib(8, 13) == 21\", \"assert next_fib(13, 21) == 34\", \"ass...
{ "split": "train", "index": 78121, "acecode_id": "evol_3905", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples where each tuple contains two elements: a string representing a chromosome ('chr') and an integer representing the start position of a gene ('start'). The chromosome can be '1' to '22', 'X', or 'Y'. Your task is to convert the chromosome 'X' to '2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_gene_positions([('1', 123), ('2', 456), ('X', 789), ('Y', 1000)]) == [1.0000000123, 2.0000000456, 23.0000000789, 24.0000001000]\", \"assert convert_gene_positions([('X', 0), ('Y', 9999)]) == [23.0000000000, 24.0000009999]\", \"assert convert_gene_pos...
{ "split": "train", "index": 78122, "acecode_id": "bigcode_python_fns_6704", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that maps word pairs to their corresponding labels based on a predefined set of word relations. Given a list of word relations where each relation is represented as a tuple of two words and an integer label, as well as a sample list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_word_pairs_to_labels([('good', 'bad', 1), ('happy', 'sad', 0)], ['good', 'happy', 'bad']) == {('good', 'happy'): -1, ('happy', 'good'): -1, ('good', 'bad'): 1, ('bad', 'good'): 1, ('happy', 'bad'): -1, ('bad', 'happy'): -1}\", \"assert map_word_pairs_to_...
{ "split": "train", "index": 78123, "acecode_id": "oss_5573", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that generates the Fibonacci sequence up to a given integer n and returns it in reverse order. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. For a given integer ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_reverse(0) == [0]\", \"assert fibonacci_reverse(1) == [1, 0]\", \"assert fibonacci_reverse(2) == [1, 1, 0]\", \"assert fibonacci_reverse(3) == [2, 1, 1, 0]\", \"assert fibonacci_reverse(4) == [3, 2, 1, 1, 0]\", \"assert fibonacci_reverse(5) == [5, ...
{ "split": "train", "index": 78124, "acecode_id": "evol_4836", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of URL patterns in the format of strings that reference view functions in a web application. Your task is to create a function `extract_view_functions(urls)` that extracts the view function names from the given URL patterns and returns them as a list. The v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_view_functions(['views.home', 'views.pwd', 'views.userAdd', 'views.userTypes', 'views.login', 'views.menu']) == ['home', 'pwd', 'userAdd', 'userTypes', 'login', 'menu']\", \"assert extract_view_functions(['views.index', 'views.about', 'views.contact'...
{ "split": "train", "index": 78125, "acecode_id": "oss_36576", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented as an adjacency list, where each node is associated with a color defined by an integer. Write a function `colorful_path_exists(graph: List[List[int]], colors: List[int], start: int, subgraph_type: str) -> List[int]` that detects if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert colorful_path_exists([[1, 2], [0, 3], [0], [1]], [1, 2, 1, 3], 0, 'path') == [1, 2, 3]\", \"assert colorful_path_exists([[1], [2], [3], [0]], [1, 2, 3, 1], 0, 'cycle') == [1, 2, 3]\", \"assert colorful_path_exists([[1], [2], [3], []], [1, 2, 2, 3], 0, 'path'...
{ "split": "train", "index": 78126, "acecode_id": "bigcode_python_fns_33117", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a note-taking application. The function should take in a title, content, and a boolean value indicating whether the note is pinned or not. It should return the number of words in the note's content. Implement a function cal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_words('Shopping List', 'Milk, Bread, Eggs', True) == 3\", \"assert count_words('Empty Note', '', False) == 0\", \"assert count_words('Single Word', 'Hello', True) == 1\", \"assert count_words('Special Characters', 'Hello, world!', True) == 2\", \"asser...
{ "split": "train", "index": 78127, "acecode_id": "oss_14139", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a Python function that determines if there are any two distinct numbers in the list that add up to a specified target sum. Your function should return True if such a pair exists, and False otherwise.\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 9) == True\", \"assert has_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert has_pair_with_sum([0, -1, 2, -3, 1], -2) == True\", \"assert has_pair_with_sum([], 5) == False\", \"assert has_pair_with_sum([1], 1) == Fals...
{ "split": "train", "index": 78128, "acecode_id": "evol_1276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `unfollow_user(follower_id: int, following_id: int, is_authenticated: bool) -> str` that simulates the action of unfollowing a user in a social media application. The function takes three parameters: `follower_id` (the ID of the user ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unfollow_user(1, 2, True) == 'Done'\", \"assert unfollow_user(3, 4, False) == 'Not Authenticated'\", \"assert unfollow_user(5, 6, True) == 'Done'\", \"assert unfollow_user(7, 8, False) == 'Not Authenticated'\", \"assert unfollow_user(9, 10, True) == 'Done'\"...
{ "split": "train", "index": 78129, "acecode_id": "bigcode_python_fns_38703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents an error with a message. Write a function `check_error_message(errors: List[Dict[str, str]], expected_msg: str, index: int = 0) -> bool` that checks if the error message at the specified index matches the ex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_error_message([{'msg': 'Invalid input'}, {'msg': 'Connection failed'}, {'msg': 'Timeout error'}], 'Invalid input', 0) == True\", \"assert check_error_message([{'msg': 'Invalid input'}, {'msg': 'Connection failed'}, {'msg': 'Timeout error'}], 'Connectio...
{ "split": "train", "index": 78130, "acecode_id": "bigcode_python_fns_47674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, each containing three elements: a string representing a function name, another string representing an operation, and an integer representing a value. Your task is to write a function that processes this list and returns a dictionary containing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_operations([('func1', 'one', 4), ('func2', 'sqrt', 16), ('func1', 'square', 3)]) == {'func1': [4, 9], 'func2': [4.0]}\", \"assert process_operations([('a', 'one', 10), ('b', 'sqrt', 25), ('c', 'square', 6)]) == {'a': [10], 'b': [5.0], 'c': [36]}\", \...
{ "split": "train", "index": 78131, "acecode_id": "oss_6569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `random_integer` that generates and returns a random integer between 1 and 6 inclusive. The output should be unpredictable and every number within this range should have an equal probability of being generated.\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert 1 <= random_integer() <= 6\", \"assert 1 <= random_integer() <= 6\", \"assert 1 <= random_integer() <= 6\", \"assert 1 <= random_integer() <= 6\", \"assert 1 <= random_integer() <= 6\", \"assert 1 <= random_integer() <= 6\", \"assert 1 <= random_integer() <=...
{ "split": "train", "index": 78132, "acecode_id": "evol_8643", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a time in the format 'HH:MM' (24-hour time). Your task is to create a function that validates whether the provided time is in a valid format. The validation rules are as follows: 1. The string must be in the format 'HH:MM'. 2. 'HH' must be be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_time_format('00:00') == '00:00'\", \"assert validate_time_format('12:30') == '12:30'\", \"assert validate_time_format('23:59') == '23:59'\", \"assert validate_time_format('15:45') == '15:45'\", \"assert validate_time_format('24:00') == 'Invalid time...
{ "split": "train", "index": 78133, "acecode_id": "bigcode_python_fns_26899", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `valid_ISBN10(isbn: str) -> bool` that checks if a given string is a valid ISBN-10 number according to the standard ISBN-10 validation rules. An ISBN-10 is considered valid if it is either a 10-digit number or a 9-digit number followed by an 'X'. The checks...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert valid_ISBN10('0306406152') == True\", \"assert valid_ISBN10('123456789X') == True\", \"assert valid_ISBN10('0471958697') == True\", \"assert valid_ISBN10('1234567890') == False\", \"assert valid_ISBN10('abcdefghij') == False\", \"assert valid_ISBN10('X123456...
{ "split": "train", "index": 78134, "acecode_id": "evol_22532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two points in a 2D coordinate system represented as tuples. Each tuple contains two integers representing the x and y coordinates of the point. Write a function `get_distance(pt1, pt2)` that returns the Euclidean distance between the two points. The distance shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(get_distance((4, 4), (4, 8)) - 4.0) < 1e-9\", \"assert abs(get_distance((0, 0), (0, 0)) - 0.0) < 1e-9\", \"assert abs(get_distance((1, 2), (4, 6)) - 5.0) < 1e-9\", \"assert abs(get_distance((-1, -1), (1, 1)) - 2.8284271247461903) < 1e-9\", \"assert abs(g...
{ "split": "train", "index": 78135, "acecode_id": "bigcode_python_fns_45144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that simulates a redirection process. The function should take a string as input representing a URL path and return a string that indicates where the path redirects to. If the input path is '/home', it should redirect to '/docs'. For any other i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert redirect_url('/home') == '/docs'\", \"assert redirect_url('/about') == 'No redirection available'\", \"assert redirect_url('/contact') == 'No redirection available'\", \"assert redirect_url('/home/about') == 'No redirection available'\", \"assert redirect_ur...
{ "split": "train", "index": 78136, "acecode_id": "bigcode_python_fns_43582", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that transforms a list of articles and their corresponding highlights into a formatted output. The function should take a list of tuples, where each tuple contains an article (a string) and its highlights (also a string). Your function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_articles([]) == ''\", \"assert format_articles([('Article 1', 'Highlight 1')]) == 'Article 1\\\\tHighlight 1\\\\n'\", \"assert format_articles([('Article 1', 'Highlight 1'), ('Article 2', 'Highlight 2')]) == 'Article 1\\\\tHighlight 1\\\\nArticle 2\\\...
{ "split": "train", "index": 78137, "acecode_id": "bigcode_python_fns_3146", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the management of backup blocks for a storage volume. The storage volume can have multiple backups, and the function must handle the addition and deletion of backup blocks based on certain conditions. Specifically, the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_backup_blocks([('create', 'backup1'), ('create', 'backup2'), ('create', 'backup3'), ('delete', 'backup1')]) == 2\", \"assert manage_backup_blocks([('create', 'backup1'), ('create', 'backup2'), ('delete', 'backup2'), ('delete', 'backup1')]) == 0\", \"a...
{ "split": "train", "index": 78138, "acecode_id": "bigcode_python_fns_6617", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function that computes the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your task is to implement a function that takes an integer n and returns the nth Fibonacci number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(0) == 0\", \"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(6) == 8\", \"assert fib(7) == 13\", \"assert fib(8) == 21\", \"assert fib(9) == 34\", \"assert fib(10) == 55\"...
{ "split": "train", "index": 78139, "acecode_id": "bigcode_python_fns_1969", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the selection of rubber ducks from a list. The function should ensure that the same type of duck is not selected more than once. The function should return a list of the unique types of ducks selected in the order th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_ducks(['Blue Duck', 'Blue Duck', 'Blue Duck']) == ['Blue Duck']\", \"assert select_ducks(['Red Duck', 'Green Duck', 'Red Duck']) == ['Red Duck', 'Green Duck']\", \"assert select_ducks(['Duck']) == ['Duck']\", \"assert select_ducks(['Duck', 'Duck', 'Du...
{ "split": "train", "index": 78140, "acecode_id": "oss_2978", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a dictionary of devices, where each device has a set of traits associated with it. Your task is to write a function `get_thermostat_entities(devices: Dict[str, Set[str]]) -> List[str]` that returns a list of device names that have the 'ThermostatHvacTrait' trait. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_thermostat_entities({'device1': {'ThermostatHvacTrait', 'Light'}, 'device2': {'Sensor'}, 'device3': {'ThermostatHvacTrait'}}) == ['device1', 'device3']\", \"assert get_thermostat_entities({'deviceA': {'ThermostatHvacTrait'}, 'deviceB': {'ThermostatHvacTr...
{ "split": "train", "index": 78141, "acecode_id": "bigcode_python_fns_10272", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function that accepts a list of integers and an integer n. The function must return a new list following these rules: 1) Maintain the original order of the elements from the first list that are located at indices not divisible by the given integer n. 2) For the element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_sort([10, 20, 30, 40], 1) == [80, 60, 40, 20]\", \"assert advanced_sort([3], 1) == [6]\", \"assert advanced_sort([], 1) == []\", \"assert advanced_sort([1], 1) == [2]\", \"assert advanced_sort([1, 1, 1, 1, 1], 2) == [2, 1, 2, 1, 2]\"]}" }
{ "split": "train", "index": 78142, "acecode_id": "evol_21914", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a logging configuration function in Python that sets up a logger named 'pynsta' to output logs in JSON format to the console. The function should also handle the log level based on a boolean argument 'is_debug'. If 'is_debug' is True, the log level ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_logger(True) == None\", \"assert configure_logger(False) == None\", \"assert configure_logger(True) == None\", \"assert configure_logger(False) == None\", \"assert configure_logger(True) == None\", \"assert configure_logger(False) == None\", \"asse...
{ "split": "train", "index": 78143, "acecode_id": "oss_19850", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given string to extract and count the occurrences of specific license provisions. The provisions to be counted are 'Zope Public License' and 'DISCLAIMED'. Your task is to implement a Python function `count_license_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_license_provisions('# This software is subject to the provisions of the Zope Public License, Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED \\\"AS IS\\\" AND ANY AND ALL EXPRESS OR IMPLIED WARRANTI...
{ "split": "train", "index": 78144, "acecode_id": "oss_36027", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple animation system for a game character. The character has a set of images for different animations represented as a dictionary, where the keys are animation names and the values are lists of images. Your goal is to implement a function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_animation({'walk': ['image1', 'image2']}, 5, 0, True, 4, 'walk') == (1, 'image2')\", \"assert update_animation({'walk': ['image1', 'image2']}, 5, 1, True, 5, 'walk') == (0, 'image1')\", \"assert update_animation({'jump': ['jump1', 'jump2', 'jump3']}, ...
{ "split": "train", "index": 78145, "acecode_id": "oss_16988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom logging handler for a home automation application that specifically manages log messages from instances of a `Window` class. Implement a function `handle_window_log(level: int, message: str) -> str` that takes in a logging level and a log m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_window_log(20, 'Window opened') == 'Log to console: Window opened'\", \"assert handle_window_log(30, 'Window obstruction detected') == 'Send email notification: Window obstruction detected'\", \"assert handle_window_log(40, 'Window motor malfunction')...
{ "split": "train", "index": 78146, "acecode_id": "oss_17650", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of floating point numbers and returns a new list containing those numbers sorted in descending order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_descending([8.9, 1.3, 2.6, 7.1, 3.4, 5.0]) == [8.9, 7.1, 5.0, 3.4, 2.6, 1.3]\", \"assert sort_descending([-1.1, -2.2, -3.3]) == [-1.1, -2.2, -3.3]\", \"assert sort_descending([0.0, 1.1, -1.1]) == [1.1, 0.0, -1.1]\", \"assert sort_descending([3.5]) == [3...
{ "split": "train", "index": 78147, "acecode_id": "evol_23468", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the average of two grades for a student. The function will take three parameters: the student's name (a string), the student's ID (a string), and two grades (both integers). The function should return a dictionary cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_student_average('Alice', 'S001', 85, 90) == {'name': 'Alice', 'student_id': 'S001', 'average': 87.5}\", \"assert calculate_student_average('Bob', 'S002', 70, 80) == {'name': 'Bob', 'student_id': 'S002', 'average': 75.0}\", \"assert calculate_studen...
{ "split": "train", "index": 78148, "acecode_id": "oss_32532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary represents a data sample with various attributes, implement a function to count the occurrences of each unique attribute value in the list. Each dictionary will contain keys that represent different attributes, and the values c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_attr_counts([{'color': 'red'}, {'color': 'blue'}, {'color': ['red', 'green']}], 'color') == {'color-red': 2, 'color-blue': 1, 'color-green': 1}\", \"assert get_attr_counts([{'shape': 'circle'}, {'shape': 'square'}, {'shape': ['circle', 'triangle']}], 'sh...
{ "split": "train", "index": 78149, "acecode_id": "bigcode_python_fns_34003", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of sentences, where each sentence is represented as a list of words (strings), implement a function that converts each sentence into a formatted string by joining the words with spaces. The function should ignore any empty words and only return non-empty sentences....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_sentences([['Hello', 'world'], ['This', '', 'is', 'a', 'test'], ['Another', 'sentence']]) == ['Hello world', 'This is a test', 'Another sentence']\", \"assert format_sentences([['One', 'word'], ['Another', 'one', 'here']]) == ['One word', 'Another one...
{ "split": "train", "index": 78150, "acecode_id": "bigcode_python_fns_30512", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a one-dimensional array of integers, write a function `max_sum_with_fixed_k(arr, k)` that returns the maximum sum of any contiguous subarray of size 'k'. If the length of the array is less than 'k', return -1.\nPlease reason step by step, then write a self-contained Pytho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_sum_with_fixed_k([1, 4, 2, 10, 23, 3, 1, 0, 20], 4) == 39\", \"assert max_sum_with_fixed_k([1, 2, 3, 4, 5], 3) == 12\", \"assert max_sum_with_fixed_k([-1, -2, -3, -4], 2) == -3\", \"assert max_sum_with_fixed_k([5, 1, 3, 2, 8], 5) == 19\", \"assert max_su...
{ "split": "train", "index": 78151, "acecode_id": "evol_34717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 'backend_str', create a function that checks if the string corresponds to a known backend. The function should return 'True' if the backend is known and 'False' otherwise. The known backends are given as a list: ['mysql', 'postgresql', 'sqlite', 'mssql', 'oracle'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_known_backend('mysql') == True\", \"assert is_known_backend('postgresql') == True\", \"assert is_known_backend('sqlite') == True\", \"assert is_known_backend('mssql') == True\", \"assert is_known_backend('oracle') == True\", \"assert is_known_backend('mon...
{ "split": "train", "index": 78152, "acecode_id": "bigcode_python_fns_15191", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that transposes a given 2D numerical matrix. The function should take a matrix 'M' as input, where 'M' is a list of lists, and return a new matrix that is the transpose of 'M'. The transpose of a matrix is obtained by switching its rows with its columns.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transpose_matrix([[1,2,3],[4,5,6],[7,8,9]]) == [[1,4,7],[2,5,8],[3,6,9]]\", \"assert transpose_matrix([[1]]) == [[1]]\", \"assert transpose_matrix([[1,2],[3,4]]) == [[1,3],[2,4]]\", \"assert transpose_matrix([[1,2,3]]) == [[1],[2],[3]]\", \"assert transpose_...
{ "split": "train", "index": 78153, "acecode_id": "evol_34186", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns a new list containing the square of each integer. Write a function `square_numbers(nums: List[int]) -> List[int]` that takes a list of integers as input and returns a list of their squa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"assert square_numbers([-1, -2, -3]) == [1, 4, 9]\", \"assert square_numbers([0, 1, 2]) == [0, 1, 4]\", \"assert square_numbers([4, 5, 6]) == [16, 25, 36]\", \"assert square_numbers([-4, -5, -6]) == [16, 25, 36]\", ...
{ "split": "train", "index": 78154, "acecode_id": "oss_15738", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes in a list of any 10 integers and returns True if the list is sorted in ascending order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_sorted_ascending([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == True\", \"assert is_sorted_ascending([-10, -9, -8, -7, -6, -5, -4, -3, -2, -1]) == True\", \"assert is_sorted_ascending([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) == True\", \"assert is_sorted_ascending([1, 1, 1, ...
{ "split": "train", "index": 78155, "acecode_id": "evol_6933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file names and a target file extension. Write a function that takes in this list and returns a new list containing only the file names that have the specified extension. The file names are case-sensitive. If no files have the specified extension, return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_files(['document.txt', 'image.png', 'archive.zip', 'notes.TXT'], 'txt') == ['document.txt']\", \"assert filter_files(['file1.doc', 'file2.doc', 'file3.pdf'], 'pdf') == ['file3.pdf']\", \"assert filter_files(['data.csv', 'info.CSV', 'report.csv'], 'csv...
{ "split": "train", "index": 78156, "acecode_id": "bigcode_python_fns_3199", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a map of land and water. Each cell in the grid can either be land (denoted by 1) or water (denoted by 0). The grid is surrounded by water on all sides. You need to calculate the perimeter of the land in the grid. The perimeter of the land is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_perimeter([[0, 1, 0, 0], [1, 1, 1, 0], [0, 1, 0, 0], [1, 1, 0, 0]]) == 16\", \"assert calculate_perimeter([[1]]) == 4\", \"assert calculate_perimeter([[0]]) == 0\", \"assert calculate_perimeter([[1, 0], [0, 1]]) == 8\", \"assert calculate_perimeter...
{ "split": "train", "index": 78157, "acecode_id": "oss_22740", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given the root of a binary tree, implement a function `level_order_traversal(root)` that returns the values of the nodes in a level-by-level manner, where each level is represented as a list of values. The output should be a list of lists, with each inner list containing the va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert level_order_traversal(None) == []\", \"assert level_order_traversal(Node(1)) == [[1]]\", \"assert level_order_traversal(Node(1, Node(2), Node(3))) == [[1], [2, 3]]\", \"assert level_order_traversal(Node(1, Node(2, Node(4), Node(5)), Node(3))) == [[1], [2, 3]...
{ "split": "train", "index": 78158, "acecode_id": "evol_22908", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of URLs as input and returns a list of the corresponding file names for each URL. The file name should be derived from the URL by extracting the last segment of the URL path (the part after the last '/') and removing any...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_file_names(['http://example.com/images/photo1.png', 'https://example.com/files/document.pdf?version=1.0']) == ['photo1.png', 'document.pdf']\", \"assert extract_file_names(['https://example.com/path/to/image.jpg', 'https://example.com/path/to/file.tx...
{ "split": "train", "index": 78159, "acecode_id": "bigcode_python_fns_15239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the total population for a specific division based on given population data. Write a function called `calculate_total_population` that takes the following parameters: \n- `population_data` (list of dictionaries): A ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_population([{'DIVISION': 'A', 'NAME': 'Region1', 'POPULATION': 1000}, {'DIVISION': 'A', 'NAME': 'Region2', 'POPULATION': 1500}, {'DIVISION': 'B', 'NAME': 'Region3', 'POPULATION': 2000}], 'A') == 2500\", \"assert calculate_total_population([{'...
{ "split": "train", "index": 78160, "acecode_id": "oss_18148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a collection of classes to determine which classes require method overloading based on their definitions. Each class is represented as a dictionary containing various properties. Your function should take a dictionary called `main_classes`, where t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_if_needs_overloading({'ClassA': {'needs_overloading': True}, 'ClassB': {'needs_overloading': False}}) == ['ClassA']\", \"assert check_if_needs_overloading({'ClassC': {'needs_overloading': True}, 'ClassD': {'needs_overloading': True}}) == ['ClassC', 'Cl...
{ "split": "train", "index": 78161, "acecode_id": "oss_34048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of requests based on given keywords and their corresponding actions. The keywords and actions are provided in a dictionary format. Your function should handle incoming requests by executing the appropriate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_requests(['search', 'calculate', 'unknown'], {'search': 'perform_search', 'calculate': 'perform_calculation'}) == ['perform_search', 'perform_calculation', 'Action not found for keyword: unknown']\", \"assert handle_requests(['add', 'subtract'], {'add...
{ "split": "train", "index": 78162, "acecode_id": "oss_7782", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves the name of a company based on its index in a predefined list of company names. The function should take an integer index as input and return the corresponding company name. If the index is out of bounds (less than 1 or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_company_name(1) == 'Company A'\", \"assert get_company_name(2) == 'Company B'\", \"assert get_company_name(3) == 'Company C'\", \"assert get_company_name(4) == 'Company D'\", \"assert get_company_name(0) == 'Invalid index'\", \"assert get_company_name(6)...
{ "split": "train", "index": 78163, "acecode_id": "bigcode_python_fns_48068", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that registers type bindings for a dependency injection container. The function, named `bind_type`, is responsible for binding a type to its respective accessor and lifetime manager. The function takes three parameters: `type_to_resol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bind_type('MyType', 'MyAccessor', 'SingletonManager') == {'MyAccessor': 'MyType with SingletonManager'}\", \"assert bind_type('MyType', ['Accessor1', 'Accessor2'], 'TransientManager') == {'Accessor1': 'MyType with TransientManager', 'Accessor2': 'MyType with...
{ "split": "train", "index": 78164, "acecode_id": "oss_34288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a string consisting of the specified character repeated a given number of times. The function should take two parameters: the character to be repeated (a single character string) and the number of times to repeat it (an integer). The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_repeated_string('*', 5) == '*****'\", \"assert create_repeated_string('a', 3) == 'aaa'\", \"assert create_repeated_string('b', 0) == ''\", \"assert create_repeated_string('x', 10) == 'xxxxxxxxxx'\", \"assert create_repeated_string('#', 1) == '#'\", \"...
{ "split": "train", "index": 78165, "acecode_id": "evol_33345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing class labels that range from 0 to 8 (inclusive). Your task is to convert these class labels into a one-hot encoded format. The one-hot encoded format is a binary representation where each class label is represented by a vector of le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert one_hot_encode([0]) == [[1, 0, 0, 0, 0, 0, 0, 0, 0]]\", \"assert one_hot_encode([1]) == [[0, 1, 0, 0, 0, 0, 0, 0, 0]]\", \"assert one_hot_encode([2]) == [[0, 0, 1, 0, 0, 0, 0, 0, 0]]\", \"assert one_hot_encode([3]) == [[0, 0, 0, 1, 0, 0, 0, 0, 0]]\", \"asser...
{ "split": "train", "index": 78166, "acecode_id": "bigcode_python_fns_39831", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of runs, where each run is represented as a dictionary containing a key 'thermal' that has a 'data_frame' key holding a list of temperature readings. Your task is to determine the number of runs that contain temperature readings. Implement a function `count...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_valid_runs([]) == 0\", \"assert count_valid_runs([{'thermal': {'data_frame': []}}]) == 0\", \"assert count_valid_runs([{'thermal': {'data_frame': [1, 2, 3]}}]) == 1\", \"assert count_valid_runs([{'thermal': {'data_frame': []}}, {'thermal': {'data_frame...
{ "split": "train", "index": 78167, "acecode_id": "bigcode_python_fns_9834", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a list of timestamps (in seconds) and a maximum age threshold (in seconds). The function should determine how many timestamps in the list are considered 'too old', which is defined as being greater than the maximum age threshold...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_too_old_timestamps([10, 20, 30, 40], 25) == 2\", \"assert count_too_old_timestamps([1, 2, 3, 4, 5], 5) == 0\", \"assert count_too_old_timestamps([100, 200, 300], 250) == 1\", \"assert count_too_old_timestamps([], 10) == 0\", \"assert count_too_old_time...
{ "split": "train", "index": 78168, "acecode_id": "bigcode_python_fns_24613", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers and returns a dictionary where the keys are the integers from the list and the values are the squares of those integers. Implement a function named `square_numbers` that accepts a list of integers and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_numbers([1, 2, 3]) == {1: 1, 2: 4, 3: 9}\", \"assert square_numbers([0, -1, -2]) == {0: 0, -1: 1, -2: 4}\", \"assert square_numbers([-3, -2, -1]) == {-3: 9, -2: 4, -1: 1}\", \"assert square_numbers([5, 10, 15]) == {5: 25, 10: 100, 15: 225}\", \"assert...
{ "split": "train", "index": 78169, "acecode_id": "oss_31974", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a rotated sorted array of integers, implement a function `process_array(nums)` that processes the array to generate a dictionary for quick access of the last occurrence and frequency of elements. The function should return a tuple containing the lookup dictionary and the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_array([]) == ({}, 0)\", \"assert process_array([1]) == ({1: (0, 1)}, 1)\", \"assert process_array([1, 1, 1]) == ({1: (2, 3)}, 3)\", \"assert process_array([3, 4, 5, 1, 2]) == ({1: (3, 1), 2: (4, 1), 3: (0, 1), 4: (1, 1), 5: (2, 1)}, 5)\", \"assert pr...
{ "split": "train", "index": 78170, "acecode_id": "evol_3732", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves the configuration of a specified node from a dictionary. The configuration is stored in a dictionary where the keys represent node names and the values are dictionaries containing configuration parameters and their corr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_node_config({'node1': {'cpu': '4 cores', 'memory': '16GB'}, 'node2': {'cpu': '8 cores', 'memory': '32GB'}}, 'node1') == {'cpu': '4 cores', 'memory': '16GB'}\", \"assert get_node_config({'node1': {'cpu': '4 cores', 'memory': '16GB'}, 'node2': {'cpu': '8 c...
{ "split": "train", "index": 78171, "acecode_id": "oss_23057", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simplified version of a database migration system. The function will take a list of migration operations and apply them to a database schema. Each migration operation represents a change to the database schema, suc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_migrations([], {'image': ['id', 'url', 'caption']}) == {'image': ['id', 'url', 'caption']}\", \"assert apply_migrations([AlterField('image', 'url', 'text')], {'image': ['id', 'url', 'caption']}) == {'image': ['id', 'text', 'caption']}\", \"assert apply...
{ "split": "train", "index": 78172, "acecode_id": "oss_6557", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a worker string representing a miner's identifier, implement a function that parses the string to extract the coin address and worker ID. The worker string may contain a coin address and a worker ID separated by a dot ('.'). If the worker string does not contain a dot, it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_worker_string(None, 'abcd.efgh') == ('abcd', 'efgh')\", \"assert parse_worker_string(None, '1234') == ('1234', None)\", \"assert parse_worker_string(None, 'coin.address.worker') == ('coin', 'worker')\", \"assert parse_worker_string(None, 'coin.1234.wor...
{ "split": "train", "index": 78173, "acecode_id": "bigcode_python_fns_30614", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a unique license plate number for vehicles in China. The license plate number consists of a one-character abbreviation for the province followed by a five-digit number. The abbreviation for each province is represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_license_plate() != generate_license_plate()\", \"assert len(generate_license_plate()) == 6\", \"assert generate_license_plate()[0] in '\\u4eac\\u6d25\\u5180\\u664b\\u8499\\u8fbd\\u5409\\u9ed1\\u6caa\\u82cf\\u6d59\\u7696\\u95fd\\u8d63\\u9c81\\u8c6b\\...
{ "split": "train", "index": 78174, "acecode_id": "oss_10216", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that takes this list as input and returns a new list containing only the unique integers from the input list, in the order they first appeared. Write a function `get_unique_integers(arr: List[int]) -> List[i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert get_unique_integers([4, 5, 4, 6, 7]) == [4, 5, 6, 7]\", \"assert get_unique_integers([7, 7, 7, 8, 9, 8]) == [7, 8, 9]\", \"assert get_unique_integers([10, 10, 10]) == [10]\", \"assert get_unique_i...
{ "split": "train", "index": 78175, "acecode_id": "bigcode_python_fns_3535", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of words, you need to implement a function that takes this list as input and returns a new list where each word is transformed into a URL-encoded format. The URL encoding should replace spaces with '%20' and any special characters should be encoded according to sta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_words(['hello world', 'foo bar']) == ['hello%20world', 'foo%20bar']\", \"assert encode_words(['python', 'is awesome!']) == ['python', 'is%20awesome%21']\", \"assert encode_words(['test@123', 'hello&world']) == ['test%40123', 'hello%26world']\", \"asse...
{ "split": "train", "index": 78176, "acecode_id": "bigcode_python_fns_38984", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, your task is to implement a function that returns a new list containing only the unique elements from the original list while preserving the original order of their first occurrence. The function should take a list of integers as input and return a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([1, 1, 1, 1]) == [1]\", \"assert unique_elements([]) == []\", \"assert unique_elements([9, 8, 7, 9, 8, 6]) == [9, 8, 7, 6]\", \"assert unique_elements([2, 4, 6, 2, 4, 6, 8]...
{ "split": "train", "index": 78177, "acecode_id": "oss_620", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing keys, write a function `has_key(key: str, keys: List[str]) -> bool` that checks if the specified `key` exists in the provided list of `keys`. The function should return `True` if the `key` is found in the list, and `False` otherwise. The inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_key('apple', ['apple', 'banana', 'cherry']) == True\", \"assert has_key('banana', ['apple', 'banana', 'banana', 'cherry']) == True\", \"assert has_key('grape', ['apple', 'banana', 'cherry']) == False\", \"assert has_key('blueberry', []) == False\", \"ass...
{ "split": "train", "index": 78178, "acecode_id": "bigcode_python_fns_17491", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a command parser that accepts various arguments for running tasks. Your function should take a list of command-line arguments and return a dictionary that maps each argument to its corresponding value. The arguments to support include:\n\n1. `ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments(['timing_chain']) == {'task': ['timing_chain'], '-l': [], '-j': 1, '-verbosity': 0, '-timeout': 2592000, '-short_task_names': False}\", \"assert parse_arguments(['timing_chain', '-l', 'task_list.txt']) == {'task': ['timing_chain'], '-l': ['ta...
{ "split": "train", "index": 78179, "acecode_id": "bigcode_python_fns_39208", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a tree structure where each node represents a discipline. Each discipline has a certain number of training sets, and some disciplines can have child disciplines. Your task is to write a function `get_total_training_sets(disciplines)` that takes a list of disciplin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_total_training_sets([{'training_sets': 3, 'children': []}]) == 3\", \"assert get_total_training_sets([{'training_sets': 5, 'children': [{'training_sets': 2, 'children': []}]}]) == 7\", \"assert get_total_training_sets([{'training_sets': 0, 'children': []...
{ "split": "train", "index": 78180, "acecode_id": "bigcode_python_fns_25087", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `remove_even_numbers(arr)` that takes a list of integers `arr` and returns a new list containing only the odd integers from the original list. The input list may contain both positive and negative integers.\nPlease reason step by step, then write a self-con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_even_numbers([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert remove_even_numbers([0, -1, -2, -3, -4]) == [-1, -3]\", \"assert remove_even_numbers([-5, -4, -3, -2, -1]) == [-5, -3, -1]\", \"assert remove_even_numbers([10, 12, 14, 16, 18]) == []\", \"assert r...
{ "split": "train", "index": 78181, "acecode_id": "evol_33745", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings. Write a function `max_building_height(heights: List[int], mode: str) -> int` that returns the maximum height of buildings after processing the list based on the given mode. If the mode is 'train', you shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_building_height([3, 5, 7, 2, 8], 'train') == 8\", \"assert max_building_height([1, 2, 3, 4, 5], 'test') == 5\", \"assert max_building_height([10, 20, 30, 40], 'train') == 40\", \"assert max_building_height([15, 25, 35], 'test') == 35\", \"assert max_buil...
{ "split": "train", "index": 78182, "acecode_id": "bigcode_python_fns_32640", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer `n`. Your task is to calculate and return the total number of integers `x` such that `0 <= x < 10^n` and `x` contains all unique digits (no repeating digits allowed). Implement the function `numUniqueDigits(n: int) -> int` to solve this problem. The con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numUniqueDigits(0) == 1\", \"assert numUniqueDigits(1) == 10\", \"assert numUniqueDigits(2) == 91\", \"assert numUniqueDigits(3) == 739\", \"assert numUniqueDigits(4) == 5275\", \"assert numUniqueDigits(3) == 739\", \"assert numUniqueDigits(2) == 91\", \"ass...
{ "split": "train", "index": 78183, "acecode_id": "evol_21972", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `register_user(email: str, password: str) -> bool` that registers a new user with a given email and password. The function should return `True` if the registration is successful and `False` if the email is already taken. Assume that the email should be uniq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_user('test@example.com', 'password123') == True\", \"assert register_user('user@example.com', 'mypassword') == True\", \"assert register_user('hello@world.com', 'password') == True\", \"assert register_user('unique_email@domain.com', '123456') == Tr...
{ "split": "train", "index": 78184, "acecode_id": "evol_25515", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of events, where each event is represented by a dictionary containing a 'date' key (formatted as 'YYYY-MM-DD') and other relevant information. Your task is to implement a function `count_honeypot_events(events: List[Dict[str, Any]], date_range: Tuple[str, s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_honeypot_events([], ('2023-01-01', '2023-01-31')) == 0\", \"assert count_honeypot_events([{'date': '2023-01-15'}], ('2023-01-01', '2023-01-31')) == 1\", \"assert count_honeypot_events([{'date': '2023-01-15'}, {'date': '2023-01-20'}], ('2023-01-01', '20...
{ "split": "train", "index": 78185, "acecode_id": "bigcode_python_fns_36587", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a scene where each cell can either be empty (0) or filled with a color value (1-255). Your task is to implement a function that processes this grid by applying a background color to any filled cells that are not already white (255). If a fil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_background_color([[0, 1, 2], [255, 4, 5]], 10) == [[0, 10, 10], [255, 10, 10]]\", \"assert apply_background_color([[1, 255], [2, 3]], 5) == [[5, 255], [5, 5]]\", \"assert apply_background_color([[255]], 50) == [[255]]\", \"assert apply_background_color...
{ "split": "train", "index": 78186, "acecode_id": "bigcode_python_fns_17765", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the setting of cross correction positive lengths for a given element. The function should take an integer representing an element ID and a float representing a positive length value. Your function should return a string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_cross_correction_positive_length(1, 3.5) == 'Element 1 set to 3.5.'\", \"assert set_cross_correction_positive_length(2, 0.0) == 'Element 2 set to 0.0.'\", \"assert set_cross_correction_positive_length(3, -1.0) == 'Error: Length must be positive.'\", \"as...
{ "split": "train", "index": 78187, "acecode_id": "bigcode_python_fns_15418", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a registered response in a system. Your function should return a bytes object that represents the body of the registered response. The content of the response should be the string 'response data' converted into bytes. Imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert registered_response_data() == b'response data'\", \"assert isinstance(registered_response_data(), bytes)\", \"assert len(registered_response_data()) == 13\", \"assert registered_response_data()[0] == 114\", \"assert registered_response_data()[-1] == 97\", \"...
{ "split": "train", "index": 78188, "acecode_id": "bigcode_python_fns_9957", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the mean and standard deviation of a list of numerical scores. The mean and standard deviation provide insights into the data's central tendency and variability. Write a Python function `calculate_cv_stats(scores)` that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cv_stats([1.0, 2.0, 3.0, 4.0]) == (2.5, 1.118)\", \"assert calculate_cv_stats([-1.0, 0.0, 1.0]) == (0.0, 0.816)\", \"assert calculate_cv_stats([0.0]) == (0.0, 0.0)\", \"assert calculate_cv_stats([]) == (0.0, 0.0)\", \"assert calculate_cv_stats([1.0...
{ "split": "train", "index": 78189, "acecode_id": "oss_34652", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers representing metric types, determine if all integers in the range from a specified minimum value (inclusive) to the maximum value (inclusive) of the list are present in the list. Write a function `is_metric_range_complete(metric_types: List[int], min_va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_metric_range_complete([243, 244, 245], 243) == True\", \"assert is_metric_range_complete([243, 245, 246], 243) == False\", \"assert is_metric_range_complete([243, 245, 246, 250], 243) == False\", \"assert is_metric_range_complete([1, 2, 3, 4, 5], 1) == Tr...
{ "split": "train", "index": 78190, "acecode_id": "bigcode_python_fns_1945", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file names in a zip archive and a target string representing a file name to search for. Implement a function that finds the target file name in the list in a case-insensitive manner. The function should return the index of the target...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_file_index(['fileA.txt', 'fileB.txt', 'fileC.txt'], 'fileB.txt') == 1\", \"assert find_file_index(['fileA.txt', 'fileB.txt', 'fileC.txt'], 'FILEC.TXT') == 2\", \"assert find_file_index(['fileA.txt', 'fileB.txt', 'fileC.txt'], 'fileD.txt') == -1\", \"ass...
{ "split": "train", "index": 78191, "acecode_id": "bigcode_python_fns_30326", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of items, each represented by a dictionary containing the keys 'id', 'parent_item_id', and 'base_url'. Implement a function `get_redirect_path(items)` that takes in this list of items and returns a list of redirect paths based on the following rules: 1. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_redirect_path([{'id': 1, 'parent_item_id': -1, 'base_url': 'http://example.com'}]) == ['http://example.com/manage/']\", \"assert get_redirect_path([{'id': 1, 'parent_item_id': -1, 'base_url': 'http://example.com'}, {'id': 2, 'parent_item_id': -1, 'base_u...
{ "split": "train", "index": 78192, "acecode_id": "bigcode_python_fns_48145", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given an array of integers `nums` and an integer `val`, write a function that removes all instances of `val` in `nums` in-place. The function should return the new length of the array after the removal. Note that it should not use any additional space for another array. The ord...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_element([3, 2, 2, 3], 3) == 2\", \"assert remove_element([0, 1, 2, 2, 3, 0, 4, 2], 2) == 5\", \"assert remove_element([], 1) == 0\", \"assert remove_element([1, 1, 1, 1], 1) == 0\", \"assert remove_element([4, 5, 6, 7, 4], 4) == 3\", \"assert remove_e...
{ "split": "train", "index": 78193, "acecode_id": "bigcode_python_fns_47395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with identifying the type of a neural network layer based on its properties. Write a function `get_layer_type(layer)` that takes a dictionary `layer` with the following keys: 'type' (a string representing the type of the layer), and optionally other keys such as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_layer_type({'type': 'Convolution'}) == 'convolution'\", \"assert get_layer_type({'type': 'FullyConnected'}) == 'fully_connected_layer'\", \"assert get_layer_type({'type': 'SoftMax'}) == 'soft_max'\", \"assert get_layer_type({'type': 'Pooling', 'pooling_p...
{ "split": "train", "index": 78194, "acecode_id": "bigcode_python_fns_40072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if there are any incoming changesets in a version control system. The function should take a list of changesets and return a boolean indicating whether there are any new changesets found. A changeset is represented as a di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_incoming_changes([{'id': '1', 'status': 'advanced'}, {'id': '2', 'status': 'diverged'}]) == False\", \"assert has_incoming_changes([{'id': '3', 'status': 'added'}, {'id': '4', 'status': 'changed'}]) == True\", \"assert has_incoming_changes([{'id': '5', '...
{ "split": "train", "index": 78195, "acecode_id": "bigcode_python_fns_11080", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that extracts destination address information from a frame represented as bytes. The frame is in HDLC (High-Level Data Link Control) format, and the destination address is to be parsed based on the specified address type. Your functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert destination_from_bytes(b'\\\\x01\\\\x02\\\\x03', 'logical') == ('dest_logical', None, 3)\", \"assert destination_from_bytes(b'\\\\x01\\\\x02\\\\x03', 'physical') == (None, 'dest_physical', 3)\", \"assert destination_from_bytes(b'\\\\x01', 'logical') == ('des...
{ "split": "train", "index": 78196, "acecode_id": "oss_4448", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, tx_values and rx_values, representing the transmission and reception counts of data packets over a network switch. Your task is to write a function called `verify_traffic_increase(tx_values: List[int], rx_values: List[int]) -> Tuple[bool, bo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_traffic_increase([1, 2, 3], [1, 2, 3]) == (True, True, True, True)\", \"assert verify_traffic_increase([1, 2, 3], [3, 2, 1]) == (True, False, True, False)\", \"assert verify_traffic_increase([1, 1, 1], [1, 1, 1]) == (False, False, False, False)\", \"a...
{ "split": "train", "index": 78197, "acecode_id": "bigcode_python_fns_34151", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `target` and `to_append`. Your task is to create a function `append_lists(target: List[int], to_append: List[int]) -> List[int]` that appends the elements of `to_append` to `target`. The function should return the combined list. If the types...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_lists([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]\", \"assert append_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert append_lists([1], []) == [1]\", \"assert append_lists([1, 2], [3, 4]) == [1, 2, 3, 4]\", \"assert append_lists([0], [0]) == [0, 0]\", \"assert...
{ "split": "train", "index": 78198, "acecode_id": "bigcode_python_fns_30427", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a configuration object that may contain a property indicating the default graph format. Your task is to implement a function `validate_graph_format(config: dict) -> bool` that checks whether the `graphtik_default_graph_format` property of the given configuration i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_graph_format({'graphtik_default_graph_format': None}) == True\", \"assert validate_graph_format({'graphtik_default_graph_format': 'SVG'}) == True\", \"assert validate_graph_format({'graphtik_default_graph_format': 'PDF'}) == True\", \"assert validat...
{ "split": "train", "index": 78199, "acecode_id": "bigcode_python_fns_13987", "num_tests": 16 }