data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a string representing a code snippet that may contain a copyright statement. Your task is to create a function that extracts the copyright year range from the code snippet. The copyright line will always follow the format: `# Copyright <start_year>-<end_year>`. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_copyright_year_range('# Copyright 2000-2020') == (2000, 2020)\", \"assert extract_copyright_year_range('# Copyright 1995-2005') == (1995, 2005)\", \"assert extract_copyright_year_range('# Copyright 2010-2015') == (2010, 2015)\", \"assert extrac...
{ "split": "train", "index": 85400, "acecode_id": "oss_32899", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_lowercase_headers(headers: Dict[str, str]) -> Dict[str, str]` that takes a dictionary of HTTP headers as input and returns a new dictionary with all header keys converted to lowercase. The values should remain unchanged. The input di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_lowercase_headers({'Content-Type': 'text/html', 'User-Agent': 'Mozilla/5.0'}) == {'content-type': 'text/html', 'user-agent': 'Mozilla/5.0'}\", \"assert get_lowercase_headers({'Accept': 'application/json', 'Authorization': 'Bearer token'}) == {'accept': '...
{ "split": "train", "index": 85401, "acecode_id": "bigcode_python_fns_19564", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `categorize_string(s: str) -> Dict[str, int]` that takes a string `s` as input and returns a dictionary where the keys are distinct lowercase English letters (from 'a' to 'z') found in the string, and the values are the counts of those letters in the string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_string('Hello World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'r': 1, 'w': 1, 'd': 1}\", \"assert categorize_string('12345!@#') == {}\", \"assert categorize_string('') == {}\", \"assert categorize_string('abcdefg') == {'a': 1, 'b': 1, 'c': 1, 'd': 1,...
{ "split": "train", "index": 85402, "acecode_id": "evol_29266", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Design a function that transforms a linked list into a binary tree. The linked list nodes can contain values that are integers or other linked lists. Each linked list should be converted into a binary tree where each node of the binary tree corresponds to a value from the linke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sortedListToBST(ListNode(1)).val == 1\", \"assert sortedListToBST(ListNode(1, ListNode(2))).val == 2\", \"assert sortedListToBST(ListNode(1, ListNode(2, ListNode(3)))).val == 2\", \"assert sortedListToBST(ListNode(1, ListNode(2, ListNode(3, ListNode(4))))).v...
{ "split": "train", "index": 85403, "acecode_id": "evol_28704", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_power(x: int, y: int, z: int) -> int` that returns the value of `x` to the power of `y` modulo `z`. If `z` is zero, the function should raise a `ValueError` since modulus by zero is undefined. Ensure that the function can handle both positive and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_power(2, 4, 3) == 1\", \"assert calculate_power(2, 3, 3) == 2\", \"assert calculate_power(2, 4, 1) == 0\", \"assert calculate_power(3, 3, 5) == 2\", \"assert calculate_power(5, 2, 7) == 4\", \"assert calculate_power(10, 3, 6) == 4\", \"assert calcu...
{ "split": "train", "index": 85404, "acecode_id": "evol_17090", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the coordinates of two opposite corners of a rectangle in a 2D coordinate system, implement a function `calculate_rectangle_area(x1, y1, x2, y2)` that computes the area of the rectangle formed by these coordinates. The function should ensure that the area is calculated ev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rectangle_area(0, 0, 5, 5) == 25\", \"assert calculate_rectangle_area(-1, -1, 1, 1) == 4\", \"assert calculate_rectangle_area(-3, 2, 2, -1) == 15\", \"assert calculate_rectangle_area(4, 4, 6, 7) == 6\", \"assert calculate_rectangle_area(2, 3, 8, 5)...
{ "split": "train", "index": 85405, "acecode_id": "oss_23077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of expressions, each represented as a dictionary containing variable coefficients and a constant term. Your task is to sum all the expressions together and return the resulting expression as a dictionary. The resulting expression should also be represented ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert esum([{'var_dict': {'x': 1, 'y': 2}, 'constant': 3}, {'var_dict': {'x': 4, 'y': 5}, 'constant': 6}]) == {'var_dict': {'x': 5, 'y': 7}, 'constant': 9}\", \"assert esum([{'var_dict': {'a': 1}, 'constant': 2}, {'var_dict': {'a': 3}, 'constant': 4}]) == {'var_di...
{ "split": "train", "index": 85406, "acecode_id": "bigcode_python_fns_6305", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a temperature in Celsius, convert it to Fahrenheit. Implement a function `celsius_to_fahrenheit(temperature_C: float) -> float` that takes a single parameter, `temperature_C`, representing the temperature in degrees Celsius, and returns the equivalent temperature in degre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert celsius_to_fahrenheit(0) == 32.0\", \"assert celsius_to_fahrenheit(100) == 212.0\", \"assert celsius_to_fahrenheit(-40) == -40.0\", \"assert celsius_to_fahrenheit(37) == 98.6\", \"assert celsius_to_fahrenheit(25) == 77.0\", \"assert celsius_to_fahrenheit(-10...
{ "split": "train", "index": 85407, "acecode_id": "bigcode_python_fns_20807", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates loading a database dump from a given string representation of SQL commands. The function should take a single string as input, representing the SQL commands, and return a list of strings where each string is a separate comm...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_sql_commands('') == []\", \"assert load_sql_commands(' ') == []\", \"assert load_sql_commands('CREATE TABLE test (id INT);') == ['CREATE TABLE test (id INT)']\", \"assert load_sql_commands('DROP TABLE IF EXISTS old_table;') == ['DROP TABLE IF EXISTS ol...
{ "split": "train", "index": 85408, "acecode_id": "bigcode_python_fns_23527", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a Python function that generates the Fibonacci series up to a specified number of terms, where the number of terms is provided as an input parameter. The function should ensure that the input is a positive integer and return the series as a list. If the input is not a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1...
{ "split": "train", "index": 85409, "acecode_id": "evol_2868", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs numerical transformations using square root transformations. The function should accept two parameters: a numerical value and a boolean flag indicating whether to perform a regular or inverted square root transformation....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert warp_value(4, False) == 2.0\", \"assert warp_value(0, False) == 0.0\", \"assert warp_value(9, False) == 3.0\", \"assert warp_value(1, False) == 1.0\", \"assert warp_value(16, False) == 4.0\", \"assert warp_value(25, False) == 5.0\", \"assert warp_value(4, Tr...
{ "split": "train", "index": 85410, "acecode_id": "oss_23237", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function called `get_consecutive_pairs` that returns a list of tuples, where each tuple contains two consecutive elements from the input list. If the input list has fewer than two elements, return an empty list.\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_consecutive_pairs([1, 2, 3, 4]) == [(1, 2), (2, 3), (3, 4)]\", \"assert get_consecutive_pairs([5]) == []\", \"assert get_consecutive_pairs([]) == []\", \"assert get_consecutive_pairs([10, 20]) == [(10, 20)]\", \"assert get_consecutive_pairs([1, 1, 1, 1])...
{ "split": "train", "index": 85411, "acecode_id": "evol_28229", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves extoam servers based on a given system ID from a list of extoam server objects. Each extoam server object contains a property `forisystemid` which indicates the associated system ID and a property `extoamservers` which ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_extoam_servers_by_system_id([], 1) == []\", \"assert get_extoam_servers_by_system_id([{'forisystemid': 1, 'extoamservers': 'server1'}], 1) == ['server1']\", \"assert get_extoam_servers_by_system_id([{'forisystemid': 2, 'extoamservers': 'server2'}], 1) ==...
{ "split": "train", "index": 85412, "acecode_id": "oss_18347", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_name(name: str) -> bool` that checks if the provided name is valid according to specific criteria. A valid name must consist only of alphabetic characters (A-Z, a-z) and spaces. The function should return `True` if the name is valid, and `False` o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_name('John Doe') == True\", \"assert validate_name('Jane') == True\", \"assert validate_name('') == False\", \"assert validate_name('123') == False\", \"assert validate_name('John123') == False\", \"assert validate_name('John Doe!') == False\", \"as...
{ "split": "train", "index": 85413, "acecode_id": "evol_10437", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of points represented as tuples (x, y) and a specific distance, write a function that returns a list of points that are within the specified distance from the origin point (0, 0). A point is considered to be within the distance if the Euclidean distance to the orig...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert within_distance([(1, 1), (2, 2), (3, 3), (0, 5)], 3) == [(1, 1), (2, 2)]\", \"assert within_distance([(0, 0), (0, 1), (1, 0), (1, 1)], 1) == [(0, 0), (0, 1), (1, 0)]\", \"assert within_distance([(3, 4), (0, 0)], 5) == [(3, 4), (0, 0)]\", \"assert within_dist...
{ "split": "train", "index": 85414, "acecode_id": "bigcode_python_fns_35295", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function that takes a hexadecimal number as a string and converts it to its binary representation, then reverses the bits in the resulting binary string. The input hexadecimal number can be very large, so ensure your solution can handle such cases efficiently. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_bin_reverse('0') == '0'\", \"assert hex_to_bin_reverse('F') == '1111'\", \"assert hex_to_bin_reverse('10') == '00001'\", \"assert hex_to_bin_reverse('FFFFFFFF') == '11111111111111111111111111111111'\", \"assert hex_to_bin_reverse('7') == '111'\", \"as...
{ "split": "train", "index": 85415, "acecode_id": "evol_15672", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that partitions the elements into two separate lists: one containing all the even numbers and the other containing all the odd numbers. The function should return a tuple of the two lists, with the first list being the even numbers a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert partition_array([1, 2, 3, 4, 5, 6]) == ([2, 4, 6], [1, 3, 5])\", \"assert partition_array([0, -1, -2, -3]) == ([0, -2], [-1, -3])\", \"assert partition_array([10, 21, 32, 43]) == ([10, 32], [21, 43])\", \"assert partition_array([]) == ([], [])\", \"assert pa...
{ "split": "train", "index": 85416, "acecode_id": "evol_28139", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing employee IDs in a simple system. Write a function `manage_employee_id()` that takes an initial employee ID and a list of operations. The operations can either be to set a new employee ID or to retrieve the current employee ID. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_employee_id(0, [('set', 3), ('set', 5), ('get', None)]) == 5\", \"assert manage_employee_id(10, [('get', None)]) == 10\", \"assert manage_employee_id(0, [('set', 7), ('set', 8), ('get', None)]) == 8\", \"assert manage_employee_id(0, [('get', None), ('...
{ "split": "train", "index": 85417, "acecode_id": "oss_25923", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a tuple containing the second smallest odd number and the second largest even number from the list. If either the second smallest odd number or the second largest even number does not exist, return None for that value ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_smallest_odd_and_second_largest_even([1, 2, 3, 4]) == (3, 2)\", \"assert second_smallest_odd_and_second_largest_even([2, 3]) == (None, None)\", \"assert second_smallest_odd_and_second_largest_even([]) == (None, None)\", \"assert second_smallest_odd_an...
{ "split": "train", "index": 85418, "acecode_id": "evol_25871", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates retrieving a setting value based on a provided key. The function should take a string key as input and return the corresponding value from a predefined settings dictionary. The settings dictionary contains various string re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_setting('setting1') == True\", \"assert retrieve_setting('setting2') == False\", \"assert retrieve_setting('setting5') == None\", \"assert retrieve_setting('setting10') == None\", \"assert retrieve_setting('setting15') == None\", \"assert retrieve_s...
{ "split": "train", "index": 85419, "acecode_id": "bigcode_python_fns_10311", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that updates the metadata of a book in a library system. The function should take several parameters describing the book's details and return a success message if the update is valid. The parameters include: \n1. book_id (int): The unique...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_book_metadata(1, 'Python Programming', 'An introduction to Python.', '2023', 'released', 0, 1) == 'Changes saved!'\", \"assert update_book_metadata(2, '', 'Book description', '2023', 'released', 0, 1) == 'Missing title!'\", \"assert update_book_metada...
{ "split": "train", "index": 85420, "acecode_id": "bigcode_python_fns_11162", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that registers an extension with a simple application. The function takes a string `extension_name` and a dictionary `extension_data` as input. The function should return a string indicating whether the registration was successful or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_extension('TestExtension', {'key': 'value'}) == 'Extension registered: TestExtension'\", \"assert register_extension('AnotherExtension', {}) == 'Extension registered: AnotherExtension'\", \"assert register_extension('', {'key': 'value'}) == 'Registr...
{ "split": "train", "index": 85421, "acecode_id": "bigcode_python_fns_2133", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string of text, write a function that identifies the most frequently occurring word in the text and swaps it with a specified new word. If the text is empty or if there is no suitable match for the most frequent word, the function should return the original text. Implem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_most_frequent_word('A A B B C C D D A', 'X') == 'X X B B C C D D X'\", \"assert swap_most_frequent_word('', 'replacement') == ''\", \"assert swap_most_frequent_word('apple banana apple', 'orange') == 'orange banana orange'\", \"assert swap_most_frequent...
{ "split": "train", "index": 85422, "acecode_id": "evol_29301", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of command-line arguments for a reinforcement learning program and returns a status message based on the provided commands. The function should take a list of strings as input and return a tuple containing an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_args(None) == ('No arguments provided', 'No arguments provided')\", \"assert process_args([]) == ('No arguments provided', 'No arguments provided')\", \"assert process_args(['--run']) == (None, 'Agent is running')\", \"assert process_args(['--run', '...
{ "split": "train", "index": 85423, "acecode_id": "oss_35109", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of complex numbers, implement a function `rolling_sum(arr)` that computes the rolling sum of the complex numbers in the list. The rolling sum at position n in the array is defined as the sum of all previous numbers including the number at position n. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rolling_sum([(1+1j), (2+2j), (3+3j)]) == [(1+1j), (3+3j), (6+6j)]\", \"assert rolling_sum([(0+0j), (0+0j), (0+0j)]) == [(0+0j), (0+0j), (0+0j)]\", \"assert rolling_sum([(1+2j), (1+2j), (1+2j)]) == [(1+2j), (2+4j), (3+6j)]\", \"assert rolling_sum([(5+5j), (5+...
{ "split": "train", "index": 85424, "acecode_id": "evol_8634", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function to calculate the comprehensive interval between two specific timestamps, including the number of years, months, weeks, days, hours, minutes, and seconds. The timestamps will be formatted as strings in the format 'MM/DD/YYYY HH:MM:SS'. The function should co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_interval('01/01/2000 00:00:00', '01/01/2020 00:00:00') == DateTimeInterval(20, 0, 0, 0, 0, 0, 0)\", \"assert calculate_interval('02/29/2020 00:00:00', '03/01/2020 00:00:00') == DateTimeInterval(0, 0, 0, 1, 0, 0, 0)\", \"assert calculate_interval('0...
{ "split": "train", "index": 85425, "acecode_id": "evol_15751", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that returns a new list containing the squares of each integer from the input list, sorted in non-decreasing order. The function should handle both positive and negative integers. Implement the function `sorted_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_squares([-4, -1, 0, 3, 10]) == [0, 1, 9, 16, 100]\", \"assert sorted_squares([-7, -3, 2, 3, 11]) == [4, 9, 9, 49, 121]\", \"assert sorted_squares([1, 2, 3, 4]) == [1, 4, 9, 16]\", \"assert sorted_squares([-2, -1]) == [1, 4]\", \"assert sorted_squares(...
{ "split": "train", "index": 85426, "acecode_id": "bigcode_python_fns_48665", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks if a user's input message is in a predefined list of stop phrases. The function, `check_user_input`, takes a string `user_input` as input. If the input is one of the stop phrases (e.g., 'cancel', 'exit', 'stop'), the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_user_input('cancel') == 'Returning to the main menu...'\", \"assert check_user_input('exit') == 'Returning to the main menu...'\", \"assert check_user_input('stop') == 'Returning to the main menu...'\", \"assert check_user_input('continue') == 'Input a...
{ "split": "train", "index": 85427, "acecode_id": "oss_23203", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the maximum change version based on whether change queries should be used or not. The function should take in four parameters: a boolean `use_change_queries`, an integer `oldest_change_version`, an integer `newest_change_v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_max_change_version(True, 1, 5, 2023) == 5\", \"assert get_max_change_version(False, 1, 5, 2023) == None\", \"assert get_max_change_version(True, 10, 20, 2022) == 20\", \"assert get_max_change_version(False, 10, 20, 2022) == None\", \"assert get_max_chang...
{ "split": "train", "index": 85428, "acecode_id": "bigcode_python_fns_36177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a multidimensional array of integers, write a function `flatten_array(array_info)` that flattens the array into a single-dimensional list. The output list should maintain the order of elements as they appear in the input array.\nPlease reason step by step, then write a se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_array([[1, 2, 3], [4, 5], [6]]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten_array([[1], [2], [3]]) == [1, 2, 3]\", \"assert flatten_array([[10, 20], [30, 40], [50]]) == [10, 20, 30, 40, 50]\", \"assert flatten_array([[1, 2, 3], [], [4, 5]]) == [1, 2, 3...
{ "split": "train", "index": 85429, "acecode_id": "evol_4537", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a command string for deleting a static NAT mapping based on the given parameters. The function should take a client object and a mapping object as input. The client object contains an 'ipv6' attribute representing the clien...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_nat_command({'ipv6': '2001:0db8:85a3:0000:0000:8a2e:0370:7334'}, {'proto': 1, 'src': '192.168.1.1', 'sport': 8080}) == 'nat 2001:0db8:85a3:0000:0000:8a2e:0370:7334 udp 192.168.1.1 8080'\", \"assert generate_nat_command({'ipv6': '::1'}, {'proto': 2, ...
{ "split": "train", "index": 85430, "acecode_id": "bigcode_python_fns_1090", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sequence of elements, implement a function `filter_non_empty(seq)` that filters out all elements that are considered empty. An element is considered empty if it is `None`, an empty string `''`, an empty list `[]`, an empty dictionary `{}`, or an empty tuple `()`. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_non_empty([1, None, '', {}, [], (), 'text', 42]) == [1, 'text', 42]\", \"assert filter_non_empty([None, '', [], {}, ()]) == []\", \"assert filter_non_empty([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert filter_non_empty(['a', 'b', 'c', '']) == ['a', 'b', '...
{ "split": "train", "index": 85431, "acecode_id": "bigcode_python_fns_5297", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_palindrome(sequence: str) -> bool` that checks whether the given string `sequence` forms a palindrome. A string is considered a palindrome if it reads the same forwards and backwards, ignoring spaces and case differences. For example, 'A man a plan a ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man a plan a canal Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('12321') == True\", \"assert is_pa...
{ "split": "train", "index": 85432, "acecode_id": "evol_114", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two integers, `start` and `end`, and returns a list of all prime numbers in the inclusive range from `start` to `end`. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_numbers(10, 20) == [11, 13, 17, 19]\", \"assert prime_numbers(0, 10) == [2, 3, 5, 7]\", \"assert prime_numbers(1, 1) == []\", \"assert prime_numbers(5, 5) == [5]\", \"assert prime_numbers(15, 15) == []\", \"assert prime_numbers(-10, -1) == []\", \"asse...
{ "split": "train", "index": 85433, "acecode_id": "evol_5683", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of numeric inputs representing the x-coordinates and a list of numeric outputs representing the target y-coordinates. The function should return a list of predicted y-coordinates based on a simple linear regression m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_regression([1, 2, 3], [2, 3, 4]) == [2.0, 3.0, 4.0]\", \"assert linear_regression([0, 1, 2], [1, 2, 3]) == [1.0, 2.0, 3.0]\", \"assert linear_regression([1, 3, 5], [2, 4, 6]) == [2.0, 4.0, 6.0]\", \"assert linear_regression([0, 0, 0], [1, 2, 3]) == [2...
{ "split": "train", "index": 85434, "acecode_id": "bigcode_python_fns_15646", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages metadata for various provider operations. The function should accept a list of operation metadata, where each metadata is represented as a dictionary containing an 'operation' key (string) and other key-value pairs repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_provider_operations_metadata([{'operation': 'op1', 'data': 1}, {'operation': 'op2', 'data': 2}, {'operation': 'op1', 'data': 3}]) == {'op1': [{'operation': 'op1', 'data': 1}, {'operation': 'op1', 'data': 3}], 'op2': [{'operation': 'op2', 'data': 2}...
{ "split": "train", "index": 85435, "acecode_id": "oss_15599", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of log entries represented by a list of dictionaries, where each dictionary contains the following keys: 'timestamp' (an integer representing the time of the log entry), 'level' (a string representing the severity level of the log entry, which can be 'INFO'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_logs([{'timestamp': 1632402000, 'level': 'INFO', 'message': 'User logged in'}, {'timestamp': 1632402100, 'level': 'ERROR', 'message': 'Database connection failed'}, {'timestamp': 1632402200, 'level': 'WARNING', 'message': 'Disk space running low'}, {'...
{ "split": "train", "index": 85436, "acecode_id": "oss_15749", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `factorial(n: int) -> int` that computes the factorial of a given non-negative integer `n` using recursion. The factorial of a non-negative integer `n` is defined as the product of all positive integers less than or equal to `n`. Note that the factorial of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 85437, "acecode_id": "evol_4482", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a price given as a decimal number into a string representation with a maximum of 10 digits, including 2 decimal places. The function should take a single parameter, `price`, which is a decimal number. If the input exceeds the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_price(Decimal('0.00')) == '0.00'\", \"assert format_price(Decimal('1234567890.123')) == 'Invalid price'\", \"assert format_price(Decimal('123456789.123')) == 'Invalid price'\", \"assert format_price(Decimal('123456789.00')) == 'Invalid price'\", \"ass...
{ "split": "train", "index": 85438, "acecode_id": "oss_26233", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in the name of a historical figure and returns their information in a structured format. The function should accept the following parameters: the name of the historical figure (string), their area of interest (string), their pl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert historical_figure_info('Leonardo da Vinci', 'Art, Science, Invention', 'Vinci, Republic of Florence', 1452, 1519) == {'pseudonym': 'Leonardo da Vinci', 'area_of_interest': 'Art, Science, Invention', 'place_of_birth': 'Vinci, Republic of Florence', 'birth_yea...
{ "split": "train", "index": 85439, "acecode_id": "oss_26056", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of user entries where each entry is a dictionary containing a user's email field, write a function that validates each email entry. The function should replace any blank email field with an error message that specifies the field name (e.g., 'Please fill in email')....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_emails([{'email': 'user1@example.com'}, {'email': ''}, {'email': 'user2@example.com'}]) == ['Please fill in email.']\", \"assert validate_emails([{'email': ''}, {'email': ''}, {'email': ''}]) == ['Please fill in email.', 'Please fill in email.', 'Pl...
{ "split": "train", "index": 85440, "acecode_id": "bigcode_python_fns_11901", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of function definitions represented as strings. Each function may or may not be decorated with a specific decorator called 'call_ec'. Your task is to identify the names of the first argument in all function definitions that are decorated with 'call_ec' or a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_ec_args(['func3 = call_ec(lambda z: z * 2)']) == ['z']\", \"assert find_ec_args(['func6 = call_ec(lambda a: a + 1)', 'def func7(c): pass']) == ['a']\", \"assert find_ec_args(['def func11(arg): pass']) == []\", \"assert find_ec_args(['func14 = call_ec(la...
{ "split": "train", "index": 85441, "acecode_id": "bigcode_python_fns_7673", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `validate_string(s: str) -> bool` that checks if a given string `s` starts with a unique non-alphanumeric symbol, is followed by exactly three distinct lowercase alphabetic characters, and ends with between two to four numerical digits. The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_string('#abc12') == True\", \"assert validate_string('@xyz1234') == True\", \"assert validate_string('$abc34') == True\", \"assert validate_string('*def56') == True\", \"assert validate_string('&ghi789') == True\", \"assert validate_string('1abc23')...
{ "split": "train", "index": 85442, "acecode_id": "evol_15837", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `bubble_sort(array: List[int]) -> List[int]` that takes a list of integers and sorts it using the bubble sort algorithm. The function should return the sorted list. The bubble sort algorithm works by repeatedly stepping through the list to be sorted, compar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert bubble_sort([3, 0, 2, 5, -1, 4, 1]) == [-1, 0, 1, 2, 3, 4, 5]\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([2, 2, 2, 2]) == [2, 2, 2, 2]\", \"a...
{ "split": "train", "index": 85443, "acecode_id": "evol_19953", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_multiplication_table(n: int) -> List[int]` that takes an integer n and returns a list containing the multiplication table of n from 1 to 10. The list should contain the products of n multiplied by each integer from 1 to 10, inclusive.\nPlease reas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_multiplication_table(1) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert generate_multiplication_table(2) == [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]\", \"assert generate_multiplication_table(3) == [3, 6, 9, 12, 15, 18, 21, 24, 27, 30]\", \"assert generat...
{ "split": "train", "index": 85444, "acecode_id": "evol_5011", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple alert system that allows users to subscribe for alerts. Implement a function `manage_alerts` that simulates user subscriptions, unsubscriptions, and sending alerts. The function should take three parameters: a list of `subscriptions` co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_alerts([('subscribe', 'user1'), ('subscribe', 'user2'), ('unsubscribe', 'user1')], ['Alert 1', 'Alert 2']) == ['user2', 'user2']\", \"assert manage_alerts([('subscribe', 'user3'), ('unsubscribe', 'user3'), ('subscribe', 'user4')], ['Alert 3']) == ['us...
{ "split": "train", "index": 85445, "acecode_id": "oss_20559", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that validates the strength of a given password based on specific criteria. The password strength is determined by the following rules: 1. The password must be at least 8 characters long. 2. The password must contain at least one uppercase...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_password_strength('StrongP@ssw0rd') == True\", \"assert validate_password_strength('weakpass') == False\", \"assert validate_password_strength('12345678') == False\", \"assert validate_password_strength('Password1!') == True\", \"assert validate_pas...
{ "split": "train", "index": 85446, "acecode_id": "oss_1011", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that counts the number of occurrences of a character in a given string without using any built-in string functions or methods. Implement a function named `count_char` that takes two parameters: a string and a character, and returns the count of the character in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_char('Hello World', 'l') == 3\", \"assert count_char('Mississippi', 's') == 4\", \"assert count_char('Programming', 'z') == 0\", \"assert count_char('AAAABBBCCC', 'A') == 4\", \"assert count_char('OpenAI', 'O') == 1\", \"assert count_char('Data Science...
{ "split": "train", "index": 85447, "acecode_id": "evol_13264", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `below_zero(operations: List[Tuple[str, int]], case_insensitive: bool = False) -> bool` that checks whether a financial account balance dips below zero at any point in a series of transactions. Each transaction is represented as a tuple of (Transaction_mode...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert below_zero([('Deposit', 1), ('Deposit', 2), ('Deposit', 3)]) == False\", \"assert below_zero([('deposit', 5), ('withdrawal', 5)]) == False\", \"assert below_zero([('deposit', 10), ('Deposit', 5), ('withdrawal', 15)]) == True\", \"assert below_zero([('Deposit...
{ "split": "train", "index": 85448, "acecode_id": "evol_19856", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `checkFileFormat(fileName: str) -> bool` that checks if the given file name ends with either '.bam' or '.cram'. The function should return True if the file name has a valid extension, and False otherwise. The input will be a single string representing the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert checkFileFormat('example.bam') == True\", \"assert checkFileFormat('example.cram') == True\", \"assert checkFileFormat('example.txt') == False\", \"assert checkFileFormat('data.bam') == True\", \"assert checkFileFormat('archive.cram') == True\", \"assert che...
{ "split": "train", "index": 85449, "acecode_id": "bigcode_python_fns_43392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `validate_event(event: dict) -> str` that validates a given event dictionary representing a POST request. The function should check for the presence of specific keys: 'bucket', 'project', and 'token'. If any of these keys are missing, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_event({'bucket': 'my_bucket', 'project': 'my_project', 'token': 'secure_token'}) == 'Validation successful!'\", \"assert validate_event({'bucket': 'my_bucket', 'project': 'my_project', 'token': 'secure_token'}) == 'Validation successful!'\", \"asser...
{ "split": "train", "index": 85450, "acecode_id": "bigcode_python_fns_37917", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that removes all occurrences of a specified integer from the list and returns the modified list. The function should not modify the original list but return a new list with the specified integer removed. The function signature is: `def...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_integer_from_list([1, 2, 3, 4, 5], 3) == [1, 2, 4, 5]\", \"assert remove_integer_from_list([1, 1, 2, 3, 1], 1) == [2, 3]\", \"assert remove_integer_from_list([5, 5, 5, 5], 5) == []\", \"assert remove_integer_from_list([], 1) == []\", \"assert remove_i...
{ "split": "train", "index": 85451, "acecode_id": "bigcode_python_fns_48362", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the disarming of an alarm system. The function will take the current state of the alarm and a disarm code as inputs and return the new state of the alarm. The alarm can be in one of three states: 'armed', 'disarmed', or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert disarm_alarm('armed', '4321') == 'disarmed'\", \"assert disarm_alarm('triggered', '4321') == 'disarmed'\", \"assert disarm_alarm('disarmed', '4321') == 'disarmed'\", \"assert disarm_alarm('armed', '1234') == 'armed'\", \"assert disarm_alarm('triggered', '123...
{ "split": "train", "index": 85452, "acecode_id": "bigcode_python_fns_30415", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a mathematical operation ('percent', 'sqrt', 'cos', 'sin') and a value (a float), implement a function that performs the corresponding operation on the value. The function should return the result of the operation. The operations are defined as follo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operation('percent', 100) == 1.0\", \"assert perform_operation('percent', 250) == 2.5\", \"assert perform_operation('sqrt', 4) == 2.0\", \"assert perform_operation('sqrt', 16) == 4.0\", \"assert perform_operation('cos', 0) == 1.0\", \"assert perform_...
{ "split": "train", "index": 85453, "acecode_id": "bigcode_python_fns_795", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of lists, where each inner list represents a mini-batch of samples, and a corresponding list of labels for those samples. Each sample is a list of integers representing pixel values of an image, and the labels are integers from 0 to 9 representing classes. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_accuracy([[[0, 0], [1, 1]]], [0, 0]) == 100.0\", \"assert calculate_accuracy([], []) == 0.0\", \"assert calculate_accuracy([[[0, 1], [1, 0]]], [0, 1]) == 100.0\", \"assert calculate_accuracy([[[0], [1], [2]]], [0, 1, 2]) == 100.0\", \"assert calcul...
{ "split": "train", "index": 85454, "acecode_id": "bigcode_python_fns_14193", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of structures with their types, energy levels, and capacities, write a function `grab_haul_list` that returns a list of structures that can be filled with energy. The function should consider the following rules: 1) Structures of type 'spawn' and 'extension' can be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert grab_haul_list([{ 'type': 'spawn', 'energy': 50, 'capacity': 100 }, { 'type': 'extension', 'energy': 20, 'capacity': 50 }, { 'type': 'tower', 'energy': 60, 'capacity': 100 }, { 'type': 'terminal', 'energy': 9000, 'capacity': 10000 }], False) == [{'type': 'sp...
{ "split": "train", "index": 85455, "acecode_id": "bigcode_python_fns_24677", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with searching through a list of dictionaries representing various items. Implement a function named `search_items` that takes a list of dictionaries and keyword arguments representing key-value pairs. The function should return a list of dictionaries that match ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_items([{'category': 'fruit', 'name': 'apple'}, {'category': 'vegetable', 'name': 'carrot'}], category='fruit') == [{'category': 'fruit', 'name': 'apple'}]\", \"assert search_items([{'category': 'fruit', 'name': 'banana'}, {'category': 'fruit', 'name':...
{ "split": "train", "index": 85456, "acecode_id": "oss_24366", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a string containing a mix of letters and digits, and returns a dictionary that maps each unique character to its frequency in the string. The function should ignore case for letters, meaning 'A' and 'a' should be considered the same character....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_chars('aabbcc112233dd4455') == {'a': 2, 'b': 2, 'c': 2, '1': 2, '2': 2, '3': 2, 'd': 2, '4': 2, '5': 2}\", \"assert count_chars('HelloWorld') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_chars('!@#$%^&*()') == {'!': 1, ...
{ "split": "train", "index": 85457, "acecode_id": "evol_9105", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that sorts a list of numerical strings in either ascending or descending order, ignoring leading zeroes. The function should take a list of strings and a string indicating the order ('asc' for ascending and 'desc' for descending) as inputs. If the order inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_numerical_strings(['0001', '01', '1'], 'desc') == ['0001', '01', '1']\", \"assert sort_numerical_strings(['999', '1000', '10'], 'asc') == ['10', '999', '1000']\", \"assert sort_numerical_strings(['999', '1000', '10'], 'desc') == ['1000', '999', '10']\",...
{ "split": "train", "index": 85458, "acecode_id": "evol_31717", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of various buildings in a city. Your task is to implement a function `max_water_trapped(buildings: List[int]) -> int` that returns the maximum amount of water that can be trapped between the buildings after it rains. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_water_trapped([0,1,0,2,1,0,1,3,2,1,2,1]) == 6\", \"assert max_water_trapped([4,2,0,3,2,5]) == 9\", \"assert max_water_trapped([1,0,2]) == 1\", \"assert max_water_trapped([2,1,2]) == 1\", \"assert max_water_trapped([1,0,1]) == 1\", \"assert max_water_trap...
{ "split": "train", "index": 85459, "acecode_id": "bigcode_python_fns_398", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Design a function that takes in a matrix and returns the number of rows, the number of columns, the sum of the diagonal elements, and a boolean indicating if the matrix is a square matrix (i.e., the number of rows is equal to the number of columns). The function should be named...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_properties([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == (3, 3, 15, True)\", \"assert matrix_properties([[1, 2], [3, 4]]) == (2, 2, 5, True)\", \"assert matrix_properties([[1]]) == (1, 1, 1, True)\", \"assert matrix_properties([]) == (0, 0, 0, True)\", \"asse...
{ "split": "train", "index": 85460, "acecode_id": "evol_3130", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `is_anomalous(data: List[float]) -> bool` that determines whether a given input data point is considered an anomaly. The function should return `True` if the input data point has a mean value significantly different from a defined normal range, and `False` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_anomalous([-1.7, 5.6, 3.2, 2.34]) == True\", \"assert is_anomalous([0.1, 0.2, 0.3, 0.4]) == False\", \"assert is_anomalous([-0.5, 0.0, 0.5, 0.1]) == False\", \"assert is_anomalous([10.0, 20.0, 30.0, 40.0]) == True\", \"assert is_anomalous([-2.0, 0.0, 2.0,...
{ "split": "train", "index": 85461, "acecode_id": "evol_23183", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes an integer n as input and returns the cube of that integer. The function should be defined as `def cube(n: int) -> int:`.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code blo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cube(0) == 0\", \"assert cube(1) == 1\", \"assert cube(2) == 8\", \"assert cube(3) == 27\", \"assert cube(4) == 64\", \"assert cube(5) == 125\", \"assert cube(6) == 216\", \"assert cube(7) == 343\", \"assert cube(8) == 512\", \"assert cube(9) == 729\", \"ass...
{ "split": "train", "index": 85462, "acecode_id": "evol_3148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with evaluating a classification machine learning model by visualizing its performance. Write a function that takes two lists of integers, `y_true` and `y_pred`, representing the true labels and predicted labels of a classification task. The function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert confusion_matrix([0, 1, 0, 1], [0, 0, 1, 1]) == [[1, 1], [1, 1]]\", \"assert confusion_matrix([0, 0, 1, 1], [0, 1, 1, 0]) == [[1, 1], [1, 1]]\", \"assert confusion_matrix([0, 1, 2], [0, 1, 2]) == [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\", \"assert confusion_matrix...
{ "split": "train", "index": 85463, "acecode_id": "oss_18837", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a boolean value `signed`, an iterable of integers `digits`, and an integer or character `expo`, implement a function that constructs a decimal value based on these inputs. The `signed` parameter indicates whether the resulting decimal should be negative (True) or positive...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decimal_from_tuple(False, [4, 5, 6], 0) == '456'\", \"assert decimal_from_tuple(False, [9, 9, 9], 3) == '999000'\", \"assert decimal_from_tuple(True, [2, 5, 0], 'F') == '-250.0'\", \"assert decimal_from_tuple(True, [3, 3, 3], -2) == '-3.33'\", \"assert decim...
{ "split": "train", "index": 85464, "acecode_id": "bigcode_python_fns_22127", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function that accepts a three-dimensional array as an argument and returns the product of the elements in the array. The function should be defined as follows: \n\ndef calculate_total_product(array):\n \"\"\"\n Function to calculate the product of all individual e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_product([[[2, 3], [4, 5]], [[6, 1], [7, 0]], [[8, 2], [3, 9]]]) == 0\", \"assert calculate_total_product([[[1], [2]], [[3], [4]], [[5], [6]]]) == 720\", \"assert calculate_total_product([[[1, 2, 3]], [[4, 5, 6]], [[7, 8, 9]]]) == 362880\", \"...
{ "split": "train", "index": 85465, "acecode_id": "evol_32902", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `generate_text` that takes various inputs and processes them to produce a final text output. The function should accept the following parameters: \n- `inputs`: Can be either a string or a list of strings. If it's a string, the functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_text('sample input', 50, None, None) == 'dummy text, 123. Easy peasy lemon squeezy.'\", \"assert generate_text(['input1', 'input2'], 100, None, None) == '0_dummy text, 123. Easy peasy lemon squeezy. 1_dummy text, 123. Easy peasy lemon squeezy.'\", \...
{ "split": "train", "index": 85466, "acecode_id": "oss_15611", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function that takes three integers as input and returns the result of the sum of the first two integers, divided by the third integer. If the third integer is zero, return the string 'Invalid operation. Division by zero is undefined'.\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_remainder(25, 10, 6) == 5\", \"assert find_remainder(4, 6, 0) == 'Invalid operation. Division by zero is undefined'\", \"assert find_remainder(-5, 5, 2) == 0\", \"assert find_remainder(0, 0, 1) == 0\", \"assert find_remainder(2, 2, 3) == 1\", \"assert f...
{ "split": "train", "index": 85467, "acecode_id": "evol_23432", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given list of configuration entries contains any duplicates. Each configuration entry is represented as a string. Your function should take a list of strings as input and return a boolean value: `True` if there are du...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_duplicates(['entry1', 'entry2', 'entry1']) == True\", \"assert has_duplicates(['entry1', 'entry2', 'entry3']) == False\", \"assert has_duplicates(['a', 'b', 'c', 'a']) == True\", \"assert has_duplicates(['test', 'test']) == True\", \"assert has_duplicate...
{ "split": "train", "index": 85468, "acecode_id": "bigcode_python_fns_18730", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, return a new list that contains the element-wise addition of the two input lists. The input lists will have the same length. Implement a function `add_lists(list1, list2)` where `list1` and `list2` are the input lists. The function should return a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_lists([1, 2, 3], [4, 5, 6]) == [5, 7, 9]\", \"assert add_lists([-1, -2, -3], [1, 2, 3]) == [0, 0, 0]\", \"assert add_lists([0, 0, 0], [0, 0, 0]) == [0, 0, 0]\", \"assert add_lists([10, 20, 30], [5, 15, 25]) == [15, 35, 55]\", \"assert add_lists([-5, -10,...
{ "split": "train", "index": 85469, "acecode_id": "evol_31237", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers a and b, write a function `get_maximum(a, b)` that returns the maximum of the two integers. If a is less than b, the function should return b; otherwise, it should return a.\nPlease reason step by step, then write a self-contained Python solution. Give your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_maximum(7, 14) == 14\", \"assert get_maximum(14, 7) == 14\", \"assert get_maximum(3, 3) == 3\", \"assert get_maximum(-5, -3) == -3\", \"assert get_maximum(0, 1) == 1\", \"assert get_maximum(1, 0) == 1\", \"assert get_maximum(100, 99) == 100\", \"assert g...
{ "split": "train", "index": 85470, "acecode_id": "evol_30088", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a variable number of callable arguments (functions) and randomly selects one of them to execute. The function should return the result of the selected function call. Each callable must not take any parameters. Implement the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert random_select(lambda: 1) == 1\", \"assert random_select(lambda: 2, lambda: 3) in [2, 3]\", \"assert random_select(lambda: 'hello', lambda: 'world') in ['hello', 'world']\", \"assert random_select(lambda: True, lambda: False) in [True, False]\", \"assert rand...
{ "split": "train", "index": 85471, "acecode_id": "bigcode_python_fns_31004", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of bars in a histogram. Write a function `max_area(heights: List[int]) -> int` that computes the maximum area of a rectangle that can be formed in the histogram. The area of the rectangle is defined as the width multipli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area([1, 1, 1, 1]) == 4\", \"assert max_area([5, 4, 1, 2]) == 8\", \"assert max_area([2, 4]) == 4\", \"assert max_area([0, 2, 0]) == 2\", \"assert max_area([1, 2, 3, 4, 5]) == 9\", \"assert max_area([3, 3, 3...
{ "split": "train", "index": 85472, "acecode_id": "bigcode_python_fns_29136", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with transforming a collection of movie ratings for various elements into a summary format. Given a list of movie ratings, where each movie is associated with a list of elements (e.g., genres or tags) and their respective ratings for specific features (like 'stor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_movie_ratings(['Action', 'Comedy', 'Drama'], ['story', 'acting'], [('Action', [4.0, 5.0]), ('Action', [3.0, 4.0]), ('Comedy', [2.0, 3.0]), ('Drama', [5.0, 5.0]), ('Comedy', [4.0, 4.0])]) == [{'element': 'Action', 'avg_story': 3.5, 'avg_acting': 4.5...
{ "split": "train", "index": 85473, "acecode_id": "bigcode_python_fns_2209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the rewards received in multiple roll-outs of a reinforcement learning agent. Your task is to implement a function that calculates the average reward for each roll-out and returns the overall average reward across all roll-outs. Eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(average_reward([[0, 0, 0], [0, 0], [0]]) - 0.0) < 1e-9\", \"assert abs(average_reward([[1], [2], [3], [4], [5]]) - 3.0) < 1e-9\", \"assert abs(average_reward([[1, -1], [2, -2], [3, -3]]) - 0.0) < 1e-9\", \"assert abs(average_reward([[5], [5], [5]]) - 5.0...
{ "split": "train", "index": 85474, "acecode_id": "bigcode_python_fns_19011", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `find_indices` that takes a list of `ESValue` objects and a target `ESValue` object as input, and returns a dictionary containing the indices of the matching elements. The matching criteria are based on the `isEqual` method of the `ES...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_indices([], ESValue()) == {'full': -1, 'name': -1, 'value': -1}\", \"assert find_indices([ESValue(name='a', value='1'), ESValue(name='b', value='2')], ESValue(name='a', value='3')) == {'full': -1, 'name': 0, 'value': -1}\", \"assert find_indices([ESValu...
{ "split": "train", "index": 85475, "acecode_id": "oss_24201", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that computes the square of each integer in a given list of integers. Implement a function called `square_elements` that takes a list of integers as input and returns a new list containing the square of each integer. For example, if the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_elements([1, 2, 3]) == [1, 4, 9]\", \"assert square_elements([-1, -2, -3]) == [1, 4, 9]\", \"assert square_elements([0]) == [0]\", \"assert square_elements([5, 10, 15]) == [25, 100, 225]\", \"assert square_elements([]) == []\", \"assert square_element...
{ "split": "train", "index": 85476, "acecode_id": "oss_7068", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing peptide fragments based on a given sequence of amino acids. Implement a function `peptide_fragment(sequence: str) -> List[Dict[str, Union[str, int, float]]]` that takes a string representing a peptide sequence (consisting of uppercase letters corre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert peptide_fragment('KK') == [{'name': 'y2', 'hill': 'C(12)H(26)N(4)O(3)', 'charge': 1, 'mz': 274.2004907132}, {'name': 'y1', 'hill': 'C(6)H(14)N(2)O(1)', 'charge': 1, 'mz': 147.1121234567}]\", \"assert peptide_fragment('KK') != []\", \"assert len(peptide_fragm...
{ "split": "train", "index": 85477, "acecode_id": "bigcode_python_fns_30786", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple banking system. Implement a function `manage_bank_account(transactions: List[Tuple[str, int]]) -> int` that takes a list of transactions and returns the final balance of a bank account that starts with an initial balance of 0. Each transa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_bank_account([('deposit', 500), ('withdraw', 200)]) == 300\", \"assert manage_bank_account([('deposit', 1000), ('withdraw', 500), ('withdraw', 600)]) == 500\", \"assert manage_bank_account([('deposit', 100), ('withdraw', 50), ('deposit', 200)]) == 250...
{ "split": "train", "index": 85478, "acecode_id": "oss_6673", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of telemetry records and a list of observation statistics. Each telemetry record contains an observation ID, a flag indicating if the observation is ok, and a magnitude value. The observation statistics provide information about each observation, including ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_obs_info([{'obsid': 2, 'ok': False, 'mags': 4.0}, {'obsid': 2, 'ok': False, 'mags': 5.0}], [{'obsid': 2, 'n': 5, 'f_track': 0.2, 'lf_variability_100s': 0.8, 'q25': 3.5, 'q75': 4.5}]) == [{'obsid': 2, 'ok': False, 'mags': 4.0, 'obs_ok': False, 'obs_outlie...
{ "split": "train", "index": 85479, "acecode_id": "bigcode_python_fns_5415", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function called average_of_two_numbers that takes two numerical inputs and returns their average. Ensure to handle the case where both inputs are zero and return a specific message for this scenario. The function should have the following signature: def average_of_t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_of_two_numbers(4, 6) == 5.0\", \"assert average_of_two_numbers(-2, 2) == 0.0\", \"assert average_of_two_numbers(10, 20) == 15.0\", \"assert average_of_two_numbers(-10, -20) == -15.0\", \"assert average_of_two_numbers(0, 5) == 2.5\", \"assert average_...
{ "split": "train", "index": 85480, "acecode_id": "evol_11396", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of container specifications representing the containers in a pod. Each container is represented as a dictionary with keys: 'name' and 'image'. Your task is to implement a function that checks if a specific container with a given name exists in the list of c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert does_container_exist([{'name': 'web', 'image': 'nginx'}, {'name': 'db', 'image': 'postgres'}], 'db') == True\", \"assert does_container_exist([{'name': 'web', 'image': 'nginx'}, {'name': 'db', 'image': 'postgres'}], 'api') == False\", \"assert does_container...
{ "split": "train", "index": 85481, "acecode_id": "bigcode_python_fns_47737", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sorted array of integers, write a function that returns a new array containing the squares of each number from the input array, sorted in non-decreasing order. The input array may contain negative numbers, zero, and positive numbers. Implement the function `sorted_squar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_squares([-4, -1, 0, 3, 10]) == [0, 1, 9, 16, 100]\", \"assert sorted_squares([-7, -3, 2, 3, 11]) == [4, 9, 9, 49, 121]\", \"assert sorted_squares([-2, -1]) == [1, 4]\", \"assert sorted_squares([0]) == [0]\", \"assert sorted_squares([1, 2, 3]) == [1, 4...
{ "split": "train", "index": 85482, "acecode_id": "evol_5215", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that identifies the ten most expensive products from a given list of product names and their corresponding unit prices. Write a Python function `retrieve_most_expensive_items` that takes a list of tuples, where each tuple contains a produ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_most_expensive_items([('Product A', 100), ('Product B', 90), ('Product C', 80), ('Product D', 70), ('Product E', 60), ('Product F', 50), ('Product G', 40), ('Product H', 30), ('Product I', 20), ('Product J', 10)]) == [('Product A', 100), ('Product B...
{ "split": "train", "index": 85483, "acecode_id": "oss_7853", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an object, determine if it is a subclass of a specific class named 'IcypawScalarType'. Implement a function `is_icypaw_scalar_type_annotation(obj)` that takes one parameter, `obj`. The function should return `True` if `obj` is a type and is a subclass of `IcypawScalarType...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_icypaw_scalar_type_annotation(IcypawScalarType) == True\", \"assert is_icypaw_scalar_type_annotation(str) == False\", \"assert is_icypaw_scalar_type_annotation(int) == False\", \"assert is_icypaw_scalar_type_annotation(float) == False\", \"assert is_icypa...
{ "split": "train", "index": 85484, "acecode_id": "bigcode_python_fns_47552", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string representation of a JSON object that contains information about a music track. The JSON object has the following structure: {\"id\": <track_id>, \"genres\": [<genre1>, <genre2>, ...], \"wordcount\": {<word_id1>: <word_count1>, <word_id2>: <word_count2>, ....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert json_line_to_track('{\\\"id\\\": \\\"1\\\", \\\"genres\\\": [\\\"rock\\\", \\\"pop\\\"], \\\"wordcount\\\": {\\\"1\\\": \\\"10\\\", \\\"2\\\": \\\"5\\\"}}') == (1, ['rock', 'pop'], {1: 10, 2: 5})\", \"assert json_line_to_track('{\\\"id\\\": \\\"2\\\", \\\"ge...
{ "split": "train", "index": 85485, "acecode_id": "bigcode_python_fns_37998", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a function that determines the number of lines in a Chinese poem based on its type. There are two recognized types of poetry: '七言绝句' (seven-character quatrain) and '五言律诗' (five-character regulated verse). The '七言绝句' type has 4 lines, while the '五言律诗' type has 8 li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_lines('\\u4e03\\u8a00\\u7edd\\u53e5') == 4\", \"assert count_lines('\\u4e94\\u8a00\\u5f8b\\u8bd7') == 8\", \"assert count_lines('unknown_type') == -1\", \"assert count_lines('\\u4e94\\u8a00\\u7edd\\u53e5') == -1\", \"assert count_lines('\\u4e03\\u8a00\...
{ "split": "train", "index": 85486, "acecode_id": "oss_35395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `validate_user` that takes a dictionary representing a user and checks if it complies with a predefined JSON schema. The schema should enforce the following rules: The object must have `firstName` and `lastName` as required fields, both of which must be string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_user({'firstName': 'John', 'lastName': 'Doe'}) == True\", \"assert validate_user({'firstName': 'Alice', 'lastName': 'Smith', 'age': 25}) == True\", \"assert validate_user({'firstName': 'Bob', 'lastName': 'Brown', 'age': 0}) == True\", \"assert valid...
{ "split": "train", "index": 85487, "acecode_id": "evol_3820", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_distinctive_char(s: str) -> Tuple[str, int]` that takes a string `s` as input and returns a tuple containing the first unique character in the string and its index. If all characters are repeating, return the character that occurs least frequently and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_distinctive_char('abcdefg') == ('a', 0)\", \"assert find_distinctive_char('aabbccddeeffgg') == ('a', 0)\", \"assert find_distinctive_char('123456123') == ('4', 3)\", \"assert find_distinctive_char('aA') == ('a', 0)\", \"assert find_distinctive_char('abc...
{ "split": "train", "index": 85488, "acecode_id": "evol_15352", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates shutting down a virtual shell. The shell is represented by a dictionary with a key `shutdown` that indicates whether the shell is active or not. Write a function `shutdown_shell(shell: dict) -> dict` that takes in a diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shutdown_shell({'shutdown': False}) == {'shutdown': True, 'status': 'EXIT', 'message': 'Shutting down the shell.', 'echo': True}\", \"assert shutdown_shell({'shutdown': True}) == {'shutdown': True, 'status': 'EXIT', 'message': 'Shutting down the shell.', 'ec...
{ "split": "train", "index": 85489, "acecode_id": "bigcode_python_fns_7136", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `deregister_hiveserver(version: str, kerberos: bool) -> None` that simulates deregistering a HiveServer2 instance. The function should take two parameters: a string `version` representing the version of the HiveServer2 to deregister, and a boole...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deregister_hiveserver('2.3.7', False) == 'Deregistered HiveServer2 version: 2.3.7'\", \"assert deregister_hiveserver('3.1.0', False) == 'Deregistered HiveServer2 version: 3.1.0'\", \"assert deregister_hiveserver('1.2.1', False) == 'Deregistered HiveServer2 v...
{ "split": "train", "index": 85490, "acecode_id": "evol_19216", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of floating-point numbers representing mass fractions of different elements in a stellar model. Each element's mass fraction should sum up to 1.0. Write a function `scale_mass_fractions(fractions: List[float]) -> List[float]` that scales these mass fraction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_mass_fractions([0.5, 0.5]) == [0.5, 0.5]\", \"assert scale_mass_fractions([0.2, 0.3, 0.5]) == [0.2, 0.3, 0.5]\", \"assert scale_mass_fractions([0.1, 0.1, 0.1, 0.7]) == [0.1/1.0, 0.1/1.0, 0.1/1.0, 0.7/1.0]\", \"assert scale_mass_fractions([0.4, 0.4, 0.2...
{ "split": "train", "index": 85491, "acecode_id": "bigcode_python_fns_12784", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of gene segments represented as strings in the format \"gs:gstart:gend:strand_inferred:chrom\". Each segment contains information about the gene symbol (gs), start position (gstart), end position (gend), inferred strand (strand_inferred), and chromosome (ch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert segment_genes([\\\"gene1:100:200:+:chr1\\\", \\\"gene2:300:400:-:chr2\\\", \\\"gene3:500:600:+:chr1\\\", \\\"gene4:700:800:-:chr2\\\", \\\"gene5:900:1000:+:chr3\\\"]) == {\\\"chr1\\\": [\\\"gene1\\\", \\\"gene3\\\"], \\\"chr2\\\": [\\\"gene2\\\", \\\"gene4\\...
{ "split": "train", "index": 85492, "acecode_id": "oss_22984", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the count of numbers that are greater than or equal to a specified minimum value. The function should take two parameters: a list of integers 'nums' and an integer 'min_value'. The function should return an integer represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_greater_equal([1, 2, 3, 4, 5], 3) == 3\", \"assert count_greater_equal([-1, -2, -3, -4], -2) == 2\", \"assert count_greater_equal([0, 0, 0, 0], 1) == 0\", \"assert count_greater_equal([5, 5, 5], 5) == 3\", \"assert count_greater_equal([], 1) == 0\", \"...
{ "split": "train", "index": 85493, "acecode_id": "bigcode_python_fns_31873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that accepts two distinct ascending-ordered lists of integers, A and B, of unequal lengths p and q (p ≠ q), respectively, and merges them into a single list in ascending order without using any built-in sort functions. The function should maximize efficiency b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_lists([10, 20, 30], [5, 15]) == [5, 10, 15, 20, 30]\", \"assert merge_lists([1, 2], [3, 4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_lists([8, 12, 14, 16], [7, 11, 13]) == [7, 8, ...
{ "split": "train", "index": 85494, "acecode_id": "evol_11278", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function `remove_empty_strings(lst)` that removes all the empty strings in-place and returns the modified list. The function should not use any pre-defined functions like filter() and should operate in one pass without using additional memor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_empty_strings(['Hello', '', 'World', '', '', 'Python', 'is', 'awesome', '']) == ['Hello', 'World', 'Python', 'is', 'awesome']\", \"assert remove_empty_strings(['', '']) == []\", \"assert remove_empty_strings(['This', 'is', '', 'a', 'test']) == ['This'...
{ "split": "train", "index": 85495, "acecode_id": "evol_3306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a user logging out of a system. The function should take no parameters and return a string indicating the logout status. When the function is called, it should return 'User logged out successfully.'\nPlease reason step ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert logout() == 'User logged out successfully.'\", \"assert logout() == 'User logged out successfully.'\", \"assert logout() == 'User logged out successfully.'\", \"assert logout() == 'User logged out successfully.'\", \"assert logout() == 'User logged out succe...
{ "split": "train", "index": 85496, "acecode_id": "bigcode_python_fns_7991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a code snippet that follows a specific format: `<reponame>Owner/RepoName<gh_stars>Min-Max`. Your task is to write a function that extracts and returns structured information from this code snippet. The function should return a dictionary containing the repository ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_repo_info('<reponame>OwnerA/RepoOne<gh_stars>1-10') == {'reponame': 'OwnerA/RepoOne', 'owner': 'OwnerA', 'repo_name': 'RepoOne', 'stars_min': 1, 'stars_max': 10}\", \"assert extract_repo_info('<reponame>OwnerB/RepoTwo<gh_stars>5-15') == {'reponame': ...
{ "split": "train", "index": 85497, "acecode_id": "oss_21915", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `merge_configs(args: List[int], defaults: List[int]) -> List[int]` that merges the `args` list with the `defaults` list. The function should replace values in the `defaults` list with corresponding values from the `args` list only if t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_configs([1, -1, 3, 0], [0, 2, 0, 4]) == [1, 2, 3, 4]\", \"assert merge_configs([0, -1, 0, 0], [0, 2, 0, 4]) == [0, 2, 0, 4]\", \"assert merge_configs([-1, -1, -1, -1], [1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert merge_configs([1, 0, 0, -1], [2, 3, 4, 5])...
{ "split": "train", "index": 85498, "acecode_id": "bigcode_python_fns_45859", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `bubble_sort(arr: List[int]) -> List[int]` that sorts an array of integers in non-decreasing order using the bubble sort algorithm. The function should return a new sorted array without modifying the original array. Ensure to handle edge cases such as an em...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort([]) == []\", \"assert bubble_sort([5]) == [5]\", \"assert bubble_sort([3, 2, 1]) == [1, 2, 3]\", \"assert bubble_sort([1, 2, 3]) == [1, 2, 3]\", \"assert bubble_sort([1, 1, 1]) == [1, 1, 1]\", \"assert bubble_sort([4, 2, 3, 1]) == [1, 2, 3, 4]\",...
{ "split": "train", "index": 85499, "acecode_id": "evol_7143", "num_tests": 16 }