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": "You are given a list of integers representing the balances of three accounts (l1, l2, l3) after a series of transactions. Each transaction involves sending a fixed amount of coins between these accounts. Your task is to implement a function `final_balances(transactions: List[Tu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_balances([(0, 1, 200), (0, 2, 100)], [500, 300, 300]) == [200, 500, 400]\", \"assert final_balances([(0, 1, 100), (1, 2, 100), (2, 0, 100)], [200, 200, 200]) == [200, 200, 200]\", \"assert final_balances([(0, 1, 1000)], [500, 400, 300]) == [500, 400, 3...
{ "split": "train", "index": 3400, "acecode_id": "bigcode_python_fns_46052", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `complex_cipher(s: str) -> str` that takes a string `s` as input and applies a specific encryption process. The function should replace every letter in the string according to the following rules: 1) For each character, if it is a letter, apply a shift base...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_cipher('1234') == '1234'\", \"assert complex_cipher('') == ''\", \"assert complex_cipher('A') == 'E'\", \"assert complex_cipher('E') == 'I'\", \"assert complex_cipher('I') == 'O'\", \"assert complex_cipher('O') == 'U'\", \"assert complex_cipher('U') ...
{ "split": "train", "index": 3401, "acecode_id": "evol_16111", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing string keys and any type of values. You need to create a function that takes this dictionary as input and returns a new dictionary which contains only those key-value pairs where the key is not present in a predefined set of reserved keywor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_keywords({'key1': 1, 'reserved1': 2, 'key2': 3}) == {'key1': 1, 'key2': 3}\", \"assert filter_keywords({'key1': 'value1', 'reserved2': 'value2', 'key3': 'value3'}) == {'key1': 'value1', 'key3': 'value3'}\", \"assert filter_keywords({'reserved3': 10, '...
{ "split": "train", "index": 3402, "acecode_id": "bigcode_python_fns_4929", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates cropping a square region of interest (ROI) from an image represented as a 2D list of integers. The function should take the input image, the top-left coordinates of the square ROI, and the side length of the square. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cropSquareImage([[1,2,3],[4,5,6],[7,8,9]], (0, 0), 2) == [[1, 2], [4, 5]]\", \"assert cropSquareImage([[1,2,3],[4,5,6],[7,8,9]], (1, 1), 1) == [[5]]\", \"assert cropSquareImage([[1,2,3],[4,5,6],[7,8,9]], (2, 2), 1) == [[9]]\", \"assert cropSquareImage([[1,2,...
{ "split": "train", "index": 3403, "acecode_id": "oss_33752", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a float `x`, implement a function `phi(x)` that calculates the value of the cumulative distribution function for a standard normal distribution at `x`. The function should return the result rounded to 6 decimal places. You can use the error function to calculate the value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(phi(0.0) - 0.500000) < 1e-6\", \"assert abs(phi(1.0) - 0.841345) < 1e-6\", \"assert abs(phi(-1.0) - 0.158655) < 1e-6\", \"assert abs(phi(2.0) - 0.977250) < 1e-6\", \"assert abs(phi(-2.0) - 0.022750) < 1e-6\", \"assert abs(phi(0.5) - 0.691462) < 1e-6\", \...
{ "split": "train", "index": 3404, "acecode_id": "bigcode_python_fns_34323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple password management system for a server. The function should be able to change the password of a server, but it should also handle cases where the authentication token is invalid. Your task is to implement t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_password('server1', 'newpass123', 'valid_token') == 'Password changed successfully for server server1'\", \"assert change_password('server2', 'mypassword', 'valid_token') == 'Password changed successfully for server server2'\", \"assert change_passwor...
{ "split": "train", "index": 3405, "acecode_id": "oss_6411", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines whether a character can jump based on specific conditions related to their state. The function `can_jump(poG: bool, ljump: bool, lljump: bool, fz: float, airtime: float, dT: float) -> int` should return 1 if the charac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_jump(True, False, False, 0, 0, 0) == 1\", \"assert can_jump(False, True, False, 10, 0.2, 0) == 1\", \"assert can_jump(False, False, True, 10, 0.2, 0) == 0\", \"assert can_jump(False, True, False, 5, 0.2, 0) == 1\", \"assert can_jump(False, False, True, 5...
{ "split": "train", "index": 3406, "acecode_id": "bigcode_python_fns_25872", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that accepts an input string and an integer limit as arguments. The function should return a new string that excludes all consecutive repeating characters that occur after the specified limit in the input string. The characters before the limit should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert truncate_string('Python', 6) == 'Python'\", \"assert truncate_string('aaaaaa', 3) == 'aaa'\", \"assert truncate_string('', 5) == ''\", \"assert truncate_string('Hello', 10) == 'Hello'\", \"assert truncate_string('aaaaaa', 1) == 'a'\", \"assert truncate_strin...
{ "split": "train", "index": 3407, "acecode_id": "evol_33055", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with cleaning up a slug string by removing any specified separator characters that occur at the beginning or end of the slug. The slug may contain multiple occurrences of the default separator '-' or a custom separator provided by the user. If a custom separator ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert slug_cleaner('--hello-world--') == 'hello-world'\", \"assert slug_cleaner('hello--world') == 'hello--world'\", \"assert slug_cleaner('--hello--world--') == 'hello--world'\", \"assert slug_cleaner('-hello-world-') == 'hello-world'\", \"assert slug_cleaner('he...
{ "split": "train", "index": 3408, "acecode_id": "bigcode_python_fns_45936", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simplified logging system for tracking beverage iterations in a manufacturing plant. Implement a function `log_beverage_info` that takes an integer `global_it` representing the current global iteration count and a string `opt_info` containing opti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_beverage_info(0) == 1\", \"assert log_beverage_info(1) == 2\", \"assert log_beverage_info(5) == 6\", \"assert log_beverage_info(10) == 11\", \"assert log_beverage_info(100) == 101\", \"assert log_beverage_info(50, 'New recipe added') == 51\", \"assert lo...
{ "split": "train", "index": 3409, "acecode_id": "oss_9137", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a tower in a tower defense game. The function should accept no input parameters and return a dictionary representing the attributes of a tower called 'monkey_village'. The dictionary should include the follo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_monkey_village_tower() == {'name': 'monkey_village', 'range': 215, 'width': 119, 'height': 103, 'size': 'xl', 'keybind': 'M', 'aquatic': False}\", \"assert create_monkey_village_tower()['name'] == 'monkey_village'\", \"assert create_monkey_village_tow...
{ "split": "train", "index": 3410, "acecode_id": "oss_4079", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two integers, a and b, and returns the result of subtracting b from a. The function should handle both positive and negative integers correctly.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtract_two_numbers(10, 5) == 5\", \"assert subtract_two_numbers(5, 10) == -5\", \"assert subtract_two_numbers(0, 0) == 0\", \"assert subtract_two_numbers(-5, -3) == -2\", \"assert subtract_two_numbers(-3, -5) == 2\", \"assert subtract_two_numbers(100, 50) ...
{ "split": "train", "index": 3411, "acecode_id": "evol_27034", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 's' and a list of strings 'lst', write a function that finds the first string in 'lst' that matches the start of 's'. The function should return the matching string if found, or None if no match exists. The order of words in 'lst' must be respected. Implement the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_string_match('chicken breast 250g boneless', ['chicken breast', 'chicken tender', 'chicken thigh', 'beef']) == 'chicken breast'\", \"assert find_string_match('beef steak 300g', ['chicken breast', 'chicken tender', 'chicken thigh', 'beef']) == 'beef'\", ...
{ "split": "train", "index": 3412, "acecode_id": "evol_19762", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of mixed data types (strings, floats, and integers) and instantiates the correct class for each entry, storing the actual value as an attribute for that instance. Each class should represent a specific data type and have a method to return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isinstance(instantiate_data_type(['Test'])[0], String)\", \"assert isinstance(instantiate_data_type([1.1])[0], Float)\", \"assert isinstance(instantiate_data_type([100])[0], Integer)\", \"assert instantiate_data_type([]) == []\", \"assert isinstance(instanti...
{ "split": "train", "index": 3413, "acecode_id": "evol_32890", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with monitoring the utilization of a service based on configurable thresholds. Write a function `check_utilization_status(service: str, high_threshold: float, low_threshold: float, current_utilization: float) -> str` that checks the current utilization against th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_utilization_status('ServiceA', 80.0, 20.0, 85.0) == 'High'\", \"assert check_utilization_status('ServiceB', 70.0, 30.0, 25.0) == 'Low'\", \"assert check_utilization_status('ServiceC', 50.0, 10.0, 50.0) == 'Normal'\", \"assert check_utilization_status('...
{ "split": "train", "index": 3414, "acecode_id": "bigcode_python_fns_43742", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that combines data from two lists: one containing project information and the other containing risk information. Each project in the project list is represented by a dictionary with the keys 'name', 'space', and 'description'. Each risk i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_project_risks([{'name': 'Project A', 'space': 'Space 1', 'description': 'Description A'}], [{'name': 'Risk 1', 'description': 'Risk A', 'likelihood': 'Low', 'project_name': 'Project A'}]) == [{'name': 'Project A', 'space': 'Space 1', 'description': '...
{ "split": "train", "index": 3415, "acecode_id": "oss_31728", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `highlight_semicolon_sequences(text: str) -> List[str]` that takes a string `text` as input and returns a list of all sequences of characters that include the semi-colon ';' symbol anywhere within them. Each sequence should be separated by at least one characte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highlight_semicolon_sequences('No semi colons here.') == []\", \"assert highlight_semicolon_sequences('Text with no semicolon') == []\", \"assert highlight_semicolon_sequences('Hello;World;') == ['Hello;World;']\", \"assert highlight_semicolon_sequences('A;B...
{ "split": "train", "index": 3416, "acecode_id": "evol_4643", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of tuples containing full names and unique identifiers, implement a function that constructs a Python dictionary utilizing the unique identifiers as keys and corresponding full names as values. If duplicate unique identifiers are found within the list, the function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_dict([('John', '1'), ('Alice', '2'), ('Bob', '3')]) == {'1': 'John', '2': 'Alice', '3': 'Bob'}\", \"assert construct_dict([('A', '1'), ('B', '2'), ('C', '3'), ('D', '4')]) == {'1': 'A', '2': 'B', '3': 'C', '4': 'D'}\", \"assert construct_dict([('Jo...
{ "split": "train", "index": 3417, "acecode_id": "evol_27986", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a non-negative integer as input and returns True if the number is a perfect square, and False otherwise. A perfect square is an integer that is the square of an integer. For example, 4 is a perfect square because it is 2 * 2, while 5 is not a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_square(0) == True\", \"assert is_perfect_square(1) == True\", \"assert is_perfect_square(2) == False\", \"assert is_perfect_square(3) == False\", \"assert is_perfect_square(4) == True\", \"assert is_perfect_square(5) == False\", \"assert is_perfec...
{ "split": "train", "index": 3418, "acecode_id": "evol_10894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that counts the number of available resources in a list. The function should take a list of strings representing different resources and count how many of them are labeled as 'available'. Write a function `count_available_resources...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_available_resources(['available', 'available', 'available']) == 3\", \"assert count_available_resources(['unavailable', 'unavailable', 'unavailable']) == 0\", \"assert count_available_resources(['available', 'unavailable', 'available', 'unavailable']) ...
{ "split": "train", "index": 3419, "acecode_id": "oss_24817", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with formatting a point in a 2D plane based on specific parameters. Each point is represented by a set of parameters, and you need to format these points according to the following template: `1 4 0 1 0 0 50 -1 20 0.000 1 0.0000 {cx} {cy} {point_radius} {point_rad...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_point(10, 20, 5, 0, 0, 50, -1, 0) == ('1 4 0 1 0 0 50 -1 20 0.000 1 0.0000 10 20 5 5 0 0 50 -1', 1)\", \"assert format_point(5, 15, 2, -1, -1, 10, 10, 1) == ('1 4 0 1 0 0 50 -1 20 0.000 1 0.0000 5 15 2 2 -1 -1 10 10', 2)\", \"assert format_point(0, 0,...
{ "split": "train", "index": 3420, "acecode_id": "oss_15976", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string consisting of ASCII characters, write a function that converts each character in the string to its binary representation, where each binary number is represented using 8 bits. The binary representations should be joined into a single string with each byte separat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ascii_to_binary('A') == '01000001'\", \"assert ascii_to_binary('AB') == '01000001 01000010'\", \"assert ascii_to_binary('Hello') == '01001000 01100101 01101100 01101100 01101111'\", \"assert ascii_to_binary(' ') == '00100000'\", \"assert ascii_to_binary('!')...
{ "split": "train", "index": 3421, "acecode_id": "evol_8341", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_point(x: int, y: int) -> str` that takes two integers, `x` and `y`, representing the coordinates of a 2D point. The function should return a string representation of the point in the format '(x, y)'.\nPlease reason step by step, then write a self-co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_point(0, 0) == '(0, 0)'\", \"assert create_point(1, 2) == '(1, 2)'\", \"assert create_point(-1, -2) == '(-1, -2)'\", \"assert create_point(10, 20) == '(10, 20)'\", \"assert create_point(-10, 5) == '(-10, 5)'\", \"assert create_point(100, 200) == '(100...
{ "split": "train", "index": 3422, "acecode_id": "evol_31370", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a provided email address exists in a given list of registered email addresses. If the email address does not exist in the list, the function should return None. If the email exists, the function should return the email ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_email('test@example.com', ['user@example.com', 'admin@example.com']) is None\", \"assert check_email('TEST@EXAMPLE.COM', ['user@example.com', 'test@example.com']) == {'email': 'TEST@EXAMPLE.COM'}\", \"assert check_email('hello@world.com', ['hello@world...
{ "split": "train", "index": 3423, "acecode_id": "bigcode_python_fns_14188", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing water supply for a hamlet consisting of `n` dwellings. For each dwelling `i`, you can either construct a well at a cost given by the array `wells` or connect it via pipelines to other dwellings at costs specified in the `pipes` array. Each element i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minCostToSupplyWater(3, [1, 2, 2], [[1, 2, 1], [2, 3, 1]]) == 3\", \"assert minCostToSupplyWater(1, [3], []) == 3\", \"assert minCostToSupplyWater(3, [1, 2, 3], [[1, 2, 1], [2, 3, 1], [1, 3, 5]]) == 3\", \"assert minCostToSupplyWater(4, [3, 4, 5, 1], [[1, 2,...
{ "split": "train", "index": 3424, "acecode_id": "evol_18215", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with validating a list of files against an expected list of filenames. Write a Python function `validate_files` that takes two parameters: \n- `actual_files` (list of strings): A list of filenames that are currently present. \n- `expected_files` (list of strings)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_files(['file1.txt', 'file2.txt'], ['file1.txt', 'file2.txt']) == True\", \"assert validate_files(['file1.txt', 'file2.txt', 'file3.txt'], ['file1.txt', 'file3.txt']) == True\", \"assert validate_files(['file1.txt', 'file2.txt'], ['file3.txt']) == Fa...
{ "split": "train", "index": 3425, "acecode_id": "oss_4840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string of characters and converts each character into its corresponding hexadecimal representation, concatenating them into a single string. The output should exclude the '0x' prefix typically associated with hexadecimal numbers.\nPlease reason...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_text_to_hex('hello') == '68656c6c6f'\", \"assert convert_text_to_hex('!@#') == '214023'\", \"assert convert_text_to_hex('Python') == '507974686f6e'\", \"assert convert_text_to_hex('') == ''\", \"assert convert_text_to_hex('A') == '41'\", \"assert con...
{ "split": "train", "index": 3426, "acecode_id": "evol_9098", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of points in 3D space represented as a list of tuples (x, y, z), rotate these points around the Z-axis by a given angle in radians. The rotation should be performed around the origin (0, 0, 0). Write a function `rotate_points(points: List[Tuple[float, float, float]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_points([(1, 0, 0), (0, 1, 0)], 0) == [(1.0, 0.0, 0.0), (0.0, 1.0, 0.0)]\", \"assert rotate_points([(1, 1, 0)], 0) == [(1.0, 1.0, 0.0)]\", \"assert rotate_points([(0, 0, 0)], 3.141592653589793) == [(0.0, 0.0, 0.0)]\", \"assert rotate_points([(1, 0, 0),...
{ "split": "train", "index": 3427, "acecode_id": "bigcode_python_fns_43947", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of integers, rearrange the elements such that each prime number is followed by the next non-prime number. If there are more non-prime numbers than prime numbers, append the remaining non-prime numbers at the end of the list. Implement the function `rearrange_number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_numbers([4, 6, 8, 10]) == [4, 6, 8, 10]\", \"assert rearrange_numbers([1, 4, 6, 8, 9, 15]) == [1, 4, 6, 8, 9, 15]\", \"assert rearrange_numbers([5, 7, 4, 6, 10]) == [5, 4, 7, 6, 10]\", \"assert rearrange_numbers([17, 18, 19, 20, 22]) == [17, 18, 19...
{ "split": "train", "index": 3428, "acecode_id": "evol_27657", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that randomly shuffles a list of file names using a fixed random seed. Write a function `shuffle_files(files: List[str]) -> List[str]` that takes a list of file names as input and shuffles them using a random seed of 515. The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_files([\\\"alpha.txt\\\", \\\"beta.txt\\\", \\\"gamma.txt\\\"]) == [\\\"gamma.txt\\\", \\\"beta.txt\\\", \\\"alpha.txt\\\"]\", \"assert shuffle_files([\\\"one.txt\\\", \\\"two.txt\\\"]) == [\\\"two.txt\\\", \\\"one.txt\\\"]\", \"assert shuffle_files(...
{ "split": "train", "index": 3429, "acecode_id": "oss_28242", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings as input and returns a new list containing only the strings that match a specific pattern. The pattern to be matched is defined as follows: \n- The string must start with 'Nistschema'. \n- The next characters ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match_pattern(['NistschemaSvIvListZPattern4', 'NistschemaSvIvList0Pattern5']) == ['NistschemaSvIvListZPattern4', 'NistschemaSvIvList0Pattern5']\", \"assert match_pattern(['NistschemaSvIvListAPattern6', 'NistschemaSvIvListBPattern7']) == ['NistschemaSvIvListA...
{ "split": "train", "index": 3430, "acecode_id": "oss_28239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string text that may contain email addresses in the format 'username@domain', write a function that replaces all occurrences of email addresses in the string with the placeholder 'REDACTED'. The function should return the modified string. For example, if the input strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_emails('Please reach out to john.doe@example.com for assistance.') == 'Please reach out to REDACTED for assistance.'\", \"assert replace_emails('No email here!') == 'No email here!'\", \"assert replace_emails('Contact: jane.doe@company.org') == 'Cont...
{ "split": "train", "index": 3431, "acecode_id": "bigcode_python_fns_45451", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers as input and returns a new list containing only the unique integers from the input list, sorted in ascending order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted([3, 1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_sorted([5, 5, 5, 5]) == [5]\", \"assert unique_sorted([]) == []\", \"assert unique_sorted([3, -1, 2, -1, 0]) == [-1, 0, 2, 3]\", \"assert unique_sorted([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\",...
{ "split": "train", "index": 3432, "acecode_id": "evol_35897", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `multiply_positive_numbers(data: str) -> int` that takes a string of space-separated integers as input. The function should return the product of all positive integers in the string. If the input contains any non-numeric characters, negative numbers, or is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_positive_numbers('1 2 3') == 6\", \"assert multiply_positive_numbers('4 5 6') == 120\", \"assert multiply_positive_numbers('0 1 2') == 0\", \"assert multiply_positive_numbers('') == 0\", \"assert multiply_positive_numbers('-10 -1 -2') == 0\", \"asse...
{ "split": "train", "index": 3433, "acecode_id": "evol_32887", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given two integers `c` and `n` where `0 <= c < n`. Write a function `calculate_polynomial(c: int, n: int, x: int) -> int` that returns the value of the polynomial function defined as `f(x) = (x^2 + c) % n`. The input `x` is a non-negative integer. Make sure the output i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_polynomial(5, 10, 2) == 9\", \"assert calculate_polynomial(3, 7, 1) == 4\", \"assert calculate_polynomial(0, 5, 0) == 0\", \"assert calculate_polynomial(1, 6, 3) == 4\", \"assert calculate_polynomial(4, 8, 2) == 0\", \"assert calculate_polynomial(0...
{ "split": "train", "index": 3434, "acecode_id": "bigcode_python_fns_44516", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given two boolean values `DS` and `v_n`, and a list of integers `theta_list`, implement a function `set_circuit_order(DS: bool, v_n: bool, theta_list: List[int]) -> List[int]` that returns a list of integers based on the following rules: If `DS` is True, return `theta_list` in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_circuit_order(True, True, [1, 2, 3]) == [1, 2, 3, 1]\", \"assert set_circuit_order(True, False, [4, 5, 6]) == [4, 5, 6, 0]\", \"assert set_circuit_order(False, True, [7, 8, 9]) == [9, 8, 7, 1]\", \"assert set_circuit_order(False, False, [0, 1, 2]) == [2,...
{ "split": "train", "index": 3435, "acecode_id": "bigcode_python_fns_49317", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `evaluateInfixExpression` that takes an infix mathematical expression as a string and evaluates it. The expression will contain positive integers, the operators addition '+', subtraction '-', multiplication '*', division '/', and parentheses '(', ')'. You need ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluateInfixExpression('10 + 2 * 6') == 22.0\", \"assert evaluateInfixExpression('100 * 2 + 12') == 212.0\", \"assert evaluateInfixExpression('100 * (2 + 12)') == 1400.0\", \"assert evaluateInfixExpression('100 * (2 + 12) / 14') == 100.0\", \"assert evaluat...
{ "split": "train", "index": 3436, "acecode_id": "evol_35601", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `detect_ripples(data: List[int]) -> List[Tuple[float, float]]` that detects sharp wave ripples (SWRs) based on the following criteria: 1. Filter the list to only include values between a lower bound (150) and an upper bound (250). 2. C...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_ripples([150, 151, 152, 153, 154, 155]) == []\", \"assert detect_ripples([160, 160, 160, 160, 160]) == []\", \"assert detect_ripples([150, 160, 170, 180, 190, 180, 170, 160]) == []\", \"assert detect_ripples([155, 156, 157, 158, 159, 160, 161]) == []\...
{ "split": "train", "index": 3437, "acecode_id": "bigcode_python_fns_4855", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the setup of a database connection for a recorder system. The function, `setup_recorder`, should take in the following parameters: `keep_days` (an integer representing how many days to keep the data), `purge_interval` (an i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_recorder(7, 2, 1, 'sqlite://', 6, 3) == 'Recorder setup successful with keep_days=7, purge_interval=2, commit_interval=1, uri=sqlite://, db_max_retries=6, db_retry_wait=3'\", \"assert setup_recorder(5, 1, 1, 'postgresql://', 4, 2) == 'Recorder setup su...
{ "split": "train", "index": 3438, "acecode_id": "bigcode_python_fns_32449", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the current configuration from a global variable. The configuration is represented as a dictionary containing various settings. Your function should return a deep copy of this configuration to ensure that any modifications ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_config() == {'setting1': 'value1', 'setting2': 42, 'setting3': [1, 2, 3]}\", \"assert get_config() is not config\", \"assert get_config()['setting1'] == 'value1'\", \"assert get_config()['setting2'] == 42\", \"assert get_config()['setting3'] == [1, 2, 3]...
{ "split": "train", "index": 3439, "acecode_id": "bigcode_python_fns_25716", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks if a given version number is a valid semantic version (major.minor.patch) and extracts the major, minor, and patch numbers. If the version number is valid, return a tuple containing the major, minor, and patch numbers. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_version('1.0.0') == (1, 0, 0)\", \"assert check_version('2.5.3') == (2, 5, 3)\", \"assert check_version('0.1.2') == (0, 1, 2)\", \"assert check_version('3.0.10') == (3, 0, 10)\", \"assert check_version('10.5.0') == (10, 5, 0)\", \"assert check_version(...
{ "split": "train", "index": 3440, "acecode_id": "oss_14362", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a job description. Your task is to implement a function `process_jobs(jobs: List[str]) -> List[str]` that processes each job description and returns a list of formatted job strings. Each job string should be prefixed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_jobs(['Engineer', 'Designer']) == ['0: Engineer', '1: Designer']\", \"assert process_jobs(['Manager', 'Developer', 'Analyst']) == ['0: Manager', '1: Developer', '2: Analyst']\", \"assert process_jobs(['']) == ['0: ']\", \"assert process_jobs(['Single...
{ "split": "train", "index": 3441, "acecode_id": "bigcode_python_fns_29184", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 3D list (a list of lists of lists) representing an image where each element is a tuple of three integers representing the RGB color values of a pixel. Write a function `calculate_average_color_intensity(image)` that takes this 3D list as input and returns a tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_color_intensity([[[255, 0, 0], [0, 255, 0]], [[0, 0, 255], [255, 255, 255]]]) == (128, 128, 128)\", \"assert calculate_average_color_intensity([[[0, 0, 0], [255, 255, 255]]]) == (128, 128, 128)\", \"assert calculate_average_color_intensity(...
{ "split": "train", "index": 3442, "acecode_id": "oss_17205", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages mappings from a source class to a target class for serialization in Python. Your function, `class_mapping`, should take a list of mappings and a source class, and return the corresponding target class. If the source class doe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert class_mapping([('source_module', 'SourceClass', 'target_module', 'TargetClass')], 'source_module', 'SourceClass') == ('target_module', 'TargetClass')\", \"assert class_mapping([('source_module', 'SourceClass', 'target_module', 'TargetClass')], 'source_module...
{ "split": "train", "index": 3443, "acecode_id": "oss_32281", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two equal-size strings `s` and `t`, and a third string `p`, which contains characters that can be used to replace characters in `t`. The replacement can only be performed on characters of `t` that are at even indices. You need to return the minimum number of steps to make...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minSteps('anagram', 'mangaar', 'anagram') == 0\", \"assert minSteps('xxyyzz', 'xxyyzz', 'xxyyzz') == 0\", \"assert minSteps('abcdef', 'fedcba', 'a') == 0\", \"assert minSteps('xyz', 'zyx', 'x') == 0\", \"assert minSteps('aaa', 'bbb', 'ab') == -1\", \"assert ...
{ "split": "train", "index": 3444, "acecode_id": "evol_28923", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a string containing HTML code that represents job listings. Each listing contains information about a job, including the job name, company name, and salary range. Your task is to write a function `extract_job_info(html: str) -> List[Dict[str, Union[str, int]]]` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_job_info('<td class=\\\"zwmc\\\"><a href=\\\"link1\\\" target=\\\"_blank\\\"><b>Software Engineer</b></a></td><td class=\\\"gsmc\\\"><a href=\\\"company1\\\" target=\\\"_blank\\\">Company A</a></td><td class=\\\"zwyx\\\">8000-12000</td>') == [{'job':...
{ "split": "train", "index": 3445, "acecode_id": "bigcode_python_fns_44438", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing subscription policies for a cloud-based messaging service. Write a function `set_subscription_policy(project: str, subscription_id: str) -> dict` that takes in a project ID and a subscription ID, and returns a dictionary representing the IAM policy ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_subscription_policy('my-project', 'my-subscription') == {'bindings': [{'role': 'roles/pubsub.viewer', 'members': ['allUsers']}, {'role': 'roles/editor', 'members': ['group:cloud-logs@google.com']}]}\", \"assert set_subscription_policy('test-project', 'te...
{ "split": "train", "index": 3446, "acecode_id": "bigcode_python_fns_9877", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the exit codes of a command line interface (CLI) execution. Your task is to implement a function that checks if all exit codes are zero (0), indicating that the commands were successful. Return True if all exit codes are zero, and F...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_exit_codes([0, 0, 0]) == True\", \"assert check_exit_codes([0, 1, 0]) == False\", \"assert check_exit_codes([-1, 0, 0]) == False\", \"assert check_exit_codes([0]) == True\", \"assert check_exit_codes([1]) == False\", \"assert check_exit_codes([0, 0, 0,...
{ "split": "train", "index": 3447, "acecode_id": "bigcode_python_fns_49761", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom error handler for a web application that displays a 500 error page. Write a function `custom_error_page(error_message: str) -> str` that takes an error message as input and returns a formatted string that includes the error message along wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_error_page('Internal Server Error') == 'Oops! Something went wrong. Error: Internal Server Error'\", \"assert custom_error_page('Database connection failed') == 'Oops! Something went wrong. Error: Database connection failed'\", \"assert custom_error_p...
{ "split": "train", "index": 3448, "acecode_id": "evol_16858", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `count_word_frequencies(text: str) -> Dict[str, int]` that takes a string `text` as input and returns a dictionary where the keys are unique words (case insensitive) from the input text, and the values are the frequency of those words in the text. Consider only...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_frequencies('Hello, world! Hello.') == {'hello': 2, 'world': 1}\", \"assert count_word_frequencies('Python is great, and python is easy!') == {'python': 2, 'is': 2, 'great': 1, 'and': 1, 'easy': 1}\", \"assert count_word_frequencies('Count the fre...
{ "split": "train", "index": 3449, "acecode_id": "evol_35095", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of host names and a dictionary that maps each host name to its corresponding CPU frequency. Your task is to write a function that takes in the list of host names and the frequency dictionary, and returns a dictionary mapping each host name to its CPU freque...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_hosts_cpu_frequency(['host1', 'host2', 'host3'], {'host1': 2.5, 'host2': 3.0}) == {'host1': 2.5, 'host2': 3.0}\", \"assert get_hosts_cpu_frequency(['host4', 'host5'], {'host1': 2.5, 'host2': 3.0}) == {}\", \"assert get_hosts_cpu_frequency(['host1', 'host...
{ "split": "train", "index": 3450, "acecode_id": "bigcode_python_fns_38285", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a graph represented as an adjacency list, where each node is represented by a unique integer and the edges are represented as pairs of integers denoting the connected nodes. Your task is to implement a function `is_connected(graph: Dict[int, List[int]]) -> bool` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_connected({0: [1, 2], 1: [0, 3], 2: [0], 3: [1]}) == True\", \"assert is_connected({0: [1], 1: [0, 2], 2: [1], 3: []}) == False\", \"assert is_connected({0: [1], 1: [0, 2], 2: [1, 3], 3: [2]}) == True\", \"assert is_connected({0: [], 1: []}) == False\", \...
{ "split": "train", "index": 3451, "acecode_id": "oss_10702", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manipulates a dictionary of runtime properties in a cloud orchestration tool. The function should remove specific properties from the dictionary based on certain conditions. Implement the function `unset_runtime_properties(runtim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert (d := {'pid': 1, 'mongo_primery_host_1': 2, 'mongo_primery_host_2': 3, 'other_key': 4}) or unset_runtime_properties(d) or d == {'other_key': 4}\", \"assert (d := {'pid': 1}) or unset_runtime_properties(d) or d == {}\", \"assert (d := {'mongo_primery_host_1':...
{ "split": "train", "index": 3452, "acecode_id": "oss_22968", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a binary input (string form) to its hexadecimal equivalent (string form), without using built-in or imported functions. The function should handle leading zeroes and accommodate hexadecimal numbers up to 'F'. Additionally, the function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_to_hexadecimal('0001') == '1'\", \"assert binary_to_hexadecimal('0010') == '2'\", \"assert binary_to_hexadecimal('0011') == '3'\", \"assert binary_to_hexadecimal('0100') == '4'\", \"assert binary_to_hexadecimal('0101') == '5'\", \"assert binary_to_hex...
{ "split": "train", "index": 3453, "acecode_id": "evol_22715", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the potential of a given condition based on its parent values. The potential is computed as a function of the parent values and a specified log probability. The function will take a list of parent values (each a float) and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_potential([1.0, 2.0, 3.0], 0.5) == 3.0\", \"assert calculate_potential([0.0, 0.0, 0.0], 1.0) == 0.0\", \"assert calculate_potential([-1.0, -2.0, -3.0], 0.5) == -3.0\", \"assert calculate_potential([2.5, 3.5], 2.0) == 12.0\", \"assert calculate_pote...
{ "split": "train", "index": 3454, "acecode_id": "bigcode_python_fns_47621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the IDs of start entries. Write a function `delete_start_entry(entry_ids: List[int], id_to_delete: int) -> List[int]` that removes the entry with the specified ID from the list. If the ID to delete is not found in the list, raise a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_start_entry([1, 2, 3, 4, 5], 3) == [1, 2, 4, 5]\", \"assert delete_start_entry([1, 2, 3], 1) == [2, 3]\", \"assert delete_start_entry([10, 20, 30], 20) == [10, 30]\", \"assert delete_start_entry([1, 2, 3, 2, 1], 2) == [1, 3, 1]\", \"assert delete_star...
{ "split": "train", "index": 3455, "acecode_id": "bigcode_python_fns_28688", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a sentence. Your task is to implement a function `extract_keywords(sentences: List[str]) -> List[str]` that extracts the first keyword (defined as the first word that starts with a capital letter) from each sentence. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_keywords(['Hello world', 'this is a test', 'Python is great']) == ['Hello', 'None', 'Python']\", \"assert extract_keywords(['no capitals here', 'Another test case']) == ['None', 'Another']\", \"assert extract_keywords(['singleword', 'YetAnother']) ==...
{ "split": "train", "index": 3456, "acecode_id": "oss_28439", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a label table from a Gifti object, where the keys are label identifiers (integers) and the values are the corresponding label names (strings). Write a function `get_labels(label_table: Dict[int, str]) -> List[str]` that returns a list of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_labels({1: 'Label A', 3: 'Label C', 2: 'Label B'}) == ['Label A', 'Label B', 'Label C']\", \"assert get_labels({0: 'First', 1: 'Second', 2: 'Third'}) == ['First', 'Second', 'Third']\", \"assert get_labels({2: 'Two', 1: 'One'}) == ['One', 'Two']\", \"asse...
{ "split": "train", "index": 3457, "acecode_id": "bigcode_python_fns_26186", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the weights of layers in a neural network model. Write a function `check_weights_update(weights: List[int], iteration: int) -> bool` that checks if the weights of the first layer have been updated after the first iteration. If the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_weights_update([0, 1, 2], 1) == True\", \"assert check_weights_update([2, 1, 0], 2) == True\", \"assert check_weights_update([2, 3, 4], 1) == True\", \"assert check_weights_update([2, 3, 4], 2) == True\", \"assert check_weights_update([2, 3, 4], 3) == ...
{ "split": "train", "index": 3458, "acecode_id": "bigcode_python_fns_49087", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of words. Your task is to write a function that returns a dictionary where the keys are the words from the input list and the values are the lengths of those words. Implement the function `word_length_dict(words: List[str]) -> Dict[str, int]` where `words` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_length_dict(['apple', 'banana', 'cherry']) == {'apple': 5, 'banana': 6, 'cherry': 6}\", \"assert word_length_dict(['hello', 'world']) == {'hello': 5, 'world': 5}\", \"assert word_length_dict(['a', 'ab', 'abc', 'abcd']) == {'a': 1, 'ab': 2, 'abc': 3, 'ab...
{ "split": "train", "index": 3459, "acecode_id": "bigcode_python_fns_22337", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `throttled_log_count(nums: List[int], once_every: int) -> List[int]` that simulates a logging mechanism where only one integer can be logged every `once_every` calls. The function should return a new list containing only the intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert throttled_log_count([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3) == [1, 4, 7, 10]\", \"assert throttled_log_count([5], 1) == [5]\", \"assert throttled_log_count([1, 2, 3], 5) == [1]\", \"assert throttled_log_count([1, 2, 3, 4, 5], 0) == []\", \"assert throttled_log_c...
{ "split": "train", "index": 3460, "acecode_id": "bigcode_python_fns_40050", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string, convert it to camel case. The string should not contain any numbers; if a number is present, raise a ValueError. For any symbols or special characters (except whitespace), replace them with their corresponding ASCII values. Return the resulting string in camel c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert camel_case('hello world') == 'HelloWorld'\", \"assert camel_case('convert me') == 'ConvertMe'\", \"assert camel_case('this is a test') == 'ThisIsATest'\", \"assert camel_case(' no special characters ') == 'NoSpecialCharacters'\", \"assert camel_case('leading...
{ "split": "train", "index": 3461, "acecode_id": "evol_18757", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of user records, where each record is represented as a dictionary containing 'email' and 'password' fields. Your task is to write a function `filter_valid_users(users: List[Dict[str, str]]) -> List[Dict[str, str]]` that returns a new list containing only th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_valid_users([{'email': 'user1@example.com', 'password': 'password123'}, {'email': 'user2@domain.com', 'password': 'abc'}]) == [{'email': 'user1@example.com', 'password': 'password123'}]\", \"assert filter_valid_users([{'email': 'valid@example.com', 'p...
{ "split": "train", "index": 3462, "acecode_id": "bigcode_python_fns_34608", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the weights of items in a batch. Implement a function `reset_weights(weights: List[int]) -> List[int]` that resets the weights of all items to zero if the total weight of the batch exceeds a specified threshold. The parameters are a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_weights([10, 20, 30], 100) == [10, 20, 30]\", \"assert reset_weights([50, 60, 70], 100) == [0, 0, 0]\", \"assert reset_weights([0, 0, 0], 100) == [0, 0, 0]\", \"assert reset_weights([100, 200, 300], 500) == [0, 0, 0]\", \"assert reset_weights([500, 500...
{ "split": "train", "index": 3463, "acecode_id": "bigcode_python_fns_9341", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of user data, where each user data is represented as a dictionary containing 'username', 'first_name', 'last_name', 'email', and 'password', implement a function `register_users(user_data_list)` that simulates the registration of users. Each user should be added to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_users([{'username': 'user1', 'first_name': 'John', 'last_name': 'Doe', 'email': 'john@example.com', 'password': 'password123'}, {'username': 'user1', 'first_name': 'Jane', 'last_name': 'Smith', 'email': 'jane@example.com', 'password': 'password456'}...
{ "split": "train", "index": 3464, "acecode_id": "bigcode_python_fns_4558", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a game board update. The game board is represented as a 2D list of integers, where each integer represents a cell on the board. The function should take in the current state of the game board and an update operation tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_board([[1, 2], [3, 4]], [(0, 0, 5), (1, 1, 6)]) == [[5, 2], [3, 6]]\", \"assert update_board([[0]], [(0, 0, 1)]) == [[1]]\", \"assert update_board([[1, 1, 1], [1, 1, 1]], [(0, 0, 2), (1, 2, 3)]) == [[2, 1, 1], [1, 1, 3]]\", \"assert update_board([[8, ...
{ "split": "train", "index": 3465, "acecode_id": "bigcode_python_fns_37388", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a sorted list of names from a provided list of dictionaries, where each dictionary contains information about a person. Each dictionary has the following structure: {'fname': first_name, 'lname': last_name}. Your function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sorted_names([]) == []\", \"assert get_sorted_names([{'fname': 'John', 'lname': 'Doe'}]) == ['John Doe']\", \"assert get_sorted_names([{'fname': 'Alice', 'lname': 'Smith'}, {'fname': 'Bob', 'lname': 'Johnson'}]) == ['Bob Johnson', 'Alice Smith']\", \"ass...
{ "split": "train", "index": 3466, "acecode_id": "bigcode_python_fns_15894", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a Python function that converts a string into a list of words. You are not allowed to use the split(), splitlines(), or any other built-in Python function for string separation. The input string will contain words separated by spaces. Implement the function `convert_to_li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_list('This is a Programming Test') == ['This', 'is', 'a', 'Programming', 'Test']\", \"assert convert_to_list('Hello World') == ['Hello', 'World']\", \"assert convert_to_list('Python is fun') == ['Python', 'is', 'fun']\", \"assert convert_to_list('...
{ "split": "train", "index": 3467, "acecode_id": "evol_14307", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `config_to_dict(sections: Dict[str, Dict[str, str]]) -> Dict[str, Dict[str, str]]` that converts a given configuration data into a dictionary format. The configuration data is organized into sections, where each section contains key-v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert config_to_dict({'section1': {'key1': 'value1', 'key2': 'value2', '__name__': 'section1'}, 'section2': {'key3': 'value3', 'key4': 'value4', '__name__': 'section2'}}) == {'section1': {'key1': 'value1', 'key2': 'value2', 'default_key': 'default_value'}, 'sectio...
{ "split": "train", "index": 3468, "acecode_id": "oss_3026", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that verifies if the cumulative multiplication of elements within an array is even or odd, and pinpoints the position of the initial odd integer within the array. If no odd integers are present, the function should return -1. The function should efficiently h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_product([1, 2, 3]) == ('odd', 0)\", \"assert check_product([1, 3, 5]) == ('odd', 0)\", \"assert check_product([-2, -3, -1]) == ('odd', 1)\", \"assert check_product([5.1, 3.9, 2]) == ('odd', 0)\", \"assert check_product([1, 1, 1]) == ('odd', 0)\", \"ass...
{ "split": "train", "index": 3469, "acecode_id": "evol_19851", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates routing requests based on their method. The function should take in a string representing the request method ('GET', 'POST', or any other method) and return a corresponding response message based on the following rules: if ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert route_request('GET') == 'index_page'\", \"assert route_request('get') == 'index_page'\", \"assert route_request('POST') == 'send_wxmsg'\", \"assert route_request('post') == 'send_wxmsg'\", \"assert route_request('get') == 'index_page'\", \"assert route_reque...
{ "split": "train", "index": 3470, "acecode_id": "bigcode_python_fns_25357", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the Euclidean distance between two points in a 2D space, represented by their coordinates. You need to write a Python function `calculate_distance(point1, point2)` that takes in two tuples representing the coordinates of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_distance((1, 1), (4, 4)) - 4.242640687119285) < 1e-9\", \"assert abs(calculate_distance((0, 0), (0, 0)) - 0.0) < 1e-9\", \"assert abs(calculate_distance((1, 2), (3, 4)) - 2.8284271247461903) < 1e-9\", \"assert abs(calculate_distance((5, 5), (5,...
{ "split": "train", "index": 3471, "acecode_id": "oss_28077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that removes all duplicate values from the list while preserving the original order of elements. The function should return a new list containing only unique elements. The input list may contain both positive and negative integers, and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([-1, -2, -2, -3, -1]) == [-1, -2, -3]\", \"assert remove_duplicates([1, 2, 3, 4, 5]) =...
{ "split": "train", "index": 3472, "acecode_id": "bigcode_python_fns_40150", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of account dictionaries, where each dictionary contains information about an account. Each account dictionary has three keys: 'Name' (a string representing the account name), 'Handle' (an integer representing the account handle), and 'Status' (a string repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_online_account_names([{'Name':'Account1', 'Handle':1, 'Status':'online'}, {'Name':'Account2', 'Handle':2, 'Status':'offline'}]) == ['Account1']\", \"assert get_online_account_names([{'Name':'Account1', 'Handle':1, 'Status':'online'}, {'Name':'Account2', ...
{ "split": "train", "index": 3473, "acecode_id": "bigcode_python_fns_49927", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the values of nodes in a directed acyclic graph, implement a function that takes the last element of the list as the output node and returns its value after performing a forward pass through the entire list. The forward pass means that you ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert forward_pass([1, 2, 3, 4, 5]) == 5\", \"assert forward_pass([10, 20, 30]) == 30\", \"assert forward_pass([7]) == 7\", \"assert forward_pass([-1, -2, -3, -4]) == -4\", \"assert forward_pass([100, 200, 300, 400, 500]) == 500\", \"assert forward_pass([0]) == 0\...
{ "split": "train", "index": 3474, "acecode_id": "bigcode_python_fns_26364", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing CSV data and accumulating it into a nested dictionary structure. Each line of the CSV data contains 13 elements, indexed from 0 to 12. Your goal is to write a function `process_csv_data(csv_data)` that takes a list of lists `csv_data` as input, wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_csv_data([['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', '10']]) == {'H': {'oorsprong': {'D': 10}, 'profiel': {'G': 10}}}\", \"assert process_csv_data([['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', '5'], ['A', 'B', 'C', '...
{ "split": "train", "index": 3475, "acecode_id": "oss_32531", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the sum of all the even numbers in the list. If there are no even numbers, return 0. The function should be defined as follows: def sum_of_evens(numbers: List[int]) -> int. The input list can contain both positive and nega...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -1, 0, 1, 2]) == 0\", \"assert sum_of_evens([-4, -6, -8]) == -18\", \"assert sum_of_evens([0, 0, 0]) == 0\", \"assert sum_of_evens([1, 3, 5, 7])...
{ "split": "train", "index": 3476, "acecode_id": "bigcode_python_fns_3801", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of non-negative integers and returns a new list sorted by the lengths of their binary representations. If two integers have the same binary length, they should be sorted by their decimal values. The function should handle large numbers eff...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_by_binary_len([1, 31, 15, 2, 7]) == [1, 2, 7, 15, 31]\", \"assert sort_by_binary_len([14, 58, 39, 41, 61]) == [14, 39, 41, 58, 61]\", \"assert sort_by_binary_len([1, 0, 2, 3, 4]) == [0, 1, 2, 3, 4]\", \"assert sort_by_binary_len([2, 3, 7, 8, 15]) == [2,...
{ "split": "train", "index": 3477, "acecode_id": "evol_17195", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a validation function that checks if a given filename has an allowed file extension. The allowed file extensions will be provided as a list. The function should take a string representing the filename and a list of allowed extensions as input. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_filename('image.jpg', ['jpg', 'png']) == True\", \"assert validate_filename('photo.png', ['jpg', 'png']) == True\", \"assert validate_filename('picture.jpeg', ['jpg', 'jpeg']) == True\", \"assert validate_filename('archive.zip', ['zip', 'tar']) == T...
{ "split": "train", "index": 3478, "acecode_id": "oss_27968", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of file names as strings. Your task is to implement a function `check_files_exist(file_list: List[str]) -> bool` that returns True if at least one of the files in the list exists (i.e., is a non-empty string), and False otherwise. The function should consid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_files_exist(['file1.txt', 'file2.txt', 'file3.txt']) == True\", \"assert check_files_exist(['', '', 'file3.txt']) == True\", \"assert check_files_exist(['', '', '']) == False\", \"assert check_files_exist(['file1.txt', '', 'file3.txt']) == True\", \"as...
{ "split": "train", "index": 3479, "acecode_id": "bigcode_python_fns_11061", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a text processor that replaces specific symbols in a given string based on a set of symbol definitions. Your task is to implement the `replace_symbols` function, which takes three parameters: \n- `text`: A string representing the input text containi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_symbols('Hello, $USER!', {'$USER': 'Alice'}) == 'Hello, Alice!'\", \"assert replace_symbols('The price is $PRICE.', {'$PRICE': '100$', '$CURRENCY': 'USD'}) == 'The price is 100$.'\", \"assert replace_symbols('Welcome to the $PLACE.', {'$PLACE': 'park...
{ "split": "train", "index": 3480, "acecode_id": "oss_4314", "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 original list, preserving the order of their first appearance. For example, if the input list is [1, 2, 2, 3,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 1]) == [1, 2, 3]\", \"assert unique_integers([4, 4, 4, 4]) == [4]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert unique_integers([1, 1, 1, 1, 1]) == [1]...
{ "split": "train", "index": 3481, "acecode_id": "oss_5785", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two binary vectors 'emb1' and 'emb2', each represented as a list of integers (0s and 1s), calculate the Jaccard similarity coefficient between them. The Jaccard similarity is defined as the size of the intersection divided by the size of the union of the sample sets. In t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert jaccard_similarity([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert jaccard_similarity([1, 1, 1], [1, 1, 1]) == 1.0\", \"assert jaccard_similarity([1, 0, 0], [0, 1, 0]) == 0.0\", \"assert jaccard_similarity([1, 0, 1, 0], [1, 1, 0, 0]) == 0.3333333333333333\", \"asse...
{ "split": "train", "index": 3482, "acecode_id": "bigcode_python_fns_36316", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `check_answers(answers: List[str], correct_answers: List[str]) -> List[str]` that checks a list of answers against a list of correct answers. The function should return a list of strings, where each string indicates whether the corres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_answers(['Paris', 'Berlin', 'London'], ['paris', 'berlin', 'LONDON']) == ['Correct', 'Correct', 'Correct']\", \"assert check_answers(['Paris', 'Berlin', 'Madrid'], ['paris', 'berlin', 'LONDON']) == ['Correct', 'Correct', 'Incorrect']\", \"assert check_...
{ "split": "train", "index": 3483, "acecode_id": "bigcode_python_fns_1638", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function named `tri_area()` that calculates the area of a triangle given its base and height. The function should take two parameters, `base` and `height`, and return the area of the triangle. However, if either `base` or `height` is less than or equal to zero, the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tri_area(10, 5) == 25.0\", \"assert tri_area(0.5, 2) == 0.5\", \"assert tri_area(3, 6) == 9.0\", \"assert tri_area(7, 8) == 28.0\", \"assert tri_area(12, 10) == 60.0\", \"assert tri_area(1, 1) == 0.5\", \"assert tri_area(15, 4) == 30.0\", \"assert tri_area(2...
{ "split": "train", "index": 3484, "acecode_id": "evol_2546", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of snapshot names and a list of VM snapshots, determine the status of each snapshot in relation to the VM snapshots. For each snapshot in the VM snapshots list, return a dictionary containing the snapshot name, type (as a string 'Type A' or 'Type B'), a message ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_snapshots([('snapshot1', 'Type A'), ('snapshot2', 'Type B')], ['snapshot1', 'snapshot3']) == [{'snapshot_name': 'snapshot1', 'snapshot_type': 'Type A', 'message': 'Snapshot present', 'operation': 'None'}, {'snapshot_name': 'snapshot2', 'snapshot_type':...
{ "split": "train", "index": 3485, "acecode_id": "bigcode_python_fns_32772", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the n most frequent elements in the list. If there is a tie, return the elements in the order they first appeared in the list. The function should have the following signature: def top_n_frequent_elements(nums: List[int], ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert top_n_frequent_elements([1, 1, 2, 2, 3, 3], 2) == [1, 2]\", \"assert top_n_frequent_elements([1, 2, 3, 4, 5, 1, 2, 1], 1) == [1]\", \"assert top_n_frequent_elements([5, 5, 4, 4, 4, 3, 3], 2) == [4, 5]\", \"assert top_n_frequent_elements([1, 2, 3, 3, 2, 1, 2]...
{ "split": "train", "index": 3486, "acecode_id": "bigcode_python_fns_30708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes in three positive integers and returns their sum and product.\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 sum_and_product(1, 2, 3) == (6, 6)\", \"assert sum_and_product(5, 10, 15) == (30, 750)\", \"assert sum_and_product(2, 3, 4) == (9, 24)\", \"assert sum_and_product(8, 9, 10) == (27, 720)\", \"assert sum_and_product(1, 1, 1) == (3, 1)\", \"assert sum_and_produ...
{ "split": "train", "index": 3487, "acecode_id": "evol_18439", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a camera's view resizing in a 3D environment. The function should take two parameters, width `w` and height `h`, representing the new dimensions of the camera's view. The function should return a dictionary containing the u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resize_camera_view(800, 600) == {'width': 800, 'height': 600}\", \"assert resize_camera_view(1024, 768) == {'width': 1024, 'height': 768}\", \"assert resize_camera_view(1920, 1080) == {'width': 1920, 'height': 1080}\", \"assert resize_camera_view(1280, 720) ...
{ "split": "train", "index": 3488, "acecode_id": "oss_21551", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of chemical reagent objects, where each reagent object contains a list of chemical species names. Your task is to implement a function that returns a sorted list of unique chemical species names from all the reagents provided. Each chemical species name is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_chemical_names([{ 'chemicals': ['H2O', 'CO2'] }, { 'chemicals': ['NaCl', 'H2O'] }, { 'chemicals': ['C6H12O6'] }]) == ['C6H12O6', 'CO2', 'H2O', 'NaCl']\", \"assert get_unique_chemical_names([{ 'chemicals': ['O2', 'N2'] }, { 'chemicals': ['N2', 'Ar'...
{ "split": "train", "index": 3489, "acecode_id": "bigcode_python_fns_17932", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a pagination system for a list of job entries. Your function should take two parameters: a list of job entries (strings) and a page number (integer). It should return a list of job entries for the specified page, where ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_jobs_by_page(['Job1', 'Job2', 'Job3', 'Job4', 'Job5', 'Job6', 'Job7', 'Job8', 'Job9', 'Job10', 'Job11'], 1) == ['Job1', 'Job2', 'Job3', 'Job4', 'Job5', 'Job6', 'Job7', 'Job8', 'Job9', 'Job10']\", \"assert get_jobs_by_page(['Job1', 'Job2', 'Job3', 'Job4',...
{ "split": "train", "index": 3490, "acecode_id": "bigcode_python_fns_31950", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `kmeans_clustering` that takes a list of data points and an integer K as inputs. The function should perform KMeans clustering on the data points and return the cluster labels for each point. The data points are represented as a list of tuples, where each t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kmeans_clustering([(1.0, 2.0), (1.5, 1.8), (5.0, 8.0), (8.0, 8.0), (1.0, 0.6), (9.0, 11.0)], 2) == [0, 0, 1, 1, 0, 1]\", \"assert kmeans_clustering([(0.0, 0.0), (1.0, 1.0), (2.0, 2.0), (3.0, 3.0)], 2) == [0, 0, 1, 1]\", \"assert kmeans_clustering([(1.0, 1.0)...
{ "split": "train", "index": 3491, "acecode_id": "evol_32719", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `env(unset: bool = False) -> Tuple[List[str], str]` that manages environment variables. When the `unset` parameter is set to `True`, the function should clear any existing environment variables and return an empty list and an empty st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert env() == (['VAR1', 'VAR2'], 'value1')\", \"assert env(unset=True) == ([], '')\", \"assert env() == (['VAR1', 'VAR2'], 'value1')\", \"assert env(unset=False) == (['VAR1', 'VAR2'], 'value1')\", \"assert env() != ([], '')\", \"assert env(unset=True) != (['VAR1'...
{ "split": "train", "index": 3492, "acecode_id": "oss_1509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `multiply_primes(num_list)` that takes a list of non-negative integers and returns the product of all prime digits (2, 3, 5, 7) found in the individual digits of the numbers in the list. If no prime digits are found, return 1.\nPlease reason step by step, then ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_primes([0, 1, 4, 6, 8, 9]) == 1\", \"assert multiply_primes([10, 20, 30]) == 6\", \"assert multiply_primes([1, 11, 111]) == 1\", \"assert multiply_primes([2, 3, 5, 7]) == 210\", \"assert multiply_primes([13, 14, 15]) == 15\", \"assert multiply_prime...
{ "split": "train", "index": 3493, "acecode_id": "evol_36191", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with checking if a given line of text exceeds a specified maximum length. Implement a function `is_length_exceeded(line: str, max_length: int) -> bool` that returns `True` if the length of the line exceeds `max_length`, and `False` otherwise. The input `line` is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_length_exceeded('Hello, World!', 15) == False\", \"assert is_length_exceeded('This is a sample line', 25) == False\", \"assert is_length_exceeded('This line is definitely too long for the specified maximum length.', 50) == True\", \"assert is_length_excee...
{ "split": "train", "index": 3494, "acecode_id": "bigcode_python_fns_38082", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of an AES object based on a provided key and Initialization Vector (IV). Write a function `create_aes_object(key: str, IV: str) -> str` that takes in a key and an IV. The key must be a string of length 16, 24, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_aes_object('1234567890123456', '1234567890123456') == 'AES-128'\", \"assert create_aes_object('123456789012345678901234', '1234567890123456') == 'AES-192'\", \"assert create_aes_object('12345678901234567890123456789012', '1234567890123456') == 'AES-25...
{ "split": "train", "index": 3495, "acecode_id": "bigcode_python_fns_21080", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a node with various attributes. Each node contains a 'name' attribute which is a string. Your task is to write a function that takes this list of dictionaries and returns a list of unique names of the nodes....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_names([]) == []\", \"assert get_unique_names([{'name': 'A'}, {'name': 'B'}, {'name': 'A'}]) == ['A', 'B']\", \"assert get_unique_names([{'name': 'A'}, {'name': 'A'}, {'name': 'A'}]) == ['A']\", \"assert get_unique_names([{'name': 'A'}, {'name': 'B...
{ "split": "train", "index": 3496, "acecode_id": "bigcode_python_fns_13222", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the magnitudes of an analog signal. Your task is to calculate the Median Absolute Deviation (MAD) of this signal. The MAD is defined as the median of the absolute deviations from the median of the data set. Implement a function `med...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median_absolute_deviation([1, 2, 3, 4, 5]) == 1.0\", \"assert median_absolute_deviation([-1, 0, 1]) == 1.0\", \"assert median_absolute_deviation([1]) == 0.0\", \"assert median_absolute_deviation([1, 2, 3, 4, 4, 4]) == 0.5\", \"assert median_absolute_deviatio...
{ "split": "train", "index": 3497, "acecode_id": "bigcode_python_fns_41438", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function that takes a complex number and a 2D list (matrix) of complex numbers as input. The function should return the conjugate of the complex number along with a new matrix where each element is the product of the corresponding element in the input matrix and the com...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_matrix_operation(0+1j, [[0, 0], [0, 0]]) == (0-1j, [[0j, 0j], [0j, 0j]])\", \"assert complex_matrix_operation(1, [[1, 2], [3, 4]]) == (1, [[1, 2], [3, 4]])\", \"assert complex_matrix_operation(2+0j, [[1, 0], [0, 1]]) == (2, [[2, 0], [0, 2]])\", \"ass...
{ "split": "train", "index": 3498, "acecode_id": "evol_17542", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a numeric value, implement a function that validates the input to ensure it is a positive integer. If the input is invalid (non-integer or negative), return an appropriate error message. If the input is valid, return a list of all prime divisors of the given numeric value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert divisors(24) == [2, 3]\", \"assert divisors(30) == [2, 3, 5]\", \"assert divisors(1) == []\", \"assert divisors(7) == [7]\", \"assert divisors(2) == [2]\", \"assert divisors(11) == [11]\", \"assert divisors(12) == [2, 3]\", \"assert divisors(15) == [3, 5]\",...
{ "split": "train", "index": 3499, "acecode_id": "evol_24529", "num_tests": 10 }