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": "Implement a function that takes a list of integers and returns a new list containing the same integers sorted in non-decreasing order using the merge sort algorithm.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ``...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sort([5, 3, 8, 1, 2]) == [1, 2, 3, 5, 8]\", \"assert merge_sort([10, 7, 8, 9, 1]) == [1, 7, 8, 9, 10]\", \"assert merge_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert merge_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert merge_sort([]) == []...
{ "split": "train", "index": 3100, "acecode_id": "evol_35569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a background image for a graphical application. The function should support the following functionalities: setting a background image, retrieving the current background image, and moving the background image to a new loca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert background_sprite_operations('background1.png', False, True, (0, 0), (10, 10)) == ('background1.png', (10, 10))\", \"assert background_sprite_operations('background2.jpg', True, True, (5, 5), (15, 15)) == ('background2.jpg', (15, 15))\", \"assert background_...
{ "split": "train", "index": 3101, "acecode_id": "oss_24371", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that binds a keyboard shortcut to a specific action in a hypothetical user interface framework. The function takes a single parameter `frame`, which represents the user interface component. The function should bind the F11 key to set focu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bind_f11(None) == (0, 122, 1001)\", \"assert bind_f11('any_frame') == (0, 122, 1001)\", \"assert bind_f11(1) == (0, 122, 1001)\", \"assert bind_f11(2) == (0, 122, 1001)\", \"assert bind_f11('frame_example') == (0, 122, 1001)\", \"assert bind_f11(object()) ==...
{ "split": "train", "index": 3102, "acecode_id": "bigcode_python_fns_34267", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing filenames from an 'Index of' page. Your task is to implement a function that returns a list of filenames that are identical to their corresponding original filenames based on their indices. Specifically, you need to write a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_identical_filenames(['file1', 'file2', 'file3']) == []\", \"assert filter_identical_filenames(['file0', 'file1', 'file2']) == ['file0', 'file1', 'file2']\", \"assert filter_identical_filenames(['test', 'test', 'test']) == []\", \"assert filter_identic...
{ "split": "train", "index": 3103, "acecode_id": "bigcode_python_fns_29848", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `find_primes(limit: int) -> Tuple[List[int], int, int]` that takes an integer `limit` as input and returns a tuple containing a list of all prime numbers up to the given limit, the count of those prime numbers, and the sum of all the prime numbers. The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes(0) == ([], 0, 0)\", \"assert find_primes(1) == ([], 0, 0)\", \"assert find_primes(2) == ([2], 1, 2)\", \"assert find_primes(3) == ([2, 3], 2, 5)\", \"assert find_primes(10) == ([2, 3, 5, 7], 4, 17)\", \"assert find_primes(20) == ([2, 3, 5, 7, 11,...
{ "split": "train", "index": 3104, "acecode_id": "evol_9170", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a JSON string and updates a dictionary based on certain conditions. The function should extract values from the JSON object into a new dictionary if the values are not empty or None. You will be given a list of keys to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_json_string('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}', ['name', 'age']) == {'name': 'Alice', 'age': 30}\", \"assert process_json_string('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}', ['name']) == {'name': 'Alice'}\", \"assert process_json_s...
{ "split": "train", "index": 3105, "acecode_id": "oss_23772", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that modifies a given string based on specific rules. Implement the function `do_something(input_string: str) -> str` that takes a string as input and returns a modified version of the string according to the following rules: 1. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert do_something('do_something') == 'Do something'\", \"assert do_something('do_test_anything') == 'Do test anything'\", \"assert do_something('try_something') == 'try_something'\", \"assert do_something('do_example_anything') == 'Do example anything'\", \"asser...
{ "split": "train", "index": 3106, "acecode_id": "oss_27514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_valid_email(email: str) -> bool` that checks if an email address is valid based on the following criteria: the email must start with a digit, contain exactly one '@' symbol, not have any spaces, and must end with a domain that is either '.com', '.net', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_email('1example@example.com') == True\", \"assert is_valid_email('2name@domain.org') == True\", \"assert is_valid_email('3user@mail.net') == True\", \"assert is_valid_email('4test@website.com') == True\", \"assert is_valid_email('0user@service.org')...
{ "split": "train", "index": 3107, "acecode_id": "evol_4419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `ternary_operator(x)` that takes an integer x as input and returns 10 if x is greater than 0; otherwise, it returns 5.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ternary_operator(1) == 10\", \"assert ternary_operator(0) == 5\", \"assert ternary_operator(-1) == 5\", \"assert ternary_operator(100) == 10\", \"assert ternary_operator(50) == 10\", \"assert ternary_operator(-50) == 5\", \"assert ternary_operator(10) == 10\...
{ "split": "train", "index": 3108, "acecode_id": "evol_8668", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `is_valid_channel(channel_name: str, channels: List[str]) -> bool` that checks if a given channel name exists in a list of channel names. The function should return `True` if the channel name exists in the list, and `False` otherwise....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_channel('general', ['general', 'random', 'help']) == True\", \"assert is_valid_channel('random', ['general', 'random', 'help']) == True\", \"assert is_valid_channel('help', ['general', 'random', 'help']) == True\", \"assert is_valid_channel('music',...
{ "split": "train", "index": 3109, "acecode_id": "bigcode_python_fns_37072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes stock market data represented as a list of dictionaries. Each dictionary contains information about a stock, including its 'symbol' and 'price'. Your function should calculate the average price of the stocks provided in the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_price([]) == 'No stock data available.'\", \"assert calculate_average_price([{'symbol': 'AAPL', 'price': 150.0}]) == (150.0, 1)\", \"assert calculate_average_price([{'symbol': 'NFLX', 'price': 500.0}]) == (500.0, 1)\", \"assert calculate_av...
{ "split": "train", "index": 3110, "acecode_id": "oss_23882", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that removes all occurrences of a specific element from a given list of integers. The function should take two parameters: a list of integers and the integer to be removed. The function should return a new list that contains all the integ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_element([1, 2, 3, 4, 5], 3) == [1, 2, 4, 5]\", \"assert remove_element([1, 2, 3, 4, 5], 6) == [1, 2, 3, 4, 5]\", \"assert remove_element([1, 2, 3, 2, 5], 2) == [1, 3, 5]\", \"assert remove_element([], 3) == []\", \"assert remove_element([1, 1, 1, 1], ...
{ "split": "train", "index": 3111, "acecode_id": "bigcode_python_fns_13246", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer x, write a function that returns the largest even number that is less than or equal to x. If x is already even, return x. If x is odd, return x - 1. Implement this in a single function called 'make_even'.\nPlease reason step by step, then write a self-contained...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_even(5) == 4\", \"assert make_even(10) == 10\", \"assert make_even(0) == 0\", \"assert make_even(-3) == -4\", \"assert make_even(-2) == -2\", \"assert make_even(1) == 0\", \"assert make_even(2) == 2\", \"assert make_even(100) == 100\", \"assert make_eve...
{ "split": "train", "index": 3112, "acecode_id": "bigcode_python_fns_7705", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining the smallest set of transactions needed to settle debts among a group of people. Each person in the group has either paid for others or owes money based on shared expenses. Your function should calculate the net amount each person owes or is owed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert settle_debts(['Alice', 'Bob'], [('Alice', 'Groceries', 50, 'USD', ['Bob'])]) == [('Alice', 'Bob', 50.0)]\", \"assert settle_debts(['Alice', 'Bob'], [('Alice', 'Rent', 100, 'USD', ['Bob']), ('Bob', 'Utilities', 50, 'USD', ['Alice'])]) == [('Alice', 'Bob', 50....
{ "split": "train", "index": 3113, "acecode_id": "bigcode_python_fns_46140", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to aggregate log messages based on their timestamps from a given log data structure. The input is a dictionary containing a list of log entries under the key 'logs'. Each log entry is a dictionary with two keys: 'timestamp' (a string)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_logs({'logs': [{'timestamp': '2022-01-01T12:00:00', 'message': 'Error 1'}, {'timestamp': '2022-01-01T12:00:00', 'message': 'Error 2'}, {'timestamp': '2022-01-01T13:00:00', 'message': 'Warning 1'}, {'timestamp': '2022-01-01T14:00:00', 'message': 'In...
{ "split": "train", "index": 3114, "acecode_id": "oss_32073", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the maximum product of any two distinct integers from the list. The function should take a single argument, which is the list of integers, and it should return a single integer representing the maximum product. If the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product([1, 2, 3, 4]) == 12\", \"assert max_product([1, 0, 2]) == 2\", \"assert max_product([5]) == 0\", \"assert max_product([]) == 0\", \"assert max_product([1, 1, 1]) == 1\", \"assert max_product([0, 0, 0]) == 0\", \"assert max_product([10, -10, 5]) =...
{ "split": "train", "index": 3115, "acecode_id": "bigcode_python_fns_6667", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts a color from the HSL (Hue, Saturation, Lightness) color space to the RGB (Red, Green, Blue) color space. The HSL color space represents colors using three components: hue (h), saturation (s), and lightness (l). Your func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hsl_to_rgb(0, 1, 0.5) == (255, 0, 0)\", \"assert hsl_to_rgb(120, 1, 0.5) == (0, 255, 0)\", \"assert hsl_to_rgb(240, 1, 0.5) == (0, 0, 255)\", \"assert hsl_to_rgb(60, 1, 0.5) == (255, 255, 0)\", \"assert hsl_to_rgb(300, 1, 0.5) == (255, 0, 255)\", \"assert hs...
{ "split": "train", "index": 3116, "acecode_id": "oss_28885", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a random date within a specified range. The function should take two parameters, `start_date` and `end_date`, both in the format 'YYYYMMDD', and return a random date within this range as a string in the same format. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_date('20220101', '20221231') >= '20220101' and generate_random_date('20220101', '20221231') <= '20221231'\", \"assert generate_random_date('20230501', '20230531') >= '20230501' and generate_random_date('20230501', '20230531') <= '20230531'\",...
{ "split": "train", "index": 3117, "acecode_id": "oss_36987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that takes a string as input and removes all whitespace characters and punctuation symbols, returning a clean string with only alphanumeric characters. For example, given the input 'Hello, world !', the output should be 'Helloworld'.\nPlease reason step by st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_spaces_and_punctuation('Hello, world !') == 'Helloworld'\", \"assert remove_spaces_and_punctuation('Python is great.') == 'Pythonisgreat'\", \"assert remove_spaces_and_punctuation(' Spaces and punctuation...') == 'Spacesandpunctuation'\", \"assert ...
{ "split": "train", "index": 3118, "acecode_id": "evol_35007", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate statistics for a given set of groups. The function `group_stats` takes three parameters: `y` (an integer representing the year), `w` (an integer representing the week number), and `groups` (a list of tuples, where each tu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_stats(2022, 10, [('GroupA', [10, 20, 30]), ('GroupB', [5, 15, 25, 35]), ('GroupC', [8, 16, 24, 32, 40])]) == {'GroupA': (60, 20.0), 'GroupB': (80, 20.0), 'GroupC': (120, 24.0)}\", \"assert group_stats(2023, 1, [('TeamX', [1, 2, 3]), ('TeamY', [4, 5]), ...
{ "split": "train", "index": 3119, "acecode_id": "oss_25160", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that performs a deep transformation of a given dictionary from snake_case to camelCase. The deep transformation involves converting all keys and nested keys in the dictionary from snake_case to camelCase. Create a function `dee...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deep_camel_case_transform({'single_key': 'value'}) == {'singleKey': 'value'}\", \"assert deep_camel_case_transform({'key_with_underscore': 'value'}) == {'keyWithUnderscore': 'value'}\", \"assert deep_camel_case_transform({'nested_dict': {'inner_key': 'inner_...
{ "split": "train", "index": 3120, "acecode_id": "oss_1380", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_perfect_square_of_two_primes(b)` that returns `True` if the input number `b` is the perfect square of the product of two distinct prime numbers, and `False` otherwise. The value of `b` will be in the range from 1 to 500. Note that the two prime factors ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_square_of_two_primes(1) == False\", \"assert is_perfect_square_of_two_primes(4) == False\", \"assert is_perfect_square_of_two_primes(9) == False\", \"assert is_perfect_square_of_two_primes(25) == False\", \"assert is_perfect_square_of_two_primes(1...
{ "split": "train", "index": 3121, "acecode_id": "evol_19593", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes data from a dungeon game and returns a list of rooms with their respective items and non-player characters (NPCs). Write a function `get_data_for_room_list` that takes in a dictionary `room_dict` containing details a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_data_for_room_list({'roomID': 1, 'roomName': 'Starting Room', 'npcID': 101, 'npcName': 'Goblin', 'npcItemID': 201, 'npcItemName': 'Sword', 'npcItemDesc': 'A sharp sword wielded by the Goblin', 'roomItemID': 301, 'roomItemName': 'Potion', 'roomItemDescrip...
{ "split": "train", "index": 3122, "acecode_id": "oss_25739", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a configuration string for a Flask application. Write a function `configure_flask_app` that takes two parameters: an integer `port` representing the port number on which the Flask app should run, and a boolean `enable_debug` indicating whether debug...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_flask_app(5000, True) == 'app.run(port=5000, debug=True)'\", \"assert configure_flask_app(5000, False) == 'app.run(port=5000, debug=False)'\", \"assert configure_flask_app(8080, True) == 'app.run(port=8080, debug=True)'\", \"assert configure_flask_...
{ "split": "train", "index": 3123, "acecode_id": "oss_32109", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists: 'weights' and 'values', representing the weights and values of items, respectively. You also have an integer 'max_weight' that represents the maximum weight capacity of a knapsack. Your task is to implement a function 'knapSack(max_weight, weights, valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert knapSack(50, [10, 20, 30], [60, 100, 120]) == 220\", \"assert knapSack(30, [10, 15, 25], [60, 90, 100]) == 150\", \"assert knapSack(70, [40, 50, 60], [100, 200, 300]) == 300\", \"assert knapSack(0, [10, 20, 30], [60, 100, 120]) == 0\", \"assert knapSack(15, ...
{ "split": "train", "index": 3124, "acecode_id": "evol_2956", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of data entries to extract relevant information. Each entry in the list is a dictionary containing the keys 'text', 'label', and 'coder'. Your function should filter out entries where the 'irr_ind' key is True and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_valid_data([{'text': 'Hello', 'label': 'Greeting', 'coder': 'Coder1', 'irr_ind': False}, {'text': 'World', 'label': 'Noun', 'coder': 'Coder2', 'irr_ind': True}]) == [{'Text': 'Hello', 'Label': 'Greeting', 'Coder': 'Coder1'}]\", \"assert extract_valid...
{ "split": "train", "index": 3125, "acecode_id": "bigcode_python_fns_4140", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified database connection pool management system. Write a function `initialize_connection_pool` that takes the following parameters: `minconn` (minimum number of connections), `maxconn` (maximum number of connections), `host` (database ho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_connection_pool(1, 5, 'localhost', 'mydb', 'admin', 'password123') == {'minconn': 1, 'maxconn': 5, 'host': 'localhost', 'database': 'mydb', 'user': 'admin', 'password': 'password123'}\", \"assert initialize_connection_pool(2, 10, '127.0.0.1', 'tes...
{ "split": "train", "index": 3126, "acecode_id": "evol_11226", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the average time between responses for a collection of pull requests in a software repository. Each pull request has a creation date and a closing date, and you need to determine the average time it takes to respond to these pull requests over a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_time_between_responses([('2023-01-01T12:00:00', '2023-01-01T14:00:00')], 'month') == {'2023-01': 2.0}\", \"assert calculate_average_time_between_responses([], 'day') == {}\", \"assert calculate_average_time_between_responses([('2023-01-01T1...
{ "split": "train", "index": 3127, "acecode_id": "bigcode_python_fns_25530", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of station data and processes it to create a dictionary representation of the stations. Each station data entry is represented as a list where the first element is the station ID, the second element is the name, and the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert populate_stations([['1', 'Station A', 'Main Station A'], ['2', 'Station B', 'Main Station B']]) == {'1': {'name': 'Station A', 'full_name': 'Main Station A'}, '2': {'name': 'Station B', 'full_name': 'Main Station B'}}\", \"assert populate_stations([['3', 'St...
{ "split": "train", "index": 3128, "acecode_id": "bigcode_python_fns_11160", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array `nums` with `n` integers, your task is to determine if it can become a non-decreasing array by modifying at most one element. The modification should not change the parity of the number (even numbers must remain even, and odd numbers must remain odd). A non-decre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert checkPossibility([4, 2, 1]) == False\", \"assert checkPossibility([3, 2, 3]) == True\", \"assert checkPossibility([1, 5, 3]) == True\", \"assert checkPossibility([2, 3, 2]) == True\", \"assert checkPossibility([1, 2, 3, 4]) == True\", \"assert checkPossibili...
{ "split": "train", "index": 3129, "acecode_id": "evol_19846", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer `vm_id` representing the ID of a virtual machine. Your task is to create a function `get_vm_status` that takes this `vm_id` as input and returns a string status of the virtual machine. The possible statuses are as follows: 'Running', 'Stopped', 'Suspend...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_vm_status(1) == 'Running'\", \"assert get_vm_status(2) == 'Stopped'\", \"assert get_vm_status(3) == 'Suspended'\", \"assert get_vm_status(4) == 'Not Found'\", \"assert get_vm_status(5) == 'Not Found'\", \"assert get_vm_status(0) == 'Not Found'\", \"asser...
{ "split": "train", "index": 3130, "acecode_id": "bigcode_python_fns_38912", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a target integer, write a function that finds the indices of the two integers in the list that are closest to the target integer. If the closest integer is equal to the target, return its index and the index of the next closest integer. If the list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_nearest_values([10, 20, 30, 40], 25) == (1, 2)\", \"assert find_nearest_values([1, 5, 9, 10], 6) == (1, 2)\", \"assert find_nearest_values([4, 7, 8, 12], 10) == (2, 3)\", \"assert find_nearest_values([0, 0, 0], 0) == (0, 1)\", \"assert find_nearest_valu...
{ "split": "train", "index": 3131, "acecode_id": "bigcode_python_fns_12974", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing pixel values of a grayscale image, where each value ranges from 0 to 255. Your task is to implement a function that converts this grayscale image into a binary image. The binary image should have pixel values of 0 or 1, where a pixe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_binary([100, 150, 200, 50], 100) == [1, 1, 1, 0]\", \"assert convert_to_binary([0, 255, 128, 64], 128) == [0, 1, 1, 0]\", \"assert convert_to_binary([50, 50, 50], 50) == [1, 1, 1]\", \"assert convert_to_binary([255, 255, 255], 255) == [1, 1, 1]\",...
{ "split": "train", "index": 3132, "acecode_id": "bigcode_python_fns_24689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two datasets represented as lists of dictionaries, where each dictionary contains feature values and a target variable 'y_yes'. Implement a function that takes these two datasets as input and splits them into predictors and response variables for both datasets. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_data([{'feature1': 1, 'feature2': 2, 'y_yes': 1}, {'feature1': 3, 'feature2': 4, 'y_yes': 0}], [{'feature1': 5, 'feature2': 6, 'y_yes': 1}, {'feature1': 7, 'feature2': 8, 'y_yes': 0}]) == ([{'feature1': 1, 'feature2': 2}, {'feature1': 3, 'feature2': 4}...
{ "split": "train", "index": 3133, "acecode_id": "bigcode_python_fns_41958", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function to manage a collection of movies. Each movie has attributes: title (string), director (string), genre (string), and release year (integer). Your function should accept a list of movies and return a list of titles of movies that hav...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_movies_by_director([], 'Steven Spielberg') == []\", \"assert get_movies_by_director([{'title': 'Jaws', 'director': 'Steven Spielberg', 'genre': 'Thriller', 'release_year': 1975}], 'Steven Spielberg') == ['Jaws']\", \"assert get_movies_by_director([{'titl...
{ "split": "train", "index": 3134, "acecode_id": "oss_27943", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `validate_command_output(command: str, expected_exit_code: int, actual_exit_code: int, actual_stdout: str, actual_stderr: str) -> bool`. This function takes a command string, an expected exit code, and the actual exit code along with ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_command_output('ls', 0, 0, '', '') == True\", \"assert validate_command_output('ls', 0, 1, '', 'Error') == False\", \"assert validate_command_output('ls', 1, 1, 'Output', '') == True\", \"assert validate_command_output('echo hello', 0, 0, '', '') ==...
{ "split": "train", "index": 3135, "acecode_id": "bigcode_python_fns_39679", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a function and a tuple of positional arguments, write a function named `named_positionals` that returns a list of names for each positional argument passed to the function. If the function has variable positional arguments (denoted by `*args`), name them automatically as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert named_positionals(lambda x, y, *args: None, (1, 2, 3, 4)) == ['x', 'y', 'args0', 'args1']\", \"assert named_positionals(lambda a, b: None, (10, 20)) == ['a', 'b']\", \"assert named_positionals(lambda a, *args: None, (1, 2, 3)) == ['a', 'args0', 'args1']\", \...
{ "split": "train", "index": 3136, "acecode_id": "bigcode_python_fns_25488", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are managing gates at an airport, where each gate is identified by a unique gate ID and has an associated route. Your task is to implement a function `get_gate_details(gateId: str, route: str) -> str` that takes in a gate ID and a route as parameters and returns a string in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_gate_details('A1', 'Route1') == 'Gate A1: Route1'\", \"assert get_gate_details('B2', 'NewRoute') == 'Gate B2: NewRoute'\", \"assert get_gate_details('C3', 'ShortRoute') == 'Gate C3: ShortRoute'\", \"assert get_gate_details('D4', '') == 'Gate D4: '\", \"a...
{ "split": "train", "index": 3137, "acecode_id": "oss_5450", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a generator that yields values one at a time. Write a function `bucketize` that takes two arguments: an iterable (which can be a generator) and an integer `bucket_size`. The function should return a generator that yields lists of length `bucket_size`, where each l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(bucketize((x for x in range(10)), 3)) == [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]\", \"assert list(bucketize((x for x in range(5)), 2)) == [[0, 1], [2, 3], [4]]\", \"assert list(bucketize((x for x in range(0)), 3)) == []\", \"assert list(bucketize((x for ...
{ "split": "train", "index": 3138, "acecode_id": "evol_20175", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that updates a list of mountains based on new data received. The mountain data consists of a list of dictionaries, each containing the name and height of a mountain. Your function should take in two parameters: the current list of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_mountains_db([{'name': 'Mount Everest', 'height': 8848}, {'name': 'K2', 'height': 8611}], [{'name': 'K2', 'height': 8611}, {'name': 'Kangchenjunga', 'height': 8586}]) == 3\", \"assert update_mountains_db([{'name': 'Mount Fuji', 'height': 3776}], [{'na...
{ "split": "train", "index": 3139, "acecode_id": "oss_31568", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `get_unique_variants(arr: List[int]) -> List[int]` that returns a list of unique integers from the input list in the order they first appeared. The resulting list should not contain any duplicates. Your function should handle edge case...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_variants([]) == []\", \"assert get_unique_variants([1, 2, 2, 3]) == [1, 2, 3]\", \"assert get_unique_variants([1, 1, 1, 1]) == [1]\", \"assert get_unique_variants([-1, -2, -2, -1]) == [-1, -2]\", \"assert get_unique_variants([5, 5, 5, 5, 5]) == [5...
{ "split": "train", "index": 3140, "acecode_id": "bigcode_python_fns_3726", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two lists of integers and returns the list that has the maximum sum of its elements. If both lists have the same sum, return 'Both lists have the same sum'. The function should handle cases where the inputs are not lists of integers by returning 'Err...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_sum_list([1, 2, 3], [4, 5]) == [4, 5]\", \"assert max_sum_list([-1, -2, -3], [-4, -5]) == [-1, -2, -3]\", \"assert max_sum_list([1, 2, 3], [3, 2, 1]) == 'Both lists have the same sum'\", \"assert max_sum_list([10, 20, 30], [10, 20]) == [10, 20, 30]\", \"...
{ "split": "train", "index": 3141, "acecode_id": "evol_26900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `print_outputs` that takes a list of outputs and prints each output to the console in a specified format. The outputs can be of different types: strings, integers, floats, or lists. Your function should handle the following typ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_outputs(['Hello', 123, 45.678, [1, 2, 3]]) == None\", \"assert print_outputs(['Test', 12.34567, [4, 5, 6]]) == None\", \"assert print_outputs(['String', 0, -10.5, ['a', 'b', 'c']]) == None\", \"assert print_outputs([1, 2, 3, 4]) == None\", \"assert pri...
{ "split": "train", "index": 3142, "acecode_id": "oss_9930", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple bank account. This function should handle deposits and withdrawals in different currencies and return the current balance in USD. The function will take the following parameters: an initial balance in USD, a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_balance(500, [(200, 'USD', 'deposit'), (150, 'EUR', 'withdraw'), (100, 'JPY', 'withdraw')]) == 500 + 200 - 150/0.85 - 100/110\", \"assert bank_account_balance(0, [(100, 'EUR', 'deposit')]) == 0 + 100/0.85\", \"assert bank_account_balance(1000, [...
{ "split": "train", "index": 3143, "acecode_id": "oss_17391", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two strings, str1 and str2, write a function to find and return the longest common substring between the two. For example, if str1 is 'creation' and str2 is 'reaction', the function should return 'eation'.\nPlease reason step by step, then write a self-contained Python so...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_substring('abcde', 'abfce') == 'ab'\", \"assert longest_common_substring('hello', 'yello') == 'ello'\", \"assert longest_common_substring('abcdef', 'ghijkl') == ''\", \"assert longest_common_substring('testcase', 'case') == 'case'\", \"assert ...
{ "split": "train", "index": 3144, "acecode_id": "evol_24136", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of binary integers, `y_true` and `y_pred`, where each list represents the true labels and predicted labels respectively for a classification task, write a function `matthews_corrcoef(y_true: List[int], y_pred: List[int]) -> float` to calculate the Matthews corre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matthews_corrcoef([1, 0, 0, 1], [1, 1, 0, 0]) == 0.0\", \"assert matthews_corrcoef([0, 1, 0, 1], [0, 1, 0, 1]) == 1.0\", \"assert matthews_corrcoef([1, 1, 0, 0], [1, 0, 1, 0]) == 0.0\", \"assert matthews_corrcoef([1, 0], [1, 1]) == 0.0\", \"assert matthews_c...
{ "split": "train", "index": 3145, "acecode_id": "bigcode_python_fns_11382", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines if a given list of actions contains a stop action. A stop action is represented by the string 'STOP'. Your function should take a list of strings as input, where each string represents an action, and return a boolean i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_stop_action(['RUN', 'JUMP', 'STOP']) == True\", \"assert contains_stop_action(['RUN', 'JUMP', 'WALK']) == False\", \"assert contains_stop_action(['STOP']) == True\", \"assert contains_stop_action(['START', 'STOP', 'END']) == True\", \"assert contain...
{ "split": "train", "index": 3146, "acecode_id": "oss_33427", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of log entries, you are required to extract all unique IP addresses from these entries, count the occurrences of each IP address, and return a list of IP addresses sorted by their occurrence count in descending order. Additionally, for each IP address that exceeds ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_logs(['Log entry from 172.16.0.1', 'Log entry from 172.16.0.1', 'Log entry from 172.16.0.1', 'Log entry from 172.16.0.2'], 2) == ['172.16.0.1']\", \"assert analyze_logs(['192.168.1.1: Successful login', '192.168.1.1: Successful login', '192.168.1.1: ...
{ "split": "train", "index": 3147, "acecode_id": "oss_13320", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with translating a list of English words into Welsh using a provided dictionary mapping. Write a function `translate_words(original: List[str], dictionary: Dict[str, str]) -> List[str]` that takes in two parameters: a list of strings `original`, which contains En...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_words(['hello', 'world'], {'hello': 'helo', 'world': 'byd'}) == ['helo', 'byd']\", \"assert translate_words(['cat', 'dog', 'fish'], {'cat': 'cath', 'dog': 'ci'}) == ['cath', 'ci', 'fish']\", \"assert translate_words(['apple'], {'banana': 'banana'})...
{ "split": "train", "index": 3148, "acecode_id": "bigcode_python_fns_31740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `monotonic(l: list, k: int, strict: bool = False) -> bool` that checks if the list's elements follow a monotonic pattern based on a fixed interval `k`. The function should return True only if the difference between every two adjacent elements in the list is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert monotonic([1, 2, 3, 4], 1) == True\", \"assert monotonic([1, 2, 3, 5], 1) == False\", \"assert monotonic([1, 1, 1, 1], 0, strict=False) == True\", \"assert monotonic([4, 2, 0, -2], 2, strict=True) == True\", \"assert monotonic([1, 3, 5, 7], 2) == True\", \"a...
{ "split": "train", "index": 3149, "acecode_id": "evol_275", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the total salary of all individuals in a person table. The function should take a list of dictionaries, where each dictionary represents a person with their name, age, number of kids, salary, and birthdate. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_salary([{'name': 'Alice', 'age': 30, 'kids': 2, 'salary': 50000.00, 'birthdate': '1991-05-21'}, {'name': 'Bob', 'age': 40, 'kids': 3, 'salary': 60000.00, 'birthdate': '1981-09-15'}]) == 110000.00\", \"assert total_salary([{'name': 'Charlie', 'age': 25,...
{ "split": "train", "index": 3150, "acecode_id": "bigcode_python_fns_11048", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a string `text` and a character pair `pair`, write a function `count_char_pairs` that counts the number of times the character pair appears consecutively in the string. The function should return the count of occurrences of the character pair. Your function should have th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_char_pairs('abracadabra', 'ab') == 2\", \"assert count_char_pairs('hello', 'lo') == 1\", \"assert count_char_pairs('abababab', 'ab') == 4\", \"assert count_char_pairs('aaaaaa', 'aa') == 5\", \"assert count_char_pairs('abcabcabc', 'ab') == 3\", \"assert...
{ "split": "train", "index": 3151, "acecode_id": "evol_2256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a recursive function that takes a list of sentences and returns a list containing the words of each sentence in reverse order. Each sentence is a string, and the function should handle an empty list gracefully by returning an empty list. The function should have the foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_words_in_sentences([]) == []\", \"assert reverse_words_in_sentences(['Hello World']) == [['World', 'Hello']]\", \"assert reverse_words_in_sentences(['The quick brown fox']) == [['fox', 'brown', 'quick', 'The']]\", \"assert reverse_words_in_sentences(...
{ "split": "train", "index": 3152, "acecode_id": "evol_31320", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function that returns a dictionary containing the prime factorization of n. The keys of the dictionary should be the prime factors, and the values should be their respective counts in the factorization. If n is less than 2, return an empty di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_factorization(12) == {2: 2, 3: 1}\", \"assert prime_factorization(1) == {}\", \"assert prime_factorization(2) == {2: 1}\", \"assert prime_factorization(15) == {3: 1, 5: 1}\", \"assert prime_factorization(28) == {2: 2, 7: 1}\", \"assert prime_factorizat...
{ "split": "train", "index": 3153, "acecode_id": "bigcode_python_fns_35661", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer num, convert it to its binary representation and return a list of integers representing the byte values of the packed floating-point number. The conversion should follow the IEEE 754 standard for encoding a float in binary. The function should be implemented as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary(0) == [0, 0, 0, 0]\", \"assert binary(1) == [63, 128, 0, 0]\", \"assert binary(-1) == [191, 128, 0, 0]\", \"assert binary(2) == [64, 0, 0, 0]\", \"assert binary(-2) == [192, 0, 0, 0]\", \"assert binary(0) == [0, 0, 0, 0]\"]}" }
{ "split": "train", "index": 3154, "acecode_id": "bigcode_python_fns_48768", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage a tree structure. You need to create a function `get_path_to_node(node)` that takes a `TreeNode` object as input and returns the path to that node as a string in the format 'parent.child.grandchild'. If the node is the root ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_path_to_node(TreeNode('root')) == 'root'\", \"assert get_path_to_node(TreeNode('child1', TreeNode('root'))) == 'root.child1'\", \"assert get_path_to_node(TreeNode('grandchild', TreeNode('child1', TreeNode('root')))) == 'root.child1.grandchild'\", \"asser...
{ "split": "train", "index": 3155, "acecode_id": "oss_35368", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of replication tasks, where each task is represented by a dictionary containing details about the task, including a key 'ReplicationInstanceArn' that identifies the instance associated with the task. Write a function `get_tasks_by_instance(replication_tasks...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_tasks_by_instance([{ 'ReplicationInstanceArn': 'arn:aws:dms:us-east-1:123456789012:replication-instance:replication-instance-1', 'TaskName': 'Task1' }, { 'ReplicationInstanceArn': 'arn:aws:dms:us-east-1:123456789012:replication-instance:replication-insta...
{ "split": "train", "index": 3156, "acecode_id": "bigcode_python_fns_37816", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple GUI application behavior. This function takes a list of boolean values representing the visibility of a status bar, where 'True' means the status bar is visible and 'False' means it is hidden. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_hidden_status_bars([True, True, False], [True, False, True]) == 2\", \"assert count_hidden_status_bars([True], [True]) == 1\", \"assert count_hidden_status_bars([True, False], [True, True]) == 1\", \"assert count_hidden_status_bars([True], []) == 0\", ...
{ "split": "train", "index": 3157, "acecode_id": "oss_13182", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `is_valid_email(email: str) -> bool` that checks if the given email address is valid based on the following criteria: it must contain exactly one '@' symbol, the local part (before the '@') can contain letters, digits, dots, underscores, pluses, and hyphens...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_email('test@example.com') == True\", \"assert is_valid_email('user.name+tag@domain.co') == True\", \"assert is_valid_email('user-name@sub.domain.org') == True\", \"assert is_valid_email('user_name@domain.info') == True\", \"assert is_valid_email('us...
{ "split": "train", "index": 3158, "acecode_id": "evol_35597", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a program that converts a Roman numeral to an integer. Roman numerals are represented by seven different symbols: I, V, X, L, C, D, and M, with corresponding values 1, 5, 10, 50, 100, 500, and 1000 respectively. However, there are specific cases...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert romanToInt('III') == 3\", \"assert romanToInt('IV') == 4\", \"assert romanToInt('IX') == 9\", \"assert romanToInt('LVIII') == 58\", \"assert romanToInt('MCMXCIV') == 1994\", \"assert romanToInt('XL') == 40\", \"assert romanToInt('CD') == 400\", \"assert roma...
{ "split": "train", "index": 3159, "acecode_id": "oss_22230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_median(numbers: List[float]) -> float` that takes a list of numbers with a length between 5 and 20 (inclusive) and returns the median of those numbers. The input list may contain duplicate values, and the numbers can be in any order. Ensure that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_median([1, 2, 3, 4, 5]) == 3\", \"assert calculate_median([5, 4, 3, 2, 1]) == 3\", \"assert calculate_median([1, 1, 1, 1, 1]) == 1\", \"assert calculate_median([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 5.5\", \"assert calculate_median([10, 20, 30, 40, 50...
{ "split": "train", "index": 3160, "acecode_id": "evol_12747", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_unique_string(length: int) -> str` that creates a unique string composed of a specific combination of alphanumeric characters. The string must contain both distinct alphabetic letters (both uppercase and lowercase) and numeric digits, and must be exac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_string(1) != ''\", \"assert generate_unique_string(2) != ''\", \"assert generate_unique_string(10) != ''\", \"assert generate_unique_string(26) != ''\", \"assert generate_unique_string(36) != ''\", \"assert generate_unique_string(62) != ''\",...
{ "split": "train", "index": 3161, "acecode_id": "evol_19371", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a sample from a sequencing experiment. Each sample dictionary contains the following keys: 'Sample_ID', 'Sample_Name', 'Sample_Project', and 'I7_Index_ID'. Your task is to implement a function that processes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_samples([{'Sample_ID': 'S1', 'Sample_Name': 'Sample1', 'Sample_Project': 'Project1', 'I7_Index_ID': 'Index1'}, {'Sample_ID': 'S2', 'Sample_Name': 'Sample2', 'Sample_Project': 'Project2', 'I7_Index_ID': 'No_index1'}]) == ('no_bc', {'S1': {'Sample_Name...
{ "split": "train", "index": 3162, "acecode_id": "bigcode_python_fns_5016", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of batches, where each batch is represented as a dictionary containing 'data' as a list of integers. Your task is to implement a function that takes this list of batches and a list of target integers. The function should load data from each batch into a new...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_data([{'data': [1, 2, 3]}, {'data': [4, 5, 6]}], [2, 4]) == [2, 4]\", \"assert load_data([{'data': [1, 2, 3]}, {'data': [7, 8, 9]}], [4, 5]) == []\", \"assert load_data([{'data': [10, 20]}, {'data': [30, 40]}], [10, 30]) == [10, 30]\", \"assert load_dat...
{ "split": "train", "index": 3163, "acecode_id": "bigcode_python_fns_45407", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D grid of non-negative integers, write a function `count_min_cost_paths(grid)` that calculates the total number of distinct paths from the top-left corner to the bottom-right corner of the grid with the minimum cost. You can only move either right or down at any point ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_min_cost_paths([[1, 2], [3, 4]]) == 1\", \"assert count_min_cost_paths([[1]]) == 1\", \"assert count_min_cost_paths([[1, 1], [1, 1]]) == 2\", \"assert count_min_cost_paths([[5, 6], [1, 2]]) == 1\", \"assert count_min_cost_paths([[1, 2, 3], [4, 5, 6], [...
{ "split": "train", "index": 3164, "acecode_id": "oss_12507", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the application's name from a given configuration. The configuration is represented as a dictionary with a key 'name' that holds the application's name as a string. Write a function `get_application_name(config: dict) -> st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_application_name({'name': 'MyApp'}) == 'MyApp'\", \"assert get_application_name({'name': 'TestApp'}) == 'TestApp'\", \"assert get_application_name({'name': ''}) == ''\", \"assert get_application_name({}) == 'Unknown Application'\", \"assert get_applicati...
{ "split": "train", "index": 3165, "acecode_id": "oss_10207", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, each representing file export options with two properties: 'file_type' (a string) and 'export_mode' (a string). Write a function `export_files(options: List[Dict[str, str]]) -> List[str]` that takes this list of export options and returns a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert export_files([]) == []\", \"assert export_files([{'file_type': 'pdf', 'export_mode': 'batch'}]) == ['Exporting pdf in batch mode.']\", \"assert export_files([{'file_type': 'docx', 'export_mode': 'single'}, {'file_type': 'csv', 'export_mode': 'append'}]) == [...
{ "split": "train", "index": 3166, "acecode_id": "bigcode_python_fns_11083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_figure` that simulates the creation of a figure and its axes. The function should take two parameters: a boolean `ipympl` which indicates if the interactive matplotlib backend is being used, and a tuple `figsize` which represents ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_figure(True, (10, 5)) == ('Figure', 'Axes')\", \"assert create_figure(False, (8, 6)) == ('Figure', 'Axes')\", \"assert create_figure(True, (12, 4)) == ('Figure', 'Axes')\", \"assert create_figure(False, (5, 5)) == ('Figure', 'Axes')\", \"assert create...
{ "split": "train", "index": 3167, "acecode_id": "bigcode_python_fns_35135", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with filtering a list of images based on specific criteria. Each image is represented as a dictionary with attributes such as 'name', 'size', and 'tags'. Your goal is to implement a function called `filter_images` that takes a list of images and a filter criterio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_images([{'name': 'image1', 'size': 150, 'tags': ['tag1']}, {'name': 'image2', 'size': 50, 'tags': ['tag2']}], 'size') == [{'name': 'image1', 'size': 150, 'tags': ['tag1']}]\", \"assert filter_images([{'name': 'image1', 'size': 150, 'tags': ['tag1']}, ...
{ "split": "train", "index": 3168, "acecode_id": "oss_33546", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of luminosity values and their associated uncertainties. Write a function `plot_luminosity(dt: List[float], lum: List[float], llum: List[float], ulum: List[float]) -> None` that simulates the plotting of this luminosity data with error bars. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert plot_luminosity([0.0, 1.0, 2.0], [10.0, 15.0, 20.0], [1.0, 1.5, 2.0], [1.5, 2.0, 3.0]) == [(0.0, 10.0, 1.0, 1.5), (1.0, 15.0, 1.5, 2.0), (2.0, 20.0, 2.0, 3.0)]\", \"assert plot_luminosity([1.0, 3.0, 4.0], [5.0, 10.0, 12.0], [0.5, 0.8, 1.0], [0.6, 0.9, 1.2]) ...
{ "split": "train", "index": 3169, "acecode_id": "bigcode_python_fns_38813", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a learning rate scheduler for a deep learning model training process. The learning rate scheduler should adjust the learning rate during training based on a predefined schedule. The schedule should consist of a warmup phase where the learning ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_lr_schedule(0.001, 5, 0.95)(0) == 0.0002\", \"assert create_lr_schedule(0.001, 5, 0.95)(1) == 0.0004\", \"assert create_lr_schedule(0.001, 5, 0.95)(3) == 0.0008\", \"assert create_lr_schedule(0.001, 5, 0.95)(4) == 0.001\", \"assert create_lr_schedule(...
{ "split": "train", "index": 3170, "acecode_id": "oss_26710", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a variable number of string arguments and returns a list containing those strings in uppercase. The function should ignore any empty strings provided as arguments. Your function should be named `create_uppercase_list` and have ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_uppercase_list('hello', 'world') == ['HELLO', 'WORLD']\", \"assert create_uppercase_list('test', '', 'case') == ['TEST', 'CASE']\", \"assert create_uppercase_list('', '', '') == []\", \"assert create_uppercase_list('a', 'b', 'c') == ['A', 'B', 'C']\",...
{ "split": "train", "index": 3171, "acecode_id": "bigcode_python_fns_19897", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a floating-point number `energy` representing the energy of a proton in MeV (Mega electron Volts), write a function `get_proton_gamma(energy: float) -> float` that calculates and returns the relativistic gamma factor for protons. The gamma factor is defined as the ratio o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_proton_gamma(0) == 0.0\", \"assert get_proton_gamma(938.27) == 1.0\", \"assert get_proton_gamma(1876.54) == 2.0\", \"assert get_proton_gamma(2814.81) == 3.0\", \"assert get_proton_gamma(1876.54) == 2.0\", \"assert get_proton_gamma(93827) == 100.0\"]}" }
{ "split": "train", "index": 3172, "acecode_id": "bigcode_python_fns_4444", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a string containing names of characters followed by their occupations in parentheses, return the occupation of the second character. The input string is formatted as 'Name (Occupation)', and characters are separated by commas. If the input string does not contain at least...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_second_character_occupation('John Doe (Writer), Jane Smith (Painter), Tom Johnson (Architect)') == 'Painter'\", \"assert get_second_character_occupation('Alice Wonderland (Explorer), Bob Builder (Constructor)') == 'Constructor'\", \"assert get_second_cha...
{ "split": "train", "index": 3173, "acecode_id": "evol_24700", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a key binding system for a text editor. Each keyboard shortcut is represented as a combination of modifier keys (such as 'ctrl', 'alt', 'shift') and a regular key (such as 'c', 'v', 'z', etc.). Your function should take a key combination as inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_edit_command(('ctrl', 'c')) == 'edit.copy'\", \"assert get_edit_command(('ctrl', 'v')) == 'edit.paste'\", \"assert get_edit_command(('ctrl', 'z')) == 'edit.undo'\", \"assert get_edit_command(('ctrl', 'y')) == 'edit.redo'\", \"assert get_edit_command(('ta...
{ "split": "train", "index": 3174, "acecode_id": "oss_30117", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an array of distinct strings, implement a function `blend_elements(arr)` that combines the elements of the array into a single string, with each element separated by a space. The order of the elements in the string should match their order in the array. For example, given...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert blend_elements(['apple', 'banana', 'cherry']) == 'apple banana cherry'\", \"assert blend_elements(['one', 'two', 'three']) == 'one two three'\", \"assert blend_elements(['hello', 'world']) == 'hello world'\", \"assert blend_elements(['foo', 'bar', 'baz']) ==...
{ "split": "train", "index": 3175, "acecode_id": "evol_11342", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `rectangle_properties(width: int, height: int) -> Tuple[int, int, bool]` that calculates the area and perimeter of a rectangle, and checks if it is a square. The function takes two parameters: 'width' and 'height' of the rectangle, both of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rectangle_properties(4, 6) == (24, 20, False)\", \"assert rectangle_properties(5, 5) == (25, 20, True)\", \"assert rectangle_properties(1, 1) == (1, 4, True)\", \"assert rectangle_properties(10, 5) == (50, 30, False)\", \"assert rectangle_properties(7, 7) ==...
{ "split": "train", "index": 3176, "acecode_id": "oss_3609", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a master token against a predefined value. The function should take a string as input representing the master token and return a boolean indicating whether the provided token matches the predefined token. The predefined tok...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_master_token('SECRET_MASTER_TOKEN') == True\", \"assert validate_master_token('WRONG_TOKEN') == False\", \"assert validate_master_token('') == False\", \"assert validate_master_token('SECRET_MASTER_TOK') == False\", \"assert validate_master_token('S...
{ "split": "train", "index": 3177, "acecode_id": "bigcode_python_fns_4519", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a city and state as input and returns the corresponding data for that city and state. The function should return a dictionary containing the city name, state abbreviation, population, and area in square miles. You need t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert city_state_lookup('New York', 'NY') == {'city': 'New York', 'state': 'NY', 'population': 8398748, 'area_sq_miles': 302.6}\", \"assert city_state_lookup('Los Angeles', 'CA') == {'city': 'Los Angeles', 'state': 'CA', 'population': 3990456, 'area_sq_miles': 503...
{ "split": "train", "index": 3178, "acecode_id": "oss_34421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function that accepts an array of numbers (not necessarily unique) and two distinct target numbers as inputs. The function should return true only if both target numbers are present within the provided array at least twice; otherwise, it should return false. The arr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert target_numbers([1,2,3,2,4,3], 2, 3) == True\", \"assert target_numbers([1,2,3,2,4,3], 2, 4) == False\", \"assert target_numbers([1,2,3,2,4,3], 1, 3) == False\", \"assert target_numbers([1,2,2,2,3,3,4], 2, 3) == True\", \"assert target_numbers([1,1,1,1,1,1], ...
{ "split": "train", "index": 3179, "acecode_id": "evol_5751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a new list containing the absolute values of those integers sorted in ascending order. The input list must contain between 5 and 100 elements. If the input list does not meet this requirement, the function should ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_absolute_values([-5, 3, -2, 2, 3, -3, 9, 0, -123]) == [0, 2, 2, 3, 3, 3, 5, 9, 123]\", \"assert sorted_absolute_values([1, -1, 2, -2, 3]) == [1, 1, 2, 2, 3]\", \"assert sorted_absolute_values([10, -20, 30, -40, 50, -60]) == [10, 20, 30, 40, 50, 60]\",...
{ "split": "train", "index": 3180, "acecode_id": "evol_20113", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks the validity of a photo's attributes. The function should take three parameters: `file_size`, `width`, and `height`. The expected values for these parameters are predefined as follows: `file_size` should be 1024 bytes, `width`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_photo_attributes(1024, 800, 600) == True\", \"assert validate_photo_attributes(1024, 800, 601) == False\", \"assert validate_photo_attributes(1023, 800, 600) == False\", \"assert validate_photo_attributes(1024, 799, 600) == False\", \"assert validat...
{ "split": "train", "index": 3181, "acecode_id": "oss_11348", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with transforming a list of tweet dictionaries into a cleaned and formatted list of tweets. Each tweet dictionary contains the following fields: 'id', 'full_text', 'screen_name', 'created_at', 'favorite_count', 'retweet_count', 'lang', and an optional 'hashtags' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_tweets([{'id': 1, 'full_text': 'Hello World!', 'screen_name': 'user1', 'created_at': '2023-01-01', 'favorite_count': 10, 'retweet_count': 5, 'lang': 'en'}]) == [{'Id': 1, 'Tweet': 'Hello World!', 'Username': 'user1', 'Date': '2023-01-01', 'Hashtags...
{ "split": "train", "index": 3182, "acecode_id": "bigcode_python_fns_38135", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sorted integer array, return the integer that occurs more than 25% of the time. If no such integer exists, return -1. The array is guaranteed to have at least one integer. You may assume that there is at most one integer that satisfies this condition.\nPlease reason ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findSpecialInteger([1,2,2,6,6,6,6,7,10]) == 6\", \"assert findSpecialInteger([1,1,1,2,2,3]) == 1\", \"assert findSpecialInteger([1,1,1,1,2,3,4]) == 1\", \"assert findSpecialInteger([4,4,4,4,5,5,5]) == 4\", \"assert findSpecialInteger([10,10,10,20,20]) == 10\...
{ "split": "train", "index": 3183, "acecode_id": "evol_26470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes a simulated vehicle recognition system with optional version loading. The function takes an optional parameter for the version path and a default parameter for the communication address. If the version path is provided, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_system() == 'System initialized with communication address: Vehicle.Recognition.1'\", \"assert initialize_system('path/to/version') == 'Version loaded from: path/to/version'\", \"assert initialize_system('another/path/to/version') == 'Version load...
{ "split": "train", "index": 3184, "acecode_id": "bigcode_python_fns_48386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function that counts the number of occurrences of a specific character in a given string. Your function should take two parameters: a string `text` and a character `char`. It should return the total count of how many times `char` appears in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_character('hello world', 'o') == 2\", \"assert count_character('hello world', 'l') == 3\", \"assert count_character('Python Programming', 'P') == 2\", \"assert count_character('aaaaa', 'a') == 5\", \"assert count_character('aaaaa', 'b') == 0\", \"asser...
{ "split": "train", "index": 3185, "acecode_id": "oss_2563", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers and returns a new array containing the same integers arranged in ascending order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_array([5, 3, 8, 1, 4]) == [1, 3, 4, 5, 8]\", \"assert sort_array([10, 2, 6, 4, 9]) == [2, 4, 6, 9, 10]\", \"assert sort_array([0, -2, 5, 3, -1]) == [-2, -1, 0, 3, 5]\", \"assert sort_array([1]) == [1]\", \"assert sort_array([]) == []\", \"assert sort_ar...
{ "split": "train", "index": 3186, "acecode_id": "evol_33996", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a user profile represented by the number of friends, posts, likes received, comments received, groups the user is a member of, and events attended, implement a function `calc_user_score` that calculates the overall user score based on the following weightages: 1 point for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_user_score(0, 0, 0, 0, 0, 0) == 0\", \"assert calc_user_score(2, 2, 2, 2, 2, 2) == 30\", \"assert calc_user_score(3, 3, 3, 3, 3, 3) == 45\", \"assert calc_user_score(10, 0, 10, 0, 0, 0) == 40\", \"assert calc_user_score(4, 4, 4, 4, 4, 4) == 60\", \"asse...
{ "split": "train", "index": 3187, "acecode_id": "evol_764", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a zero-filled byte stream. The function should take an integer parameter 'length' and return a bytes object containing 'length' number of zero bytes. If the input length is zero, the function should return an empty bytes ob...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert zero_stream(0) == b''\", \"assert zero_stream(1) == b'\\\\x00'\", \"assert zero_stream(2) == b'\\\\x00\\\\x00'\", \"assert zero_stream(5) == b'\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00'\", \"assert zero_stream(10) == b'\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\...
{ "split": "train", "index": 3188, "acecode_id": "bigcode_python_fns_37903", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s consisting of alphanumeric characters, determine if it can be rearranged to form a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. Im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_form_palindrome('aabb') == True\", \"assert can_form_palindrome('racecar') == True\", \"assert can_form_palindrome('hello') == False\", \"assert can_form_palindrome('civic') == True\", \"assert can_form_palindrome('ivicc') == True\", \"assert can_form_pa...
{ "split": "train", "index": 3189, "acecode_id": "evol_2613", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two strings, `str1` and `str2`, write a function that finds the index of the first character where the two strings differ. If the strings are identical, return -1. The function should handle cases where the strings may have different lengths by only comparing up to the le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_difference('hello', 'hello') == -1\", \"assert first_difference('hello', 'hell') == 4\", \"assert first_difference('hell', 'hello') == 4\", \"assert first_difference('abc', 'abcd') == 3\", \"assert first_difference('abcd', 'abc') == 3\", \"assert first...
{ "split": "train", "index": 3190, "acecode_id": "bigcode_python_fns_9769", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine if a notification can be sent and if the user prefers to receive the notification based on certain conditions. You need to implement a function `notification_preferences(user, notification_type, is_active)` that takes thr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert notification_preferences(None, {'unsubscribe_allowed': True}, True) == (False, False)\", \"assert notification_preferences({'is_active': True}, {'unsubscribe_allowed': True}, True) == (True, True)\", \"assert notification_preferences({'is_active': False}, {'...
{ "split": "train", "index": 3191, "acecode_id": "oss_12795", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_number(n)` that takes an integer `n` as input and returns an integer representing the digits of `n` reversed. The function should handle both positive and negative integers, and should not return leading zeros in the output. If the input is not an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_number(123) == 321\", \"assert reverse_number(-123) == -321\", \"assert reverse_number(120) == 21\", \"assert reverse_number(-120) == -21\", \"assert reverse_number(0) == 0\", \"assert reverse_number(5000) == 5\", \"assert reverse_number(-5000) == -5...
{ "split": "train", "index": 3192, "acecode_id": "evol_27429", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, each representing an image in a specific format. Your task is to create a function that simulates loading these images and optionally resizing them. The resizing can be represented by converting each image string to a fixed-length string by trun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_images(['image1data', 'image2data', 'image3data'], False) == ['image1data', 'image2data', 'image3data']\", \"assert load_images([], True) == []\", \"assert load_images([], False) == []\", \"assert load_images(['longimage1data', 'longimage2data'], True) ...
{ "split": "train", "index": 3193, "acecode_id": "bigcode_python_fns_4086", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of user IDs representing live streamers and their corresponding live statuses. The live status can be either '0' (not live), '1' (live), or '2' (offline). Your task is to write a function that takes in a list of user IDs and their statuses, and returns a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_live_streamers([1, 2, 3], [0, 1, 0]) == [2]\", \"assert get_live_streamers([10, 20, 30, 40], [0, 2, 1, 0]) == [30]\", \"assert get_live_streamers([], []) == []\", \"assert get_live_streamers([5, 6, 7], [1, 1, 1]) == [5, 6, 7]\", \"assert get_live_streame...
{ "split": "train", "index": 3194, "acecode_id": "bigcode_python_fns_16404", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that processes historical minute bar data for a given stock symbol and exchange. The function takes in a list of dictionaries, where each dictionary represents a minute bar with the following keys: 'OpenPrice', 'HighestPrice', 'LowestPrice', 'Cl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_bar_data([{'OpenPrice': 100.0, 'HighestPrice': 105.0, 'LowestPrice': 99.0, 'ClosePrice': 102.0, 'Volume': 1000, 'Turnover': 102000, 'ActionDay': '20230301', 'UpdateTime': '09:30:00'}, {'OpenPrice': 102.0, 'HighestPrice': 106.0, 'LowestPrice': 101.0, ...
{ "split": "train", "index": 3195, "acecode_id": "bigcode_python_fns_23683", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `be` that takes two parameters: `subject` (a string) and `contract` (a boolean). The function should return the string 'be' concatenated with the `subject` if `contract` is True, otherwise it should simply return 'be'. For exam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert be('friend', True) == 'befriend'\", \"assert be('team', True) == 'beteam'\", \"assert be('family', False) == 'be'\", \"assert be('work', False) == 'be'\", \"assert be('love', True) == 'belove'\", \"assert be('enemy', True) == 'beenemy'\", \"assert be('', Tru...
{ "split": "train", "index": 3196, "acecode_id": "bigcode_python_fns_27790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that determines whether a given integer is a perfect square. A perfect square is an integer that is the square of an integer. For example, 1, 4, 9, and 16 are perfect squares, while 2, 3, 5, and 7 are not. The function should return True if the input number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_square(0) == True\", \"assert is_perfect_square(1) == True\", \"assert is_perfect_square(4) == True\", \"assert is_perfect_square(9) == True\", \"assert is_perfect_square(16) == True\", \"assert is_perfect_square(25) == True\", \"assert is_perfect...
{ "split": "train", "index": 3197, "acecode_id": "evol_35986", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates and sets a student's course subject. The function should take a single argument, 'subject', which is a string. If the provided subject is a non-empty string, the function should return the subject. If the subject is an empt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_student_course_subject('Mathematics') == 'Mathematics'\", \"assert set_student_course_subject('Physics') == 'Physics'\", \"assert set_student_course_subject('Chemistry') == 'Chemistry'\", \"assert set_student_course_subject('Biology') == 'Biology'\", \"a...
{ "split": "train", "index": 3198, "acecode_id": "oss_19299", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of regions, where each region is represented by a dictionary containing a device name and a list of mappings. Each mapping is also a dictionary that contains a DIMM identifier. Your task is to implement a function `get_dimm_list(region: str, regions: List[D...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_dimm_list('region1', [{'dev': 'region1', 'mappings': [{'dimm': 'dimm1'}, {'dimm': 'dimm2'}]}, {'dev': 'region2', 'mappings': [{'dimm': 'dimm3'}]}]) == ['dimm1', 'dimm2']\", \"assert get_dimm_list('region2', [{'dev': 'region1', 'mappings': [{'dimm': 'dimm...
{ "split": "train", "index": 3199, "acecode_id": "bigcode_python_fns_22022", "num_tests": 16 }