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 tasked with implementing a Python function that processes a dictionary and logs its contents. The function should take in a dictionary called `responseDictionary`, log its contents with a custom logging utility, and then return the original dictionary. The logging shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_and_log({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}\", \"assert process_and_log({'key': 'value'}) == {'key': 'value'}\", \"assert process_and_log({'name': 'Alice', 'age': 30}) == {'name': 'Alice', 'age': 30}\", \"assert process_and_log({}) == {}\", \"asser... | {
"split": "train",
"index": 68100,
"acecode_id": "oss_19459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with decoding a string that contains HTML entities. An HTML entity is a sequence that starts with an ampersand (&) and ends with a semicolon (;). It can be in the form of a named entity (e.g., &) or a numeric character reference (e.g., & or &). Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_html_entities('Hello <World>!') == 'Hello <World>!'\", \"assert decode_html_entities('This is & an example.') == 'This is & an example.'\", \"assert decode_html_entities('The number is #.') == 'The number is #.'\", \"assert decode_html_e... | {
"split": "train",
"index": 68101,
"acecode_id": "bigcode_python_fns_22465",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of events, where each event is represented as a dictionary with the following keys: 'room_id', 'name', 'location', 'start_time', 'end_time', and 'description'. Write a function `get_event_info(events: List[Dict[str, Union[str, int]]], room_id: str) -> Dict[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_event_info([{'room_id': '1', 'name': 'Meeting', 'location': 'Room A', 'start_time': '10:00', 'end_time': '11:00', 'description': 'Team meeting'}, {'room_id': '2', 'name': 'Workshop', 'location': 'Room B', 'start_time': '12:00', 'end_time': '13:00', 'desc... | {
"split": "train",
"index": 68102,
"acecode_id": "bigcode_python_fns_40923",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the peak value of a specific engineering analysis based on a set of parameters. The function `calculate_peak_value` takes a dictionary of parameters, where the parameters include 'plate_imp', 'fab_class', and 'f_yield'. Y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_peak_value({'plate_imp': 3, 'fab_class': 2, 'f_yield': 1}) == 6.0\", \"assert calculate_peak_value({'plate_imp': 4, 'fab_class': 2, 'f_yield': 1}) == 8.0\", \"assert calculate_peak_value({'plate_imp': 5, 'fab_class': 2, 'f_yield': 1}) == 10.0\", \"... | {
"split": "train",
"index": 68103,
"acecode_id": "oss_11596",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_number(n: int, shouldPrintAllPrimeDivisors: bool) -> Union[str, List[int]]` that takes a whole number `n` and a boolean `shouldPrintAllPrimeDivisors`. The function should return 'prime' if `n` is a prime number, or 'composite' if `n` is a composite n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_number(2, False) == 'prime'\", \"assert check_number(3, False) == 'prime'\", \"assert check_number(1, False) == 'composite'\", \"assert check_number(29, False) == 'prime'\", \"assert check_number(97, False) == 'prime'\", \"assert check_number(13, False... | {
"split": "train",
"index": 68104,
"acecode_id": "evol_15086",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of countries with their corresponding attributes as a dictionary. Each country has a name, a hierarchy, and an ISO2 code. Implement a function `get_country_info(countries: Dict[str, Dict[str, str]], country_name: str) -> Dict[str, str]` that retrieves the a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_country_info({\\\"World\\\": {\\\"hierarchy\\\": \\\"common\\\", \\\"iso2\\\": \\\"WW\\\"}, \\\"Some Country\\\": {\\\"hierarchy\\\": \\\"countries\\\", \\\"iso2\\\": \\\"XY\\\"}}, \\\"World\\\") == {\\\"hierarchy\\\": \\\"common\\\", \\\"iso2\\\": \\\"W... | {
"split": "train",
"index": 68105,
"acecode_id": "bigcode_python_fns_47133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `supports_box_chars()` that checks if the encoding of a given system supports specific Unicode box characters. The box characters to check are: '│', '─', '└', '┘', '┌', '┐'. Your function should return `True` if all of these characters ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert supports_box_chars() == True\", \"assert supports_box_chars() == True\", \"assert supports_box_chars() == True\", \"assert supports_box_chars() == True\", \"assert supports_box_chars() == True\", \"assert supports_box_chars() == True\", \"assert supports_box... | {
"split": "train",
"index": 68106,
"acecode_id": "bigcode_python_fns_13616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a list of strings into a specific output format. Implement a function `convert_strings(input_list: List[str], output_format: str) -> List[str]` that takes in a list of strings and a target output format. The function should convert each string in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_strings(['hello', 'world'], 'uppercase') == ['HELLO', 'WORLD']\", \"assert convert_strings(['hello', 'world'], 'lowercase') == ['hello', 'world']\", \"assert convert_strings(['hello', 'world'], 'titlecase') == ['Hello', 'World']\", \"assert convert_s... | {
"split": "train",
"index": 68107,
"acecode_id": "bigcode_python_fns_45351",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that separates the array into two sets such that the absolute difference between the sums of the two sets is maximized. The function should return the two sets and the maximum difference. The two sets should be formed by distribu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_difference_sets([1, 2, 3, 4]) == ([4, 2], [3, 1], 2)\", \"assert max_difference_sets([10, 20, 30, 40]) == ([40, 20], [30, 10], 20)\", \"assert max_difference_sets([5, 15, 25, 35]) == ([35, 15], [25, 5], 20)\", \"assert max_difference_sets([100]) == ([100... | {
"split": "train",
"index": 68108,
"acecode_id": "evol_33979",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function `find_max_sum_subarray(arr: List[int], k: int) -> int` that returns the maximum sum of any contiguous subarray of size `k`. If the length of the array is less than `k`, return 0. The function should have the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_sum_subarray([1, 2, 3, 4, 5], 3) == 12\", \"assert find_max_sum_subarray([2, 1, 5, 1, 3, 2], 3) == 9\", \"assert find_max_sum_subarray([2, 3], 3) == 0\", \"assert find_max_sum_subarray([1, 2, 3, -1, -2, -3], 2) == 5\", \"assert find_max_sum_subarray... | {
"split": "train",
"index": 68109,
"acecode_id": "bigcode_python_fns_30513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values and three integers a, bc, and d that define the bounds for a bell-shaped sigmoidal function, implement a function that applies the bell-shaped sigmoidal transformation to each value in the list. The transformation works as follows: values betwee... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bell_sigmoid_transform([1, 2, 3, 4, 5], 0, 2, 4) == [1.0, 1.0, 0.0, 0.0, 0.0]\", \"assert bell_sigmoid_transform([0, 0, 0], 0, 1, 2) == [0.0, 0.0, 0.0]\", \"assert bell_sigmoid_transform([4, 5], 2, 3, 6) == [0.0, 0.0]\", \"assert bell_sigmoid_transform([5, 3... | {
"split": "train",
"index": 68110,
"acecode_id": "bigcode_python_fns_44381",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function `subsets(arr)` that takes an array of integers `arr` and returns a list of all possible subsets of the array. Each subset should be represented as a list of integers. The output should include the empty set and the set itself. The order of subsets in the output... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subsets([]) == [[]]\", \"assert subsets([1]) == [[], [1]]\", \"assert subsets([1, 2]) == [[], [1], [2], [1, 2]]\", \"assert subsets([0]) == [[], [0]]\", \"assert subsets([5, 6]) == [[], [5], [6], [5, 6]]\", \"assert subsets([4, 4]) == [[], [4], [4], [4, 4]]\... | {
"split": "train",
"index": 68111,
"acecode_id": "evol_8659",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given an alphanumeric string, implement a function that separates the digits and letters from the input string. The function should return two strings: one containing unique digits sorted in ascending order, and the other containing unique letters sorted in alphabetical order. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_sequence('abc123xyz') == ('123', 'abcxyz')\", \"assert split_sequence('') == ('', '')\", \"assert split_sequence('!@#$%^&*()') == ('', '')\", \"assert split_sequence('123abc456def') == ('123456', 'abcdef')\", \"assert split_sequence('A1B2C3D4E5') == ('... | {
"split": "train",
"index": 68112,
"acecode_id": "evol_13921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, each containing a string and an integer, implement a function that removes tuples containing any repeated element in the list. This means if any string or any integer appears more than once in the tuples of the list, all tuples containing them should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_data([('A', 1), ('B', 2), ('C', 3)]) == [('A', 1), ('B', 2), ('C', 3)]\", \"assert get_unique_data([('A', 1), ('B', 2), ('A', 3), ('C', 4)]) == [('B', 2), ('C', 4)]\", \"assert get_unique_data([('X', 7), ('Y', 9), ('X', 6), ('Z', 1), ('A', 9)]) ==... | {
"split": "train",
"index": 68113,
"acecode_id": "evol_27234",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even integers from the original list. The order of the even integers in the new list should be the same as their order in the original list. If there are no even... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([8, 1, 3, 7, 12]) == [8, 12]\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]\", \"assert filter_even_numbers(... | {
"split": "train",
"index": 68114,
"acecode_id": "oss_11910",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that validates a list of integers based on specific criteria. The function should raise a custom `ValidationException` only when all entries in the list are invalid, and the `all` parameter is set to `True`. If any entry in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_list(is_int(min=5), all=False)([5, 6, 7]) is None\", \"assert is_list(is_int(min=10), all=False)([10, 11, 12]) is None\", \"assert is_list(is_int(min=10), all=False)([10, 5]) is None\", \"assert is_list(is_int(min=0), all=False)([-1, -2, 0]) is None\", \"... | {
"split": "train",
"index": 68115,
"acecode_id": "oss_23733",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a 2D matrix of integers, implement a function that returns a new 2D matrix containing the squares of each element in the original matrix. The input matrix can include both positive and negative integers. The function should maintain the original structure of the matrix.\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_matrix([[1, 2], [3, 4]]) == [[1, 4], [9, 16]]\", \"assert square_matrix([[-1, -2], [-3, -4]]) == [[1, 4], [9, 16]]\", \"assert square_matrix([[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert square_matrix([[5]]) == [[25]]\", \"assert square_matrix([[3... | {
"split": "train",
"index": 68116,
"acecode_id": "evol_6334",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two arrays A and B of equal length. You need to implement a function that constructs a new array C by applying a specific function F on every corresponding pair of elements from arrays A and B. The function F(x, y) is defined as follows: If x is even and y is odd,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_array([2, 3], [4, 5]) == [8, 15]\", \"assert construct_array([10], [1]) == [100]\", \"assert construct_array([9, 0], [0, 9]) == [0, 0]\", \"assert construct_array([0, 0], [0, 0]) == [0, 0]\", \"assert construct_array([1, 1, 1], [1, 1, 1]) == [1, 1,... | {
"split": "train",
"index": 68117,
"acecode_id": "evol_5111",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string of ASCII symbols, implement a function `find_most_uncommon_symbol(s: str) -> str` that returns the symbol with the least frequency of its corresponding hexadecimal value. If there are multiple symbols with the same least frequency, return the one with the smalles... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_most_uncommon_symbol('abcde') == 'a'\", \"assert find_most_uncommon_symbol('aabbccddeeff') == 'a'\", \"assert find_most_uncommon_symbol('abcdefgabcdefg') == 'a'\", \"assert find_most_uncommon_symbol('aaaabbbbccccddddeeeeffff') == 'a'\", \"assert find_mo... | {
"split": "train",
"index": 68118,
"acecode_id": "evol_6552",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `primes_in_range(start: int, end: int) -> List[int]` that returns a list of all the prime numbers in the inclusive range from `start` to `end`. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert primes_in_range(2, 10) == [2, 3, 5, 7]\", \"assert primes_in_range(1, 1) == []\", \"assert primes_in_range(10, 10) == []\", \"assert primes_in_range(15, 30) == [17, 19, 23, 29]\", \"assert primes_in_range(20, 25) == [23]\", \"assert primes_in_range(30, 35) =... | {
"split": "train",
"index": 68119,
"acecode_id": "evol_16226",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, implement a function to calculate the factorial of n using a while loop. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. For example, factorial(5) = 5 * 4 * 3 * 2 * 1 = 120. Your function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_while(0) == 1\", \"assert factorial_while(1) == 1\", \"assert factorial_while(2) == 2\", \"assert factorial_while(3) == 6\", \"assert factorial_while(4) == 24\", \"assert factorial_while(5) == 120\", \"assert factorial_while(6) == 720\", \"assert f... | {
"split": "train",
"index": 68120,
"acecode_id": "evol_34432",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine if a given point is inside a polygon defined by a list of vertices. The polygon is represented as a list of points, where each point is a tuple of two integers (x, y) denoting its coordinates. Your function should take in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_point_inside_polygon([(0, 0), (0, 5), (5, 5), (5, 0)], (3, 3)) == True\", \"assert is_point_inside_polygon([(0, 0), (0, 5), (5, 5), (5, 0)], (6, 3)) == False\", \"assert is_point_inside_polygon([(0, 0), (2, 2), (0, 4)], (1, 1)) == True\", \"assert is_poin... | {
"split": "train",
"index": 68121,
"acecode_id": "oss_21535",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps representing the block creation times of a blockchain, sorted in ascending order. Implement a function `get_closest_block_index(timestamps: List[int], target_timestamp: int) -> int` that returns the index of the closest timestamp that is less ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_closest_block_index([1609459200, 1609462800, 1609466400], 1609470000) == 2\", \"assert get_closest_block_index([1609459200], 1609459200) == 0\", \"assert get_closest_block_index([], 1609459200) == -1\", \"assert get_closest_block_index([1609459200, 16094... | {
"split": "train",
"index": 68122,
"acecode_id": "bigcode_python_fns_40601",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function to compute the maximum temperature reading given as a list of temperature strings in Fahrenheit and Celsius. The temperature strings will be formatted as '<number><unit>', where <number> is an integer and <unit> can be either 'F' for Fahrenheit or 'C' for Celsi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_temperature(['212F', '100C']) == '212F'\", \"assert max_temperature(['50F', '50C']) == '122F'\", \"assert max_temperature(['-40F', '-40C']) == '-40F'\", \"assert max_temperature(['0F', '32F', '100F']) == '100F'\", \"assert max_temperature(['-10F', '20C',... | {
"split": "train",
"index": 68123,
"acecode_id": "evol_26723",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string and an integer n, design a function that splits the string into n equal parts. If the string cannot be divided evenly, the last part should contain the remaining characters. Return the parts as a list of strings.\nPlease reason step by step, then write a self-con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_string('This_is_a_test', 3) == ['This_', 'is_a_', 'test']\", \"assert split_string('hello', 1) == ['hello']\", \"assert split_string('testcase', 1) == ['testcase']\", \"assert split_string('equalparts', 10) == ['e', 'q', 'u', 'a', 'l', 'p', 'a', 'r', '... | {
"split": "train",
"index": 68124,
"acecode_id": "evol_6",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of frame annotations for a video, where each frame contains multiple labels. Each label has attributes such as 'ignored', 'category', 'id', 'visibility', and 'box2d' which contains coordinates (x1, x2). Your task is to implement a function `parse_annotation... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_annotations([{0: []}, {1: []}]) == {}\", \"assert parse_annotations([{0: [{'id': '1', 'category': 'pedestrian', 'attributes': {'ignored': False, 'visibility': 1.0}}]}]) == {0: [{'id': '1', 'category': 'pedestrian', 'visibility': 1.0}]}\", \"assert pars... | {
"split": "train",
"index": 68125,
"acecode_id": "bigcode_python_fns_16981",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of events, where each event is represented as a dictionary with at least two fields: 'type_id' (an integer) and 'description' (a string). Your task is to implement a function called `has_cross_not_claimed(event_list)` that checks if there is at least one ev... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_cross_not_claimed([]) == False\", \"assert has_cross_not_claimed([{'type_id': 50, 'description': 'Goalkeeper saved'}]) == False\", \"assert has_cross_not_claimed([{'type_id': 53, 'description': 'Cross not claimed'}]) == True\", \"assert has_cross_not_cla... | {
"split": "train",
"index": 68126,
"acecode_id": "bigcode_python_fns_41884",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to manage authentication tokens for different social media platforms. The function should handle the retrieval and invalidation of tokens for various providers. The function should take two parameters: a list of tokens for different p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_tokens({'Twitter': 'sample_token', 'Facebook': 'another_token'}, 'Twitter', 'retrieve') == 'sample_token'\", \"assert manage_tokens({'Twitter': 'sample_token', 'Facebook': 'another_token'}, 'Instagram', 'retrieve') == 'Provider not supported'\", \"ass... | {
"split": "train",
"index": 68127,
"acecode_id": "oss_13679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a date from the American format (MM/DD/YYYY) to the European format (DD-MM-YYYY). The function should take a single string as input and return the formatted date string. If the input date string is not in the correct format, return 'Invalid Date F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_date_format('02/20/2020') == '20-02-2020'\", \"assert convert_date_format('12/31/1999') == '31-12-1999'\", \"assert convert_date_format('01/01/2021') == '01-01-2021'\", \"assert convert_date_format('11/15/2022') == '15-11-2022'\", \"assert convert_da... | {
"split": "train",
"index": 68128,
"acecode_id": "evol_15160",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing nodes and another dictionary representing edges for a directed graph. Each node has a unique key and a label. The edges dictionary specifies the connections between these nodes. Your task is to implement a function that generates a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_graphic_model({'A': ['Node A'], 'Like': ['Node Like'], 'B': ['Node B']}, {'A': ['B'], 'B': ['Like']}) == [('A', 'Node A', None), ('Like', 'Node Like', 'filled'), ('B', 'Node B', None)]\", \"assert create_graphic_model({'X': ['Node X'], 'Y': ['Node Y']... | {
"split": "train",
"index": 68129,
"acecode_id": "bigcode_python_fns_12845",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two 3D points in space represented by their coordinates (x1, y1, z1) and (x2, y2, z2). Your task is to implement a function that calculates the Euclidean distance between these two points. The Euclidean distance is defined as the square root of the sum of the squa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert euclidean_distance((0, 0, 0), (1, 1, 1)) == 1.7320508075688772\", \"assert euclidean_distance((1, 2, 3), (4, 5, 6)) == 5.196152422706632\", \"assert euclidean_distance((1, 1, 1), (1, 1, 1)) == 0.0\", \"assert euclidean_distance((3, 4, 0), (0, 0, 0)) == 5.0\"... | {
"split": "train",
"index": 68130,
"acecode_id": "bigcode_python_fns_32528",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a specific alarm time is already set in a list of alarms. Each alarm is represented by a dictionary with the following keys: 'title', 'content', 'url_request', and 'alarm_identifier'. The function should take a list of alar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alarm_already_set([{'title': 'Alarm1', 'content': 'Wake up', 'url_request': '2025-12-02T07:00', 'alarm_identifier': 'Wake up alarm'}], '2025-12-02T07:00') is True\", \"assert alarm_already_set([{'title': 'Alarm2', 'content': 'Meeting', 'url_request': '2025-1... | {
"split": "train",
"index": 68131,
"acecode_id": "bigcode_python_fns_47838",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `S`, write a function that determines the length of the longest substring that appears more than once in `S`. If no such substring exists, the function should return `0`. The string `S` is guaranteed to consist only of lowercase English letters and has a length b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_repeating_length('abcd') == 0\", \"assert longest_repeating_length('abbaba') == 2\", \"assert longest_repeating_length('aabcaabdaab') == 3\", \"assert longest_repeating_length('aaaaa') == 4\", \"assert longest_repeating_length('xyzxyz') == 3\", \"ass... | {
"split": "train",
"index": 68132,
"acecode_id": "evol_20822",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the updating of a social media post's attributes based on provided form data. The function should take in the current state of the post as a dictionary with keys 'title', 'content', 'author', and 'tags', and a second di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_post({'title': 'Original Title', 'content': 'Original Content', 'author': 'Author A', 'tags': ['tag1']}, {'title': 'New Title'}) == {'title': 'New Title', 'content': 'Original Content', 'author': 'Author A', 'tags': ['tag1']}\", \"assert update_post({... | {
"split": "train",
"index": 68133,
"acecode_id": "oss_23954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing the output of a command execution. The output contains a line that shows the elapsed time in the format 'real XYmZ.s', where X is the number of minutes, Y is the number of seconds, and Z.s is the decimal part of seconds. Your task is to imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_time('real 2m30.5s') == 150.5\", \"assert parse_time('real 0m15.0s') == 15.0\", \"assert parse_time('real 10m0.0s') == 600.0\", \"assert parse_time('real 5m45.1s') == 345.1\", \"assert parse_time('real 1m0.0s') == 60.0\", \"assert parse_time('real 3m5.... | {
"split": "train",
"index": 68134,
"acecode_id": "bigcode_python_fns_29868",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total price of items in a shopping cart for an e-commerce application. Each item in the cart has a price associated with it. Your goal is to implement a function that takes a list of item prices and returns the total price of all items. Write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_price([10.0, 20.0, 30.0]) == 60.0\", \"assert calculate_total_price([5.5, 2.5, 8.0]) == 16.0\", \"assert calculate_total_price([0.0, 0.0, 0.0]) == 0.0\", \"assert calculate_total_price([100.0, 200.0, 300.0]) == 600.0\", \"assert calculate_tot... | {
"split": "train",
"index": 68135,
"acecode_id": "oss_20430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an ISO 8601 formatted date string, your task is to implement a function that parses the date string and returns the corresponding datetime object. The ISO 8601 format for dates is 'YYYY-MM-DDTHH:MM:SS±hh:mm', where 'T' separates the date and time, and '±hh:mm' represents ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_iso_date('2016-01-30T23:50:00+00:00') == datetime(2016, 1, 30, 23, 50, tzinfo=timezone.utc)\", \"assert parse_iso_date('2020-12-31T15:30:00-05:00') == datetime(2020, 12, 31, 15, 30, tzinfo=timezone(timedelta(hours=-5)))\", \"assert parse_iso_date('2021... | {
"split": "train",
"index": 68136,
"acecode_id": "oss_17462",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries: one mapping individual IDs to family IDs and another mapping individual IDs to batch information. Your task is to write a function that takes these two dictionaries and generates a list of strings formatted as 'FID IID <original attributes> batch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_individuals_info({'id1': 'fam1', 'id2': 'fam2'}, {'id1': 'batch1', 'id2': 'batch2'}) == ['fam1 id1 attr1 attr2 attr3 batch1', 'fam2 id2 attr1 attr2 attr3 batch2']\", \"assert process_individuals_info({'id3': 'fam3'}, {'id3': 'batch3'}) == ['fam3 id3 ... | {
"split": "train",
"index": 68137,
"acecode_id": "bigcode_python_fns_33481",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a string representing markdown output based on the content provided. The function should accept two parameters: `content` (a string representing the text to be converted to markdown) and `php_extra` (a boolean indicating wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_markdown_output('Normal text.', False) == 'Normal text.'\", \"assert generate_markdown_output('Just a term', True) == 'Just a term'\", \"assert generate_markdown_output('One term: One definition', False) == 'One term: One definition'\", \"assert gen... | {
"split": "train",
"index": 68138,
"acecode_id": "oss_2938",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple game character movement system. The game character can move in four cardinal directions (up, down, left, right) based on keyboard inputs. Given the initial position of the character and a list of movements (each movement being one of 'up'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_character(1, 1, ['up', 'up', 'up']) == (1, 4)\", \"assert move_character(5, 5, ['down', 'down', 'left', 'left']) == (3, 3)\", \"assert move_character(0, 0, ['right', 'right', 'down', 'down', 'down']) == (2, -3)\", \"assert move_character(10, 10, ['left'... | {
"split": "train",
"index": 68139,
"acecode_id": "oss_16626",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two integers K and N, write a function `maximize_and_product(K, N)` that returns the maximum possible value of the expression (A * B), where A and B are non-negative integers satisfying the following conditions: 1) A + B = N, and 2) the product of the bitwise ANDs, (A & K... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximize_and_product(1, 0) == 0\", \"assert maximize_and_product(6, 12) == 36\", \"assert maximize_and_product(7, 14) == 49\", \"assert maximize_and_product(0, 0) == 0\", \"assert maximize_and_product(0, 10) == 0\", \"assert maximize_and_product(5, 1) == 0\"... | {
"split": "train",
"index": 68140,
"acecode_id": "oss_27432",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and a pattern string. Your task is to write a function that returns a new list containing only the file names that match the given pattern. The pattern may contain wildcard characters: '*' matches any sequence of characters (including an empty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files(['image1.jpg', 'image2.png', 'test.txt', 'photo.gif'], '*.jpg') == ['image1.jpg']\", \"assert filter_files(['file1.txt', 'file2.txt', 'file3.txt'], 'file?.txt') == ['file1.txt', 'file2.txt', 'file3.txt']\", \"assert filter_files(['data.csv', 'da... | {
"split": "train",
"index": 68141,
"acecode_id": "bigcode_python_fns_29632",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that receives an instance of an Animal subclass and returns the sound that the animal makes. If the provided instance is not an Animal subclass, the function should raise a TypeError. Implement the function `animal_sound(animal)` that tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert animal_sound(Dog('Bingo')) == 'Bark'\", \"assert animal_sound(Cat('Whiskers')) == 'Meow'\", \"assert animal_sound(Dog('Rex')) == 'Bark'\", \"assert animal_sound(Cat('Fluffy')) == 'Meow'\", \"assert animal_sound(Dog('Buddy')) == 'Bark'\", \"assert animal_soun... | {
"split": "train",
"index": 68142,
"acecode_id": "evol_14296",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains two elements: a feature (a string) and a label (an integer). Write a function `extract_labels(data: List[Tuple[str, int]]) -> List[int]` that takes this list as input and returns a list of all the labels in the same orde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_labels([('feature1', 1), ('feature2', 2), ('feature3', 3)]) == [1, 2, 3]\", \"assert extract_labels([('apple', 0), ('banana', 1), ('cherry', 2)]) == [0, 1, 2]\", \"assert extract_labels([('dog', 5)]) == [5]\", \"assert extract_labels([('cat', 4), ('m... | {
"split": "train",
"index": 68143,
"acecode_id": "bigcode_python_fns_37865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that takes a dictionary as input and returns a tuple containing a list of all the unique values present in the dictionary and the count of these unique values. The function should not print anything, only return the values. For example, given the dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_values_count({'a': 1, 'b': 2, 'c': 3}) == ([1, 2, 3], 3)\", \"assert unique_values_count({'x': 10, 'y': 10, 'z': 20}) == ([10, 20], 2)\", \"assert unique_values_count({'key1': 'value1', 'key2': 'value2', 'key3': 'value1'}) == (['value1', 'value2'], 2)... | {
"split": "train",
"index": 68144,
"acecode_id": "evol_1362",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string `sentence` consisting of words separated by spaces, your task is to transform this sentence into a structured representation of a labeled tree. The output should be a tuple containing the following elements: the original sentence as a string, a list of tuples rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_labeled_tree('hello world') == ('hello world', [(0, 5), (6, 11)], ['LABEL', 'LABEL'], ['TAG', 'TAG'])\", \"assert save_labeled_tree('Python is great') == ('Python is great', [(0, 6), (7, 9), (10, 15)], ['LABEL', 'LABEL', 'LABEL'], ['TAG', 'TAG', 'TAG'])... | {
"split": "train",
"index": 68145,
"acecode_id": "bigcode_python_fns_29206",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing collaborators, and a credentials dictionary for a specific user. Each collaborator dictionary contains the keys 'login' and 'permissions', where 'permissions' is another dictionary containing an 'admin' key (a boolean). Your tas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_collaborators([{'login': 'user1', 'permissions': {'admin': False}}, {'login': 'user2', 'permissions': {'admin': True}}, {'login': 'user3', 'permissions': {'admin': False}}], {'user_name': 'user1'}) == ['user2', 'user3']\", \"assert filter_collaborator... | {
"split": "train",
"index": 68146,
"acecode_id": "bigcode_python_fns_27675",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of activities, where each activity is represented by a string. Your task is to implement a function that checks if a given list of activities contains both 'activity1' and 'activity2'. The function should return True if both activities are present in the li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_activities(['activity1', 'activity2', 'activity3']) == True\", \"assert check_activities(['activity1', 'activity4', 'activity5']) == False\", \"assert check_activities(['activity3', 'activity4', 'activity5']) == False\", \"assert check_activities(['act... | {
"split": "train",
"index": 68147,
"acecode_id": "bigcode_python_fns_38887",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the execution of a series of notebooks, represented by their respective file paths in a list. Each notebook can either execute successfully or fail. Your goal is to implement a function `simulate_notebook_execution(notebook_paths: List[str]) -> Tu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_notebook_execution(['notebook1.ipynb', 'notebook2.ipynb']) == (0, 2)\", \"assert simulate_notebook_execution(['notebook_fail1.ipynb', 'notebook2.ipynb']) == (1, 1)\", \"assert simulate_notebook_execution(['notebook_fail.ipynb', 'notebook_fail2.ipynb... | {
"split": "train",
"index": 68148,
"acecode_id": "bigcode_python_fns_4861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the cleanup process of a temporary directory in a file management system. The function, `cleanup_temp_directory`, accepts a string representing the name of the directory. The function should return a string indicating wheth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cleanup_temp_directory('temp_utilities') == 'Cleanup successful'\", \"assert cleanup_temp_directory('temp_data') == 'Cleanup successful'\", \"assert cleanup_temp_directory('temp_logs') == 'Cleanup successful'\", \"assert cleanup_temp_directory('temp_backup')... | {
"split": "train",
"index": 68149,
"acecode_id": "bigcode_python_fns_20725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 10 integers, find the maximum three unique numbers in the list without using any comparison operator, built-in max() method, or any sorting technique. You should return a list containing these three numbers in descending order. If there are fewer than three uniq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMaxThree([3, 10, 2, 5, 9, 8, 33, 21, 1, 7]) == [33, 21, 10]\", \"assert findMaxThree([5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == [5]\", \"assert findMaxThree([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [10, 9, 8]\", \"assert findMaxThree([10, 9, 10, 9, 8, 8, 7, 6, 5, 4])... | {
"split": "train",
"index": 68150,
"acecode_id": "evol_16460",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that takes a list of strings, converts each string to camelCase format, and returns a new list with the converted strings. The camelCase format requires that the first letter of each word is capitalized and all subsequent letters are in lowercase, ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_camel_case(['this', 'is', 'an', 'example']) == ['thisIsAnExample']\", \"assert convert_to_camel_case(['hello', 'world']) == ['helloWorld']\", \"assert convert_to_camel_case(['make', 'a', 'wish']) == ['makeAWish']\", \"assert convert_to_camel_case(... | {
"split": "train",
"index": 68151,
"acecode_id": "evol_30614",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of an IR LED controller based on received button codes from an IR remote. The function should take a button code as input and return a string indicating whether the LED is turned 'ON' or 'OFF'. The LED starts i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert control_led(0x00FF30CF) == 'ON'\", \"assert control_led(0x00FF18E7) == 'ON'\", \"assert control_led(0x00FF7A85) == 'OFF'\", \"assert control_led(0x00FF30CF) == 'ON'\", \"assert control_led(0x00FF18E7) == 'ON'\", \"assert control_led(0x00FF18E7) == 'ON'\", \"... | {
"split": "train",
"index": 68152,
"acecode_id": "oss_24461",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_matched_filenames` that takes a list of filenames and a regex pattern as input. The function should return a tuple of filenames that match the provided regex pattern. If the regex is None, return all filenames. The filenames are represented as strings ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_matched_filenames(['file1.txt', 'file2.log', 'image.png'], '.*\\\\.txt') == ('file1.txt',)\", \"assert get_matched_filenames(['file1.txt', 'file2.log', 'image.png'], None) == ('file1.txt', 'file2.log', 'image.png')\", \"assert get_matched_filenames(['dat... | {
"split": "train",
"index": 68153,
"acecode_id": "bigcode_python_fns_9056",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n: int) -> bool` that determines if a given integer `n` is a prime number. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. The function should return `True` if `n` is prime, and `False` o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser... | {
"split": "train",
"index": 68154,
"acecode_id": "evol_26057",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sequence of integers representing tokenized data and two integers, `max_length` and `n_features`, implement a function that returns a 1-hot encoded representation of the sequence. The 1-hot encoding should be padded with zeros to reach the specified `max_length`. Each t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert token2hot([1, 2, 2], 5, 4) == [[0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 1, 0], [0, 0, 0, 0], [0, 0, 0, 0]]\", \"assert token2hot([0, 1], 3, 2) == [[1, 0], [0, 1], [0, 0]]\", \"assert token2hot([3], 4, 5) == [[0, 0, 0, 1, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0... | {
"split": "train",
"index": 68155,
"acecode_id": "bigcode_python_fns_30245",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that modifies a string by replacing every occurrence of a specified substring with a new substring. Your function should take three parameters: the original string, the substring to be replaced, and the new substring to replace it with. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_substring('hello world', 'world', 'there') == 'hello there'\", \"assert replace_substring('hello world', 'Hello', 'hi') == 'hello world'\", \"assert replace_substring('test test test', 'test', 'exam') == 'exam exam exam'\", \"assert replace_substring... | {
"split": "train",
"index": 68156,
"acecode_id": "oss_6226",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_sequence(k: int, n: int) -> List[int]` that takes two integers, k and n, and returns a list of all whole numbers starting from k up to and including n. The list should represent a consecutive sequence of integers without any gaps. If k is greater than... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sequence(5, 10) == [5, 6, 7, 8, 9, 10]\", \"assert generate_sequence(0, 5) == [0, 1, 2, 3, 4, 5]\", \"assert generate_sequence(-3, 2) == [-3, -2, -1, 0, 1, 2]\", \"assert generate_sequence(7, 7) == [7]\", \"assert generate_sequence(10, 20) == [10, 1... | {
"split": "train",
"index": 68157,
"acecode_id": "evol_9891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the time step based on the input provided. The function should accept either a number or a list of numbers as input and infer the time step accordingly. If a number is provided, it should be used directly as the time s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_time_step(0.2, True) == 0.2\", \"assert calculate_time_step(1, False) == 1\", \"assert calculate_time_step([0.0, 0.5, 1.0], True) == 0.5\", \"assert calculate_time_step([1, 2, 3, 4], False) == 1\", \"assert calculate_time_step([5, 6, 7], True) == 1... | {
"split": "train",
"index": 68158,
"acecode_id": "oss_9570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of a bank from a list of banks. The function should take two parameters: a list of bank IDs and a bank ID to be deleted. If the bank ID exists in the list, it should be removed, and the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_bank(['bank1', 'bank2', 'bank3'], 'bank2') == ['bank1', 'bank3']\", \"assert delete_bank(['bank1', 'bank2', 'bank3'], 'bank4') == ['bank1', 'bank2', 'bank3']\", \"assert delete_bank([], 'bank1') == []\", \"assert delete_bank(['bank1'], 'bank1') == []\... | {
"split": "train",
"index": 68159,
"acecode_id": "bigcode_python_fns_36152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that sorts the list in descending order and returns the sorted list. The input list may contain duplicate values.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_descending([4, 7, 2, 9, 6]) == [9, 7, 6, 4, 2]\", \"assert sort_descending([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert sort_descending([10, 10, 5, 5, 0]) == [10, 10, 5, 5, 0]\", \"assert sort_descending([-1, -2, -3, -4]) == [-1, -2, -3, -4]\", \"ass... | {
"split": "train",
"index": 68160,
"acecode_id": "evol_21983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of dictionaries representing documents. Each document contains fields 'title', 'author', and 'timestamp'. Your function should take a list of such documents and return a new list where each dictionary has the followi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_documents([]) == []\", \"assert format_documents([{'title': 'Hello World', 'author': 'Alice', 'timestamp': 1609459200}]) == [{'title': 'Hello World', 'author': 'Alice', 'formatted_timestamp': '2021-01-01 00:00:00'}]\", \"assert format_documents([{'tit... | {
"split": "train",
"index": 68161,
"acecode_id": "oss_14630",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that handles the serialization of synthetic enzyme data into a standard format. Your function should take a list of synthetic enzyme entries and return a string representation of this data. If the `long_form` parameter is set to True,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_synthases([{'name': 'EnzymeA', 'type': 'Type1'}, {'name': 'EnzymeB', 'type': 'Type2'}], False) == \\\"EnzymeA: Type1; EnzymeB: Type2\\\"\", \"assert serialize_synthases([{'name': 'EnzymeA', 'type': 'Type1'}, {'name': 'EnzymeB', 'type': 'Type2'}], T... | {
"split": "train",
"index": 68162,
"acecode_id": "oss_13447",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing pixel values of a grayscale image. Write a function `convert_to_grayscale(pixel_values: List[int]) -> List[int]` that takes in this list and returns a new list where each pixel value is converted to its corresponding grayscale value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_grayscale([0, 128, 255]) == [0, 128, 255]\", \"assert convert_to_grayscale([255]) == [255]\", \"assert convert_to_grayscale([100, 150, 200]) == [100, 150, 200]\", \"assert convert_to_grayscale([0, 0, 0]) == [0, 0, 0]\", \"assert convert_to_graysca... | {
"split": "train",
"index": 68163,
"acecode_id": "bigcode_python_fns_14413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified notification system in Python. The system should allow for the registration of notifiers for specific notification IDs and the triggering of notifications to the registered notifiers. Implement a function `notification_system` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert notification_system([('register', 'notify1', lambda msg: f'Notifier 1: {msg}'), ('trigger', 'notify1', {'msg': 'Hello'})]) == ['Notifier 1: Hello']\", \"assert notification_system([('register', 'notify2', lambda msg: f'Notifier 2: {msg}'), ('trigger', 'notif... | {
"split": "train",
"index": 68164,
"acecode_id": "oss_16535",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_of_first_natural_numbers(n)` that takes an integer `n` as input and returns the sum of the first `n` natural numbers. For example, if `n = 10`, the function should return 55, since 1 + 2 + ... + 10 = 55.\nPlease reason step by step, then write a self-conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_first_natural_numbers(1) == 1\", \"assert sum_of_first_natural_numbers(2) == 3\", \"assert sum_of_first_natural_numbers(3) == 6\", \"assert sum_of_first_natural_numbers(4) == 10\", \"assert sum_of_first_natural_numbers(5) == 15\", \"assert sum_of_firs... | {
"split": "train",
"index": 68165,
"acecode_id": "evol_26718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D array of integers representing a collection of plots. Write a function that checks if the number of unique plots (as represented by the keys in a dictionary of unique values) is less than or equal to the number of columns in the given array. Implement the fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_unique_plots([[1, 1], [1, 1], [1, 1]]) == True\", \"assert check_unique_plots([[1, 2], [1, 2], [1, 2]]) == True\", \"assert check_unique_plots([[1, 1, 1], [2, 2, 2]]) == True\", \"assert check_unique_plots([[1, 2, 3], [1, 2, 4], [1, 2, 5]]) == False\",... | {
"split": "train",
"index": 68166,
"acecode_id": "bigcode_python_fns_28186",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing dataset labels and a list of unique class labels representing a task, implement a function `samples_for_each_class(dataset_labels: List[int], task: List[int]) -> List[float]` that returns a list of floats where each float represents the num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert samples_for_each_class([1, 2, 1, 3, 2, 1, 4], [1, 2, 3, 4]) == [3.0, 2.0, 1.0, 1.0]\", \"assert samples_for_each_class([1, 1, 1, 1], [1]) == [4.0]\", \"assert samples_for_each_class([5, 5, 5, 5], [5]) == [4.0]\", \"assert samples_for_each_class([1, 2, 3, 4],... | {
"split": "train",
"index": 68167,
"acecode_id": "bigcode_python_fns_26313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_email(email: str) -> bool` that checks if a given email address is compliant with RFC 5322, excluding quoted strings and comments. The function should return True if the email is valid according to the specified format and False otherwise.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('user@example.com') == True\", \"assert validate_email('user.name+tag@example.co.uk') == True\", \"assert validate_email('user_name123@example.org') == True\", \"assert validate_email('user@subdomain.example.com') == True\", \"assert validate_... | {
"split": "train",
"index": 68168,
"acecode_id": "evol_21686",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the volume of a torus in a 3-dimensional space. The volume is given by the formula `(pi * r^2) * (2 * pi * R)`, where 'r' is the radius of the tube and 'R' is the distance from the center of the tube to the center of the torus. Implement a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert volume_of_torus(0, 1) == 0.0\", \"assert volume_of_torus(1, 0) == 0.0\", \"assert volume_of_torus(0, 0) == 0.0\", \"assert volume_of_torus(0, 10) == 0.0\", \"assert volume_of_torus(10, 0) == 0.0\"]}"
} | {
"split": "train",
"index": 68169,
"acecode_id": "evol_6403",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_user_data(username: str, password: str, age: int, email: str) -> Tuple[bool, List[str]]` that checks if a user's account data is valid. The function should return a tuple containing a boolean indicating if the data is valid and a list of error mes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_data('user4', 'password123', 20, 'user4@example.com') == (True, [])\", \"assert validate_user_data('user5', 'mypassword', 19, 'user5@domain.com') == (True, [])\", \"assert validate_user_data('user6', '12345678', 18, 'user6@domain.net') == (True... | {
"split": "train",
"index": 68170,
"acecode_id": "evol_23498",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of boolean expressions (represented as True or False values), implement a function `any_true` that returns True if at least one of the expressions in the list is True, and False if all of them are False. The function should raise a ValueError if the input list is e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert any_true([True, False, False]) == True\", \"assert any_true([False, False, False]) == False\", \"assert any_true([True]) == True\", \"assert any_true([False]) == False\", \"assert any_true([True, True, False]) == True\", \"assert any_true([False, True]) == T... | {
"split": "train",
"index": 68171,
"acecode_id": "bigcode_python_fns_32752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to manage datasets for a machine learning project. The function should allow you to add a dataset, remove a dataset, check if a dataset exists, and list all datasets. The dataset names must be unique and follow a specific naming conventio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_datasets([('add', 'datasetC'), ('add', 'datasetD'), ('list', ''), ('exists', 'datasetC'), ('exists', 'datasetD')]) == (['datasetC', 'datasetD'], [True, True])\", \"assert manage_datasets([('remove', 'non_existent'), ('list', ''), ('add', 'datasetE'), ... | {
"split": "train",
"index": 68172,
"acecode_id": "oss_19803",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that rounds off a collection of complex numbers (real and imaginary parts separately) to the nearest integer using a custom rounding function. The rounding function should round up if a number's decimal part is 0.5 or above, and round down otherwise. Additi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_complex_numbers([-1.5+4.5j, 0+0j, 3.3+7.6j]) == [-2+5j, 0+0j, 3+8j]\", \"assert round_complex_numbers([-0.1+1.6j, 2.5+2.5j]) == [-0.1+2j, 3+3j]\", \"assert round_complex_numbers([-0.99-0.99j, 1.99+1.99j]) == [-0.99-1j, 2+2j]\", \"assert round_complex_n... | {
"split": "train",
"index": 68173,
"acecode_id": "evol_25848",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of k sorted lists, implement a function `merge_sorted_lists(lists)` that merges these lists into a single sorted list and returns it. Each inner list may contain integers sorted in ascending order. The function should be efficient and handle edge cases such as empt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([[1, 4, 5], [1, 3, 4], [2, 6]]) == [1, 1, 2, 3, 4, 4, 5, 6]\", \"assert merge_sorted_lists([[], [], []]) == []\", \"assert merge_sorted_lists([[1]]) == [1]\", \"assert merge_sorted_lists([[3, 5, 7], [0, 6], [2, 4, 8]]) == [0, 2, 3, 4, 5, 6... | {
"split": "train",
"index": 68174,
"acecode_id": "evol_19554",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_valid_html(html: str) -> bool` that validates whether the input HTML string is correctly formatted according to the following criteria: 1) All opening tags must have corresponding closing tags, 2) The `id` attributes must be valid identifiers, and 3) Ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_html('<div><p>Hello World</p></div>') == True\", \"assert is_valid_html('<div><p>Hello World</div></p>') == False\", \"assert is_valid_html('<div id=\\\"validId\\\"><span class=\\\"validClass\\\"></span></div>') == True\", \"assert is_valid_html('<d... | {
"split": "train",
"index": 68175,
"acecode_id": "evol_35890",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the storage and retrieval of brain signal data. Implement a function `brain_signal_data` that takes a list of tuples as input, where each tuple consists of a `signal_type` (a string) and `data` (which can be of any type). T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert brain_signal_data([('visual-N170', 1), ('visual-P300', 2), ('invalid-signal', 3)]) == {'visual-N170': 1, 'visual-P300': 2, 'visual-SSVEP': None, 'auditory-SSAEP orig': None, 'auditory-SSAEP onefreq': None}\", \"assert brain_signal_data([('visual-SSVEP', 'dat... | {
"split": "train",
"index": 68176,
"acecode_id": "oss_33502",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple user profile system. Implement a function called `create_profile` that takes two parameters: `is_new_user`, a boolean indicating whether a new user is being registered, and `user_id`, an integer representing the user's ID. If `is_new_user` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_profile(True, 1) == {'user_id': 1, 'profile_status': 'active'}\", \"assert create_profile(True, 2) == {'user_id': 2, 'profile_status': 'active'}\", \"assert create_profile(True, 3) == {'user_id': 3, 'profile_status': 'active'}\", \"assert create_profi... | {
"split": "train",
"index": 68177,
"acecode_id": "bigcode_python_fns_10455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that transforms a list of integers by multiplying each integer by 2. The function should take a list of integers as input and return a new list containing the transformed integers. Write a function named `transformer` that accomplishe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transformer([1, 2, 3]) == [2, 4, 6]\", \"assert transformer([0, -1, -2]) == [0, -2, -4]\", \"assert transformer([-5, 10]) == [-10, 20]\", \"assert transformer([]) == []\", \"assert transformer([100]) == [200]\", \"assert transformer([1, 0, 1]) == [2, 0, 2]\"... | {
"split": "train",
"index": 68178,
"acecode_id": "oss_27544",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that maps payload names to their corresponding payloads, which are also dictionaries that map seconds to specific payload values. Write a function `get_payload_for_time(payload: str, seconds: int) -> str` that returns the payload value for the given p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_payload_for_time('payload1', 1) == 'value11'\", \"assert get_payload_for_time('payload1', 2) == 'value12'\", \"assert get_payload_for_time('payload2', 1) == 'value21'\", \"assert get_payload_for_time('payload3', 0) == 'Invalid payload or seconds'\", \"as... | {
"split": "train",
"index": 68179,
"acecode_id": "bigcode_python_fns_22546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `convert_to_hex_array(text: str) -> List[str]` that takes a string `text` as input and converts it into an array of hexadecimal byte representations. The function should return a list of hexadecimal strings, where each byte from the input string is represented ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_hex_array('hello world') == ['0x68', '0x65', '0x6c', '0x6c', '0x6f', '0x20', '0x77', '0x6f', '0x72', '0x6c', '0x64']\", \"assert convert_to_hex_array('') == []\", \"assert convert_to_hex_array('A') == ['0x41']\", \"assert convert_to_hex_array('abc... | {
"split": "train",
"index": 68180,
"acecode_id": "evol_18289",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that summarizes the result of a game based on the user's score, maximum score, the secret word, and whether the user won or lost. Your function should take the following parameters: an integer `game_score` representing the score of the ga... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summarize_game(10, 20, 'PYTHON', True) == 'You Won! The word was: PYTHON Score: 10/20'\", \"assert summarize_game(5, 15, 'JAVA', False) == 'You Lost! The word was: JAVA Score: 5/15'\", \"assert summarize_game(0, 10, 'RUBY', False) == 'You Lost! The word was:... | {
"split": "train",
"index": 68181,
"acecode_id": "bigcode_python_fns_27143",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates sending a notification for a web service. The function should return a status code of 200 along with a dictionary containing information about the notification. The dictionary should include the prompt identifier, the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_notification('prompt1', {'state': 'sent', 'expireAt': '2023-09-01T12:00:00Z'}) == (200, {'promptIdentifier': 'prompt1', 'state': 'sent', 'expireAt': '2023-09-01T12:00:00Z'})\", \"assert send_notification('prompt2', {'state': 'pending', 'expireAt': '2023... | {
"split": "train",
"index": 68182,
"acecode_id": "oss_28933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where each key is a unique identifier (UUID) representing a photo, and each value is a list of dictionaries containing information about faces detected in that photo. The face information is represented as a dictionary with keys 'uuid' (a unique ident... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_face_info({'photo1': [{'uuid': 'face1', 'age': 25}, {'uuid': 'face2', 'age': 30}]}, {'photo1': [{'uuid': 'face1', 'age': 25}, {'uuid': 'face2', 'age': 30}]} ) == True\", \"assert validate_face_info({'photo1': [{'uuid': 'face1', 'age': 25}]}, {'photo... | {
"split": "train",
"index": 68183,
"acecode_id": "bigcode_python_fns_587",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `manage_books(books: List[Dict[str, str]], action: str, book: Optional[Dict[str, str]] = None, book_id: Optional[int] = None) -> Union[str, List[Dict[str, str]]]:` that simulates managing a collection of books. The function should accept a list of book dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_books([], 'list') == []\", \"assert manage_books([], 'add', {'title': 'Book A', 'author': 'Author A'}) == 'Book added successfully!'\", \"assert manage_books([{'title': 'Book A', 'author': 'Author A'}], 'list') == [{'title': 'Book A', 'author': 'Autho... | {
"split": "train",
"index": 68184,
"acecode_id": "evol_33053",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `can_dispense_beer(mode: int, password: str, license: str, username: str, registered_users: List[str], bac: float) -> bool` that determines if beer can be dispensed based on the following criteria: the `mode` must be a positive integer, the `password` must ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_dispense_beer(1, 'correct_password', '1234567890', 'user1', ['user1', 'user2', 'user3'], 0.04) == True\", \"assert can_dispense_beer(1, 'correct_password', '1234567890', 'user1', ['user1', 'user2', 'user3'], 0.06) == False\", \"assert can_dispense_beer(1... | {
"split": "train",
"index": 68185,
"acecode_id": "evol_35272",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an N x N matrix, implement a function that calculates the determinant recursively. Ensure that your function handles potential input errors such as non-square matrices and non-numeric elements. The function should return the determinant if the input is valid, or an approp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_det([[1, 2], [3, 4]]) == -2\", \"assert calc_det([[5]]) == 5\", \"assert calc_det([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 0\", \"assert calc_det([[2, 3], [1, 4]]) == 5\", \"assert calc_det([[1, 1], [1, 1]]) == 0\", \"assert calc_det([[1, 2], [2, 4]]) == 0... | {
"split": "train",
"index": 68186,
"acecode_id": "evol_7803",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a 3D list representing an image with dimensions (height, width, channels), and two integers representing the crop height and crop width, implement a function `central_crop` that returns a new 3D list representing the central cropped image. The function should ensure that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert central_crop([[1, 1, 1], [1, 1, 1], [1, 1, 1]], 3, 3) == [[1, 1, 1], [1, 1, 1], [1, 1, 1]]\", \"assert central_crop([[1, 2, 3]], 1, 3) == [[1, 2, 3]]\", \"assert central_crop([], 2, 2) == []\", \"assert central_crop([[1, 2]], 2, 2) == []\", \"assert central_... | {
"split": "train",
"index": 68187,
"acecode_id": "bigcode_python_fns_48840",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of boolean values representing the status of various tests. Each test can either pass (True) or fail (False). Your task is to implement a function `filter_tests(tests: List[bool]) -> Tuple[int, int]` that returns a tuple containing two integers: the number ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_tests([True, True, True]) == (3, 0)\", \"assert filter_tests([False, False, False]) == (0, 3)\", \"assert filter_tests([True, False, True, False]) == (2, 2)\", \"assert filter_tests([True, True, False, False, True]) == (3, 2)\", \"assert filter_tests(... | {
"split": "train",
"index": 68188,
"acecode_id": "bigcode_python_fns_13769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a regular expression to identify sequences containing only uppercase letters and digits. The sequence must begin with an uppercase letter and must not contain consecutive occurrences of the same type (letters or digits). For example, 'AB12' and 'X4Y2' are valid, while '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_sequence('A') == True\", \"assert check_sequence('A3B2A1') == False\", \"assert check_sequence('AA12') == False\", \"assert check_sequence('45XY') == False\", \"assert check_sequence('XX12') == False\", \"assert check_sequence('A11B') == False\", \"ass... | {
"split": "train",
"index": 68189,
"acecode_id": "evol_21058",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function `remove_duplicates` that returns a new list containing only the unique strings from the original list, preserving the order of their first appearance.\nPlease reason step by step, then write a self-contained Python solution. Give your f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates(['apple', 'pear', 'apple', 'banana']) == ['apple', 'pear', 'banana']\", \"assert remove_duplicates(['cat', 'dog', 'cat', 'mouse']) == ['cat', 'dog', 'mouse']\", \"assert remove_duplicates(['hello', 'world', 'hello']) == ['hello', 'world']\"... | {
"split": "train",
"index": 68190,
"acecode_id": "evol_34218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of attributes where each attribute is represented by a dictionary containing the keys 'name', 'id', 'type', 'facetable', 'sortable', and 'attributeType', write a function `filter_custom_attributes(attributes: List[Dict[str, Union[str, bool]]]) -> List[Dict[str, Uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_custom_attributes([{'name': 'com.infa.appmodels.ldm.custom1', 'id': '1', 'type': 'string', 'facetable': True, 'sortable': False, 'attributeType': 'custom'}, {'name': 'systemAttribute', 'id': '2', 'type': 'number', 'facetable': False, 'sortable': True,... | {
"split": "train",
"index": 68191,
"acecode_id": "bigcode_python_fns_7886",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function `convert_to_leet(str)` that converts a given string into leetspeak. The conversion should follow these rules: 'A' is replaced with '4', 'B' is replaced with '8', 'E' is replaced with '3', 'G' is replaced with '6', 'I' is replaced with '1', 'L' is replaced with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_leet('leet') == '1337'\", \"assert convert_to_leet('HELLO WORLD') == 'H3110 W0R1D'\", \"assert convert_to_leet('A B C D') == '4 8 C D'\", \"assert convert_to_leet('Hello') == 'H3110'\", \"assert convert_to_leet('') == ''\", \"assert convert_to_lee... | {
"split": "train",
"index": 68192,
"acecode_id": "evol_16964",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You have a chocolate bar represented by an array `sweetness`, where each element indicates the sweetness of a chunk. You want to share this chocolate with `K` friends by making `K` cuts, resulting in `K + 1` pieces of consecutive chunks. You have a preference for specific chunk... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_chocolate([5,6,7,8,9,1,2,3,4], 8, [0,0,0,0,0,0,0,0,0]) == 1\", \"assert divide_chocolate([1,2,2,1,2,2,1,2,2], 2, [0,0,1,0,0,1,0,0,1]) == 6\", \"assert divide_chocolate([10,20,30,40], 1, [1,1,1,1]) == 41\", \"assert divide_chocolate([1,1,1,1,1], 4, [0,... | {
"split": "train",
"index": 68193,
"acecode_id": "evol_20784",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom data structure called `UnionDict` that behaves like a dictionary but also supports attribute-style access for nested dictionaries. The `UnionDict` should allow you to access nested dictionaries using dot notation, similar to accessing a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (d := UnionDict()).x.y.z == {}\", \"assert (d := UnionDict()).a.b.c.d == {}\", \"assert (d := UnionDict()).foo.bar == {}\", \"assert (d := UnionDict()).nested.level1.level2 == {}\", \"assert (d := UnionDict()).m.n.o.p.q == {}\", \"assert (d := UnionDict()).t... | {
"split": "train",
"index": 68194,
"acecode_id": "oss_14103",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a single integer value, implement a function that appends the integer value to the end of the list. The function should return the updated list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_value([1, 2, 3, 4], 7) == [1, 2, 3, 4, 7]\", \"assert insert_value([], 5) == [5]\", \"assert insert_value([10, 20], 30) == [10, 20, 30]\", \"assert insert_value([1], 0) == [1, 0]\", \"assert insert_value([-1, -2, -3], -4) == [-1, -2, -3, -4]\", \"asse... | {
"split": "train",
"index": 68195,
"acecode_id": "evol_28526",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design an algorithm that categorizes a provided series of dates into consecutive weekly intervals. The algorithm should account for the start day of the week and handle incomplete weeks at the beginning and end of the series of dates. Return the start and end date of each week ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_dates(['2021-12-31', '2022-01-01', '2022-01-02']) == [('2021-12-27', '2022-01-02')]\", \"assert categorize_dates(['2022-01-01', '2022-01-03', '2022-01-04', '2022-01-05', '2022-01-06', '2022-01-07', '2022-01-08']) == [('2021-12-27', '2022-01-02'), ... | {
"split": "train",
"index": 68196,
"acecode_id": "evol_32514",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines the minimum number of swaps required to transform one binary numeral, represented as a string, into another binary numeral. The function should return a list of tuples, where each tuple contains the indices of the two binary digits that were... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_swaps('0000', '0000') == []\", \"assert calculate_swaps('110', '101') == [(1, 2)]\", \"assert calculate_swaps('1', '1') == []\", \"assert calculate_swaps('01', '10') == [(0, 1)]\", \"assert calculate_swaps('1101', '1110') == [(2, 3)]\", \"assert ca... | {
"split": "train",
"index": 68197,
"acecode_id": "evol_4633",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that saves a new version of a workfile in a hypothetical content management system. The function should take a string input representing the name of the workfile and return a string indicating that the workfile has been versioned up. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert version_up_workfile('example_workfile') == 'example_workfile_v1'\", \"assert version_up_workfile('example_workfile_v1') == 'example_workfile_v2'\", \"assert version_up_workfile('example_workfile_v2') == 'example_workfile_v3'\", \"assert version_up_workfile('... | {
"split": "train",
"index": 68198,
"acecode_id": "oss_19747",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing atom indices, implement a function that extracts a smaller cluster of atoms, recentering it around the last atom in an input list. The function should return the recentered cluster as a list of integers, along with the index of the last ato... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_and_recenter_cluster([1, 2, 3, 4, 5]) == ([1, 2, 3, 4, 5], 4, 4)\", \"assert extract_and_recenter_cluster([10, 20, 30]) == ([10, 20, 30], 2, 2)\", \"assert extract_and_recenter_cluster([0]) == ([0], 0, 0)\", \"assert extract_and_recenter_cluster([5, ... | {
"split": "train",
"index": 68199,
"acecode_id": "bigcode_python_fns_43878",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.