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 developing a Python package for image processing and need to define the public API of the package by creating a string representation of the `__all__` variable. This variable should include both existing head modules and any new head modules provided as input. Write a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_all_variable(['NewHead1', 'NewHead2']) == \\\"__all__ = ['UPerHead', 'SegFormerHead', 'SFHead', 'FPNHead', 'FaPNHead', 'FCNHead', 'CondHead', 'NewHead1', 'NewHead2']\\\"\", \"assert generate_all_variable([]) == \\\"__all__ = ['UPerHead', 'SegFormerH... | {
"split": "train",
"index": 72800,
"acecode_id": "oss_15477",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `rescale_intensity(arr: List[int], in_range: Tuple[int, int], out_range: Tuple[int, int]) -> List[float]` that rescales the intensity levels of the integers in the list based on the specified input and output ranges. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rescale_intensity([1, 2, 3, 4, 5], (1, 5), (0, 1)) == [0.0, 0.25, 0.5, 0.75, 1.0]\", \"assert rescale_intensity([10, 20, 30], (10, 30), (0, 100)) == [0.0, 50.0, 100.0]\", \"assert rescale_intensity([5, 15, 25], (5, 25), (0, 10)) == [0.0, 5.0, 10.0]\", \"asse... | {
"split": "train",
"index": 72801,
"acecode_id": "bigcode_python_fns_23410",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the current prices of an item at different times. Implement a function that returns a dictionary containing the current price, the average price of the next three prices, and the maximum price from the list. If there are less than t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_prices([100, 200, 300, 400]) == {'current': 100, 'average_next_three': 300.0, 'max': 400}\", \"assert analyze_prices([30]) == {'current': 30, 'average_next_three': 0.0, 'max': 30}\", \"assert analyze_prices([]) == None\", \"assert analyze_prices([5])... | {
"split": "train",
"index": 72802,
"acecode_id": "bigcode_python_fns_39176",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of file names, implement a function `filter_text_files(file_list: List[str]) -> List[str]` that returns a list of all text files in the input list. A text file is defined as any file that ends with the extension '.txt'. The input list may contain file names with va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_text_files(['file1.txt', 'image.png', 'document.pdf', 'notes.TXT']) == ['file1.txt', 'notes.TXT']\", \"assert filter_text_files(['data.csv', 'report.docx']) == []\", \"assert filter_text_files([]) == []\", \"assert filter_text_files(['README.md', 'scr... | {
"split": "train",
"index": 72803,
"acecode_id": "bigcode_python_fns_30269",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple task management system that allows users to manage tasks. Your program should provide three primary commands: 'add <task_description>' to add a new task, 'list' to display all tasks with their indices, and 'remove <task_index>' to remove a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_tasks(['add Task 1', 'add Task 2', 'list']) == ['Task 1', 'Task 2']\", \"assert manage_tasks(['add Task A', 'remove 1', 'list']) == []\", \"assert manage_tasks(['add Task 1', 'add Task 2', 'remove 1', 'list']) == ['Task 2']\", \"assert manage_tasks(['... | {
"split": "train",
"index": 72804,
"acecode_id": "oss_13335",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of unique slugs from a list of entry titles. A slug is a URL-friendly version of a title, typically formed by converting the title to lowercase, replacing spaces with hyphens, and removing any special characters. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_slugs(['Hello World', 'Hello World', 'My First Entry']) == ['hello-world', 'hello-world-1', 'my-first-entry']\", \"assert generate_slugs(['Python Programming', 'Python Programming', 'Python Programming 101']) == ['python-programming', 'python-progra... | {
"split": "train",
"index": 72805,
"acecode_id": "oss_9922",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given path is a directory or not. The function should take a string representing the path as input and return True if the path is a directory and False otherwise. You can assume that the function will receive a valid stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_directory('/home/user/') == True\", \"assert is_directory('/home/user') == False\", \"assert is_directory('/var/log/') == True\", \"assert is_directory('/var/log') == False\", \"assert is_directory('/') == True\", \"assert is_directory('C:/Program Files/'... | {
"split": "train",
"index": 72806,
"acecode_id": "bigcode_python_fns_38004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `quicksort(array)` that takes a list of integers and sorts it using the QuickSort algorithm. The function should select the pivot as the middle element of the array. The function should return a new list containing the sorted integers. Ensure that the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quicksort([]) == []\", \"assert quicksort([1]) == [1]\", \"assert quicksort([2, 1]) == [1, 2]\", \"assert quicksort([3, 2, 1]) == [1, 2, 3]\", \"assert quicksort([1, 2, 3]) == [1, 2, 3]\", \"assert quicksort([2, 3, 1]) == [1, 2, 3]\", \"assert quicksort([4, ... | {
"split": "train",
"index": 72807,
"acecode_id": "evol_17745",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string and a multiplier value. Your task is to create a new string that consists of the original string repeated a specified number of times, separated by a space. If the multiplier value is zero or less, return an empty string. Implement a function `repeat_stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_string('abc', 0) == ''\", \"assert repeat_string('AI', -1) == ''\", \"assert repeat_string('end', 0) == ''\", \"assert repeat_string('empty', -5) == ''\", \"assert repeat_string('!', 0) == ''\"]}"
} | {
"split": "train",
"index": 72808,
"acecode_id": "bigcode_python_fns_42805",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of sensor readings (integers) and returns a dictionary containing the following keys: 'sub_title' and 'table'. The 'sub_title' key should have the value 'Latest readings:', and the 'table' key should have a string repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_readings_report([]) == {'sub_title': 'Latest readings:', 'table': ''}\", \"assert generate_readings_report([1]) == {'sub_title': 'Latest readings:', 'table': '1'}\", \"assert generate_readings_report([10, 20, 30]) == {'sub_title': 'Latest readings:'... | {
"split": "train",
"index": 72809,
"acecode_id": "bigcode_python_fns_45798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_primes_from_array(arr: List[int]) -> List[int]` that takes a list of integers `arr` and returns a list of all prime numbers present in the list. Consider negative numbers as non-prime and do not include them in the output. The function should handle an em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes_from_array([-10, -5, -1, 0, 1, 4, 6]) == []\", \"assert find_primes_from_array([2, 3, 5, 7]) == [2, 3, 5, 7]\", \"assert find_primes_from_array([10, 12, 14, 15]) == []\", \"assert find_primes_from_array([-11, -3, 0, 1]) == []\", \"assert find_pri... | {
"split": "train",
"index": 72810,
"acecode_id": "evol_15463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a display position and size into a specific string format. The function will take two parameters: a string representing the size and position (`size_pos`) in the format 'WIDTHxHEIGHT+X+Y', and a string representing the positi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_mvarg('1920x1080+0+0', 'full') == '0,0,0,1920,1080'\", \"assert get_mvarg('1920x1080+0+0', 'left') == '0,0,0,960,1080'\", \"assert get_mvarg('1920x1080+0+0', 'right') == '0,960,0,960,1080'\", \"assert get_mvarg('1280x720+100+200', 'top') == '0,100,200,12... | {
"split": "train",
"index": 72811,
"acecode_id": "bigcode_python_fns_49488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `smart_car_features` that takes in the current status of a smart car's features: autopilot, self-parking, and collision warning systems, as well as the engine state, battery level, and sensor status. The function should return a dictionary containing the st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smart_car_features(True, True, True, True, 100, True) == {'autopilot': True, 'self_parking': True, 'collision_warning': True, 'engine_state': True, 'battery_level': 100, 'sensor_status': True}\", \"assert smart_car_features(False, False, False, False, 0, Fal... | {
"split": "train",
"index": 72812,
"acecode_id": "evol_26977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of device IDs representing different plates. Your task is to determine which plate is currently connected to the device. The plates are represented by the following constants: `PLATE_ID_FOUNDATION` and `PLATE_ID_EXPANSION`. Each plate has a function `get_de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connected_plate([1, 2]) == 1\", \"assert connected_plate([2, 1]) == 1\", \"assert connected_plate([1]) == 1\", \"assert connected_plate([2]) == None\", \"assert connected_plate([]) == None\", \"assert connected_plate([3, 4]) == None\", \"assert connected_pla... | {
"split": "train",
"index": 72813,
"acecode_id": "bigcode_python_fns_17688",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a language translation tool that can convert English phrases to their corresponding Chinese translations. The tool should be able to handle multiple phrases and their translations, and should also support the ability to mark certain translations as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_to_chinese([ (('*', 'Hello'), ((), ()), ('zh_CN', '\\u4f60\\u597d', (True, ())))]) == {'Hello': {'translation': '\\u4f60\\u597d', 'confirmed': True}}\", \"assert translate_to_chinese([ (('*', 'Goodbye'), ((), ()), ('zh_CN', '\\u518d\\u89c1', (False... | {
"split": "train",
"index": 72814,
"acecode_id": "oss_26753",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if two input strings contain the same unique words in the same order, ignoring case sensitivity and any non-alphanumeric characters. The function should return True if the sequences of unique words are identical, and False otherwise.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_word_sets_order('Apple, Banana-Orange!', 'orange Apple @banana') == False\", \"assert compare_word_sets_order('apple BANANA', 'apple orange (banana)') == False\", \"assert compare_word_sets_order('baNana Apple', 'apple baNAna') == False\", \"assert c... | {
"split": "train",
"index": 72815,
"acecode_id": "evol_18085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes metadata from a software package and extracts specific information. The metadata is represented as a dictionary, and your goal is to extract the license information and a list of classifiers from the given dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metadata({\\\"name\\\": \\\"Package1\\\", \\\"version\\\": \\\"1.0\\\", \\\"description\\\": \\\"Sample Package\\\", \\\"author\\\": \\\"Author1\\\", \\\"__license__\\\": \\\"MIT\\\", \\\"classifiers\\\": [\\\"Classifier1\\\", \\\"Classifier2\\\"]}) ... | {
"split": "train",
"index": 72816,
"acecode_id": "oss_16193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing the current time in the format 'HH:MM' and another string representing the timezone as either 'US Eastern' or 'UTC', write a function that converts the given time to the time in UTC+3. Your function should handle potential errors by returning specifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_time_to_utc3('12:00', 'UTC') == '15:00'\", \"assert convert_time_to_utc3('23:00', 'UTC') == '02:00'\", \"assert convert_time_to_utc3('00:00', 'UTC') == '03:00'\", \"assert convert_time_to_utc3('06:30', 'UTC') == '09:30'\", \"assert convert_time_to_ut... | {
"split": "train",
"index": 72817,
"acecode_id": "evol_29",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function `char_count(s: str) -> Tuple[int, int]` that takes a string `s` and returns a tuple containing two integers. The first integer should represent the count of alphabetic characters in the string, while the second integer should represent the count of non-alphabet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_count('Hello, World!') == (10, 3)\", \"assert char_count('12345') == (0, 5)\", \"assert char_count('') == (0, 0)\", \"assert char_count('Python 3.7') == (6, 4)\", \"assert char_count('abc!@#123') == (3, 6)\", \"assert char_count('A B C') == (3, 2)\", \"... | {
"split": "train",
"index": 72818,
"acecode_id": "evol_22082",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of journal permissions represented as tuples, where each tuple contains a holder ID and a journal ID, implement a function `get_journal_permissions(journal_permissions: List[Tuple[str, str]], user_id: Optional[str], user_group_id_list: Optional[List[str]], journal_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_journal_permissions([('user1', 'journal1'), ('group1', 'journal1'), ('user2', 'journal2')], 'user1', None, 'journal1') == [('user1', 'journal1')]\", \"assert get_journal_permissions([('user1', 'journal1'), ('group1', 'journal1'), ('user2', 'journal2')], ... | {
"split": "train",
"index": 72819,
"acecode_id": "bigcode_python_fns_2555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of mood entries. Each mood entry is represented by a dictionary containing the following keys: `profile`, `characteristic`, `latitude`, `longitude`, `image`, and `location`. Your goal is to create a function called `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_moods([{'profile': 'User1', 'characteristic': 'happy', 'latitude': 34.0522, 'longitude': -118.2437, 'image': 'img1.png', 'location': 'Los Angeles'}, {'profile': 'User2', 'characteristic': 'sad', 'latitude': 40.7128, 'longitude': -74.0060, 'image': ... | {
"split": "train",
"index": 72820,
"acecode_id": "oss_8960",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes lists of x and y coordinates and generates a formatted string representation of a scatter plot. The function should accept the following parameters: a list of x-coordinates, a list of y-coordinates, labels for the x-axis, label... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_scatterplot_string([1, 2, 3], [4, 5, 6], 'X Axis', 'Y Axis', 'My Scatter Plot') == \\\"Title: My Scatter Plot\\\\nX Label: X Axis\\\\nY Label: Y Axis\\\\nPoints: ['Point(1, 4)', 'Point(2, 5)', 'Point(3, 6)']\\\"\", \"assert generate_scatterplot_stri... | {
"split": "train",
"index": 72821,
"acecode_id": "bigcode_python_fns_29766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `convertMinHeap(arr: List[Any]) -> int` that takes an array of mixed data types (including integers, floats, strings, None, etc.) and converts it into a valid min heap. The function should return the number of swaps made to achieve this. If any element in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convertMinHeap([5, 3, 8, 4, 1]) == 3\", \"assert convertMinHeap([]) == 0\", \"assert convertMinHeap([1, 2, 3, 4, 5]) == 0\", \"assert convertMinHeap([1, 2, 3, 4, 5, 6, 7, 8]) == 0\", \"assert convertMinHeap([1.5, 2.5, 0.5]) == 1\", \"assert convertMinHeap([3... | {
"split": "train",
"index": 72822,
"acecode_id": "evol_32354",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sum_of_numbers(n: int) -> int` that calculates the sum of all integers from 0 up to but not including `n`. The function should return the cumulative sum. If `n` is less than or equal to 0, the function should return 0.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_numbers(0) == 0\", \"assert sum_of_numbers(1) == 0\", \"assert sum_of_numbers(2) == 1\", \"assert sum_of_numbers(3) == 3\", \"assert sum_of_numbers(4) == 6\", \"assert sum_of_numbers(5) == 10\", \"assert sum_of_numbers(10) == 45\", \"assert sum_of_num... | {
"split": "train",
"index": 72823,
"acecode_id": "evol_32792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of a GPIO pin. The function should accept an integer representing the pin number and return a string indicating that the pin has been configured as input. The string should be formatted as 'Pin {pin_number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_pin_as_input(1) == 'Pin 1 configured as input.'\", \"assert configure_pin_as_input(2) == 'Pin 2 configured as input.'\", \"assert configure_pin_as_input(3) == 'Pin 3 configured as input.'\", \"assert configure_pin_as_input(4) == 'Pin 4 configured a... | {
"split": "train",
"index": 72824,
"acecode_id": "bigcode_python_fns_5969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a mixed character string consisting of alphabets and digits as its input and returns the sum of all individual numeric digits present in the string. For instance, given the input string 'a1b2c3d4e5', the function should return 15, which is the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_digits('a1b2c3d4e5') == 15\", \"assert sum_of_digits('123abc456') == 21\", \"assert sum_of_digits('abc') == 0\", \"assert sum_of_digits('0') == 0\", \"assert sum_of_digits('a0b0c0') == 0\", \"assert sum_of_digits('1') == 1\", \"assert sum_of_digits('9... | {
"split": "train",
"index": 72825,
"acecode_id": "evol_14891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that filters a list of event data based on specified criteria. The function should take in two parameters: `origin_name` (string) and `uri_raw` (string). The function must perform the following steps: 1. Convert the `origin_name` p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_event_data([{'subject_id': 1, 'origin': 'web', 'created_at': '2021-01-01', 'uri': 'example.com'}, {'subject_id': 2, 'origin': 'mobile', 'created_at': '2021-01-02', 'uri': 'example.com'}], 'web', 'example.com') == '[{\\\"subject_id\\\": 1, \\\"origin\... | {
"split": "train",
"index": 72826,
"acecode_id": "oss_29456",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing words. Your task is to implement a function `generate_word_summary(words: List[str]) -> str` that takes this list of words as input and returns a summary of the most frequently used words in the list. The summary should include the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_word_summary(['apple', 'banana', 'apple', 'orange', 'banana', 'kiwi']) == 'The most frequently used words are: apple, banana, orange, kiwi'\", \"assert generate_word_summary(['hello', 'world', 'hello', 'python']) == 'The most frequently used words a... | {
"split": "train",
"index": 72827,
"acecode_id": "oss_14109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that constructs a simple table reference string based on a dataset name and a table ID. The function should take two arguments: a dataset name (a string) and a table ID (a string). The output should be a single string in the format 'datas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_table_reference('sales', '2023_orders') == 'sales.2023_orders'\", \"assert get_table_reference('marketing', 'campaigns') == 'marketing.campaigns'\", \"assert get_table_reference('finance', 'transactions') == 'finance.transactions'\", \"assert get_table_r... | {
"split": "train",
"index": 72828,
"acecode_id": "bigcode_python_fns_3582",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `has_permissions(member_perms: List[str], required_perms: List[str]) -> bool` that determines whether a user has all of the specified permissions. The function will take two lists of strings: `member_perms` representing the permission... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_permissions(['read', 'write', 'execute'], ['read', 'write']) == True\", \"assert has_permissions(['read', 'write', 'execute'], ['read', 'delete']) == False\", \"assert has_permissions(['admin', 'write'], ['admin']) == True\", \"assert has_permissions(['a... | {
"split": "train",
"index": 72829,
"acecode_id": "bigcode_python_fns_5921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of distinct coin denominations and an integer N, implement a function that determines the quantity of distinct combinations available to create a change of N utilizing the specified set of coin denominations. You may use each coin denomination an unlimited number o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_combinations([1, 2, 3], 4) == 4\", \"assert count_combinations([2, 5, 3], 7) == 2\", \"assert count_combinations([1], 0) == 1\", \"assert count_combinations([1, 2], 2) == 2\", \"assert count_combinations([1, 2, 3], 5) == 5\", \"assert count_combination... | {
"split": "train",
"index": 72830,
"acecode_id": "evol_27250",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where each key is a unique identifier of a musical tonnetz, and the value is a list of integers representing note points associated with that tonnetz. Your task is to implement a function `get_total_note_points(dict_of_tonnetze)` that calculates and r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_note_points({'T1': [1, 2, 3], 'T2': [4, 5]}) == 15\", \"assert get_total_note_points({'T1': []}) == 0\", \"assert get_total_note_points({'T1': [10], 'T2': [20, 30]}) == 60\", \"assert get_total_note_points({'T1': [1, 1], 'T2': [1, 1], 'T3': [1]}) =... | {
"split": "train",
"index": 72831,
"acecode_id": "oss_33695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a JSON string and performs specific operations based on the content. The function should take a JSON string as input and return a modified JSON string as output. The function should perform the following operations: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_json('{\\\"title\\\": \\\"Inception\\\", \\\"year\\\": 2010}') == '{\\\"title\\\": \\\"Inception (updated)\\\", \\\"year\\\": 2015}'\", \"assert modify_json('{\\\"title\\\": \\\"The Matrix\\\", \\\"year\\\": 1999}') == '{\\\"title\\\": \\\"The Matrix ... | {
"split": "train",
"index": 72832,
"acecode_id": "oss_5044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a variable number of tensors, each represented as a list of integers. Your task is to create a function that overlays these tensors by concatenating them into a single list. The tensors should be concatenated in the order they are provided, meaning the last tensor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert overlay_tensors([1, 2], [3, 4]) == [1, 2, 3, 4]\", \"assert overlay_tensors([1], [2], [3]) == [1, 2, 3]\", \"assert overlay_tensors([], [1, 2]) == [1, 2]\", \"assert overlay_tensors([1, 2], []) == [1, 2]\", \"assert overlay_tensors([1, 2], [3, 4], [5, 6]) ==... | {
"split": "train",
"index": 72833,
"acecode_id": "bigcode_python_fns_39866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a tuple of integers representing the number of neurons for two LSTM layers, a string representing the loss function to be used, and a tuple of floats representing the dropout rates for those layers. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert model_description((50, 100), 'mean_squared_error', (0.2, 0.3)) == 'LSTM(50) -> Dropout(0.2) -> LSTM(100) -> Dropout(0.3) -> Dense(1, activation=linear) with loss=mean_squared_error'\", \"assert model_description((64, 128), 'categorical_crossentropy', (0.0, 0... | {
"split": "train",
"index": 72834,
"acecode_id": "oss_11031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a file path for a data split based on the given split number and whether it is for training or testing. The function takes two parameters: an input string representing the base directory path (_DATA_DIRECTORY_PATH) and an i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_index_train_test_path('/data/', 1, True) == '/data/index_train_1.txt'\", \"assert get_index_train_test_path('/data/', 1, False) == '/data/index_test_1.txt'\", \"assert get_index_train_test_path('/dataset/', 5, True) == '/dataset/index_train_5.txt'\", \"a... | {
"split": "train",
"index": 72835,
"acecode_id": "bigcode_python_fns_4040",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of URL patterns for a Django application. Given an `app_name`, you need to return a list of URL patterns that map to two views: `projects_list` and `project_details`. The `projects_list` view should be mapped to the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_url_patterns('projects') == [{'path': '', 'view': 'projects.projects_list'}, {'path': '<int:project_id>/', 'view': 'projects.project_details'}]\", \"assert generate_url_patterns('test_app') == [{'path': '', 'view': 'test_app.projects_list'}, {'path'... | {
"split": "train",
"index": 72836,
"acecode_id": "oss_15440",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a user's email format and calculating the number of days since their registration. Write a function called `user_info(email: str, registration_date: str, current_date: str) -> Tuple[bool, int]` that takes in three parameters: the user's email addr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_info('example@email.com', '2022-01-15', '2023-01-15') == (True, 365)\", \"assert user_info('invalid-email', '2022-01-15', '2023-01-15') == (False, 365)\", \"assert user_info('test.user@domain.com', '2023-01-01', '2023-01-15') == (True, 14)\", \"assert u... | {
"split": "train",
"index": 72837,
"acecode_id": "oss_7967",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that finds the shortest path between two nodes in a weighted graph. The graph is represented as a dictionary of dictionaries, where the keys are the nodes and the values are dictionaries containing neighboring nodes and their correspo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_shortest_path({'A': {'B': 1, 'C': 4}, 'B': {'A': 1, 'C': 2, 'D': 5}, 'C': {'A': 4, 'B': 2, 'D': 1}, 'D': {'B': 5, 'C': 1}}, 'A', 'D') == ['A', 'B', 'C', 'D']\", \"assert find_shortest_path({'A': {'B': 2}, 'B': {'A': 2, 'C': 3}, 'C': {'B': 3}}, 'A', 'C')... | {
"split": "train",
"index": 72838,
"acecode_id": "oss_10669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that receives three strings as input and returns a list containing the count of unique alphabets in each string. The function should ignore case and spaces, and consider only alphabetic characters. For instance, given the inputs 'Hello World!', 'Python Progra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_alphabet_count('A quick brown fox jumps over the lazy dog', 'The five boxing wizards jump quickly', 'Pack my box with five dozen liquor jugs') == [26, 26, 26]\", \"assert unique_alphabet_count('A B C D E F', 'G H I J K L', 'M N O P Q R') == [6, 6, 6]\... | {
"split": "train",
"index": 72839,
"acecode_id": "evol_9498",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a dataset for a machine learning project. The function `generate_dataset` takes two parameters: `maximum_length` (an integer) and `possible_labels` (a list of strings). The function should return a dataset, which is a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert all(isinstance(item, int) and 0 <= item <= 100 for sublist in generate_dataset(4, ['label1'])[0] for item in sublist)\", \"assert generate_dataset(2, ['label1'])[1][0][0] in range(len(['label1']))\", \"assert generate_dataset(3, ['label1', 'label2'])[0][2][2... | {
"split": "train",
"index": 72840,
"acecode_id": "oss_7555",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that extracts all HTTP links from a given HTML content string. The function should take a single parameter, `html_content`, which is a string containing valid HTML. Your function should return a list of strings, where each string is an HTT... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_http_links('<a href=\\\"http://example.com\\\">Example</a>') == ['http://example.com']\", \"assert extract_http_links('<a href=\\\"https://example.com\\\">Example</a>') == []\", \"assert extract_http_links('<p>No links here!</p>') == []\", \"assert e... | {
"split": "train",
"index": 72841,
"acecode_id": "evol_24213",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that initializes a web application using a given configuration. The function should accept an optional configuration parameter. If the configuration is provided, the function should return a message indicating successful initializatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_app('Debug Mode') == 'Application initialized with configuration: Debug Mode'\", \"assert initialize_app('Production Mode') == 'Application initialized with configuration: Production Mode'\", \"assert initialize_app('Testing Mode') == 'Application... | {
"split": "train",
"index": 72842,
"acecode_id": "oss_26261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of musical instruments. Your task is to classify these instruments into three distinct groups based on their family classification: 'Strings', 'Brass', and 'Percussion'. The list of instruments is as follows: ['Violin', 'Trumpet', 'Drum', 'Flute', 'Guitar',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ClassifyInstruments(['Violin', 'Trumpet', 'Drum', 'Flute', 'Guitar', 'Tuba', 'Cello', 'Piano', 'Harmonica']) == {'Strings': ['Violin', 'Guitar', 'Cello', 'Piano'], 'Brass': ['Trumpet', 'Tuba'], 'Percussion': ['Drum']}\", \"assert ClassifyInstruments(['Harmon... | {
"split": "train",
"index": 72843,
"acecode_id": "evol_14134",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `max_of_three_numbers` that takes three parameters. The parameters can be of any type, including integers, floats, or strings. Your function should determine if all three parameters can be converted to numerical values (integers or floats). If they c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_of_three_numbers(1, 2, 3) == 3\", \"assert max_of_three_numbers(3.5, 2.1, 4.2) == 4.2\", \"assert max_of_three_numbers('1', '2', '3') == 3.0\", \"assert max_of_three_numbers('1.1', 2.2, 3.3) == 3.3\", \"assert max_of_three_numbers(10, '20', 30) == 30\", ... | {
"split": "train",
"index": 72844,
"acecode_id": "evol_2843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple email notification system. Implement a function `send_email` that simulates sending an email by accepting three parameters: `recipient`, `subject`, and `body`. The function should return a string indicating the outcome of the operation in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_email('test@example.com', 'Hello', 'This is a test email.') == 'Email sent to test@example.com with subject: Hello'\", \"assert send_email('user@example.com', 'Greetings', 'How are you?') == 'Email sent to user@example.com with subject: Greetings'\", \"... | {
"split": "train",
"index": 72845,
"acecode_id": "oss_33522",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that finds all perfect squares between two given integers, inclusive. The function should return a dictionary where the keys are the perfect squares found, and the values are booleans indicating whether each perfect square is a prime number (True) or not (False... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perfect_squares(1, 1) == {1: False}\", \"assert perfect_squares(1, 4) == {1: False, 4: False}\", \"assert perfect_squares(5, 15) == {9: False}\", \"assert perfect_squares(10, 30) == {16: False, 25: False}\", \"assert perfect_squares(20, 40) == {25: False, 36... | {
"split": "train",
"index": 72846,
"acecode_id": "evol_19324",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines if a given string is a valid duration format. The valid duration format is defined as a string that consists of a non-negative integer followed by a single character representing the unit of time. The valid units are: 's' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_duration('0s') == True\", \"assert is_valid_duration('1h') == True\", \"assert is_valid_duration('30m') == True\", \"assert is_valid_duration('15d') == True\", \"assert is_valid_duration('2s') == True\", \"assert is_valid_duration('5m') == True\", \... | {
"split": "train",
"index": 72847,
"acecode_id": "bigcode_python_fns_30949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a document from a database, which contains various key-value pairs. Your task is to implement a function that transforms this document into a JSON-serializable dictionary. The transformation should follow these rules: 1. Any key-value pai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert doc_to_dict({'_id': 1, 'name': 'Alice', 'age': 30}) == {'name': 'Alice', 'age': 30, '_id': '1'}\", \"assert doc_to_dict({'_id': 2, 'email': 'alice@example.com', 'status': 'active'}) == {'email': 'alice@example.com', 'status': 'active', '_id': '2'}\", \"asser... | {
"split": "train",
"index": 72848,
"acecode_id": "bigcode_python_fns_23455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pipeline stages, where each stage is represented by an object that has an attribute `data` which in turn has a `name` attribute. Your task is to implement a function `select_stage(pipeline_stages, stage_name)` that takes a list of pipeline stages and a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_stage([{'data': {'name': 'foo'}}, {'data': {'name': 'bar'}}, {'data': {'name': 'baz'}}], 'bar')['data']['name'] == 'bar'\", \"assert select_stage([{'data': {'name': 'foo'}}, {'data': {'name': 'bar'}}, {'data': {'name': 'baz'}}], 'foo')['data']['name']... | {
"split": "train",
"index": 72849,
"acecode_id": "oss_12047",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to write a function that converts a given temperature from Celsius to Fahrenheit and vice versa. The function should take two parameters: the temperature value and a string indicating the current unit of the temperature ('C' for Celsius and 'F' for Fahrenheit). The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_temperature(25, 'C') == 'Temperature: 77.0 \\u00b0F'\", \"assert convert_temperature(0, 'C') == 'Temperature: 32.0 \\u00b0F'\", \"assert convert_temperature(-40, 'C') == 'Temperature: -40.0 \\u00b0F'\", \"assert convert_temperature(100, 'C') == 'Temp... | {
"split": "train",
"index": 72850,
"acecode_id": "oss_37547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a JSON object. Your task is to validate this JSON string to ensure it is properly formatted and contains a specific key. The JSON object must have a key named 'metadata' which itself must contain a key 'chef'. If the JSON string is invalid or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_dumpling('{\\\"metadata\\\": {\\\"chef\\\": \\\"John\\\"}}') == {'metadata': {'chef': 'John'}}\", \"assert validate_dumpling('{\\\"metadata\\\": {\\\"chef\\\": \\\"Alice\\\"}}') == {'metadata': {'chef': 'Alice'}}\", \"assert validate_dumpling('{\\\"... | {
"split": "train",
"index": 72851,
"acecode_id": "bigcode_python_fns_45657",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fib(n)` that computes the nth Fibonacci number. The Fibonacci sequence is defined as follows: fib(0) = 0, fib(1) = 1, and for n >= 2, fib(n) = fib(n-1) + fib(n-2). Your implementation should use dynamic programming or memoization to optimize the time compl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(0) == 0\", \"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(6) == 8\", \"assert fib(7) == 13\", \"assert fib(8) == 21\", \"assert fib(9) == 34\", \"assert fib(10) == 55\"... | {
"split": "train",
"index": 72852,
"acecode_id": "evol_34429",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains three floating-point numbers representing the temperature, pressure, and density of a star at various distances from the center of a star cluster. Your task is to implement a function `write_star_properties(data)` that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_star_properties([(1.0, 2.0, 3.0)]) == '1.0 1.0 2.0 3.0 '\", \"assert write_star_properties([(4.5, 5.5, 6.5), (7.5, 8.5, 9.5)]) == '4.5 4.5 5.5 6.5 7.5 8.5 9.5 '\", \"assert write_star_properties([(0.0, 0.0, 0.0)]) == '0.0 0.0 0.0 0.0 '\", \"assert writ... | {
"split": "train",
"index": 72853,
"acecode_id": "bigcode_python_fns_1695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary containing information about resources and converts them to a specific RDF format. The function should extract resource URLs from the dictionary under the 'resources' key and convert them to RDF format. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_rdf({'resources': [{'url': 'http://example.com/1'}, {'url': 'http://example.com/2'}]}) == ['<rdf:RDF><rdf:Description rdf:about=\\\"http://example.com/1\\\"><rdf:type rdf:resource=\\\"http://xmlns.com/foaf/0.1/Document\\\"/></rdf:Description></rdf... | {
"split": "train",
"index": 72854,
"acecode_id": "oss_12817",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of integers and returns the sum of all even numbers in the list. If the input list is empty, the function should return 0. Your function should be implemented as `sum_of_evens(numbers: List[int]) -> int`. The func... | 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, -2, -3, -4]) == -6\", \"assert sum_of_evens([-2, -2, -2]) == -6\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"a... | {
"split": "train",
"index": 72855,
"acecode_id": "oss_1562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing test data where the keys are strings and the values are integers. Your task is to implement a function that takes this dictionary as input and returns a new dictionary with the same keys, but the values should be squared. Write a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_values({'a': 1, 'b': 2, 'c': 3}) == {'a': 1, 'b': 4, 'c': 9}\", \"assert square_values({'x': 0, 'y': 5}) == {'x': 0, 'y': 25}\", \"assert square_values({'key1': 10}) == {'key1': 100}\", \"assert square_values({'keyA': -3, 'keyB': -4}) == {'keyA': 9, '... | {
"split": "train",
"index": 72856,
"acecode_id": "oss_37695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a file path. Your task is to implement a function that extracts the file name (including the extension) from the given file path. The file path may contain directories separated by slashes '/' and may or may not end with a trailing slash. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_file_name('/home/user/documents/file.txt') == 'file.txt'\", \"assert extract_file_name('/home/user/documents/') == ''\", \"assert extract_file_name('file.txt') == 'file.txt'\", \"assert extract_file_name('/file.txt') == 'file.txt'\", \"assert extract... | {
"split": "train",
"index": 72857,
"acecode_id": "bigcode_python_fns_9368",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a dataset with three specific columns: 'numeric_feature', 'categorical_feature', and 'text_feature'. Your function should fill missing values in the following way: for 'numeric_feature', replace missing values with the mean... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fill_missing_values([1, 2, None], ['cat', 'dog', None], ['hello', None, 'world']) == ([1, 2, 1.5], ['cat', 'dog', 'cat'], ['hello', 'missing', 'world'])\", \"assert fill_missing_values([None, None, None], ['apple', 'banana', 'banana'], [None, None, 'text']) ... | {
"split": "train",
"index": 72858,
"acecode_id": "oss_1010",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two integers n and m. You need to implement a function called `flip_buttons(n, m)` that simulates flipping a series of n lights (initially all off) m times using a set of predefined functions. Each function toggles the state of the lights based on specific criteri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flip_buttons(1, 1) == [1]\", \"assert flip_buttons(1, 2) == [1]\", \"assert flip_buttons(3, 2) == [1, 0, 1]\", \"assert flip_buttons(4, 2) == [1, 0, 1, 0]\", \"assert flip_buttons(6, 2) == [1, 0, 1, 0, 1, 0]\"]}"
} | {
"split": "train",
"index": 72859,
"acecode_id": "evol_2322",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string representation of a model definition and checks whether the definition is valid. The model definition consists of a line containing the class name followed by a series of parameters. You need to implement a function `i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_model_definition('Second 12 23 34 56') == True\", \"assert is_valid_model_definition('ClassA 10 20 30 \\\"text\\\"') == True\", \"assert is_valid_model_definition('ClassB 5 15 25 35') == True\", \"assert is_valid_model_definition('InvalidClass') == ... | {
"split": "train",
"index": 72860,
"acecode_id": "bigcode_python_fns_26358",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `a` and `b`, which represent the values of two different types of actions. Your task is to write a function `calculate_total_value(a: List[int], b: List[int]) -> int` that returns the sum of all values in list `a`, multiplied by the number o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_value([], []) == 0\", \"assert calculate_total_value([1, 2, 3], []) == 0\", \"assert calculate_total_value([], [4, 5]) == 0\", \"assert calculate_total_value([10], [1, 2, 3]) == 30\", \"assert calculate_total_value([0, 0], [1, 2]) == 0\", \"a... | {
"split": "train",
"index": 72861,
"acecode_id": "bigcode_python_fns_12150",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a random authentication challenge nickname for a user in a system. The nickname must be a string of 20 characters, composed of uppercase letters, lowercase letters, and digits. Your function should take no parameters an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_authentication_nickname() != generate_authentication_nickname()\", \"assert len(generate_authentication_nickname()) == 20\", \"assert generate_authentication_nickname().isalnum()\", \"assert all(c.isalnum() for c in generate_authentication_nickname(... | {
"split": "train",
"index": 72862,
"acecode_id": "bigcode_python_fns_35012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that extracts every third character starting from the third character (index 2). If the extracted character is an alphabet letter, replace it with its corresponding numerical value (1 for 'a' or 'A', 2 for 'b' or 'B', ..., 26 for 'z' or 'Z')... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manipulate_string('abcdefg') == [3, 6]\", \"assert manipulate_string('aBcDeF') == [3, 6]\", \"assert manipulate_string('1234567890') == []\", \"assert manipulate_string('') == []\", \"assert manipulate_string('a') == []\", \"assert manipulate_string('ab') ==... | {
"split": "train",
"index": 72863,
"acecode_id": "evol_12214",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists where each inner list contains mathematical expressions in string format, implement a function that evaluates each expression and returns a flat list of results, maintaining the order of evaluation. Each expression must handle operator precedence and paren... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve([ ['1+1', '2*2'], ['3-1', '4/2'] ]) == [2, 4, 2, 2.0]\", \"assert solve([ ['10-5*2', '3+(4*2)'], ['7*2-3'] ]) == [0, 11, 11]\", \"assert solve([ ['(1+2)*3', '4/2'], ['5-3+2'] ]) == [9, 2.0, 4]\", \"assert solve([ ['2+2', '2*2*2'], ['5+5'] ]) == [4, 8, ... | {
"split": "train",
"index": 72864,
"acecode_id": "evol_18901",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats an alert message based on the severity level, an optional process name, and the alert message text. The function should concatenate these elements into a single formatted string. If a process name is provided, it should be in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_alert('ERROR', 'Disk space is low') == '[ERROR] Disk space is low\\\\n'\", \"assert format_alert('WARNING', 'CPU usage is high', 'Monitor') == '[WARNING] [Monitor] CPU usage is high\\\\n'\", \"assert format_alert('INFO', 'Service started successfully'... | {
"split": "train",
"index": 72865,
"acecode_id": "bigcode_python_fns_19796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of real numbers with at least two elements, write a function that identifies and returns the two elements that show the maximum numerical distance between them. The returned pair should be in ascending order, with the smaller number first, regardless of their origi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_furthest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (1.0, 5.0)\", \"assert find_furthest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (1.0, 5.0)\", \"assert find_furthest_elements([-1.0, -2.0, -3.0, -4.0, -5.0]) == (-5.0, -1.0)\", \"assert find_furthest... | {
"split": "train",
"index": 72866,
"acecode_id": "evol_35936",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of controller objects, each capable of being updated. Your task is to implement a function `setup_entities(controllers: List[Controller]) -> List[Entity]` that takes a list of controller objects. For each controller, if it can be successfully updated (simul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_entities([Controller(), Controller()]).__len__() == 2\", \"assert setup_entities([]) == []\", \"assert isinstance(setup_entities([Controller()])[0], Entity) == True\", \"assert setup_entities([Controller()]).__len__() == 1\", \"assert setup_entities([C... | {
"split": "train",
"index": 72867,
"acecode_id": "bigcode_python_fns_38465",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a set of columns. Your task is to determine the maximum area of a rectangle that can be formed within the confines of these columns. The width of the rectangle is determined by the distance between the columns, and th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_rectangle_area([2, 4]) == 4\", \"assert max_rectangle_area([1, 1, 1, 1, 1]) == 5\", \"assert max_rectangle_area([0]) == 0\", \"assert max_rectangle_area([5, 4, 1, 2]) == 8\", \"assert max_rectangle... | {
"split": "train",
"index": 72868,
"acecode_id": "bigcode_python_fns_27052",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that analyzes a dancer's competition ranking based on their current ranking and favorite dance genre. The function should take three parameters: the dancer's name (a string), their favorite dance genre (a string), and their current ra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_ranking('Alice', 'Ballet', 1) == 'Alice is currently at the top of their competition in Ballet dancing.'\", \"assert analyze_ranking('Bob', 'Hip Hop', 5) == 'Bob is doing quite well, currently ranked at position 5 in Hip Hop dancing.'\", \"assert ana... | {
"split": "train",
"index": 72869,
"acecode_id": "evol_27187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `create_sandbox_queries` that generates a list of SQL-like query strings for sandbox creation and data cleaning based on the given integers. The function should take the following parameters: `project_id` (a string representing the pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_sandbox_queries('project1', 'ticket123', 'deactivated_project', 'dataset1', 'pids_table', [1, 2, 3]) == [{'query': 'CREATE SANDBOX project1.ticket123_pids_table FOR PID 1', 'destination': 'project1.ticket123_pids_table', 'destination_dataset': 'datase... | {
"split": "train",
"index": 72870,
"acecode_id": "bigcode_python_fns_7933",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two integers n1 and n2, write a function `count_primes(n1, n2)` that returns the count of prime numbers in the inclusive range from n1 to n2. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_primes(0, 10) == 4\", \"assert count_primes(10, 20) == 4\", \"assert count_primes(1, 1) == 0\", \"assert count_primes(10, 10) == 0\", \"assert count_primes(11, 11) == 1\", \"assert count_primes(-5, 5) == 3\", \"assert count_primes(1, 100) == 25\", \"as... | {
"split": "train",
"index": 72871,
"acecode_id": "evol_8488",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of deposit and withdrawal operations on an account starting with a balance of zero. The operations can be integers, strings representing integers, or tuples that contain both an integer and a string. The integer represents the amount to deposit or withdraw,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([(2, '5'), 3]) == False\", \"assert below_zero([1, 2, '-4', 5, (3, '-2')]) == True\", \"assert below_zero([1, '2', -3], True) == True\", \"assert below_zero([5, -10, 5]) == True\", \"assert below_zero([(3, '2'), -7]) == True\", \"assert below_zero... | {
"split": "train",
"index": 72872,
"acecode_id": "evol_12684",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_length_prime(arr: List[int]) -> bool` that takes an array of integers as input and returns `True` if the length of the array is a prime number, and `False` otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give your final ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_length_prime([]) == False\", \"assert is_length_prime([1, 2, 3]) == True\", \"assert is_length_prime([1, 2, 3, 4]) == False\", \"assert is_length_prime([1, 2, 3, 4, 5]) == True\", \"assert is_length_prime([1, 2, 3, 4, 5, 6]) == False\", \"assert is_length... | {
"split": "train",
"index": 72873,
"acecode_id": "evol_12894",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple guessing game. The function should take an integer input representing the user's guess and an integer representing the target number (both between 1 and 10, inclusive). If the user's guess matches the target number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert guessing_game(5, 5) == 'correct!'\", \"assert guessing_game(3, 5) == 'look again!'\", \"assert guessing_game(5, 3) == 'look again!'\", \"assert guessing_game(1, 1) == 'correct!'\", \"assert guessing_game(2, 2) == 'correct!'\", \"assert guessing_game(4, 2) ==... | {
"split": "train",
"index": 72874,
"acecode_id": "oss_18345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `retrieve_greater_than` that takes a list of dictionaries and an integer value. Each dictionary represents an entry with various attributes, and the function should return a list of dictionaries where the specified attribute's value is greater than the prov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_greater_than([{'age': 25}, {'age': 18}, {'age': 30}], 'age', 20) == [{'age': 25}, {'age': 30}]\", \"assert retrieve_greater_than([{'age': 15}, {'age': 22}, {'age': 17}], 'age', 20) == [{'age': 22}]\", \"assert retrieve_greater_than([{'age': 20}, {'a... | {
"split": "train",
"index": 72875,
"acecode_id": "evol_11508",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given list of numbers is monotonically increasing or decreasing. The function should take two parameters: a list of numbers and a boolean flag `strict`. If `strict` is set to True, the function should return True only if the list is strictl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monotonic([1, 2, 3, 4]) == True\", \"assert monotonic([4, 3, 2, 1]) == True\", \"assert monotonic([1, 1, 2, 3], strict=False) == True\", \"assert monotonic([1, 2, 2, 3], strict=False) == True\", \"assert monotonic([1, 2, 2, 1], strict=False) == False\", \"as... | {
"split": "train",
"index": 72876,
"acecode_id": "evol_8275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of SNP-gene-tissue associations where each association is represented as a tuple containing a SNP identifier, a gene identifier, and a tissue site detail identifier. Your task is to implement a function that processes these associations in batches of a maxi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert batch_snp_gene_tissue([('rs123', 'ENSG000001', 'Tissue_A'), ('rs456', 'ENSG000002', 'Tissue_B')]) == [{'variantId': 'rs123', 'gencodeId': 'ENSG000001', 'tissueSiteDetailId': 'Tissue_A'}, {'variantId': 'rs456', 'gencodeId': 'ENSG000002', 'tissueSiteDetailId':... | {
"split": "train",
"index": 72877,
"acecode_id": "bigcode_python_fns_49613",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a color picker. The function should take a list of RGB color tuples and an integer index as input. It should return the RGB color at the given index from the list. If the index is out of bounds for the list, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pick_color([(1, 0, 0), (0, 1, 0), (0, 0, 1)], 0) == (1, 0, 0)\", \"assert pick_color([(1, 0, 0), (0, 1, 0), (0, 0, 1)], 1) == (0, 1, 0)\", \"assert pick_color([(1, 0, 0), (0, 1, 0), (0, 0, 1)], 2) == (0, 0, 1)\", \"assert pick_color([(1, 0, 0), (0, 1, 0), (0... | {
"split": "train",
"index": 72878,
"acecode_id": "oss_24076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `contents` that contains commands and an optional string `args`, create a function that processes the commands inside the string. If `args` is not an empty string, return a warning message indicating that the function does not accept any arguments. Regardless of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands('', 'command1; command2;') == ''\", \"assert process_commands('arg1', 'command1; command2;') == 'extra-arguments: the void block takes no arguments'\", \"assert process_commands(' ', 'command1; command2;') == 'extra-arguments: the void block... | {
"split": "train",
"index": 72879,
"acecode_id": "bigcode_python_fns_44233",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_first_occurrence(arr: List[int], target: int) -> int` that takes in a list of integers `arr` and a specific integer `target`. The function should return the index of the first occurrence of `target` in `arr`. If `target` is not present in the list, re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_first_occurrence([-2, 3, 0, 1, 5, 2, -3, 0], 0) == 2\", \"assert find_first_occurrence([-2, 3, 0, 1, 5, 2, -3, 0], -3) == 6\", \"assert find_first_occurrence([-2, 3, 0, 1, 5, 2, -3, 0], 5) == 4\", \"assert find_first_occurrence([-2, 3, 0, 1, 5, 2, -3, 0... | {
"split": "train",
"index": 72880,
"acecode_id": "evol_6759",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates user input for a specific Discord guild ID. A Discord guild ID is a unique identifier for a server or guild within the Discord platform. The function should take a string as input and determine whether it is a valid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_guild_id('878926572235665418') == True\", \"assert validate_guild_id('123456789012345678') == False\", \"assert validate_guild_id('888888888888888888') == True\", \"assert validate_guild_id('12345678901234567') == False\", \"assert validate_guild_id... | {
"split": "train",
"index": 72881,
"acecode_id": "oss_9855",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of domain names and a list of keywords. Your function should return a list of domains that contain any of the specified keywords. A domain is considered valid if it does not contain any special characters except for hyph... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_domains(['example.com', 'test-site.com', 'mydomain.org'], ['example', 'test']) == ['example.com', 'test-site.com']\", \"assert filter_domains(['example1.com', 'test-site.com'], ['xyz']) == []\", \"assert filter_domains(['example.com', 'example.org', '... | {
"split": "train",
"index": 72882,
"acecode_id": "bigcode_python_fns_12071",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the total resistance of a parallel circuit using the equivalent resistance formula. The function should take a list of resistance values as input and return the total resistance of the parallel circuit. The equivale... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_resistance([1, 1]) == 0.5\", \"assert calculate_total_resistance([10]) == 10.0\", \"assert calculate_total_resistance([2, 2, 2, 2]) == 0.5\", \"assert calculate_total_resistance([15, 15, 15, 15]) == 3.75\", \"assert calculate_total_resistance... | {
"split": "train",
"index": 72883,
"acecode_id": "oss_1424",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a data flow in a workflow management system. Implement a function `validate_flow` that takes a loaded flow object as input and performs the following validation checks: 1. Check if the flow contains at least one task. 2. Check if the flow is confi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_flow(Flow(tasks=[1], configuration='custom-driver')) == True\", \"assert validate_flow(Flow(tasks=[], configuration='custom-driver')) == False\", \"assert validate_flow(Flow(tasks=[1, 2], configuration='default-driver')) == False\", \"assert validat... | {
"split": "train",
"index": 72884,
"acecode_id": "oss_34047",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of equal length representing true values and predicted values. Each list contains float values. Your task is to implement a function that calculates the Smooth L1 loss between the two lists. The Smooth L1 loss is defined as follows: if the absolute diffe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smooth_l1_loss([1.0, 2.0, 3.0], [1.0, 2.0, 3.0]) == 0.0\", \"assert smooth_l1_loss([1.0], [2.0]) == 0.5\", \"assert smooth_l1_loss([2.0], [3.0]) == 0.5\", \"assert smooth_l1_loss([3.0], [5.0]) == 1.5\", \"assert smooth_l1_loss([1.0, 2.0, 3.0], [2.0, 3.0, 4.0... | {
"split": "train",
"index": 72885,
"acecode_id": "bigcode_python_fns_32166",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, implement a function that returns the nth Fibonacci number efficiently. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your implementation should handle large values of n (up to 1e18) witho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Fibonacci(0) == 0\", \"assert Fibonacci(1) == 1\", \"assert Fibonacci(2) == 1\", \"assert Fibonacci(3) == 2\", \"assert Fibonacci(4) == 3\", \"assert Fibonacci(5) == 5\", \"assert Fibonacci(6) == 8\", \"assert Fibonacci(7) == 13\", \"assert Fibonacci(8) == 2... | {
"split": "train",
"index": 72886,
"acecode_id": "evol_33022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a user request based on a session dictionary containing user details and a token status. The function should check if the token is valid and if an 'envelope_id' is present in the session. If both conditions are satisfied, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_user_request({'ds_account_id': '12345', 'envelope_id': 'abcde'}, True) == 'Success: Account ID: 12345, Envelope ID: abcde'\", \"assert process_user_request({'ds_account_id': '12345'}, False) == 'Error: Sorry, you need to re-authenticate.'\", \"assert... | {
"split": "train",
"index": 72887,
"acecode_id": "bigcode_python_fns_4147",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the separation distance between two aircraft based on their geographical coordinates and flight levels. Implement a function `calculate_separation_distance(latitude1: float, longitude1: float, flight_level1: int, latitude2: float, longitude2: flo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_separation_distance(48.8566, 2.3522, 10000, 48.8566, 2.3522, 10000) == pytest.approx(0.0, 0.01)\", \"assert calculate_separation_distance(35.6895, 139.6917, 35000, 35.6895, 139.6917, 34000) == pytest.approx(304.8, 0.01)\", \"assert calculate_separa... | {
"split": "train",
"index": 72888,
"acecode_id": "bigcode_python_fns_17495",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `bubble_sort(arr)` that takes a list of integers `arr` and sorts it in ascending order using the bubble sort algorithm. The function should return the sorted list. For example, given an input list [3, 1, 5, 4, 2], the output should be [1, 2, 3, 4, 5].\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([3, 1, 5, 4, 2]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([2]) == [2]\", \"assert bubble_s... | {
"split": "train",
"index": 72889,
"acecode_id": "evol_27913",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string title, implement a function that formats the title based on the following rules: If the length of the title exceeds 40 characters, truncate the title to the first 40 characters and append '...'. If the title is 40 characters or less, return it as is. You may igno... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert formatTitle('This is a short title') == 'This is a short title'\", \"assert formatTitle('A title with exactly forty chars, wow!!') == 'A title with exactly forty chars, wow!!'\", \"assert formatTitle('<h1>Title with HTML tags</h1>') == '<h1>Title with HTML t... | {
"split": "train",
"index": 72890,
"acecode_id": "bigcode_python_fns_4052",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `process_file` that simulates a file processing operation based on certain conditions. The function takes in three parameters: `source`, a string representing the source file path, `target`, a string representing the target file path,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_file('source.txt', 'target.txt', True) == None\", \"assert process_file('source.txt', 'target.html', False) == None\", \"assert process_file('source.txt', 'target.txt', False) == 'File processed successfully'\", \"assert process_file('file1.txt', 'fi... | {
"split": "train",
"index": 72891,
"acecode_id": "oss_30252",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a galaxy name, a data directory, and a boolean indicating whether the data is thermal or non-thermal, write a function `get_spectral_index_path(name: str, data_directory: str, thermal: bool) -> str` that returns the path to the spectral index file. The path should be form... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_spectral_index_path('Andromeda', '/data', True) == '/data/magnetic/Andromeda/Andromeda_spix_non_thermal.fits'\", \"assert get_spectral_index_path('Andromeda', '/data', False) == '/data/magnetic/Andromeda/Andromeda_spix.fits'\", \"assert get_spectral_inde... | {
"split": "train",
"index": 72892,
"acecode_id": "bigcode_python_fns_25192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add_cors_header(response: dict) -> dict` that takes a dictionary representing an HTTP response and adds a CORS (Cross-Origin Resource Sharing) header to it. The function should add the header 'Access-Control-Allow-Origin' with the value '*' to the provided... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_cors_header({'status': 200, 'headers': {'Content-Type': 'application/json'}}) == {'status': 200, 'headers': {'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*'}}\", \"assert add_cors_header({'status': 404, 'headers': {'Content-Type': ... | {
"split": "train",
"index": 72893,
"acecode_id": "bigcode_python_fns_12870",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a versioning system for a software project. The version number is represented as a string in the format 'x.y', where both 'x' and 'y' are non-negative integers. Write a function `get_version_number(version_string: str) -> str` that takes a versi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_version_number('1.0') == '1.0'\", \"assert get_version_number('0.1') == '0.1'\", \"assert get_version_number('2.5') == '2.5'\", \"assert get_version_number('10.0') == '10.0'\", \"assert get_version_number('0.0') == '0.0'\", \"assert get_version_number('1... | {
"split": "train",
"index": 72894,
"acecode_id": "oss_28337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_string(sentence: str, string: str) -> int` that searches for a given string in a sentence and returns the position of the first occurrence of the string. If the string is not found, return -1.\nPlease reason step by step, then write a self-contained Pytho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_string('This is a sample sentence', 'sample') == 10\", \"assert find_string('Hello world', 'world') == 6\", \"assert find_string('Python programming', 'Java') == -1\", \"assert find_string('A quick brown fox', 'quick') == 2\", \"assert find_string('Find... | {
"split": "train",
"index": 72895,
"acecode_id": "evol_21075",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a camera system. The function should accept two parameters: 'duration' (an integer representing the number of seconds the camera should be active) and 'interval' (an integer representing the number of seconds between each t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_camera_tasks(6, 2) == ['Performing tasks...', 'Performing tasks...', 'Performing tasks...']\", \"assert simulate_camera_tasks(5, 1) == ['Performing tasks...', 'Performing tasks...', 'Performing tasks...', 'Performing tasks...', 'Performing tasks...'... | {
"split": "train",
"index": 72896,
"acecode_id": "oss_31827",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, each representing a machine learning pipeline, write a function that counts how many pipelines contain the term 'random_forest' and how many contain the term 'xgb'. The function should return a dictionary with the counts for 'RF', 'XGB', and the total n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_ml_pipelines(['random_forest_model', 'xgb_classifier', 'linear_regression']) == {'RF': 1, 'XGB': 1, 'total': 3}\", \"assert count_ml_pipelines(['random_forest', 'xgb', 'pipeline1', 'pipeline2']) == {'RF': 1, 'XGB': 1, 'total': 4}\", \"assert count_ml_p... | {
"split": "train",
"index": 72897,
"acecode_id": "bigcode_python_fns_22051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a feed and generates a summary of its entries. Your function should take in a feed object `awesomefeed` and return a dictionary containing the feed's title, a list of entry titles, a list of entry links, and the numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_feed_summary({'feed': {'title': 'My Awesome Feed', 'entries': [{'title': 'Entry 1', 'link': 'http://link1.com'}, {'title': 'Entry 2', 'link': 'http://link2.com'}]}}) == {'title': 'My Awesome Feed', 'entry_titles': ['Entry 1', 'Entry 2'], 'entry_link... | {
"split": "train",
"index": 72898,
"acecode_id": "oss_27703",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the sizes of different items and a positive integer 's' representing the maximum weight that can be carried. Your task is to determine the maximum number of items that can be carried without exceeding the weight limit 's'. Write a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_items(10, [5, 3, 7, 2, 8]) == 3\", \"assert max_items(5, [1, 2, 3, 4]) == 2\", \"assert max_items(15, [10, 5, 3, 7]) == 3\", \"assert max_items(0, [1, 2, 3]) == 0\", \"assert max_items(10, [10, 10, 10]) == 1\", \"assert max_items(5, [6, 7, 8]) == 0\", \"... | {
"split": "train",
"index": 72899,
"acecode_id": "oss_29390",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.