data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a list of non-negative integers. Your task is to implement a function that sorts this list in descending order using the bubble sort algorithm. Write a function named `bubble_sort_descending` that takes a list of integers as input and modifies the list in place to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort_descending([4, 23, 1, 89, 56]) == [89, 56, 23, 4, 1]\", \"assert bubble_sort_descending([1]) == [1]\", \"assert bubble_sort_descending([10, 20, 30]) == [30, 20, 10]\", \"assert bubble_sort_descending([5, 5, 5]) == [5, 5, 5]\", \"assert bubble_sor... | {
"split": "train",
"index": 68200,
"acecode_id": "evol_12252",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a graph represented as an adjacency list, implement a function that calculates the average clustering coefficient of the graph. The average clustering coefficient is defined as the average of the local clustering coefficients for all nodes in the graph. Each local cluster... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_clustering_coefficient({'A': ['B'], 'B': ['A', 'C'], 'C': ['B']}) == 0.0\", \"assert calculate_average_clustering_coefficient({'A': ['B', 'C'], 'B': ['A'], 'C': ['A']}) == 0.0\", \"assert calculate_average_clustering_coefficient({'A': [], '... | {
"split": "train",
"index": 68201,
"acecode_id": "oss_32541",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Implement a function `elementwise_max` that returns a new list containing the maximum values from each corresponding index of the input lists. The input will be a variable number of lists, and the function should support lists of different leng... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert elementwise_max([1, 2, 3], [4, 5], [0]) == [4, 5, 3]\", \"assert elementwise_max([-1, -2, -3], [-4, -5], [-6]) == [-1, -2, -3]\", \"assert elementwise_max([1, 2], [3, 2, 1], [1, 3, 2]) == [3, 3, 2]\", \"assert elementwise_max([], []) == []\", \"assert elemen... | {
"split": "train",
"index": 68202,
"acecode_id": "bigcode_python_fns_47997",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are working on a computer vision project that involves processing images and their associated annotations. Your task is to implement a function that processes the input data and returns a dictionary containing the processed images and annotations. You are given three inputs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_images_and_annotations(['img1', 'img2'], ['label1', 'label2', 'label3'], 0) == {'images': ['img1-processed', 'img2-processed'], 'annotations': ['label1', 'label2', 'label3']}\", \"assert process_images_and_annotations([], ['label1', 'label2'], 0) == ... | {
"split": "train",
"index": 68203,
"acecode_id": "oss_4609",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes an integer input `length` and returns a list of `length` random integers, where the integers range between 1 and 100 (inclusive). The input `length` must be at least 5. If the input `length` is less than 5, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_int_list(5) != generate_random_int_list(5)\", \"assert len(generate_random_int_list(5)) == 5\", \"assert all(1 <= x <= 100 for x in generate_random_int_list(10))\", \"assert len(generate_random_int_list(6)) == 6\", \"assert len(generate_rando... | {
"split": "train",
"index": 68204,
"acecode_id": "oss_12566",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of date entries in the format 'YYYY-MM-DD', write a function that organizes these dates into successive weekly timespans. Each week should start on Monday and end on Sunday. The function should return a dictionary where each key is a tuple representing the start an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_dates_into_weeks(['2022-01-01', '2022-01-02', '2022-01-08', '2022-01-15', '2022-01-16', '2022-01-22', '2022-02-01']) == {('2021-12-27', '2022-01-02'): ['2022-01-01', '2022-01-02'], ('2022-01-03', '2022-01-09'): ['2022-01-08'], ('2022-01-10', '2022-0... | {
"split": "train",
"index": 68205,
"acecode_id": "evol_3209",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s`. Your task is to transform `s` into a palindrome by appending characters to its beginning. Write a function `shortest_palindrome(s: str) -> str` that returns the shortest possible palindrome that can be achieved through this transformation process. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_palindrome('abcd') == 'dcbabcd'\", \"assert shortest_palindrome('racecar') == 'racecar'\", \"assert shortest_palindrome('abc') == 'cbabc'\", \"assert shortest_palindrome('abba') == 'abba'\", \"assert shortest_palindrome('a') == 'a'\", \"assert short... | {
"split": "train",
"index": 68206,
"acecode_id": "evol_24277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings where each string contains a SampleID followed by two values (an antigen and a receptor) separated by spaces, write a function that extracts unique SampleIDs, antigens, and receptors from the list. The function should return a tuple containing a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_data(['sample1 IgA Fc1', 'sample2 IgG Fc2', 'sample3 IgA Fc2', 'sample1 IgA Fc1']) == (['sample1', 'sample2', 'sample3'], ['Fc1', 'Fc2'], ['IgA', 'IgG'])\", \"assert extract_data(['sample1 IgA Fc1', 'sample1 IgA Fc1']) == (['sample1'], ['Fc1'], ['IgA... | {
"split": "train",
"index": 68207,
"acecode_id": "bigcode_python_fns_41504",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing control points and a list of labels corresponding to those control points. Your task is to create a function that returns a list of dictionaries, where each dictionary contains the label and the corresponding control point from the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_peaks([1, 2, 3], ['A', 'B', 'C']) == [{'label': 'A', 'point': 1}, {'label': 'B', 'point': 2}, {'label': 'C', 'point': 3}]\", \"assert initialize_peaks([4, 5], ['X', 'Y', 'Z']) == []\", \"assert initialize_peaks([], []) == []\", \"assert initialize... | {
"split": "train",
"index": 68208,
"acecode_id": "bigcode_python_fns_29083",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple trading system for futures contracts. Specifically, you need to create a function that takes two parameters: a price (float) and a time_in_force (string). The function should return a dictionary representing a futures limit order with t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_future_limit_order(100.5, 'GTC') == {'price': 100.5, 'time_in_force': 'GTC'}\", \"assert create_future_limit_order(250.75, 'IOC') == {'price': 250.75, 'time_in_force': 'IOC'}\", \"assert create_future_limit_order(0.0, 'FOK') == {'price': 0.0, 'time_in... | {
"split": "train",
"index": 68209,
"acecode_id": "oss_30192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D array of integers and an integer k, implement a function that finds the sum of all elements that are greater than k and returns the sum along with the count of those elements. If no elements are greater than k, return -1 and 0 respectively.\nPlease reason step by ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greater_elems_sum_count([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 4) == (35, 5)\", \"assert greater_elems_sum_count([[1, 2], [3, 4]], 5) == (-1, 0)\", \"assert greater_elems_sum_count([[1, 2, 3], [4, 5, 6]], 6) == (-1, 0)\", \"assert greater_elems_sum_count([[1, 2,... | {
"split": "train",
"index": 68210,
"acecode_id": "evol_5335",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a square matrix of size n x n and an integer value, write a function that fills the k-th diagonal of the matrix with the specified integer value. The k-th diagonal is defined as the diagonal running from the top-left to the bottom-right of the matrix, where k = 0 refers t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fill_diagonal([[1, 2], [3, 4]], 9, 0) == [[9, 2], [3, 9]]\", \"assert fill_diagonal([[1, 2], [3, 4]], 9, 1) == [[1, 9], [3, 4]]\", \"assert fill_diagonal([[5]], 10, 0) == [[10]]\", \"assert fill_diagonal([[1, 2], [3, 4]], 5, -1) == [[1, 2], [5, 4]]\", \"asse... | {
"split": "train",
"index": 68211,
"acecode_id": "bigcode_python_fns_30894",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains two integers (a, b). Your task is to implement a function that filters and returns a new list containing only those tuples (m, n) from the input list where the first element of the tuple m is less than a specified thresh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_tuples([(1, 2), (3, 4), (5, 6)], 0.75) == [(1, 2)]\", \"assert filter_tuples([(10, 20), (30, 40), (50, 60)], 0.5) == []\", \"assert filter_tuples([], 0.5) == []\", \"assert filter_tuples([(1, 2)], 1) == [(1, 2)]\", \"assert filter_tuples([(12, 24), (6... | {
"split": "train",
"index": 68212,
"acecode_id": "bigcode_python_fns_48297",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_active_orders(table: int) -> List[Dict[str, str]]` that simulates retrieving active orders for a given table number in a restaurant management system. The function takes a parameter `table` representing the table number, and it retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_active_orders(1) == [{'item_name': 'Burger', 'quantity': '2', 'additional_details': 'No onions'}, {'item_name': 'Fries', 'quantity': '1', 'additional_details': 'Extra crispy'}]\", \"assert get_active_orders(2) == [{'item_name': 'Pizza', 'quantity': '1', ... | {
"split": "train",
"index": 68213,
"acecode_id": "oss_26093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates mouse click events on an image. The function should take a list of tuples representing mouse events, where each tuple contains the event type (as a string: 'left' for left-click and 'right' for right-click) and the coordina... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_mouse_events([('left', (10, 20)), ('right', (30, 40))]) == ['Left click at (10, 20)', 'Right click event occurred']\", \"assert handle_mouse_events([('right', (0, 0)), ('left', (5, 5)), ('left', (10, 15))]) == ['Right click event occurred', 'Left clic... | {
"split": "train",
"index": 68214,
"acecode_id": "oss_30880",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple middleware system for processing a web request. Your middleware system should allow for adding, removing, and executing a sequence of middlewares that modify the request in a specified order. Each middleware will implement a `process` m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_middlewares([], 'initial_request') == 'initial_request'\", \"assert process_middlewares([lambda req: req + ' -> middleware1'], 'initial_request') == 'initial_request -> middleware1'\", \"assert process_middlewares([lambda req: req + ' -> middleware1'... | {
"split": "train",
"index": 68215,
"acecode_id": "oss_3979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement the function is_prime_and_largest_prime_factor(n) that checks if a given integer n is a prime number and also calculates its largest prime factor. The function should return a tuple of the form (is_prime, largest_prime_factor), where is_prime indicates if the number i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime_and_largest_prime_factor(1) == (False, 1)\", \"assert is_prime_and_largest_prime_factor(2) == (True, 2)\", \"assert is_prime_and_largest_prime_factor(3) == (True, 3)\", \"assert is_prime_and_largest_prime_factor(4) == (False, 2)\", \"assert is_prime... | {
"split": "train",
"index": 68216,
"acecode_id": "evol_27902",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of image filenames and extracts specific views from each image. The function should take in a list of strings representing the filenames and return a list of strings containing the processed images for eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert image_processor(['image1.jpg', 'image2.png']) == ['image1.jpg Front', 'image1.jpg Front_left', 'image1.jpg Side_left', 'image1.jpg Front_right', 'image1.jpg Side_right', 'image2.png Front', 'image2.png Front_left', 'image2.png Side_left', 'image2.png Front_r... | {
"split": "train",
"index": 68217,
"acecode_id": "oss_12731",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `cache_request` that simulates caching behavior for HTTP requests. The function takes a URL and a method (either 'GET' or 'POST') as input. The function should return a cache response that includes the URL, method, and a status code (200 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_request('http://example.com', 'GET') == {'url': 'http://example.com', 'method': 'GET', 'status': 200}\", \"assert cache_request('http://example.com', 'POST') == {'url': 'http://example.com', 'method': 'POST', 'status': 200}\", \"assert cache_request('h... | {
"split": "train",
"index": 68218,
"acecode_id": "bigcode_python_fns_9729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_unique_words(sentence: str) -> int` that takes a string `sentence` and returns the count of unique words in that sentence. A word is defined as a sequence of characters separated by spaces. For the purpose of testing, consider punctuation marks as part o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_words('This is a sentence') == 4\", \"assert count_unique_words('Hello, world! Hello world') == 4\", \"assert count_unique_words('abc abc def ghi abc') == 3\", \"assert count_unique_words('A quick brown fox jumps over the lazy dog') == 9\", \"as... | {
"split": "train",
"index": 68219,
"acecode_id": "evol_3553",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a feed with various fields. Your task is to create a function `get_feed_list(feeds: List[Dict[str, Any]]) -> List[Dict[str, Any]]` that takes this list of feeds and returns a list of feeds with only the vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_feed_list([{'id': 1, 'title': 'Feed 1', 'content': 'Content 1'}, {'id': 2, 'title': 'Feed 2'}]) == [{'id': 1, 'title': 'Feed 1', 'content': 'Content 1'}]\", \"assert get_feed_list([{'title': 'Feed 1', 'content': 'Content 1'}, {'id': 2, 'title': 'Feed 2',... | {
"split": "train",
"index": 68220,
"acecode_id": "bigcode_python_fns_30631",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a list of integers is monotonically increasing or decreasing, while also considering specific conditions. The function should accept a list and the following optional parameters: 'strict' (a boolean that indicates whether adjacent elements ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monotonic_advanced([1, 2, 3, 4], strict=False, zero_crossing=False, progression='arithmetic') == True\", \"assert monotonic_advanced([4, 3, 2, 1], strict=False, zero_crossing=False, progression='arithmetic') == True\", \"assert monotonic_advanced([1, 2, 3, 4... | {
"split": "train",
"index": 68221,
"acecode_id": "evol_18598",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Develop a function that receives a list of temperature values (integers or floats) and computes the mean temperature from the provided set of values. If the input list is empty, the function should return 0.\nPlease reason step by step, then write a self-contained Python soluti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mean_temperature([20, 24, 26, 18]) == 22.0\", \"assert calculate_mean_temperature([15, 30, 45]) == 30.0\", \"assert calculate_mean_temperature([-10, 0, 10]) == 0.0\", \"assert calculate_mean_temperature([100, 200, 300]) == 200.0\", \"assert calcula... | {
"split": "train",
"index": 68222,
"acecode_id": "evol_30207",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that finds the maximum number in a list without using the built-in max function. The function should return not only the maximum value but also a list of all indices where this maximum value occurs. Additionally, the function should compute and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_and_indices([15, 32, 76, 48, 90, 22]) == (90, [4], 4)\", \"assert max_and_indices([90, 32, 76, 48, 90, 22]) == (90, [0, 4], 2)\", \"assert max_and_indices([1, 2, 3, 2, 1]) == (3, [2], 2)\", \"assert max_and_indices([5, 5, 5, 5, 5]) == (5, [0, 1, 2, 3, 4]... | {
"split": "train",
"index": 68223,
"acecode_id": "evol_21826",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and an integer value, implement a function that returns the index of the first occurrence of the integer in the list. If the integer is not present in the list, the function should return -1.\nPlease reason step by step, then write a self-contained Pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_position([1, 7, 9, 8, 5], 9) == 2\", \"assert find_position([1, 7, 9, 8, 5], 1) == 0\", \"assert find_position([1, 7, 9, 8, 5], 5) == 4\", \"assert find_position([1, 7, 9, 8, 5], 8) == 3\", \"assert find_position([1, 7, 9, 8, 5], 10) == -1\", \"assert f... | {
"split": "train",
"index": 68224,
"acecode_id": "evol_19671",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries, write a function that sorts the list based on the values of a specified key. The function should take two parameters: the list of dictionaries and the key to sort by. If the key does not exist in a dictionary, that dictionary should be placed at th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_dicts_by_key([{'name': 'John', 'age': 15}, {'name': 'Jane', 'age': 20}, {'name': 'Alice', 'age': 12}], 'age') == [{'name': 'Alice', 'age': 12}, {'name': 'John', 'age': 15}, {'name': 'Jane', 'age': 20}]\", \"assert sort_dicts_by_key([{'name': 'John', 'ag... | {
"split": "train",
"index": 68225,
"acecode_id": "evol_35312",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a list of integers and returns a new list containing only the unique integers from the input list, in the order they first appear. The function should not modify the original list. Write a function `get_unique_integers(a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_integers([5, 6, 5, 7, 8, 7]) == [5, 6, 7, 8]\", \"assert get_unique_integers([10, 20, 30, 20, 10]) == [10, 20, 30]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_in... | {
"split": "train",
"index": 68226,
"acecode_id": "oss_15110",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement an algorithm to convert this string into snake_case. The transformation should ignore any special characters or numbers, and retain only lowercase letters. If there are multiple spaces between words, they should be treated as a single space. Return the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert snake_case_converter('This is a Test Phrase') == 'this_is_a_test_phrase'\", \"assert snake_case_converter('Hello, World !! Today is 1st May') == 'hello_world_today_is_st_may'\", \"assert snake_case_converter(' Leading and trailing spaces ') == 'leadi... | {
"split": "train",
"index": 68227,
"acecode_id": "evol_14319",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string and a positive integer n as inputs and returns a list containing the string repeated n times. The function should validate that the string is not empty and that n is a positive integer. If the string is empty or n is not a positive integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_string_n_times('hello', 3) == ['hello', 'hello', 'hello']\", \"assert repeat_string_n_times('test', 1) == ['test']\", \"assert repeat_string_n_times('Python', 5) == ['Python', 'Python', 'Python', 'Python', 'Python']\", \"assert repeat_string_n_times('... | {
"split": "train",
"index": 68228,
"acecode_id": "evol_6313",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a message for logging. The function should take in the following parameters: a log level (string), a message subject (string), and a message body (string). The function should concatenate these inputs into a single formatted ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_log_message('INFO', 'Server Start', 'The server has started successfully.') == '[INFO]: [Server Start] - [The server has started successfully.]'\", \"assert format_log_message('ERROR', 'Database Connection', 'Failed to connect to the database.') == '[... | {
"split": "train",
"index": 68229,
"acecode_id": "bigcode_python_fns_19892",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a predefined tuple `JOIN_TOKENS` containing three specific elements from an enumeration called `NodeToken`. Your task is to implement a function that takes a list of `NodeToken` objects and returns a new list containing only the `NodeToken` objects that are presen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_join_tokens([NodeToken.JOIN]) == [NodeToken.JOIN]\", \"assert filter_join_tokens([NodeToken.JOIN1]) == [NodeToken.JOIN1]\", \"assert filter_join_tokens([NodeToken.JOIN2]) == [NodeToken.JOIN2]\", \"assert filter_join_tokens([NodeToken.MERGE]) == []\", ... | {
"split": "train",
"index": 68230,
"acecode_id": "oss_32040",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a network configuration with specific parameters. The function should create a network object and set up two configuration parameters: `monitor` to `False` (to disable network monitoring) and `enable_learning` to `True` (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_network('host1', 'secret1', 'releasefive-daily') == {'monitor': False, 'enable_learning': True}\", \"assert initialize_network('host2', 'secret2', 'releasefive-daily') == {'monitor': False, 'enable_learning': True}\", \"assert initialize_network('... | {
"split": "train",
"index": 68231,
"acecode_id": "oss_3603",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary image represented as a 2D list of integers where each integer is either 0 or 1, write a function that splits the image into continuous horizontal blocks of 1s. Each block should be represented as a list of lists, where each inner list corresponds to a row of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_binary_image_into_blocks([[0, 0, 0], [1, 1, 1], [0, 0, 0], [1, 1, 1]]) == [[[1, 1, 1]], [[1, 1, 1]]]\", \"assert split_binary_image_into_blocks([[0, 0], [0, 0], [0, 0]]) == []\", \"assert split_binary_image_into_blocks([[1, 0], [1, 0], [0, 0], [0, 0], ... | {
"split": "train",
"index": 68232,
"acecode_id": "bigcode_python_fns_43429",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of folders where each folder contains file names. Each file name can have any extension. Your task is to determine if all the folders contain only PNG files and no other types of files. Implement a function `is_valid_png_folders(folders: List[List[str]]) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_png_folders([['image1.png', 'image2.png'], ['image3.png']]) == True\", \"assert is_valid_png_folders([['image1.png', 'image2.png', 'image3.png'], ['another_image.png']]) == True\", \"assert is_valid_png_folders([['image1.png', 'image2.png'], ['image... | {
"split": "train",
"index": 68233,
"acecode_id": "bigcode_python_fns_39840",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates changing the current working directory of a system. Write a function `change_directory(path: str) -> str` that takes a string `path`, representing a file system path, and returns a message indicating whether the directory c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_directory('/home/user/documents') == 'Directory changed to /home/user/documents'\", \"assert change_directory('/var/log') == 'Directory changed to /var/log'\", \"assert change_directory('/etc/nginx') == 'Directory changed to /etc/nginx'\", \"assert ch... | {
"split": "train",
"index": 68234,
"acecode_id": "bigcode_python_fns_4104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if all elements of a given list are present in another list without considering duplicates. The function should return True if all elements of the first list exist in the second list, and False otherwise. For example, for list1 = [1, 2] and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_elements_present([1, 2, 3], [1, 2, 3, 4, 5]) == True\", \"assert are_elements_present([1, 2], [1, 2, 3]) == True\", \"assert are_elements_present([1, 2, 3, 4], [4, 3, 2, 1]) == True\", \"assert are_elements_present([5], [1, 2, 3]) == False\", \"assert ar... | {
"split": "train",
"index": 68235,
"acecode_id": "evol_30257",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the Euclidean distance between two n-dimensional points. The function should accept two lists, each representing a point in n-dimensional space. Ensure that both lists have the same length, and raise a ValueError if they do not. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert euclidean_distance([0, 0], [3, 4]) == 5.0\", \"assert euclidean_distance([1, 2, 3], [4, 5, 6]) == 5.196152422706632\", \"assert euclidean_distance([-1, -1], [1, 1]) == 2.8284271247461903\", \"assert euclidean_distance([0], [0]) == 0.0\", \"assert euclidean_d... | {
"split": "train",
"index": 68236,
"acecode_id": "evol_27860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `get_even_numbers(nums: List[int]) -> List[int]` that returns a new list containing only the even numbers from the original list. The order of the numbers in the output list should be the same as their order in the input list. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert get_even_numbers([1, 3, 5]) == []\", \"assert get_even_numbers([2, 4, 6]) == [2, 4, 6]\", \"assert get_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert get_even_numbers([-2, -1, 0, 1, 2]) == [-2, ... | {
"split": "train",
"index": 68237,
"acecode_id": "bigcode_python_fns_48492",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that serializes a given object to a JSON string format. The function should handle basic data types such as integers, floats, strings, lists, and dictionaries. If the object contains unsupported types (e.g., custom objects, sets, etc.), t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_to_json(123) == '123'\", \"assert serialize_to_json(3.14) == '3.14'\", \"assert serialize_to_json('hello') == '\\\"hello\\\"'\", \"assert serialize_to_json([1, 2, 3]) == '[1, 2, 3]'\", \"assert serialize_to_json({'key': 'value'}) == '{\\\"key\\\": ... | {
"split": "train",
"index": 68238,
"acecode_id": "bigcode_python_fns_41706",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts information about software and their licenses from a given list of strings. Each string in the list follows a specific format: 'Software: {software_name} License: {license_type}'. Your function should process this lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_license_info(['Software: ExampleSoftware License: GNU Lesser General Public License', 'Software: AnotherSoftware License: MIT License']) == {'ExampleSoftware': 'GNU Lesser General Public License', 'AnotherSoftware': 'MIT License'}\", \"assert extract... | {
"split": "train",
"index": 68239,
"acecode_id": "oss_15766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given file name corresponds to a medical image file in the DICOM format. The function should determine this based solely on the file's extension. The valid DICOM file extensions are: \".dcm\", \".dicom\", and \".ima\". Wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_dicom_file('image.dcm') == True\", \"assert is_dicom_file('scan.ima') == True\", \"assert is_dicom_file('document.txt') == False\", \"assert is_dicom_file('image.png') == False\", \"assert is_dicom_file('archive.dcm.zip') == False\", \"assert is_dicom_fil... | {
"split": "train",
"index": 68240,
"acecode_id": "bigcode_python_fns_37061",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `findURLs` that takes a string as input and uses a regular expression to extract all web addresses (HTTP and HTTPS) from the given string. The function should account for variations in URL formation, including the presence or absence of 'www', special character... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findURLs('Visit us at http://example.com for more info.') == ['example.com']\", \"assert findURLs('Check out our site https://www.test-site.org!') == ['test-site.org']\", \"assert findURLs('No valid URL here!') == []\", \"assert findURLs('Contact us at www.e... | {
"split": "train",
"index": 68241,
"acecode_id": "evol_29668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a specific format of binary table field descriptors into a corresponding dtype format and shape for a numpy array. The descriptors follow a specific syntax: single characters represent the data type (e.g., 'L' for boolea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_aips_format('4J') == ('>i4', 4)\", \"assert convert_aips_format('2I') == ('>i2', 2)\", \"assert convert_aips_format('E(4,32)') == ('>f4', (4, 32))\", \"assert convert_aips_format('D(2,10)') == ('>f8', (2, 10))\", \"assert convert_aips_format('E(1,1)'... | {
"split": "train",
"index": 68242,
"acecode_id": "bigcode_python_fns_46792",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary may contain a key called 'score'. Your task is to implement a function that sorts the list based on the values of the 'score' key in ascending order. If a dictionary does not have the 'score' key or if the value associ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_dicts_by_score([{'score': 100}, {'score': 5}, {'score': 90}, {}, {'score': 60}, {'score': 'fifty'}]) == [{'score': 5}, {'score': 60}, {'score': 90}, {'score': 100}, {}, {'score': 'fifty'}]\", \"assert sort_dicts_by_score([{'score': 10}, {'score': 20}, {... | {
"split": "train",
"index": 68243,
"acecode_id": "evol_20549",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that rearranges the list based on a user-defined order and returns a new list where each element from the rearranged list is repeated twice. The input to the function will be two lists: the first list containing the integers and th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_twice([1, 2, 3, 4], [2, 0, 3, 1]) == [3, 3, 1, 1, 4, 4, 2, 2]\", \"assert print_twice([5, 10, 15], [1, 2, 0]) == [10, 10, 15, 15, 5, 5]\", \"assert print_twice([0, 1, 2], [0, 2, 1]) == [0, 0, 2, 2, 1, 1]\", \"assert print_twice([4, 5, 6, 7], [3, 2, 1, ... | {
"split": "train",
"index": 68244,
"acecode_id": "evol_4265",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a linear search on a provided list of integers for a specified target integer. The function should return the number of comparisons made to find the target. If the target is not found, return the number of comparisons made along with a message... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linear_search([1, 2, 3, 4, 5], 5) == 5\", \"assert linear_search([1], 1) == 1\", \"assert linear_search([5, 4, 3, 2, 1], 3) == 3\", \"assert linear_search([10, 9, 8, 7, 6], 10) == 1\", \"assert linear_search([-1, -2, -3, -4], -3) == 3\", \"assert linear_sear... | {
"split": "train",
"index": 68245,
"acecode_id": "evol_17703",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that filters out prime numbers from a given list and returns a new list containing only these prime numbers. The prime numbers must be sorted in descending order. You are not allowed to use any pre-existing library functions for checking primality. For... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isolate_primes([2, 3, 4, 5, 6, 7, 8, 9, 10]) == [7, 5, 3, 2]\", \"assert isolate_primes([11, 13, 17, 19]) == [19, 17, 13, 11]\", \"assert isolate_primes([4, 6, 8, 10]) == []\", \"assert isolate_primes([29, 23, 19, 15, 9]) == [29, 23, 19]\", \"assert isolate_... | {
"split": "train",
"index": 68246,
"acecode_id": "evol_26439",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a target element, write a function that checks if all elements within the target (which can be of any iterable type) are present and returns a tuple containing four values: a boolean indicating if all elements are present, the count of occurrences of the target element, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_element(1) == (True, 0, 0, 0)\", \"assert check_element([1, 2, 3]) == (True, 0, 0, 3)\", \"assert check_element({1, 2, 3}) == (True, 0, 0, 3)\", \"assert check_element((1, 2, 3)) == (True, 0, 0, 3)\", \"assert check_element([]) == (True, 0, 0, 0)\", \"... | {
"split": "train",
"index": 68247,
"acecode_id": "evol_19163",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that renames a short URL. The function should take two strings as input: an `old_slug` representing the current identifier of the short URL, and a `new_slug` representing the desired new identifier. The function should return a message in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rename_shorturl('abc123', 'xyz789') == 'shorturl `abc123` has been renamed to `xyz789`'\", \"assert rename_shorturl('short1', 'short2') == 'shorturl `short1` has been renamed to `short2`'\", \"assert rename_shorturl('url1', 'newurl1') == 'shorturl `url1` has... | {
"split": "train",
"index": 68248,
"acecode_id": "bigcode_python_fns_22382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns the sum of all even numbers in that list. The function should ignore odd numbers and return 0 if there are no even numbers. Write a function `sum_of_evens(numbers: List[int]) -> int` that acco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, 2, 4, 6]) == 12\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([-1, -2, -3, -4]) == -6\", \"assert sum_of_evens([10, 21, 32, 4... | {
"split": "train",
"index": 68249,
"acecode_id": "oss_2306",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a font manipulation program that handles the positioning of anchors for specific characters. Each character has its own set of anchors and a mark value associated with it. Your task is to implement a function that calculates the average mark value for all the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_mark_value({'i': {'anchors': ['bottom', 'ogonek'], 'mark': 100}, 'dotlessi': {'anchors': ['top'], 'mark': 100}, 'dotlessj': {'anchors': ['top'], 'mark': 100}}) == 100.0\", \"assert average_mark_value({'a': {'anchors': ['bottom'], 'mark': 80}, 'b': {'... | {
"split": "train",
"index": 68250,
"acecode_id": "oss_34458",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `solve_linear_equation(equation: str) -> float` that takes a string representing a simple linear equation in the format 'ax + b = c' or 'ax - b = c', where 'a', 'b', and 'c' are integers, and 'x' is present only once. The function should return the numerical re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve_linear_equation('2x + 3 = 11') == 4.0\", \"assert solve_linear_equation('5x - 10 = 0') == 2.0\", \"assert solve_linear_equation('-3x + 6 = 0') == 2.0\", \"assert solve_linear_equation('4x + 8 = 24') == 4.0\", \"assert solve_linear_equation('x - 5 = 0')... | {
"split": "train",
"index": 68251,
"acecode_id": "evol_10774",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an unsorted list of integers and a target integer, implement a function that returns the index of the first occurrence of the target integer in the list. If the target integer is not found, return -1. You may assume that the input list contains unique elements. Do not use... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_target_index([1, 3, 5, 7, 9], 5) == 2\", \"assert find_target_index([10, 20, 30, 40, 50], 40) == 3\", \"assert find_target_index([4, 5, 6, 7, 8], 9) == -1\", \"assert find_target_index([0, -1, -2, -3, -4], -3) == 3\", \"assert find_target_index([10], 10... | {
"split": "train",
"index": 68252,
"acecode_id": "bigcode_python_fns_8649",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that returns the ordinal representation of numbers from 1 to 25. The ordinals are represented as strings: 'first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth', 'thirte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_ordinal(1) == 'first'\", \"assert get_ordinal(2) == 'second'\", \"assert get_ordinal(3) == 'third'\", \"assert get_ordinal(4) == 'fourth'\", \"assert get_ordinal(5) == 'fifth'\", \"assert get_ordinal(6) == 'sixth'\", \"assert get_ordinal(7) == 'seventh'\... | {
"split": "train",
"index": 68253,
"acecode_id": "oss_12102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates the first n numbers in the Fibonacci series. For every third number in the series, replace it with its binary representation (as a string). The function should return a list of the modified Fibonacci numbers.\nPlease reason step by step, then wri... | 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, '101']\"]}"
} | {
"split": "train",
"index": 68254,
"acecode_id": "evol_1497",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list representing a batch of input data, where each inner list contains `n_input` floating-point numbers. Your task is to create overlapping windows of this batch data. The function should return a 2D list where each inner list represents an overlapping windo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert overlap([[1.0, 2.0, 3.0]], 3, 3) == [[1.0, 2.0, 3.0]]\", \"assert overlap([[1.0, 2.0, 3.0, 4.0]], 3, 3) == [[1.0, 2.0, 3.0], [2.0, 3.0, 4.0]]\", \"assert overlap([[1.0, 2.0, 3.0, 4.0, 5.0]], 3, 3) == [[1.0, 2.0, 3.0], [2.0, 3.0, 4.0], [3.0, 4.0, 5.0]]\", \"a... | {
"split": "train",
"index": 68255,
"acecode_id": "bigcode_python_fns_38154",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a character, represented as an integer value according to the ASCII encoding, is a valid character for a specific set of conditions. Write a function `characterCheck(c)` where `c` is an integer that represents a charact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert characterCheck(65) == 'Uppercase'\", \"assert characterCheck(90) == 'Uppercase'\", \"assert characterCheck(97) == 'Letter'\", \"assert characterCheck(122) == 'Letter'\", \"assert characterCheck(48) == 'LetterOrDigit'\", \"assert characterCheck(57) == 'Letter... | {
"split": "train",
"index": 68256,
"acecode_id": "oss_24737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of tuples representing hardware components and their availability. Each tuple contains two elements: a string representing the hardware component and a boolean indicating its availability. Your goal is to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_available_hardware([('cpu', False), ('gpu', True), ('ram', True), ('ssd', False)]) == ['gpu', 'ram']\", \"assert filter_available_hardware([('motherboard', True), ('power supply', False), ('cooler', True)]) == ['cooler', 'motherboard']\", \"assert fil... | {
"split": "train",
"index": 68257,
"acecode_id": "oss_8153",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `orderedsandwich` that takes a list of ingredients as input and returns a string representing the ordered sandwich. The function should follow the following rules: If the list contains only one ingredient, the sandwich should be made ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert orderedsandwich(['kela', 'aloo']) == 'kela and aloo sandwich'\", \"assert orderedsandwich(['cheese', 'potato']) == 'cheese and potato sandwich'\", \"assert orderedsandwich(['uiyer']) == 'uiyer sandwich'\", \"assert orderedsandwich(['tomato', 'lettuce']) == '... | {
"split": "train",
"index": 68258,
"acecode_id": "oss_11734",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a DNA sequence and two enzymes denoted by their respective indices in the string. Your task is to identify pairs of indices in the DNA sequence where the first index is associated with the first enzyme and the second index with the second enz... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_enzyme_regions('AAGCTGTTGACGTTAGCAGTACCAGTCTAGC', 1, 6) == []\", \"assert get_enzyme_regions('ACGTACGTACGTACGTACGTACGTACGTACGT', 1, 1) == []\", \"assert get_enzyme_regions('GCGCGCGCGCGCGCGCGCGCGCGCGCGC', 0, 1) == []\", \"assert get_enzyme_regions('AATTCC... | {
"split": "train",
"index": 68259,
"acecode_id": "bigcode_python_fns_1794",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a given number or a list of numbers from one unit to another based on a conversion factor. The function should accept three parameters: 'to_convert', which can be a single number or an iterable of numbers, 'old_unit', which ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_unit(1, 'inches', 'cm') == 2.54\", \"assert convert_unit(72, 1, 72) == 1.0\", \"assert convert_unit([1, 2, 3], 'inches', 'cm') == (2.54, 5.08, 7.62)\", \"assert convert_unit(50, 1, 0.5) == 100.0\", \"assert convert_unit([1, 2, 3, 4], 1, 0.5) == (2.0,... | {
"split": "train",
"index": 68260,
"acecode_id": "bigcode_python_fns_1341",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the mean canopy height of a given region based on the provided region information. The input will be a dictionary containing a key 'mean_canopy_height' which can either be a numeric value representing the height in meters ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_canopy_height({'mean_canopy_height': 10}) == 10\", \"assert check_canopy_height({'mean_canopy_height': 0}) == 0\", \"assert check_canopy_height({'mean_canopy_height': 25}) == 25\", \"assert check_canopy_height({'mean_canopy_height': 'no data'}) == 0\",... | {
"split": "train",
"index": 68261,
"acecode_id": "bigcode_python_fns_33834",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `yaml_tag_constructor(*args, **kwargs)` that simulates a YAML tag constructor for testing purposes. The function should take any number of positional and keyword arguments and return a tuple containing two elements: the first element should be a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert yaml_tag_constructor(1, 2, 3) == ((1, 2, 3), {})\", \"assert yaml_tag_constructor() == ((), {})\", \"assert yaml_tag_constructor(a=1, b=2) == ((), {'a': 1, 'b': 2})\", \"assert yaml_tag_constructor(1, 2, a=3, b=4) == ((1, 2), {'a': 3, 'b': 4})\", \"assert ya... | {
"split": "train",
"index": 68262,
"acecode_id": "bigcode_python_fns_12903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with normalizing a given string based on specific conditions. Write a function `normalize_string(string: str, ignore_spaces: bool, ignore_punctuation: bool) -> str` that takes a string and two boolean parameters. The function should perform the following operatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_string('Hello, World!', True, False) == 'HELLO,WORLD!'\", \"assert normalize_string('Spaces and punctuation!', True, False) == 'SPACESANDPUNCTUATION!'\", \"assert normalize_string(' Leading and trailing spaces ', False, False) == 'LEADING AN... | {
"split": "train",
"index": 68263,
"acecode_id": "bigcode_python_fns_13198",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, `prev_hash_dict` and `current_hash_dict`, where each dictionary maps string keys to string values. Your task is to write a function `compare_elements(prev_hash_dict: Dict[str, str], current_hash_dict: Dict[str, str]) -> Dict[str, str]` that compa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_elements({'a': '1', 'b': '2'}, {'a': '1', 'b': '3'}) == {'b': 'changed'}\", \"assert compare_elements({'x': '10'}, {'y': '20'}) == {'y': 'added', 'x': 'deleted'}\", \"assert compare_elements({}, {'a': '1'}) == {'a': 'added'}\", \"assert compare_eleme... | {
"split": "train",
"index": 68264,
"acecode_id": "bigcode_python_fns_1043",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a range of integers and returns a list of prime numbers within that range. The function should utilize functional programming principles, specifically using a filter to identify prime numbers. The input will be a range of integers starting from 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_numbers(range(1, 10)) == [2, 3, 5, 7]\", \"assert prime_numbers(range(1, 20)) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert prime_numbers(range(1, 5)) == [2, 3]\", \"assert prime_numbers(range(1, 2)) == []\", \"assert prime_numbers(range(10, 15)) == [11,... | {
"split": "train",
"index": 68265,
"acecode_id": "evol_32062",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `classify_integers(list_of_integers)` that takes a list of integers and returns a dictionary with four keys: 'even', 'odd', 'prime', and 'composite'. Each key should map to a list containing the respective classified integers from the input list. An integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_integers([2, 3, 4, 5, 6, 7, 8]) == {'even': [2, 4, 6, 8], 'odd': [3, 5, 7], 'prime': [2, 3, 5, 7], 'composite': [4, 6, 8]}\", \"assert classify_integers([0, -1, -2, -3, -4]) == {'even': [0, -2, -4], 'odd': [-1, -3], 'prime': [], 'composite': []}\", ... | {
"split": "train",
"index": 68266,
"acecode_id": "evol_31763",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a JSON-like dictionary representing an experiment payload. Your function should check if the experiment is valid based on certain criteria, including presence of required fields and their types. The required fields are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_experiment({'name': 'Test Experiment', 'version': 1.0, 'parameters': {}}) == {'status': 'success', 'message': 'Experiment is valid'}\", \"assert validate_experiment({'name': 'Test Experiment', 'version': '1.0', 'parameters': {}}) == {'status': 'erro... | {
"split": "train",
"index": 68267,
"acecode_id": "bigcode_python_fns_15798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple bank account. You need to implement a function called `transfer_funds` that takes two bank account balances and a transfer amount. The function should simulate transferring funds from the first account to the second account. If the transf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transfer_funds(1000, 500, 300) == (700, 800)\", \"assert transfer_funds(0, 500, 100) == (0, 500)\", \"assert transfer_funds(750, 250, 500) == (250, 750)\", \"assert transfer_funds(500, 500, 0) == (500, 500)\", \"assert transfer_funds(1200, 300, 1500) == (120... | {
"split": "train",
"index": 68268,
"acecode_id": "oss_7491",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple representing the size of a kernel in a multi-dimensional space, implement a function that calculates the total number of elements (or pixels/voxels) in that kernel. The kernel size is defined as an N-tuple, where each element represents the size of that dimension.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_kernel_size_numel((3, 3)) == 9\", \"assert get_kernel_size_numel((2, 2, 2)) == 8\", \"assert get_kernel_size_numel((1, 5, 7)) == 35\", \"assert get_kernel_size_numel((4,)) == 4\", \"assert get_kernel_size_numel((2, 3, 4, 5)) == 120\", \"assert get_kernel... | {
"split": "train",
"index": 68269,
"acecode_id": "bigcode_python_fns_24745",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating an HTML table of images based on a list of slide numbers and their corresponding summaries. Implement a function `generate_html_table(slide_nums: List[int], tile_summaries: Dict[int, str], data_link: bool) -> str` that generates the HTML code for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_html_table([1, 2, 3], {1: 'Summary 1', 2: 'Summary 2', 3: 'Summary 3'}, False) == '<html><head><title>Tiles</title></head><body><table><tr><td>Image 1: Summary 1</td></tr><tr><td>Image 2: Summary 2</td></tr><tr><td>Image 3: Summary 3</td></tr></tabl... | {
"split": "train",
"index": 68270,
"acecode_id": "bigcode_python_fns_1281",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given three points A, B, and C in a 2D plane represented as tuples of coordinates (x, y), calculate the orbital phase angle at point B between the vectors AB and CB, where A, B, and C are distinct points. The angle should be returned in degrees, and the result should be in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert phase_angle((0, 0), (1, 1), (1, 0)) == 315.0\", \"assert phase_angle((2, 2), (2, 3), (2, 3)) == None\", \"assert phase_angle((0, 2), (2, 2), (2, 0)) == 270.0\", \"assert phase_angle((3, 3), (1, 1), (1, 1)) == None\", \"assert phase_angle((1, 2), (2, 3), (2, ... | {
"split": "train",
"index": 68271,
"acecode_id": "bigcode_python_fns_21740",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function `build_conditional_single(cond: Tuple[str, str, Any], vals: Dict[str, Any]) -> str` that constructs a conditional SQL clause based on the provided logic operation and value. The function takes a tuple `cond` which consists of a column nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_conditional_single(('age', 'EQUAL', 30), {}) == 'age = %(wval0)s'\", \"assert build_conditional_single(('name', 'LESS_THAN', 'Alice'), {}) == 'name < %(wval0)s'\", \"assert build_conditional_single(('salary', 'GREATER_THAN_OR_EQUAL', 50000), {}) == 'sa... | {
"split": "train",
"index": 68272,
"acecode_id": "bigcode_python_fns_1351",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `greet` that takes multiple planet names as input and returns a list of greetings for valid planet names. The greeting should only print 'Greetings Earth' if the input is 'Earth'. For any other valid planet name, return 'Valid planet name' and for invalid p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet('Earth') == ['Greetings Earth']\", \"assert greet('Mars') == ['Valid planet name']\", \"assert greet('Mercury') == ['Valid planet name']\", \"assert greet('Venus') == ['Valid planet name']\", \"assert greet('Jupiter') == ['Valid planet name']\", \"asse... | {
"split": "train",
"index": 68273,
"acecode_id": "evol_6710",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a task represented as a dictionary containing various attributes. Your task is to implement a function that serializes this task dictionary into a JSON string. The task dictionary will have the following attributes: 'id' (an integer), 'title' (a string), 'descript... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_task({'id': 1, 'title': 'Task 1', 'description': 'First task', 'status': 'pending', 'due_date': '2023-01-01'}) == '{\\\"id\\\": 1, \\\"title\\\": \\\"Task 1\\\", \\\"description\\\": \\\"First task\\\", \\\"status\\\": \\\"pending\\\", \\\"due_date... | {
"split": "train",
"index": 68274,
"acecode_id": "oss_13973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates a valid random IPv4 address. An IPv4 address consists of four decimal numbers separated by dots, where each number ranges from 0 to 255. The generated address should be returned as a string in the format 'x.x.x.x' where x is a number between 0 an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ip() is not None\", \"assert isinstance(generate_ip(), str)\", \"assert len(generate_ip().split('.')) == 4\", \"assert all(0 <= int(part) <= 255 for part in generate_ip().split('.'))\", \"assert generate_ip() != generate_ip()\", \"assert generate_ip... | {
"split": "train",
"index": 68275,
"acecode_id": "evol_14409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string representation of an XML document as input and returns the root element of the parsed XML tree. The function should utilize the ElementTree library to parse the XML content. If the input string is not a valid XML, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_xml('<root><child></child></root>').tag == 'root'\", \"assert parse_xml('<data><item>test</item></data>').tag == 'data'\", \"assert parse_xml('<config><settings><setting name=\\\"example\\\">value</setting></settings></config>').tag == 'config'\", \"as... | {
"split": "train",
"index": 68276,
"acecode_id": "oss_26935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a series of system events. Each event is represented by a string that describes its status. You need to implement a function `get_unexpected_events(events: List[str]) -> List[str]` that takes a list of event status strings and returns a list of eve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unexpected_events(['INFO: Start', 'INFO: Running', 'ERROR: Crash']) == ['ERROR: Crash']\", \"assert get_unexpected_events(['INFO: Start', 'INFO: Running', 'WARNING: Low memory']) == ['WARNING: Low memory']\", \"assert get_unexpected_events(['INFO: Start'... | {
"split": "train",
"index": 68277,
"acecode_id": "bigcode_python_fns_23368",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of camera positions in 3D space and a list of 3D points. Your task is to determine if there are any points within a specified radius from the cameras. If there are no points provided, return None. Otherwise, return a list of all the points that are within t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_points_within_radius_of_cameras([[0, 0, 0], [10, 0, 0]], [], 10.0) is None\", \"assert get_points_within_radius_of_cameras([[0, 0, 0]], [[0, 0, 5]], 10.0) == [[0, 0, 5]]\", \"assert get_points_within_radius_of_cameras([[0, 0, 0]], [[5, 0, 0], [12, 0, 0]]... | {
"split": "train",
"index": 68278,
"acecode_id": "bigcode_python_fns_33109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging system in Python that supports different log levels and corresponding colored output. The log levels are ERROR, WARNING, INFO, DEBUG, and TRACE, each associated with a specific color: ERROR (Red), WARNING (Magenta), INFO (Green), DEBUG... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message(1, 'Critical error occurred', 1) == '\\\\033[91mCritical error occurred\\\\033[0m'\", \"assert log_message(2, 'This is a warning', 2) == '\\\\033[95mThis is a warning\\\\033[0m'\", \"assert log_message(3, 'Informational message', 3) == '\\\\033[9... | {
"split": "train",
"index": 68279,
"acecode_id": "oss_1160",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a time in ISO 8601 format (e.g., '2011-07-06T21:54:23.000-07:00'), write a function that converts this time to a UTC datetime object. If the input string is empty or invalid, return None. The datetime object should be returned in the format YYYY-MM-D... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_datetime('2011-07-06T21:54:23.000-07:00') == '2011-07-07 04:54:23'\", \"assert parse_datetime('2020-01-01T00:00:00.000Z') == '2020-01-01 00:00:00'\", \"assert parse_datetime('2012-08-15T12:30:00.000+02:00') == '2012-08-15 10:30:00'\", \"assert parse_da... | {
"split": "train",
"index": 68280,
"acecode_id": "bigcode_python_fns_14257",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom log formatter for a logging system. The function `side_seperator` takes two string parameters, `lsep` and `rsep`, which represent the left and right separators for the log messages. The function should return a dictionary with two keys: 'ls... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert side_seperator('<<', '>>') == {'ls': '<<', 'rs': '>>'}\", \"assert side_seperator('(', ')') == {'ls': '(', 'rs': ')'}\", \"assert side_seperator('[[', ']]') == {'ls': '[[', 'rs': ']]'}\", \"assert side_seperator('<<', '>>') == {'ls': '<<', 'rs': '>>'}\", \"a... | {
"split": "train",
"index": 68281,
"acecode_id": "bigcode_python_fns_15864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a configuration dictionary for a seeding process in a data processing environment. The configuration is expected to have a specific structure for both Spark v2.0 and v3.0. Your function should check if the configuration contains a top-level key ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_seeding_configuration({'seeds': {'quote_columns': True}}) == True\", \"assert validate_seeding_configuration({'seeds': {'quote_columns': False}}) == True\", \"assert validate_seeding_configuration({'seeds': {}}) == False\", \"assert validate_seeding... | {
"split": "train",
"index": 68282,
"acecode_id": "oss_6237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of image names and a specific image name to delete, implement a function that removes all occurrences of the specified image name from the list and returns the modified list. The function should maintain the order of the remaining images. If the specified image nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_images(['cat.png', 'dog.jpg', 'cat.png', 'fish.gif'], 'cat.png') == ['dog.jpg', 'fish.gif']\", \"assert delete_images(['sunset.jpg', 'sunrise.jpg', 'sunset.jpg'], 'sunset.jpg') == ['sunrise.jpg']\", \"assert delete_images(['image1.png', 'image2.png', ... | {
"split": "train",
"index": 68283,
"acecode_id": "bigcode_python_fns_19566",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a positive integer n and returns the sum of all prime numbers less than n. For example: sum_primes(5) should return 10, as the prime numbers less than 5 are 2 and 3, and their sum is 5. If n is less than 2, the function should return 0.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_primes(0) == 0\", \"assert sum_primes(20) == 77\", \"assert sum_primes(1) == 0\", \"assert sum_primes(2) == 0\", \"assert sum_primes(3) == 2\", \"assert sum_primes(4) == 5\", \"assert sum_primes(10) == 17\", \"assert sum_primes(15) == 41\", \"assert sum_... | {
"split": "train",
"index": 68284,
"acecode_id": "evol_33074",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a list of unique strings. The function should either add a new string to the list or replace an existing string if a match is found. The comparison of strings should be case-insensitive. If a string already exists in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_string_list(['apple', 'banana'], 'orange') == ['apple', 'banana', 'orange']\", \"assert manage_string_list(['apple', 'banana'], 'APPLE') == ['apple', 'banana']\", \"assert manage_string_list(['apple', 'banana'], 'Banana') == ['apple', 'banana']\", \"a... | {
"split": "train",
"index": 68285,
"acecode_id": "bigcode_python_fns_38651",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of numbers representing a data frame, where each row contains values of different variables for specific dates, implement a function that transforms this data frame into a long format. The result should be a list of dictionaries, where each dictionary represents... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_dataframe([['2000-01-03', 0.1, 0.2], ['2000-01-04', 0.3, 0.4]]) == [{'date': '2000-01-03', 'variable': 'A', 'value': 0.1}, {'date': '2000-01-03', 'variable': 'B', 'value': 0.2}, {'date': '2000-01-04', 'variable': 'A', 'value': 0.3}, {'date': '2000-... | {
"split": "train",
"index": 68286,
"acecode_id": "bigcode_python_fns_17026",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a command string and a variable number of integers, and returns a formatted result based on the input. The function should take two arguments: a string `command` and a variable number of integers `args`. The `com... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_command('sum', 1, 2, 3, 4) == 10\", \"assert process_command('product', 1, 2, 3, 4) == 24\", \"assert process_command('average', 1, 2, 3, 4) == 2.5\", \"assert process_command('sum', 5, 10, 15) == 30\", \"assert process_command('product', 2, 3, 4) ==... | {
"split": "train",
"index": 68287,
"acecode_id": "oss_25877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `query_stream(words: List[str], queries: List[str]) -> List[bool]` that determines if any of the last queried characters (in reverse order) match any of the words in the provided list. Your function should return a list of boolean values where each value co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert query_stream(['cd', 'f', 'kl'], ['a']) == [False]\", \"assert query_stream(['cd', 'f', 'kl'], ['b']) == [False]\", \"assert query_stream(['cd', 'f', 'kl'], ['c']) == [False]\", \"assert query_stream(['cd', 'f', 'kl'], ['e']) == [False]\", \"assert query_stre... | {
"split": "train",
"index": 68288,
"acecode_id": "evol_18750",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of numerical values representing a matrix. Write a function that computes the sum of each row in the matrix and returns a list of these sums. The function should handle cases where the matrix might have varying row lengths by only summing the elements pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_rows([[1, 2, 3], [4, 5, 6], [7, 8]]) == [6, 15, 15]\", \"assert sum_rows([[1], [2], [3], [4]]) == [1, 2, 3, 4]\", \"assert sum_rows([[10, 20], [30], [40, 50, 60]]) == [30, 30, 150]\", \"assert sum_rows([[0, 0, 0], [0, 0], [0]]) == [0, 0, 0]\", \"assert s... | {
"split": "train",
"index": 68289,
"acecode_id": "bigcode_python_fns_25633",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user permissions and a resource that a user wants to access. Implement a function `get_resource_if_permitted(permissions: List[str], resource: str) -> str` that checks if the user has the permission to access the requested resource. If the user has permi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_resource_if_permitted(['view'], 'resource1') == 'resource1'\", \"assert get_resource_if_permitted(['edit'], 'resource2') == 'Permission Denied'\", \"assert get_resource_if_permitted(['view', 'edit'], 'resource3') == 'resource3'\", \"assert get_resource_i... | {
"split": "train",
"index": 68290,
"acecode_id": "bigcode_python_fns_9884",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function to find and return the median of the array. The median is the middle value in a list of numbers. If the list has an even number of elements, the median is the average of the two middle numbers. You may assume that the input array... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([1]) == 1\", \"assert find_median([1, 2]) == 1.5\", \"assert find_median([3, 1, 2]) == 2\", \"assert find_median([4, 5, 1, 2]) == 3.0\", \"assert find_median([10, 20, 30, 40, 50]) == 30\", \"assert find_median([7, 5, 3, 1]) == 4.0\", \"assert fin... | {
"split": "train",
"index": 68291,
"acecode_id": "evol_8467",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `perfect_cubes_of_primes(n: int) -> List[int]` that returns a list of all perfect cubes of prime numbers that are less than `n`. A perfect cube is defined as a number that can be expressed as the cube of an integer. Your function should return the cubes of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perfect_cubes_of_primes(1) == []\", \"assert perfect_cubes_of_primes(2) == []\", \"assert perfect_cubes_of_primes(3) == []\", \"assert perfect_cubes_of_primes(10) == [8]\", \"assert perfect_cubes_of_primes(30) == [8, 27]\", \"assert perfect_cubes_of_primes(5... | {
"split": "train",
"index": 68292,
"acecode_id": "evol_24653",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_divisors(n: int) -> List[int]` that takes an integer `n` as input and returns a list of all the divisors of `n`. The function should return an empty list if `n` is less than 1.\nPlease reason step by step, then write a self-contained Python solution. Give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_divisors(1) == [1]\", \"assert find_divisors(2) == [1, 2]\", \"assert find_divisors(3) == [1, 3]\", \"assert find_divisors(4) == [1, 2, 4]\", \"assert find_divisors(5) == [1, 5]\", \"assert find_divisors(6) == [1, 2, 3, 6]\", \"assert find_divisors(10) ... | {
"split": "train",
"index": 68293,
"acecode_id": "evol_31217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple client-server message system. Your function should take a list of messages as input and return a list of those messages formatted as if they were received by a server. Each message in the output list should be pref... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_server_messages(['Hello', 'World']) == ['Received: Hello', 'Received: World']\", \"assert simulate_server_messages(['Test message', 'Another message']) == ['Received: Test message', 'Received: Another message']\", \"assert simulate_server_messages([... | {
"split": "train",
"index": 68294,
"acecode_id": "oss_3483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the liking and unliking of comments in a comment system. The function should accept a list of comments, where each comment is represented by its ID and the number of likes it has. The function should perform a series of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_comment_likes([(1, 0), (2, 5)], [(1, 'add'), (2, 'remove')]) == [(1, 1), (2, 4)]\", \"assert update_comment_likes([(1, 3), (2, 2)], [(1, 'remove'), (2, 'add')]) == [(1, 2), (2, 3)]\", \"assert update_comment_likes([(1, 0), (2, 0)], [(1, 'add'), (1, 'a... | {
"split": "train",
"index": 68295,
"acecode_id": "bigcode_python_fns_33846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `reverse_string(input_string: str) -> str` that takes a string as input and returns the string reversed. The function should maintain the capitalization scheme of the initial input, handle numerical and special characters, and manage white spaces between th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('Hello World') == 'dlroW olleH'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$%') == '%$#@!'\", \"assert reverse_string('Hello World Again') == 'niagA dlroW olleH'\", \"assert reverse_string('aBc 123!') == '!32... | {
"split": "train",
"index": 68296,
"acecode_id": "evol_18718",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `calculate_ospf_cost` that determines the OSPF cost for a network device based on its type. The function should take a single parameter `node`, which is an object representing a network device. The type of the device can be retrieved ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_ospf_cost(MockNode('router')) == 10\", \"assert calculate_ospf_cost(MockNode('switch')) == 20\", \"assert calculate_ospf_cost(MockNode('firewall')) == 30\", \"assert calculate_ospf_cost(MockNode('hub')) == 50\", \"assert calculate_ospf_cost(MockNod... | {
"split": "train",
"index": 68297,
"acecode_id": "oss_32102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates playing musical notes with specified durations. The function, `play_notes`, takes a list of tuples where each tuple consists of a musical note (a string, e.g., 'C4', 'D#5') and a duration (a float representing the durat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert play_notes([('C4', 0.5)]) == ['Played C4 for 0.5 seconds']\", \"assert play_notes([('D#5', 1.0)]) == ['Played D#5 for 1.0 seconds']\", \"assert play_notes([('A4', 0.75), ('B4', 0.25)]) == ['Played A4 for 0.75 seconds', 'Played B4 for 0.25 seconds']\", \"asse... | {
"split": "train",
"index": 68298,
"acecode_id": "oss_2905",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sentence_classification` that takes in a list of sentences and a list of corresponding labels, and returns a dictionary that maps each unique label to the number of sentences that belong to that label. The sentences will be represented as strings and the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sentence_classification(['Hello world', 'Hello there', 'Goodbye'], [1, 1, 2]) == {1: 2, 2: 1}\", \"assert sentence_classification(['Test one', 'Test two', 'Test three'], [0, 1, 0]) == {0: 2, 1: 1}\", \"assert sentence_classification(['Sample text'], [5]) == ... | {
"split": "train",
"index": 68299,
"acecode_id": "evol_20016",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.