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": "Given a string, write a function that counts the number of alphabetic characters in the string, ignoring punctuation and spaces. The function should consider case sensitivity. Implement a function `count_alpha_characters(s)` where `s` is the input string.\nPlease reason step by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_alpha_characters('Hello, World!') == 10\", \"assert count_alpha_characters('Python 3.9!') == 6\", \"assert count_alpha_characters('12345') == 0\", \"assert count_alpha_characters('') == 0\", \"assert count_alpha_characters(' ') == 0\", \"assert count...
{ "split": "train", "index": 80300, "acecode_id": "evol_605", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a grayscale image represented as a two-dimensional list of integers, where each integer corresponds to a pixel intensity (0-255). Implement a function `classify_image` that takes in this image and returns a label based on the following criteria: \n\n1. If the imag...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_image([[255, 255], [255, 255]]) == 'bright'\", \"assert classify_image([[0, 0], [0, 0]]) == 'dark'\", \"assert classify_image([[100, 150], [200, 250]]) == 'normal'\", \"assert classify_image([[255, 0], [0, 255]]) == 'normal'\", \"assert classify_ima...
{ "split": "train", "index": 80301, "acecode_id": "bigcode_python_fns_46631", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `delete_rows(keys: List[int]) -> List[bool]` that simulates the deletion of rows from a cache based on a list of keys. The function should take in a list of integer keys, where each key corresponds to a row in the cache. Your function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_rows([1, 2, 3, 4]) == [False, True, False, True]\", \"assert delete_rows([0, 5, 10, 15]) == [True, False, True, False]\", \"assert delete_rows([2, 4, 6, 8]) == [True, True, True, True]\", \"assert delete_rows([]) == []\", \"assert delete_rows([1, 3, 5...
{ "split": "train", "index": 80302, "acecode_id": "oss_34672", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `create_config(name: str) -> str` that simulates the creation of a configuration for a subreddit. The function takes a single input parameter, `name`, which is a string representing the subreddit name. The function should randomly ass...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_config('python') == '/r/python configuration'\", \"assert create_config('learnpython') == '/r/learnpython configuration'\", \"assert create_config('datascience') == '/r/datascience configuration'\", \"assert create_config('machinelearning') == '/r/mac...
{ "split": "train", "index": 80303, "acecode_id": "oss_295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `compute_gcf(x: int, y: int) -> int` that takes two integers, `x` and `y`, and returns their greatest common factor (GCF).\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 compute_gcf(36, 90) == 18\", \"assert compute_gcf(48, 18) == 6\", \"assert compute_gcf(101, 103) == 1\", \"assert compute_gcf(54, 24) == 6\", \"assert compute_gcf(100, 250) == 50\", \"assert compute_gcf(13, 27) == 1\", \"assert compute_gcf(56, 98) == 14\", \...
{ "split": "train", "index": 80304, "acecode_id": "evol_23658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `rotate_matrix(mat: List[List[int]], k: int) -> List[List[int]]` that rotates a given two-dimensional square matrix `mat` clockwise by `k` steps. The matrix is guaranteed to be square (i.e., having the same number of rows and columns). The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_matrix([[1, 2], [3, 4]], 1) == [[3, 1], [4, 2]]\", \"assert rotate_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 1) == [[7, 4, 1], [8, 5, 2], [9, 6, 3]]\", \"assert rotate_matrix([[1, 2], [3, 4]], 1) == [[3, 1], [4, 2]]\", \"assert rotate_matrix([[1, 2, 3...
{ "split": "train", "index": 80305, "acecode_id": "evol_23589", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing flake issues, where each integer is a unique identifier for a flake issue. Your task is to implement a function that takes this list and returns a new list where each integer is replaced by a boolean value indicating whether the fla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert archive_flakes([1, 2, 3, 4, 5]) == [False, True, False, True, False]\", \"assert archive_flakes([0, 7, 8, 14, 15]) == [True, False, True, True, False]\", \"assert archive_flakes([10, 21, 32, 45, 60]) == [True, False, True, False, True]\", \"assert archive_fl...
{ "split": "train", "index": 80306, "acecode_id": "bigcode_python_fns_35695", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers as input and returns a new list containing only the even numbers from the original list. The order of the even numbers in the output list should be the same as their order in the input list. Write a funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([7, 9, 11]) == []\", \"assert filter_even_numbers([-2, -3, -4, -5]) == [-2, -4]\", \"assert filter_even_numbers...
{ "split": "train", "index": 80307, "acecode_id": "bigcode_python_fns_39552", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that sorts a two-dimensional array using the Bubble Sort technique. The function should first sort each sub-array in ascending order and then sort the sub-arrays themselves based on the first element of each sub-array. The function should return the sorted ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_2D_array([[3, 5, 1, 0, 9], [0, 7, 2, 5, 3]]) == [[0, 1, 3, 5, 9], [0, 2, 3, 5, 7]]\", \"assert sort_2D_array([[5, 1], [4, 0], [3, 2]]) == [[0, 4], [1, 5], [2, 3]]\", \"assert sort_2D_array([[9], [1], [8]]) == [[1], [8], [9]]\", \"assert sort_2D_array([[...
{ "split": "train", "index": 80308, "acecode_id": "evol_31408", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of nodes, and you need to implement a function that calculates the derivative labels for these nodes. The derivative labels are predefined in a list: ['D1', 'D2', 'D3', 'D12', 'D13', 'D23', 'D123']. Your task is to create a function named `calculate_derivat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_derivative_labels([1]) == ['D1']\", \"assert calculate_derivative_labels([1, 2]) == ['D1', 'D2']\", \"assert calculate_derivative_labels([1, 2, 3]) == ['D1', 'D2', 'D3']\", \"assert calculate_derivative_labels([1, 2, 3, 4]) == ['D1', 'D2', 'D3', 'D...
{ "split": "train", "index": 80309, "acecode_id": "oss_20983", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique integers from the original list, in the order they first appeared. Implement a function called `get_unique_integers` which accepts a list of integers and retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert get_unique_integers([1, 1, 1, 1]) == [1]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_integers([3, 1, 2, 2, 3, 3]) == [3, 1, 2]\", \"assert get_unique_integers([5, 5, 6, 7, ...
{ "split": "train", "index": 80310, "acecode_id": "oss_6498", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries, each representing a record, implement a function that converts this list into a JSON string format. Each dictionary will contain string keys and can have values of various types, including integers, floats, and strings. The output should be a JSON ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_to_json([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}]) == '[{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}, {\\\"name\\\": \\\"Bob\\\", \\\"age\\\": 25}]'\", \"assert list_to_json([{'product': 'Laptop', 'price': 999.99}, {'product': 'Mouse'...
{ "split": "train", "index": 80311, "acecode_id": "bigcode_python_fns_3903", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of movie dictionaries, each containing information about a film's ID, category, and popularity status. Your task is to implement a function that takes this list as input, removes the 'film_category' key from each dictionary, and returns a list of the modifi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_movie_data([{'film_id': 1, 'film_category': 'Action', 'is_popular': True}, {'film_id': 2, 'film_category': 'Comedy', 'is_popular': False}]) == [{'film_id': 1, 'is_popular': True}, {'film_id': 2, 'is_popular': False}]\", \"assert process_movie_data([{...
{ "split": "train", "index": 80312, "acecode_id": "oss_32975", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of floating-point numbers representing rewards earned at each time step in a 1D array. Your task is to implement a function that computes the discounted rewards using a discount factor of 0.99. The discounted reward at each time step is calculated as the su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert discounted_rewards([0.0, 0.0, 0.0]) == [0.0, 0.0, 0.0]\", \"assert discounted_rewards([5.0]) == [5.0]\", \"assert discounted_rewards([3.0, 1.0]) == [3.99, 1.0]\", \"assert discounted_rewards([]) == []\", \"assert discounted_rewards([2.2]) == [2.2]\"]}" }
{ "split": "train", "index": 80313, "acecode_id": "bigcode_python_fns_16433", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `calculator(a: int, b: int, operation: str) -> Union[int, float, str]` that performs a basic arithmetic operation on two integers. The function should support the following operations: 'add', 'subtract', 'multiply', and 'divide'. It should return the result...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculator(3, 2, 'add') == 5\", \"assert calculator(3, 2, 'subtract') == 1\", \"assert calculator(3, 2, 'multiply') == 6\", \"assert calculator(6, 2, 'divide') == 3.0\", \"assert calculator(3, 0, 'divide') == 'Error: Cannot divide by zero.'\", \"assert calcu...
{ "split": "train", "index": 80314, "acecode_id": "evol_19980", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string representing an email address and a password, and validates the email format and password strength. The email should consist of a local part, an '@' symbol, followed by a domain that includes a '.' character. The p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_credentials('test@example.com', 'Password123!') == True\", \"assert validate_credentials('user@domain.com', 'P@ssword1') == True\", \"assert validate_credentials('invalid-email', 'Password!') == False\", \"assert validate_credentials('user@domain', ...
{ "split": "train", "index": 80315, "acecode_id": "bigcode_python_fns_17967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tasks represented as dictionaries, each containing an 'id' and 'item_order', and an integer 'begin_order', implement a function that updates the 'item_order' of each task that has an 'item_order' greater than or equal to 'begin_order' by incrementing it by 1. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_item_orders([{'id': 1, 'item_order': 3}, {'id': 2, 'item_order': 5}, {'id': 3, 'item_order': 1}], 2) == [{'id': 1, 'item_order': 4}, {'id': 2, 'item_order': 6}, {'id': 3, 'item_order': 1}]\", \"assert update_item_orders([{'id': 1, 'item_order': 0}, {'...
{ "split": "train", "index": 80316, "acecode_id": "bigcode_python_fns_16831", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers, where each integer represents a byte (in the range of 0 to 255). Your task is to implement a function `convert_bytes_to_hex_string(bytes_list: List[int]) -> str` that converts each byte in the list into its corresponding two-digit hexadecimal s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_bytes_to_hex_string([16, 255, 0, 1]) == '10ff0001'\", \"assert convert_bytes_to_hex_string([0]) == '00'\", \"assert convert_bytes_to_hex_string([255]) == 'ff'\", \"assert convert_bytes_to_hex_string([1, 2, 3]) == '010203'\", \"assert convert_bytes_to...
{ "split": "train", "index": 80317, "acecode_id": "bigcode_python_fns_21905", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function that accepts a time string in the format 'hh:mm:ss' and a timezone (e.g., 'UTC', 'EST'). The function should return the equivalent time in seconds since the start of the day and also return the adjusted time in 'hh:mm:ss' format based on the provided timezo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_time('12:00:00', 'UTC') == (43200, '12:00:00')\", \"assert convert_time('23:59:59', 'PST') == (86399, '15:59:59')\", \"assert convert_time('18:45:00', 'UTC') == (67500, '18:45:00')\", \"assert convert_time('12:30:30', 'PST') == (45030, '04:30:30')\",...
{ "split": "train", "index": 80318, "acecode_id": "evol_3024", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a function that simulates getting input from a player in a game. Implement a function `get_player_input(player_number: int, input_value: str) -> str` that takes two parameters: an integer `player_number` (1 or 2) and a string `input_value`. The function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_player_input(1, 'hello') == 'Player 1 input: hello'\", \"assert get_player_input(2, 'world') == 'Player 2 input: world'\", \"assert get_player_input(1, 'test') == 'Player 1 input: test'\", \"assert get_player_input(2, 'code') == 'Player 2 input: code'\",...
{ "split": "train", "index": 80319, "acecode_id": "bigcode_python_fns_27523", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple translation system that processes an input string through a sequence of transformation functions. Each transformation function is responsible for modifying the input string in a specific way. Your goal is to create a function that takes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert chain_translate('base', [lambda s: 'Prefix-' + s, lambda s: s + '-Suffix']) == 'Prefix-base-Suffix'\", \"assert chain_translate('test', [lambda s: s.upper(), lambda s: s + '!!!']) == 'TEST!!!'\", \"assert chain_translate('hello', [lambda s: s + ' world', lam...
{ "split": "train", "index": 80320, "acecode_id": "oss_33734", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array 'arr' that consists of N integers arranged randomly, determine whether it's possible to sort the array in non-decreasing order by performing at most two swaps of any two elements. The function should return True if it is possible to sort the array and False if it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_two_elements([]) == True\", \"assert rearrange_two_elements([1, 2, 3, 5, 4, 6]) == True\", \"assert rearrange_two_elements([5, 4, 3, 1, 2, 6]) == False\", \"assert rearrange_two_elements([1, 2, 3, 4]) == True\", \"assert rearrange_two_elements([4, ...
{ "split": "train", "index": 80321, "acecode_id": "evol_18069", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_feature_name_list(feature_setting, feature_name)` that takes in a feature setting and a feature name, and returns a list of uppercase feature names for all the names in a predefined settings dictionary. The settings dictionary co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_feature_name_list('feature1', 'Feature') == ['FEATURENAME1', 'FEATURENAME2']\", \"assert get_feature_name_list('feature2', 'Feature') == ['FEATURENAME3']\", \"assert get_feature_name_list('feature3', 'Feature') == ['FEATURENAME4', 'FEATURENAME5', 'FEATUR...
{ "split": "train", "index": 80322, "acecode_id": "oss_22438", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers `nums`. Your task is to write a function `lengthOfLIS` to find the length of the longest increasing subsequence (LIS) within the list `nums`. A subsequence is a sequence that can be derived from another sequence by deleting some or no elements w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lengthOfLIS([10, 9, 2, 5, 3, 7, 101, 18]) == 4\", \"assert lengthOfLIS([1, 2, 3, 4, 5]) == 5\", \"assert lengthOfLIS([5, 4, 3, 2, 1]) == 1\", \"assert lengthOfLIS([3, 1, 2, 1, 5]) == 3\", \"assert lengthOfLIS([]) == 0\", \"assert lengthOfLIS([0]) == 1\", \"a...
{ "split": "train", "index": 80323, "acecode_id": "oss_31514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that extracts the innermost quoted string from a given input string. The input string may contain multiple levels of nested quotation marks. If there are no quotes present, return an empty string. Implement the function `extract_innermost_quoted(s: str) -> str`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_innermost_quoted('Hello \\\"world\\\"!') == 'world'\", \"assert extract_innermost_quoted('No quotes here!') == ''\", \"assert extract_innermost_quoted('\\\"\\\"') == ''\", \"assert extract_innermost_quoted('\\\"One level\\\"') == 'One level'\", \"ass...
{ "split": "train", "index": 80324, "acecode_id": "evol_23248", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `thresholded_map` that computes and returns a new list where each element is set to zero if it is below a specified threshold value. The function should also return the threshold value used. If the input list is empty, the function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert thresholded_map([1, 2, 3, 4, 5], 3) == ([0, 0, 3, 4, 5], 3)\", \"assert thresholded_map([10, 20, 30], 25) == ([0, 0, 30], 25)\", \"assert thresholded_map([5, 6, 7, 8], 10) == ([0, 0, 0, 0], 10)\", \"assert thresholded_map([], 5) == ([], 0)\", \"assert thresh...
{ "split": "train", "index": 80325, "acecode_id": "bigcode_python_fns_9434", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array consisting of at least two strings that contain only the characters '(' and ')'. Your task is to determine if it is possible to concatenate these strings in any order to create a valid sequence of parentheses. A valid sequence is defined as one where ever...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_parenthesis_sequence(['((', '))', '()']) == 'Yes'\", \"assert advanced_parenthesis_sequence(['(', '(', '(', ')']) == 'No'\", \"assert advanced_parenthesis_sequence(['(', ')', '(', ')']) == 'Yes'\", \"assert advanced_parenthesis_sequence([')', '(', '...
{ "split": "train", "index": 80326, "acecode_id": "evol_35901", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an array of integers, your task is to find the kth least significant prime digit that appears in the numbers of the array. The prime digits are defined as 2, 3, 5, and 7. Your function should have a time complexity of O(n), where n is the total number of digits across all...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_kth_prime_digit([12, 34, 56, 78], 1) == 2\", \"assert find_kth_prime_digit([12, 34, 56, 78], 2) == 3\", \"assert find_kth_prime_digit([12, 34, 56, 78], 3) == 5\", \"assert find_kth_prime_digit([12, 34, 56, 78], 4) == 7\", \"assert find_kth_prime_digit([...
{ "split": "train", "index": 80327, "acecode_id": "evol_36216", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple authentication provider for a version control system. Implement a function that simulates the retrieval of an authentication provider given a pool identifier. The function should accept a variable number of arguments and return a string ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert svn_auth_get_simple_provider('user') == 'user provider'\", \"assert svn_auth_get_simple_provider('password') == 'password provider'\", \"assert svn_auth_get_simple_provider('token') == 'token provider'\", \"assert svn_auth_get_simple_provider('admin') == 'un...
{ "split": "train", "index": 80328, "acecode_id": "bigcode_python_fns_13894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that extracts the integer part of a floating-point number, returning the greatest integer that is less than or equal to the input value if the number is positive, and the least integer that is greater than or equal to the input value if the number is negative...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_integer(4.7) == 4\", \"assert extract_integer(-3.2) == -3\", \"assert extract_integer(0.0) == 0\", \"assert extract_integer(2.4) == 2\", \"assert extract_integer(-1.9) == -1\", \"assert extract_integer(10.99) == 10\", \"assert extract_integer(-10.01)...
{ "split": "train", "index": 80329, "acecode_id": "evol_22970", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function in Python that takes a string as input and returns the string with all uppercase letters converted to lowercase. The function should handle empty strings and strings that are already in lowercase as well.\nPlease reason step by step, then write a self-conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_lowercase('HELLO') == 'hello'\", \"assert convert_to_lowercase('Hello World') == 'hello world'\", \"assert convert_to_lowercase('python') == 'python'\", \"assert convert_to_lowercase('123 ABC') == '123 abc'\", \"assert convert_to_lowercase('') == ...
{ "split": "train", "index": 80330, "acecode_id": "evol_29186", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the CPU cores available in a system. Write a function `cpu_info_summary(cpu_cores: List[int]) -> Dict[str, Union[str, int]]` that returns a dictionary containing the following information: \n1. `host_cpu_model`: A string representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cpu_info_summary([2, 4, 8]) == {'host_cpu_model': 'Generic CPU Model', 'host_physical_cpus': 8, 'host_cpu_cores': 14, 'host_logical_cpus': 3}\", \"assert cpu_info_summary([1, 1, 1]) == {'host_cpu_model': 'Generic CPU Model', 'host_physical_cpus': 1, 'host_cp...
{ "split": "train", "index": 80331, "acecode_id": "bigcode_python_fns_30035", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an unsorted array of integers `nums`, return the length of the longest continuous increasing subsequence (i.e., subarray). The subsequence must be strictly increasing. You are allowed to change at most two elements in the array to increase the length of the longest contin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestIncreasingSubsequence([1,2,3,4,5]) == 5\", \"assert longestIncreasingSubsequence([1,2,1,2,1,2]) == 3\", \"assert longestIncreasingSubsequence([1,5,3,6,7]) == 5\", \"assert longestIncreasingSubsequence([-1,0,1,2,3]) == 5\", \"assert longestIncreasingSu...
{ "split": "train", "index": 80332, "acecode_id": "evol_9412", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list representing a stack of elements. Your task is to implement a function that pops the last element from the stack and returns the modified stack. If the stack is empty, return an empty list. Implement the function `pop_stack(stack: List[int]) -> List[int]` w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pop_stack([1, 2, 3]) == [1, 2]\", \"assert pop_stack([5]) == []\", \"assert pop_stack([]) == []\", \"assert pop_stack([10, 20, 30, 40]) == [10, 20, 30]\", \"assert pop_stack([7, 8]) == [7]\", \"assert pop_stack([0]) == []\", \"assert pop_stack([1, 2, 3, 4, 5...
{ "split": "train", "index": 80333, "acecode_id": "bigcode_python_fns_22762", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to manage a list of IoT devices and their connection statuses. Each device is represented as a dictionary containing its 'address', 'type', and 'status'. The function should take a list of these device dictionaries as input and ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_connected_devices([{'address': '192.168.1.1', 'type': 'iGrill', 'status': 'connected'}, {'address': '192.168.1.2', 'type': 'TokenCube', 'status': 'disconnected'}]) == ['192.168.1.1']\", \"assert get_connected_devices([{'address': '192.168.1.3', 'type': '...
{ "split": "train", "index": 80334, "acecode_id": "oss_5291", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a whitespace-separated string of names, write a function that converts this string into a list of string elements. The function should split the input string by whitespace and return the resulting list. If the input string is empty, the function should return an empty lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_to_string_list('') == []\", \"assert split_to_string_list('a b c') == ['a', 'b', 'c']\", \"assert split_to_string_list('hello world') == ['hello', 'world']\", \"assert split_to_string_list('one two three four') == ['one', 'two', 'three', 'four']\", \"a...
{ "split": "train", "index": 80335, "acecode_id": "bigcode_python_fns_23226", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers 'arr' and an integer 'target_sum', write a function that returns a boolean indicating whether there exists a subset of 'arr' whose sum is equal to 'target_sum'. A subset can consist of any combination of elements from the array, and the same element can...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_subset_sum([1, 2, 3, 4, 5], 5) == True\", \"assert has_subset_sum([1, 2, 3, 4, 5], 10) == True\", \"assert has_subset_sum([1, 2, 3, 4, 5], 0) == True\", \"assert has_subset_sum([1, 2, 3, 4, 5], 1) == True\", \"assert has_subset_sum([1, 2, 3, 4, 5], 6) ==...
{ "split": "train", "index": 80336, "acecode_id": "bigcode_python_fns_7445", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary represents a student and contains the student's name and their attributes (including age and score), write a function that calculates the mean of the 'score' values across all students.\nPlease reason step by step, then write a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_score([{ 'student': 'Alice', 'attributes': { 'age': 21, 'score': 95 }}, { 'student': 'Bob', 'attributes': { 'age': 23, 'score': 85 }}]) == 90.0\", \"assert average_score([{ 'student': 'Charlie', 'attributes': { 'age': 20, 'score': 70 }}, { 'student':...
{ "split": "train", "index": 80337, "acecode_id": "evol_7907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a spiral matrix of size n x m, starting with a given initial value and incrementing by a specified amount for each subsequent value. The function should take four parameters: n (number of rows), m (number of columns), val (initial value), and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_spiral(1, 1, 5, 1) == [[5]]\", \"assert generate_spiral(2, 2, 1, 1) == [[1, 2], [4, 3]]\", \"assert generate_spiral(3, 3, 0, 1) == [[0, 1, 2], [7, 8, 3], [6, 5, 4]]\", \"assert generate_spiral(1, 5, 7, 1) == [[7, 8, 9, 10, 11]]\", \"assert generate_...
{ "split": "train", "index": 80338, "acecode_id": "evol_8929", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a Python function that returns a dictionary. Each key of the dictionary should represent a unique character from the original strings and the value would be a count of how many strings contain that character. The function should treat uppercase an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_strings_with_characters(['abc', 'def', 'ghi']) == {'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 1, 'f': 1, 'g': 1, 'h': 1, 'i': 1}\", \"assert count_strings_with_characters(['A', 'a', 'B', 'b']) == {'a': 2, 'b': 2}\", \"assert count_strings_with_characters(['s...
{ "split": "train", "index": 80339, "acecode_id": "evol_843", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given two lists of integers, implement a function that returns a new list containing the intersection of the two input lists. The intersection should maintain the order of elements as they appear in the first list, and the lists may contain duplicates. You should not use any bu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersect_lists([1, 2, 2, 3], [2, 2, 3, 4]) == [2, 2, 3]\", \"assert intersect_lists([4, 5, 6, 7], [8, 9, 4, 5]) == [4, 5]\", \"assert intersect_lists([1, 1, 1], [1, 1]) == [1, 1]\", \"assert intersect_lists([1, 2, 3], [4, 5, 6]) == []\", \"assert intersect_...
{ "split": "train", "index": 80340, "acecode_id": "evol_18072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with formatting a test case identifier from a given string. The input string can be in one of the following formats: '-[TestClass TestMethod]' or '[TestClass/TestMethod]'. Your goal is to convert this input into a standardized format 'TestClass/TestMethod'. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_test_case('[TestClass/TestMethod]') == 'TestClass/TestMethod'\", \"assert format_test_case('[SomeClass/SomeMethod]') == 'SomeClass/SomeMethod'\", \"assert format_test_case('[Test1/Test2]') == 'Test1/Test2'\", \"assert format_test_case('[IntegrationTes...
{ "split": "train", "index": 80341, "acecode_id": "bigcode_python_fns_45875", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given integer is a palindrome. An integer is considered a palindrome if it reads the same backward as forward. For example, the integers 121 and -121 are palindromes, while 123 is not. Your function should accept a single integer as input a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome(121) == True\", \"assert is_palindrome(-121) == False\", \"assert is_palindrome(12321) == True\", \"assert is_palindrome(0) == True\", \"assert is_palindrome(10) == False\", \"assert is_palindrome(1) == True\", \"assert is_palindrome(-1) == Fal...
{ "split": "train", "index": 80342, "acecode_id": "evol_20530", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a list of shot lengths in a movie, where shot length refers to the duration of a single continuous shot in a film. Your function should take a list of positive integers representing shot lengths and return a dictionary that contains the frequency o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_shot_length_frequency([10, 20, 10, 30, 20, 10]) == {10: 3, 20: 2, 30: 1}\", \"assert calculate_shot_length_frequency([5, 5, 5, 5]) == {5: 4}\", \"assert calculate_shot_length_frequency([]) == {}\", \"assert calculate_shot_length_frequency([1]) == {...
{ "split": "train", "index": 80343, "acecode_id": "oss_17471", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `name` and a dictionary `sort` which contains a key `length` representing the length of a floating-point number, implement a function `create_floating_point_symbol(name: str, sort: Dict[str, int], explicit_name: Optional[bool] = None) -> str` that generates a uni...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_floating_point_symbol('symbol', {'length': 4}, explicit_name=True) == 'FP_symbol'\", \"assert create_floating_point_symbol('number', {'length': 5}, explicit_name=True) == 'FP_number'\", \"assert create_floating_point_symbol('example', {'length': 2}, e...
{ "split": "train", "index": 80344, "acecode_id": "bigcode_python_fns_34767", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, lst1 and lst2. Your task is to determine if it is possible to swap an arbitrary number of elements between the two lists such that lst1 contains only prime numbers, while the total sum of elements in both lists remains unchanged. The swaps m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert exchange([4, 6, 8, 9], [1, 5, 3, 4]) == 'NO'\", \"assert exchange([2, 3, 5], [1, 4, 6]) == 'YES'\", \"assert exchange([9, 10, 12], [2, 3, 5]) == 'NO'\", \"assert exchange([15, 25, 35], [2, 7, 11]) == 'NO'\", \"assert exchange([4, 4, 4], [2, 2, 2]) == 'NO'\",...
{ "split": "train", "index": 80345, "acecode_id": "evol_27733", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of strings representing file paths. The function should identify and return a new list containing only the absolute paths from the input list. An absolute path is defined as a path that starts with a forward slas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_absolute_paths(['/home/user/file.txt', 'relative/path', 'C:\\\\Program Files\\\\app.exe', 'another/relative/path']) == ['/home/user/file.txt', 'C:\\\\Program Files\\\\app.exe']\", \"assert get_absolute_paths(['C:\\\\Windows\\\\system32', '/usr/local/bin'...
{ "split": "train", "index": 80346, "acecode_id": "bigcode_python_fns_21559", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing an issue. The issue can have a field called 'epic_link' which contains the key of its parent epic. In some cases, the issue may also have a 'parent' field, which itself is a dictionary that contains a 'key' field representing the parent e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_parent_epic({'epic_link': 'EPIC-123'}) == 'EPIC-123'\", \"assert get_parent_epic({'parent': {'key': 'EPIC-456'}}) == 'EPIC-456'\", \"assert get_parent_epic({'epic_link': None}) == None\", \"assert get_parent_epic({}) == None\", \"assert get_parent_epic({...
{ "split": "train", "index": 80347, "acecode_id": "bigcode_python_fns_39736", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of directory paths and a file path. Your task is to implement a function that returns the relative path of the file with respect to the first matching directory in the list. If the file path does not start with any of the provided directory paths, return No...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_relative_path('/home/user/documents/report.txt', ['/home/user/']) == 'documents/report.txt'\", \"assert get_relative_path('/home/user/documents/report.txt', ['/home/user/', '/var/log/']) == 'documents/report.txt'\", \"assert get_relative_path('/var/log/s...
{ "split": "train", "index": 80348, "acecode_id": "bigcode_python_fns_14379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that divides a list of genes into a specified number of equal parts for parallel processing. The function should take a list of genes (each gene represented as a string) and the number of processes. It should return a list of lists, w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert divide_genes(['geneA', 'geneB', 'geneC', 'geneD', 'geneE'], 2) == [['geneA', 'geneB', 'geneC'], ['geneD', 'geneE']]\", \"assert divide_genes(['gene1', 'gene2', 'gene3', 'gene4', 'gene5', 'gene6'], 3) == [['gene1', 'gene2'], ['gene3', 'gene4'], ['gene5', 'gen...
{ "split": "train", "index": 80349, "acecode_id": "oss_11231", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given list of words can be stored in a Trie data structure and then checks if specific words are present in the Trie. The function should take two parameters: a list of words and a list of words to search. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_words_in_trie(['apple', 'banana', 'grape'], ['apple', 'orange', 'grape']) == [True, False, True]\", \"assert check_words_in_trie(['cat', 'dog', 'fish'], ['cat', 'bat', 'fish']) == [True, False, True]\", \"assert check_words_in_trie(['hello', 'world'], ...
{ "split": "train", "index": 80350, "acecode_id": "oss_3785", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with constructing a valid URL from its individual components: protocol, subdomain, domain, country code top-level domain (ccTLD), resource path, and request method (GET or POST). Implement a function `validate_and_construct_url(protocol: str, subdomain: str, doma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_construct_url('sftp', 'mypage', 'google', '.co.uk', 'search/bookmarks/pages', 'GET') == 'sftp://mypage.google.co.uk/search/bookmarks/pages'\", \"assert validate_and_construct_url('http', 'mypage', 'google', '.co.uk', 'search/bookmarks/pages', 'P...
{ "split": "train", "index": 80351, "acecode_id": "evol_19553", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of filenames, write a function `upload_files(filenames: List[str]) -> Dict[str, Union[str, List[str]]]` that simulates the process of uploading files. The function should return a dictionary with a message indicating that the files have been uploaded and a list of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_files(['data.csv', 'data.csv', 'data.xlsx', 'data.csv']) == {'message': 'Files uploaded', 'files': ['data.csv', 'data.xlsx']}\", \"assert upload_files(['report.pdf', 'summary.docx']) == {'message': 'Files uploaded', 'files': ['report.pdf', 'summary.do...
{ "split": "train", "index": 80352, "acecode_id": "bigcode_python_fns_19966", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a string `sentence` consisting of words separated by underscores ('_') and a dictionary `word_to_index` that maps each unique word to a non-negative integer index, implement a function `convert_sentence_to_indices(sentence: str, word_to_index: Dict[str, int], max_length: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_sentence_to_indices('hello_world_python', {'hello': 1, 'world': 2, 'python': 3}, 5) == [1, 2, 3, 0, 0]\", \"assert convert_sentence_to_indices('cat_dog', {'cat': 4, 'dog': 5}, 4) == [4, 5, 0, 0]\", \"assert convert_sentence_to_indices('apple_orange',...
{ "split": "train", "index": 80353, "acecode_id": "bigcode_python_fns_31532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `title`, return a string that represents the page title displayed on browser tabs. The returned string should be formatted as '{title} | NeuraHS'. Write a function `get_page_title(title: str) -> str` that takes a single parameter `title` and returns the formatted...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_page_title('Home') == 'Home | NeuraHS'\", \"assert get_page_title('About Us') == 'About Us | NeuraHS'\", \"assert get_page_title('Contact') == 'Contact | NeuraHS'\", \"assert get_page_title('Services') == 'Services | NeuraHS'\", \"assert get_page_title('...
{ "split": "train", "index": 80354, "acecode_id": "bigcode_python_fns_16070", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that generates a manifest JSON object based on the provided parameters related to digital certificates. The function should take in the following parameters: a responder URL (string), a subject certificate (byte string), an issuer certif...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_manifest('http://example.com', b'certificate_subject', b'certificate_issuer', '123e4567-e89b-12d3-a456-426614174000', '2023-10-01T10:00:00Z') == ({'responder_url': 'http://example.com', 'subject_certificate': 'Y2VydGlmaWNhdGVfc3ViamVjdA==', 'issuer_...
{ "split": "train", "index": 80355, "acecode_id": "oss_7796", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Design and implement a simple cache system that supports the following operations: 1. `insert(key, value)`: Inserts the value at the specified key. If the key is already in the cache, update the value. If adding a new item exceeds a predefined cache size limit (e.g., 100 items)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cache_operations(['insert 1 10', 'insert 2 20', 'get 1']) == [(1, 10), (2, 20)]\", \"assert cache_operations(['insert 1 10', 'insert 1 15', 'get 1']) == [(1, 15)]\", \"assert cache_operations(['insert 1 10', 'insert 2 20', 'delete 1', 'get 1']) == [(2, 20)]\...
{ "split": "train", "index": 80356, "acecode_id": "evol_4567", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `labels_pred` and `labels_true`, representing the predicted labels and true labels of objects respectively, implement a function that calculates the efficiency and completeness of the predictions. Efficiency is defined as the ratio of correctly pred...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_efficiency_completeness([-1, -1, -1], [0, 1, 1]) == (0.0, 0.0)\", \"assert calculate_efficiency_completeness([2, 2, 2], [2, 2, 2]) == (1.0, 1.0)\", \"assert calculate_efficiency_completeness([1, 2, 3, 4], [1, 2, 3, -1]) == (0.75, 1.0)\", \"assert c...
{ "split": "train", "index": 80357, "acecode_id": "bigcode_python_fns_37505", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function `select_random_elements(lst: List[int], n: int) -> List[int]` that randomly selects `n` unique items from a given list `lst`. The function should return the selected items in any order. If `n` is greater than the length of `lst`, the function should raise a `Va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_random_elements([1, 2, 3, 4, 5], 3) != select_random_elements([1, 2, 3, 4, 5], 3)\", \"assert len(select_random_elements([1, 2, 3, 4, 5], 2)) == 2\", \"assert select_random_elements([1, 2, 3], 2) != select_random_elements([1, 2, 3], 2)\", \"assert len...
{ "split": "train", "index": 80358, "acecode_id": "evol_23867", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a farmland, where each cell contains an integer value that indicates the yield of a specific crop. Your task is to implement a function `dissatisfaction(farmland)` that calculates the dissatisfaction level of the farmland. The dissatisfactio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dissatisfaction([[3, 7, 2], [9, 5, 8], [6, 4, 1]]) == 8\", \"assert dissatisfaction([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 8\", \"assert dissatisfaction([[10, 20], [30, 40]]) == 30\", \"assert dissatisfaction([[5]]) == 0\", \"assert dissatisfaction([[5, 5], [...
{ "split": "train", "index": 80359, "acecode_id": "oss_27088", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement the function `multiply_three_numbers` that takes three integers as input and returns their product. The function should only accept integer values and return an integer result.\nPlease reason step by step, then write a self-contained Python solution. Give your final p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_three_numbers(1, 2, 3) == 6\", \"assert multiply_three_numbers(0, 5, 10) == 0\", \"assert multiply_three_numbers(-1, -2, -3) == -6\", \"assert multiply_three_numbers(-1, 2, 3) == -6\", \"assert multiply_three_numbers(4, 5, 6) == 120\", \"assert mult...
{ "split": "train", "index": 80360, "acecode_id": "evol_15306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `revert_commit(sha: str) -> str` that takes a SHA key of a commit as input and simulates reverting a Git repository to that commit. The function should return a message indicating whether the revert was successful or if it encountered a conflict. For simplicity...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert revert_commit('a1b2c3d4') == 'Revert encountered a conflict.'\", \"assert revert_commit('b1c2d3e4') == 'Revert was successful.'\", \"assert revert_commit('a5f6g7h8') == 'Revert encountered a conflict.'\", \"assert revert_commit('c9d0e1f2') == 'Revert was suc...
{ "split": "train", "index": 80361, "acecode_id": "evol_30299", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `change(test)` that takes a single parameter `test`. The parameter can be either an integer or a floating-point number. The function should return a string based on the value of `test`: if `test` exceeds 1000, return 'Value is too high'; if `test` is greate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change(3.5) == 'Value is equal or below 10'\", \"assert change(10) == 'Value is equal or below 10'\", \"assert change(10.0) == 'Value is equal or below 10'\", \"assert change(11) == 'Value is above 10'\", \"assert change(100.5) == 'Value is above 10'\", \"as...
{ "split": "train", "index": 80362, "acecode_id": "evol_4462", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists of integers `full_sq` and `life_sq`, which represent the full area and living area of different properties, respectively. Your task is to create a new list that contains the difference between the corresponding elements of `full_sq` and `life_sq`. Implem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_extra_area([50, 60, 70], [30, 40, 50]) == [20, 20, 20]\", \"assert calculate_extra_area([100, 200, 300], [50, 150, 250]) == [50, 50, 50]\", \"assert calculate_extra_area([30, 40, 50], [30, 40, 50]) == [0, 0, 0]\", \"assert calculate_extra_area([10,...
{ "split": "train", "index": 80363, "acecode_id": "bigcode_python_fns_13522", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings where each string represents the quantity of various fruits in a supply unit (formatted as \"X fruitName\"), an integer indicating the total cost of the fruits, a list of fruit names, and a dictionary mapping each fruit name to its price, implement a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fruit_distribution(['3 bananas'], 15, ['bananas', 'grapes'], {'bananas': 1, 'grapes': 2}) == {'grapes': 6}\", \"assert fruit_distribution(['1 apple'], 3, ['banana', 'kiwi'], {'apple': 1, 'banana': 2, 'kiwi': 3}) == {'banana': 1}\", \"assert fruit_distributio...
{ "split": "train", "index": 80364, "acecode_id": "evol_26808", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string that contains multiple nested groups of round, square, and curly brackets, your task is to segregate these bracket groups into separate string segments and return them in the form of a list. Each distinct group is balanced (every opening brace has a corresponding...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert separate_bracket_groups(' ( ) (( )) {[()]} (( )( )) ') == ['()', '(())', '{[()]}', '(()())']\", \"assert separate_bracket_groups(' [ ] { } ( ) ') == ['[]', '{}', '()']\", \"assert separate_bracket_groups(' ( ) ( ) ( ) ') == ['()', '()', '()']\", \"assert sep...
{ "split": "train", "index": 80365, "acecode_id": "evol_18299", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that takes two strings and returns a list of unique common characters between them, in the order of their first appearance in the first string. The result should not contain any duplicates. If there are no common characters, return an empty list.\nPlease re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_chars('apple', 'applesauce') == ['a', 'p', 'l', 'e']\", \"assert common_chars('abc', 'def') == []\", \"assert common_chars('same', 'same') == ['s', 'a', 'm', 'e']\", \"assert common_chars('unique', 'unicorn') == ['u', 'n', 'i']\", \"assert common_char...
{ "split": "train", "index": 80366, "acecode_id": "evol_18369", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a set of URIs representing various ontology labels and returns a dictionary where the keys are the URI prefixes and the values are the count of unique labels for each prefix. The URI prefix is defined as the part of the URI...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_uri_prefixes({\\\"http://example.com/ontology#Label1\\\", \\\"http://example.com/ontology#Label2\\\", \\\"http://another.com/ontology#Label3\\\"}) == {\\\"http://example.com/ontology\\\": 2, \\\"http://another.com/ontology\\\": 1}\", \"assert count_uri...
{ "split": "train", "index": 80367, "acecode_id": "oss_35299", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage project settings for a cloud-based identity service. The function should allow for setting and retrieving attributes related to project configuration. Implement a function named `manage_project_settings` that takes in two pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_project_settings('example_domain', True) == {'domain_id': 'example_domain', 'authorization_enabled': True}\", \"assert manage_project_settings('test_domain', False) == {'domain_id': 'test_domain', 'authorization_enabled': False}\", \"assert manage_pro...
{ "split": "train", "index": 80368, "acecode_id": "oss_33627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of objects that represent different types of fabrics and their properties. Each fabric has a name (a string) and a thickness (a float). Write a function `get_thinnest_fabric(fabrics: List[Dict[str, Union[str, float]]]) -> Dict[str, float]` that takes in a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_thinnest_fabric([]) == {}\", \"assert get_thinnest_fabric([{ 'name': 'Cotton', 'thickness': 0.5 }, { 'name': 'Silk', 'thickness': 0.3 }, { 'name': 'Wool', 'thickness': 0.8 }]) == {'name': 'Silk', 'thickness': 0.3}\", \"assert get_thinnest_fabric([{ 'name...
{ "split": "train", "index": 80369, "acecode_id": "bigcode_python_fns_115", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates an HTML representation of the <samp> element, which is used to indicate sample output from a computer program. The function should take a variable number of string arguments, which will be the inner text of the <samp> eleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_samp('Hello World') == '<samp>Hello World</samp>'\", \"assert generate_samp('Sample output', 'of a program') == '<samp>Sample output of a program</samp>'\", \"assert generate_samp() == '<samp></samp>'\", \"assert generate_samp('Line 1', 'Line 2', 'L...
{ "split": "train", "index": 80370, "acecode_id": "bigcode_python_fns_20592", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates updating trade volumes for a given list of currency pairs based on their recent trades. The function should take a list of tuples where each tuple contains a currency pair (as a string, e.g., 'USD/EUR') and a trade volu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_trade_volumes([('USD/EUR', 100.0), ('USD/EUR', 150.0), ('GBP/USD', 200.0)]) == {'USD/EUR': 250.0, 'GBP/USD': 200.0}\", \"assert update_trade_volumes([('JPY/GBP', 50.0), ('JPY/GBP', 75.0)]) == {'JPY/GBP': 125.0}\", \"assert update_trade_volumes([]) == ...
{ "split": "train", "index": 80371, "acecode_id": "bigcode_python_fns_35005", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that toggles the state of a boolean variable representing the 'enabled' status of a robot's inverse kinematic solution. The function should accept a list of boolean values, where each value represents the current state of the inverse kine...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert toggle_ik_solutions([True, False, True]) == [False, True, False]\", \"assert toggle_ik_solutions([False, False, False]) == [True, True, True]\", \"assert toggle_ik_solutions([True]) == [False]\", \"assert toggle_ik_solutions([False]) == [True]\", \"assert to...
{ "split": "train", "index": 80372, "acecode_id": "bigcode_python_fns_10670", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the product of all the non-zero elements in a given list of integers. Your function should take a list of integers as input and return the product of all the non-zero elements in the list. If the list is empty or if...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_product([8, 2, 3, -1, 7]) == -336\", \"assert calculate_product([0, 0, 0]) == 1\", \"assert calculate_product([]) == 1\", \"assert calculate_product([5, 0, 2]) == 10\", \"assert calculate_product([1, 2, 3, 4]) == 24\", \"assert calculate_product([-...
{ "split": "train", "index": 80373, "acecode_id": "oss_35690", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates the full name of a practitioner based on their first name and an optional second name. The function should take in two parameters: `first_name` (a string) and `second_name` (an optional string). If the `second_name` is not ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_full_name('John', 'Doe') == 'John Doe'\", \"assert generate_full_name('Jane') == 'Jane'\", \"assert generate_full_name('Alice', '') == 'Alice'\", \"assert generate_full_name('Bob', 'Smith') == 'Bob Smith'\", \"assert generate_full_name('David', 'Joh...
{ "split": "train", "index": 80374, "acecode_id": "oss_22002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to write a function that returns a list of the visible building heights from the left side of the skyline. A building is considered visible if no taller building stands to its left...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert visible_buildings([4, 2, 3, 1, 5]) == [4, 5]\", \"assert visible_buildings([1, 3, 2, 4]) == [1, 3, 4]\", \"assert visible_buildings([5, 4, 3, 2, 1]) == [5]\", \"assert visible_buildings([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert visible_buildings([2, 1,...
{ "split": "train", "index": 80375, "acecode_id": "bigcode_python_fns_4381", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a unique slug for a given room name. The slug should be URL-friendly and must ensure that it is unique across a list of existing slugs. The slug should be derived from the room name using the following rules: 1. Convert...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_slug('Deluxe Room', ['deluxe-room', 'deluxe-room-1']) == 'deluxe-room-2'\", \"assert generate_unique_slug('Standard Room', ['standard-room', 'standard-room-1', 'standard-room-2']) == 'standard-room-3'\", \"assert generate_unique_slug('Family ...
{ "split": "train", "index": 80376, "acecode_id": "oss_37655", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a list of integers from a given start to end value, inclusive. The function should take two integers, `start` and `end`, and return a list of integers that includes all values starting from `start` to `end`. If `end` is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_integers(1, 5) == [1, 2, 3, 4, 5]\", \"assert generate_integers(0, 0) == [0]\", \"assert generate_integers(3, 3) == [3]\", \"assert generate_integers(5, 10) == [5, 6, 7, 8, 9, 10]\", \"assert generate_integers(-2, 2) == [-2, -1, 0, 1, 2]\", \"assert...
{ "split": "train", "index": 80377, "acecode_id": "oss_25212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes image categories. The function should take in a category string and return a specific image URL based on the category. If the category is 'dog', it should return the URL of a dog image. If the category is 'book', it ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_image('dog') == 'https://example.com/dog_image.jpg'\", \"assert get_image('book') == 'https://example.com/book_image.jpg'\", \"assert get_image('cat') == 'https://example.com/dog_image.jpg'\", \"assert get_image('bird') == 'https://example.com/dog_image....
{ "split": "train", "index": 80378, "acecode_id": "oss_11946", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple logging system. The function should take in an error message as input and return the error message as a string. Your function should not write to any files or print to the console. Instead, it should simply ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_logger(\\\"File not found\\\") == \\\"File not found\\\"\", \"assert simple_logger(\\\"Access denied\\\") == \\\"Access denied\\\"\", \"assert simple_logger(\\\"Connection timed out\\\") == \\\"Connection timed out\\\"\", \"assert simple_logger(\\\"In...
{ "split": "train", "index": 80379, "acecode_id": "oss_24610", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a recursive function in Python to calculate the greatest common divisor (GCD) of three numbers. The function should take three integer inputs and return their GCD. For example, given the inputs a = 48, b = 64, c = 80, the function should return 16.\nPlease reason step by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert GCD_Three_Numbers(48, 64, 80) == 16\", \"assert GCD_Three_Numbers(50, 75, 100) == 25\", \"assert GCD_Three_Numbers(9, 12, 15) == 3\", \"assert GCD_Three_Numbers(7, 14, 21) == 7\", \"assert GCD_Three_Numbers(100, 200, 300) == 100\", \"assert GCD_Three_Numbers...
{ "split": "train", "index": 80380, "acecode_id": "evol_23294", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a start date and an end date, write a function that calculates the number of days between these two dates, inclusive. The function should take two strings as input representing the dates in 'YYYY-MM-DD' format and return an integer representing the total number of days. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_days('2023-01-01', '2023-01-10') == 10\", \"assert calculate_days('2023-01-10', '2023-01-01') == 0\", \"assert calculate_days('2023-02-01', '2023-02-01') == 1\", \"assert calculate_days('2023-03-01', '2023-03-05') == 5\", \"assert calculate_days('2...
{ "split": "train", "index": 80381, "acecode_id": "bigcode_python_fns_24033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining whether a player-controlled character can safely move to a specified destination cell in a grid-based game. The grid is represented by a 2D array where each cell can either be empty or occupied by enemy characters. Given the destination cell's co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_safe_to_move((1, 1), (0, 0), [(2, 2), (3, 3)]) == True\", \"assert is_safe_to_move((0, 1), (0, 0), [(0, 1)]) == False\", \"assert is_safe_to_move((3, 3), (2, 2), [(1, 1), (2, 3)]) == True\", \"assert is_safe_to_move((0, 0), (0, 1), [(0, 0)]) == False\", \...
{ "split": "train", "index": 80382, "acecode_id": "oss_21117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers `step_number` and `tail_start`, and a floating-point number `body_value`, write a function `calculate_learning_rate(step_number: int, tail_start: int, body_value: float) -> float` that computes a learning rate value. The learning rate is calculated using the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_learning_rate(4, 1, 2.0) == 1.0\", \"assert calculate_learning_rate(9, 4, 3.0) == 2.0\", \"assert calculate_learning_rate(25, 9, 5.0) == 3.0\", \"assert calculate_learning_rate(100, 36, 4.0) == 2.4\", \"assert calculate_learning_rate(49, 49, 7.0) =...
{ "split": "train", "index": 80383, "acecode_id": "bigcode_python_fns_49246", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that converts a numeric input into its respective roman numeral representation in lower case, or converts a roman numeral back to its integer equivalent. The function should take two parameters: `number`, which can either be an integer (1 to 1000) or a roma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_number(1, 'int_to_roman') == 'i'\", \"assert convert_number(4, 'int_to_roman') == 'iv'\", \"assert convert_number(9, 'int_to_roman') == 'ix'\", \"assert convert_number(10, 'int_to_roman') == 'x'\", \"assert convert_number(40, 'int_to_roman') == 'xl'\...
{ "split": "train", "index": 80384, "acecode_id": "evol_11115", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the distance between two points in a 2D plane. The points are represented as tuples of two elements, where the first element is the x-coordinate and the second element is the y-coordinate. The distance between two points ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance((1, 2), (4, 6)) == 5.0\", \"assert calculate_distance((0, 0), (3, 4)) == 5.0\", \"assert calculate_distance((2, 3), (2, 3)) == 0.0\", \"assert calculate_distance((-1, -1), (1, 1)) == 2.8284271247461903\", \"assert calculate_distance((-3, -...
{ "split": "train", "index": 80385, "acecode_id": "oss_26521", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer value, implement a function that returns the value itself if it is non-negative. If the value is negative, return zero. Your task is to write a function `cast_to_non_negative(value: int) -> int` that performs this operation. The function should take a single in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cast_to_non_negative(5) == 5\", \"assert cast_to_non_negative(0) == 0\", \"assert cast_to_non_negative(-3) == 0\", \"assert cast_to_non_negative(10) == 10\", \"assert cast_to_non_negative(-1) == 0\", \"assert cast_to_non_negative(-100) == 0\", \"assert cast_...
{ "split": "train", "index": 80386, "acecode_id": "bigcode_python_fns_44244", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that accepts a list of integers and returns a tuple containing the product of the numbers in the list and a Boolean value indicating whether the product is a prime number. The function should handle edge cases such as an empty list and lists containing negative...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_product_prime([2, 3, 5]) == (30, False)\", \"assert is_product_prime([7]) == (7, True)\", \"assert is_product_prime([1]) == (1, False)\", \"assert is_product_prime([]) == (1, False)\", \"assert is_product_prime([-2, -3, -5]) == (-30, False)\", \"assert is...
{ "split": "train", "index": 80387, "acecode_id": "evol_4245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a session cookie based on certain criteria. The session cookie is a string that contains information about the user's session. Your function should check if the session cookie meets the following conditions: 1. The c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_session_cookie('sessionid=1234567890') == True\", \"assert validate_session_cookie('sessionid=abcdefghij') == True\", \"assert validate_session_cookie('sessionid=abc!@#') == False\", \"assert validate_session_cookie('sessionid=') == False\", \"asser...
{ "split": "train", "index": 80388, "acecode_id": "oss_4401", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that creates a new class using a provided metaclass. The function should take three parameters: the name of the class (a string), a list of base classes (a list of class objects), and a dictionary of attributes (a dictionary of name-value pairs). The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_class('TestClass', [], {}) is not None\", \"assert create_class('MyClass', [object], {'attr1': 10}).__name__ == 'MyClass'\", \"assert create_class('EmptyClass', [], {}).__base__ == object\", \"assert create_class('ClassWithMethod', [], {'method': lamb...
{ "split": "train", "index": 80389, "acecode_id": "evol_35613", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a limit `n`, implement a function `count_prime_sums(n: int) -> int` that returns the number of distinct integers less than `n` that can be represented as the sum of a prime number squared, a different prime number cubed, and a third prime number raised to the fourth power...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_prime_sums(10) == 0\", \"assert count_prime_sums(1) == 0\", \"assert count_prime_sums(2) == 0\", \"assert count_prime_sums(3) == 0\", \"assert count_prime_sums(4) == 0\", \"assert count_prime_sums(5) == 0\", \"assert count_prime_sums(6) == 0\", \"asser...
{ "split": "train", "index": 80390, "acecode_id": "evol_30020", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of users and their corresponding permissions and returns a dictionary where the keys are the usernames and the values are the permissions granted to each user. Implement a function `generate_whitelist(users, permissions)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_whitelist(['user1', 'user2'], ['read', 'write']) == {'user1': 'read', 'user2': 'write'}\", \"assert generate_whitelist(['user1'], ['read']) == {'user1': 'read'}\", \"assert generate_whitelist(['user1', 'user2', 'user3'], ['read', 'write']) == {'user...
{ "split": "train", "index": 80391, "acecode_id": "oss_28352", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that takes a single integer `n` (1-indexed) and returns the nth value in the Fibonacci series. The Fibonacci series is defined as follows: F(1) = 0, F(2) = 1, and F(n) = F(n-1) + F(n-2) for n > 2. Your function should return the F...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(1) == 0\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 1\", \"assert fibonacci(4) == 2\", \"assert fibonacci(5) == 3\", \"assert fibonacci(6) == 5\", \"assert fibonacci(7) == 8\", \"assert fibonacci(8) == 13\", \"assert fibonacci(9) == 2...
{ "split": "train", "index": 80392, "acecode_id": "evol_24001", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that splits the list into two equal halves. If the list has an odd number of elements, the first half should have one more element than the second half. The function should return a tuple containing the two halves as lists. If the inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_list([1, 2, 3, 4]) == ([1, 2], [3, 4])\", \"assert split_list([1, 2, 3]) == ([1, 2], [3])\", \"assert split_list([1]) == ([1], [])\", \"assert split_list([]) == ([], [])\", \"assert split_list([10, 20, 30, 40, 50]) == ([10, 20, 30], [40, 50])\", \"asse...
{ "split": "train", "index": 80393, "acecode_id": "bigcode_python_fns_21990", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `count_arguments` that takes a variable number of positional arguments and keyword arguments, and returns the total count of all arguments passed to the function. The function should count both positional and keyword arguments. For example, if the function is c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_arguments(1, 2, 3) == 3\", \"assert count_arguments(a=1, b=2) == 2\", \"assert count_arguments(1, 2, 3, a=4) == 4\", \"assert count_arguments() == 0\", \"assert count_arguments(1) == 1\", \"assert count_arguments(1, 2, a=3, b=4, c=5) == 5\", \"assert c...
{ "split": "train", "index": 80394, "acecode_id": "evol_19900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple client-server interaction. The function should accept a client identifier (a string), and a message (also a string) to send to a server. The server responds with a fixed reply that combines the client identifier an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert client_response('Client-1', 'HELLO') == 'Client Client-1 says: HELLO'\", \"assert client_response('Client-2', 'GOODBYE') == 'Client Client-2 says: GOODBYE'\", \"assert client_response('Client-3', 'TESTING') == 'Client Client-3 says: TESTING'\", \"assert clie...
{ "split": "train", "index": 80395, "acecode_id": "bigcode_python_fns_9392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_max(words, case_sensitive=False)` that accepts a list of distinct strings as input and returns the word that contains the greatest number of unique characters. In case of a tie, the function should return the word that comes first lexicographically. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max(['Apple', 'apple'], True) == 'Apple'\", \"assert find_max(['abcd', 'efgh', 'ijkl']) == 'abcd'\", \"assert find_max(['a', 'b', 'c', 'd', 'e']) == 'a'\", \"assert find_max(['hello', 'world', 'python']) == 'python'\", \"assert find_max(['unique', 'char...
{ "split": "train", "index": 80396, "acecode_id": "evol_20363", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string `policy_type_id` that represents a policy type ID in the format 'storage-policy-XXXXXX', where 'XXXXXX' is a sequence of digits. Your task is to implement a function that verifies whether the given policy type ID is valid. A valid policy type ID starts wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_policy_type_id('storage-policy-00000001') == 1\", \"assert verify_policy_type_id('storage-policy-123456') == 123456\", \"assert verify_policy_type_id('storage-policy-999999') == 999999\", \"assert verify_policy_type_id('storage-policy-000001') == 1\",...
{ "split": "train", "index": 80397, "acecode_id": "bigcode_python_fns_15282", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, 'left' and 'right', implement a function that merges these two lists into a single list by performing a database-style 'inner' join. An 'inner' join means that only the elements that appear in both lists should be included in the result. The merged ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_lists([1, 2, 3], [2, 3, 4]) == [2, 3]\", \"assert merge_lists([5, 6, 7], [7, 8, 9]) == [7]\", \"assert merge_lists([1, 1, 2], [2, 2, 3]) == [2]\", \"assert merge_lists([-1, 0, 1], [0, 1, 2]) == [0, 1]\", \"assert merge_lists([10, 20, 30], [30, 40, 50])...
{ "split": "train", "index": 80398, "acecode_id": "bigcode_python_fns_25240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s, write a function `make_palindrome(s: str) -> str` that modifies the string to form a palindrome. The modification involves appending the reverse of the non-palindromic suffix of s (after filtering out non-alphanumeric characters and converting it to lowercase)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_palindrome('race!car') == 'race!car'\", \"assert make_palindrome('123@abc') == '123@abcba321'\", \"assert make_palindrome('') == ''\", \"assert make_palindrome('abc') == 'abcba'\", \"assert make_palindrome('madam') == 'madam'\", \"assert make_palindrome...
{ "split": "train", "index": 80399, "acecode_id": "evol_10875", "num_tests": 12 }