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": "Given a list of integers `nums` and an integer `target`, write a function `nums_sum_target(nums, target)` that returns the indices of the two numbers such that they add up to the `target`. You may assume that each input would have exactly one solution, and you may not use the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nums_sum_target([2, 5, 5, 11], 10) == [1, 2]\", \"assert nums_sum_target([1, 2, 3, 4], 5) == [1, 2]\", \"assert nums_sum_target([3, 2, 4], 6) == [1, 2]\", \"assert nums_sum_target([3, 3], 6) == [0, 1]\", \"assert nums_sum_target([5, 6, 7, 8], 13) == [1, 2]\"...
{ "split": "train", "index": 63800, "acecode_id": "evol_34766", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Develop a function that takes an array consisting solely of string elements and identifies the longest sequential, alphabetic substring that is present in every single element of the array. If no such substring exists, return an empty string.\nPlease reason step by step, then w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_substring(['a', 'b', 'c']) == ''\", \"assert find_substring(['abcde', 'fghij', 'klmno']) == ''\", \"assert find_substring(['longest', 'string', 'substring']) == ''\", \"assert find_substring(['', '', '']) == ''\", \"assert find_substring(['abcdefg', 'hi...
{ "split": "train", "index": 63801, "acecode_id": "evol_5479", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `initialize_model` that takes the following parameters: `backbone`, `neck_cls`, `neck_mim`, `head_cls`, `head_mim`, `weight_mim`, `weight_cls`, `init_cfg`, and `kwargs`. The function should initialize a model configuration and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_model('ResNet', {'type': 'cls_neck'}, {'type': 'mim_neck'}, {'type': 'cls_head'}, {'type': 'mim_head'}, 0.5, 1.0, {'learning_rate': 0.001}, {}).keys() == {'backbone', 'neck_cls', 'neck_mim', 'head_cls', 'head_mim', 'weight_mim', 'weight_cls', 'ini...
{ "split": "train", "index": 63802, "acecode_id": "oss_882", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that interprets the workload metadata configuration for a node in a cluster. The function should take a string input representing the metadata configuration and return a description of what that configuration entails. The valid configurat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert interpret_metadata_config('SECURE') == 'Prevents workloads not in hostNetwork from accessing certain VM metadata, specifically kube-env, which contains Kubelet credentials, and the instance identity token. This is a temporary security solution available whil...
{ "split": "train", "index": 63803, "acecode_id": "bigcode_python_fns_33867", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a series of conversions, where each integer corresponds to a unique conversion. Your task is to implement a function `move_down(conversions: List[int], index: int) -> List[int]` that takes in a list of integers and an index. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_down([1, 2, 3, 4], 1) == [1, 3, 2, 4]\", \"assert move_down([5, 10], 0) == [10, 5]\", \"assert move_down([1, 2, 3], 2) == [1, 2, 3]\", \"assert move_down([7, 8, 9, 10], 3) == [7, 8, 9, 10]\", \"assert move_down([4, 5, 6], 1) == [4, 6, 5]\", \"assert mov...
{ "split": "train", "index": 63804, "acecode_id": "oss_180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that finds the smallest and largest numbers in the array without using in-built functions. The array may contain negative numbers and duplicates. The function should return a tuple containing the smallest and largest numbers.\nPlease...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_smallest_largest([2, 5, 1, 7, 3, 9, 3]) == (1, 9)\", \"assert find_smallest_largest([-2, -5, -1, -7, -3, -9, -3]) == (-9, -1)\", \"assert find_smallest_largest([0, 0, 0, 0]) == (0, 0)\", \"assert find_smallest_largest([10, 20, 30, 40, 50]) == (10, 50)\"...
{ "split": "train", "index": 63805, "acecode_id": "evol_30683", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that counts the number of lowercase characters in a given string and calculates the percentage representation of lowercase letters in the entire string, including spaces and special characters. The function should take a single string as input and return a tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_and_percentage('Hello World!') == (8, 66.66666666666666)\", \"assert count_and_percentage('UPPERCASE ONLY') == (0, 0.0)\", \"assert count_and_percentage('!@#$%^&*()') == (0, 0.0)\", \"assert count_and_percentage('A B C D E') == (0, 0.0)\", \"assert cou...
{ "split": "train", "index": 63806, "acecode_id": "evol_32129", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a firewall rule management system. The system should allow users to either drop all existing rules or add a new rule to permit specific traffic. The rules are represented as a list of tuples, where each tuple contains the source and destination ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_firewall_rules([], True, False) == []\", \"assert manage_firewall_rules([('192.168.1.1', '10.0.0.1', 'permit')], True, False) == []\", \"assert manage_firewall_rules([('192.168.1.1', '10.0.0.1', 'permit')], False, True) == [('192.168.1.1', '10.0.0.1',...
{ "split": "train", "index": 63807, "acecode_id": "oss_27171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a custom CSS string that defines style rules for a web application's navigation bar and tooltips. Your function should return a single string that concatenates the following styles: 1. A navbar with an ID of 'navbar-top' that has a white backgroun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_styles() == '#navbar-top{background-color: white; z-index: 100;}a.tip{text-decoration:none; font-weight:bold; cursor:pointer; color:#2196F3;}a.tip:hover{position: relative;border-bottom: 1px dashed #2196F3;}a.tip span{display: none;background-color:...
{ "split": "train", "index": 63808, "acecode_id": "bigcode_python_fns_24415", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string consisting of digits (0-9). Your task is to transform each digit into its 'jump the 5' equivalent based on the following mapping: {'1': '9', '2': '8', '3': '7', '4': '6', '5': '0', '6': '4', '7': '3', '8': '2', '9': '1', '0': '5'}. Implement a function `c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_jump_five('67890') == '43215'\", \"assert convert_jump_five('0') == '5'\", \"assert convert_jump_five('5') == '0'\", \"assert convert_jump_five('1a2b3c') == '9a8b7c'\", \"assert convert_jump_five('!@#$%^') == '!@#$%^'\", \"assert convert_jump_five(''...
{ "split": "train", "index": 63809, "acecode_id": "bigcode_python_fns_40356", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `sentence`, write a function `count_distinct_words` that returns the number of distinct words in the sentence. A word is defined as a sequence of characters separated by spaces. The comparison should be case insensitive, meaning 'Word' and 'word' should be consid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_distinct_words('This sentence contains five words.') == 5\", \"assert count_distinct_words('Hello, world! Hello') == 2\", \"assert count_distinct_words('Python is great, and python is fun.') == 5\", \"assert count_distinct_words('Hello') == 1\", \"asse...
{ "split": "train", "index": 63810, "acecode_id": "evol_18808", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer n. Your task is to implement a function that returns a list containing integers from 0 to n-1, inclusive. The function should handle edge cases, such as when n is 0 or negative, by returning an empty list. Implement the function `get_list(n)` that takes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_list(5) == [0, 1, 2, 3, 4]\", \"assert get_list(0) == []\", \"assert get_list(-3) == []\", \"assert get_list(1) == [0]\", \"assert get_list(10) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert get_list(15) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1...
{ "split": "train", "index": 63811, "acecode_id": "oss_18957", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with filtering a list of clothing and footwear items based on their subcategories. Write a function called `filter_items_by_subcategory` that takes a list of dictionaries representing items, where each dictionary contains the following keys: 'masterCategory', 'su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_items_by_subcategory([{'masterCategory': 'Apparel', 'subCategory': 'Dress', 'baseColour': 'Red'}, {'masterCategory': 'Footwear', 'subCategory': 'Shoes', 'baseColour': 'Blue'}, {'masterCategory': 'Apparel', 'subCategory': 'Innerwear', 'baseColour': 'Ye...
{ "split": "train", "index": 63812, "acecode_id": "bigcode_python_fns_6489", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `prime_pairs_count(lst)` that takes in a list of integers and returns the count of possible unordered pairs with non-identical elements where the difference of each pair forms a prime number. If the list is empty or contains only one element, return 0. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_pairs_count([]) == 0\", \"assert prime_pairs_count([1]) == 0\", \"assert prime_pairs_count([1, 3]) == 1\", \"assert prime_pairs_count([-1, 1]) == 1\", \"assert prime_pairs_count([-4, -2, 0, 2, 4]) == 4\", \"assert prime_pairs_count([0, 0, 0]) == 0\", \...
{ "split": "train", "index": 63813, "acecode_id": "evol_8215", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with formatting a tuple of arguments for display. Implement a function `format_args(args: Tuple[Any]) -> str` that takes a tuple of arguments and returns a string representation of the tuple. However, if the tuple contains only one element, the output should omit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_args(('hello',)) == \\\"('hello')\\\"\", \"assert format_args((1,)) == \\\"(1)\\\"\", \"assert format_args((42,)) == \\\"(42)\\\"\", \"assert format_args((True,)) == \\\"(True)\\\"\", \"assert format_args((None,)) == \\\"(None)\\\"\", \"assert format_...
{ "split": "train", "index": 63814, "acecode_id": "bigcode_python_fns_43278", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a function `iteratee` and multiple lists of integers, your task is to apply the `iteratee` function to each integer from all the lists and then flatten the results into a single list. The `iteratee` function takes an integer as input and returns a list of integers. You ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_flat_deep(lambda n: [n, n], [1, 2]) == [1, 1, 2, 2]\", \"assert map_flat_deep(lambda n: [n * 2], [1, 2, 3]) == [2, 4, 6]\", \"assert map_flat_deep(lambda n: [n + 1, n + 1], [1, 2]) == [2, 2, 3, 3]\", \"assert map_flat_deep(lambda n: [n**2], [1, 2]) == [1...
{ "split": "train", "index": 63815, "acecode_id": "bigcode_python_fns_2355", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple packing algorithm for a rectangular canvas represented as a 2D grid of cells. Each cell in the grid can either be empty (represented by 0) or occupied (represented by 1). Your task is to implement a function `p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pack_canvas([[1, 1], [1, 1]], [(0, 0, 1, 1)]) == [[1, 1], [1, 1]]\", \"assert pack_canvas([[0, 0], [0, 0]], [(0, 0, 2, 2)]) == [[1, 1], [1, 1]]\", \"assert pack_canvas([[0, 0], [0, 0]], [(0, 0, 1, 1), (0, 0, 1, 1)]) == [[1, 0], [0, 0]]\", \"assert pack_canva...
{ "split": "train", "index": 63816, "acecode_id": "oss_32340", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to simulate basic audio player operations. The function should accept a series of commands and return a list of strings indicating the actions performed. The commands should include 'play', 'pause', 'stop', and 'set_volume X', where X...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert audio_player_operations(['play']) == ['Playing audio.']\", \"assert audio_player_operations(['pause']) == ['Audio paused.']\", \"assert audio_player_operations(['stop']) == ['Audio stopped.']\", \"assert audio_player_operations(['set_volume 30']) == ['Volume...
{ "split": "train", "index": 63817, "acecode_id": "oss_544", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of companies along with their employees' information (name, age, and years of service), implement a function `unique_personnel_count` that calculates the distinct personnel count for each company. A unique person is defined as a tuple of (\"Name\", \"Age\", \"Servi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_personnel_count([['Tesla', ['Elon', 50, 10], ['Elon', 30, 5]], ['SpaceX', ['Elon', 50, 10], ['Jeff', 45, 15]]]) == {'Tesla': 2, 'SpaceX': 2}\", \"assert unique_personnel_count([['Apple', ['John', 40, 5], ['James', 45, 10]], ['Apple', ['John', 40, 5], ...
{ "split": "train", "index": 63818, "acecode_id": "evol_8753", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given two parameters, `height` (a float representing the height of a 1D Gaussian) and `sigma` (a float representing the standard deviation of the Gaussian). Your task is to implement a function `height_to_amplitude(height: float, sigma: float) -> float` that calculates ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert height_to_amplitude(1.0, 1.0) == 2.5066282746310002\", \"assert height_to_amplitude(0.0, 1.0) == 0.0\", \"assert height_to_amplitude(2.0, 1.0) == 5.0132565492620005\", \"assert height_to_amplitude(1.0, 0.5) == 1.2533141373155001\", \"assert height_to_amplitu...
{ "split": "train", "index": 63819, "acecode_id": "bigcode_python_fns_38015", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string representing a datetime in the format 'YYYY-MM-DDTHH:MM:SS+TZ'. Your task is to implement a function that takes this string as input and returns a tuple containing the formatted datetime in 'YYYY-MM-DD HH:MM:SS' format and a string indicating whether the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_token_expiration('2023-10-01T12:00:00+0000') == ('2023-10-01 12:00:00', 'Y')\", \"assert get_token_expiration('2023-10-01T12:00:00+0000') == ('2023-10-01 12:00:00', 'Y')\", \"assert get_token_expiration('2025-01-01T12:00:00+0000') == ('2025-01-01 12:00:0...
{ "split": "train", "index": 63820, "acecode_id": "bigcode_python_fns_39430", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two sorted integer arrays, `nums1` and `nums2`, where `nums1` has enough space at the end to hold all elements from `nums2`. The number of elements initialized in `nums1` is `m` and the number of elements initialized in `nums2` is `n`. Write a function `merge` to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge([1, 2, 3, 0, 0, 0], 3, [2, 5, 6], 3) is None\", \"assert merge([1, 3, 5, 0, 0, 0], 3, [2, 4, 6], 3) is None\", \"assert merge([0, 0, 0, 0, 0, 0], 0, [1, 2, 3], 3) is None\", \"assert merge([-1, 0, 2, 0, 0, 0], 3, [1, 3, 4], 3) is None\", \"assert merge...
{ "split": "train", "index": 63821, "acecode_id": "oss_12171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a permutation array, write a function that returns a new list where the elements are rearranged according to the specified permutation. The permutation array contains indices that indicate the new positions of the elements from the original list. It...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_list([10, 20, 30, 40, 50], [4, 3, 2, 1, 0]) == [50, 40, 30, 20, 10]\", \"assert rearrange_list([1], [0]) == [1]\", \"assert rearrange_list([1, 2], [1, 0]) == [2, 1]\", \"assert rearrange_list([9, 8, 7, 6], [3, 2, 1, 0]) == [6, 7, 8, 9]\", \"assert ...
{ "split": "train", "index": 63822, "acecode_id": "bigcode_python_fns_7318", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function called `sort_integers` that takes a list of integers as input and returns a new list that contains the same integers sorted in ascending order.\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 sort_integers([3, 1, 2]) == [1, 2, 3]\", \"assert sort_integers([5, 5, 5]) == [5, 5, 5]\", \"assert sort_integers([-1, -3, 2, 0]) == [-3, -1, 0, 2]\", \"assert sort_integers([]) == []\", \"assert sort_integers([10, 2, 8, 6]) == [2, 6, 8, 10]\", \"assert sort...
{ "split": "train", "index": 63823, "acecode_id": "evol_18246", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function `calculate_properties(a: int, b: int, c: int, d: int, e: int) -> Dict[str, float]` that takes five distinct integer properties as input and returns a dictionary containing the sum, average, and product of these properties. The dictionary should have the keys '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_properties(1, 2, 3, 4, 5) == {'sum': 15, 'average': 3.0, 'product': 120}\", \"assert calculate_properties(-1, -2, -3, -4, -5) == {'sum': -15, 'average': -3.0, 'product': -120}\", \"assert calculate_properties(0, 1, 2, 3, 4) == {'sum': 10, 'average'...
{ "split": "train", "index": 63824, "acecode_id": "evol_24534", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of edges representing a simple undirected graph, where each edge is represented as a tuple of two integers (u, v) indicating an edge between nodes u and v. Your task is to implement a function `random_rewire(edges: List[Tuple[int, int]], n: int, allow_self_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(random_rewire([(1, 2), (2, 3)], 1, False)) == 2\", \"assert (1, 2) in random_rewire([(1, 2), (2, 3)], 1, True)\", \"assert (2, 3) in random_rewire([(1, 2), (2, 3)], 1, True)\", \"assert len(random_rewire([(1, 2), (2, 3), (3, 4)], 2, False)) == 3\", \"ass...
{ "split": "train", "index": 63825, "acecode_id": "bigcode_python_fns_31042", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a document class based on user input. The function should take a string input representing the document class name. If the input string is empty or None, the function should return 'Enter a doc class!'. Otherwise, it sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_document_class(None) == 'Enter a doc class!'\", \"assert process_document_class('') == 'Enter a doc class!'\", \"assert process_document_class('Invoice') == 'Document class set to: Invoice'\", \"assert process_document_class('Report') == 'Document cl...
{ "split": "train", "index": 63826, "acecode_id": "oss_15454", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_optimal_string(target: str, population_size: int, max_generations: int) -> str` that simulates a simple genetic algorithm to evolve a random string towards a target string. The function should return the best string found after a specified number of g...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_optimal_string('abc', 10, 100) in ['abc', 'bca', 'cab']\", \"assert find_optimal_string('hello', 50, 500) in ['hello', 'hallo', 'hella']\", \"assert find_optimal_string('test', 20, 300) in ['test', 'tset', 'estt']\", \"assert find_optimal_string('python...
{ "split": "train", "index": 63827, "acecode_id": "evol_34091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending an attendance report to a user based on their Student ID and password. The function, `send_attendance_report`, takes three arguments: `student_id` (a string representing the user's Student ID), `password` (a string ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_attendance_report('12345', 'password123', 1) == 'Attendance Report for 12345 generated successfully.'\", \"assert send_attendance_report('invalid_id', 'password123', 2) == '\\ud83d\\udccb Unregistered! Please use /register to start.'\", \"assert send_at...
{ "split": "train", "index": 63828, "acecode_id": "bigcode_python_fns_40386", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to compute accuracy metrics for a set of prediction methods used to rank items. The function should take in the number of methods, a list of gold preferences, and a list of predicted rankings. Your goal is to compute the accuracy a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_metrics(1, [1, 1, 1], [[1, 1, 1]]) == {'acc': [1.0], 'f1': [1.0]}\", \"assert compute_metrics(1, [1, 2, 3, 4, 5], [[1, 2, 3, 4, 5]]) == {'acc': [1.0], 'f1': [1.0]}\", \"assert compute_metrics(2, [1, 2, 3], [[1, 2, 3], [1, 2, 3]]) == {'acc': [1.0, 1.0...
{ "split": "train", "index": 63829, "acecode_id": "oss_27191", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with managing a user within a group in a system. Implement a function `manage_user_group(user: str, group: str) -> None` that takes two parameters: a string `user` representing the username and a string `group` representing the group name. The function should sim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_user_group('user1', 'group1') == None\", \"assert manage_user_group('testuser', 'testgroup') == None\", \"assert manage_user_group('admin', 'admins') == None\", \"assert manage_user_group('guest', 'guests') == None\", \"assert manage_user_group('membe...
{ "split": "train", "index": 63830, "acecode_id": "bigcode_python_fns_7222", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of non-zero integers, implement a function `numeric_signs(array)` that computes the summation of distinct numeric magnitudes multiplied by their respective signs (1 for positive integers, -1 for negative integers). If the array contains only zeroes or is empty, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numeric_signs([0, 0, 0]) == None\", \"assert numeric_signs([]) == None\", \"assert numeric_signs([-1, 1, 2, -2]) == 0\", \"assert numeric_signs([5, -5, 0, 0]) == 0\", \"assert numeric_signs([1, 2, 0, -2, -1]) == 0\", \"assert numeric_signs([-1, -2, -3, -4]) ...
{ "split": "train", "index": 63831, "acecode_id": "evol_34630", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function `is_semiperfect(n: int) -> bool` that determines whether n is a semiperfect number. A semiperfect number is defined as a number that is equal to the sum of some of its proper divisors, excluding itself. For example, 6 is semiperfect ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_semiperfect(6) == True\", \"assert is_semiperfect(12) == True\", \"assert is_semiperfect(18) == True\", \"assert is_semiperfect(20) == True\", \"assert is_semiperfect(28) == True\", \"assert is_semiperfect(30) == True\", \"assert is_semiperfect(1) == Fals...
{ "split": "train", "index": 63832, "acecode_id": "bigcode_python_fns_49802", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `match_string(input_string: str) -> bool` that uses a regular expression to determine if the input string starts with the substring 'dog', contains only uppercase letters in its body, and ends with the character 'X'. The function should return `True` if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match_string('dogX') == True\", \"assert match_string('dogAAX') == True\", \"assert match_string('dogHELLOX') == True\", \"assert match_string('dogXYZX') == True\", \"assert match_string('dog123X') == False\", \"assert match_string('catX') == False\", \"asse...
{ "split": "train", "index": 63833, "acecode_id": "evol_15008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `get_siblings_sum` that takes an integer `num` and returns the sum of all integers that are in the same list as `num` but are not equal to `num` itself. If `num` is not present in the list, return 0. The function should take two argume...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_siblings_sum([1, 2, 3, 4, 5], 3) == 12\", \"assert get_siblings_sum([1, 2, 2, 4, 5], 2) == 10\", \"assert get_siblings_sum([5, 5, 5, 5], 5) == 0\", \"assert get_siblings_sum([], 3) == 0\", \"assert get_siblings_sum([0, 0, 0, 0], 0) == 0\", \"assert get_s...
{ "split": "train", "index": 63834, "acecode_id": "bigcode_python_fns_44280", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates taking attendance for a group of people. The function, `take_attendance`, should accept a single parameter `methodcnt`, which represents whether the attendance method is set up correctly. If `methodcnt` is `False`, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert take_attendance(True) == 1\", \"assert take_attendance(False) == 2\", \"assert take_attendance(True) == 1\", \"assert take_attendance(False) == 2\", \"assert take_attendance(True) == 1\", \"assert take_attendance(False) == 2\", \"assert take_attendance(True)...
{ "split": "train", "index": 63835, "acecode_id": "bigcode_python_fns_3838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string dataset containing a mixture of words, integers, and special characters, implement a function that calculates the frequency percentage of a specified word in the dataset. The function should disregard any non-textual elements and return the frequency percentage o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_percentage_frequency('hello world world hello', 'world') == 50.0\", \"assert correct_percentage_frequency('this is a test text', 'test') == 20.0\", \"assert correct_percentage_frequency('apple banana apple', 'apple') == 66.66666666666666\", \"assert ...
{ "split": "train", "index": 63836, "acecode_id": "evol_8061", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a sequence of numbers. Your task is to implement a function that checks if the sequence is strictly increasing. A sequence is said to be strictly increasing if each element is greater than the previous one. For example, the sequence...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_strictly_increasing([1, 2, 3]) == True\", \"assert is_strictly_increasing([5, 6, 7, 8]) == True\", \"assert is_strictly_increasing([1, 3, 2]) == False\", \"assert is_strictly_increasing([10]) == True\", \"assert is_strictly_increasing([1, 2, 2, 3]) == Fal...
{ "split": "train", "index": 63837, "acecode_id": "bigcode_python_fns_18406", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts a list of digests into a formatted string. Each digest is represented as a dictionary containing the keys 'registry', 'repository', 'tag', and 'digest'. The function should take this list of digests and return a string w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_digests_str([]) == ''\", \"assert make_digests_str([{'registry': 'r1', 'repository': 'repo1', 'tag': 'tag1', 'digest': 'digest1'}]) == 'r1/repo1:tag1 digest1'\", \"assert make_digests_str([{'registry': 'r1', 'repository': 'repo1', 'tag': 'tag1', 'digest...
{ "split": "train", "index": 63838, "acecode_id": "oss_17052", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of data representations from a scientific simulation. Each data representation is provided as a dictionary containing the following keys: 'Source' (a string representing the data source), 'Point2' (a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data_representations([{ 'Source': 'Source A', 'Point2': [1.0, 0.0, 0.0], 'Resolution': 10 }, { 'Source': 'Source B', 'Point2': [2.0, 0.0, 0.0], 'Resolution': 5 }]) == {'total_data_representations': 2, 'average_resolution': 7.5, 'highest_x_source': 'S...
{ "split": "train", "index": 63839, "acecode_id": "oss_16776", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, reverse every second word in the string without using any inbuilt Python functions or modules for reversing. Implement a function `reverse_every_second_word(s: str) -> str` that takes a string `s` as input and returns the modified string. For example, given the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_every_second_word('Hello world this is a test') == 'Hello dlrow this si a tset'\", \"assert reverse_every_second_word('Leetcode challenges are exciting') == 'Leetcode segnellahc are gniticxe'\", \"assert reverse_every_second_word('Data structures and...
{ "split": "train", "index": 63840, "acecode_id": "evol_16670", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n)` that returns the value corresponding to the `n`th position in the Fibonacci sequence. The Fibonacci sequence is defined as follows: F(1) = 0, F(2) = 1, and F(n) = F(n-1) + F(n-2) for n > 2. If the input `n` is less than or equal to 0, the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(1) == 0\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 1\", \"assert fibonacci(4) == 2\", \"assert fibonacci(5) == 3\", \"assert fibonacci(6) == 5\", \"assert fibonacci(7) == 8\", \"assert fibonacci(8) == 13\", \"assert fibonacci(9) == 2...
{ "split": "train", "index": 63841, "acecode_id": "evol_8112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `difference_in_strings(string1: str, string2: str) -> str` that takes two strings as input and returns a new string containing all the unique letters from the second string that are not present in the first string. The resulting string should be sorted in a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert difference_in_strings('hello', 'world') == 'drw'\", \"assert difference_in_strings('abc', 'def') == 'def'\", \"assert difference_in_strings('test', 'best') == 'b'\", \"assert difference_in_strings('abc', 'abc') == ''\", \"assert difference_in_strings('', 'ab...
{ "split": "train", "index": 63842, "acecode_id": "evol_30801", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that extracts a specific authentication key from a given header string. The function should parse the input string, which represents the 'HTTP_X_SENTRY_AUTH' header, and extract the value associated with the 'sentry_key' parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert auth_from_request('Sentry sentry_key=my_key, other_param=value') == 'my_key'\", \"assert auth_from_request('Sentry sentry_key=secret, another_param=123') == 'secret'\", \"assert auth_from_request('Sentry sentry_key=abc123, param1=value1, param2=value2') == '...
{ "split": "train", "index": 63843, "acecode_id": "oss_10600", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that rearranges the words of a given string in alphabetical order, ignoring any symbols. The input string will contain multiple words, and the output should be a single string with the words sorted alphabetically. For example, the input 'Python Programming'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reorder_string_alphabetically('Python Programming') == 'Programming Python'\", \"assert reorder_string_alphabetically('Hello World') == 'Hello World'\", \"assert reorder_string_alphabetically('apple banana cherry') == 'apple banana cherry'\", \"assert reorde...
{ "split": "train", "index": 63844, "acecode_id": "evol_26829", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dynamic obstacles represented as tuples of their coordinates (x, y) at a specific time step. Your task is to compute the bounding box that contains all dynamic obstacles at that time step. The bounding box is defined by the minimum and maximum x and y co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_bounding_box([(1, 2), (3, 4), (5, 6)]) == ((1, 2), (5, 6))\", \"assert compute_bounding_box([(0, 0), (1, 1), (2, 2)]) == ((0, 0), (2, 2))\", \"assert compute_bounding_box([(10, 15), (20, 25), (30, 35)]) == ((10, 15), (30, 35))\", \"assert compute_bou...
{ "split": "train", "index": 63845, "acecode_id": "bigcode_python_fns_28490", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the tags of entries in a database. Your task is to implement a function `delete_tags(entry_tags: List[int], tag_to_delete: int) -> List[int]` that removes all occurrences of a specified tag from the list of entry tags. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_tags([1, 2, 3, 4, 5], 3) == [1, 2, 4, 5]\", \"assert delete_tags([1, 2, 3, 3, 4, 5], 3) == [1, 2, 4, 5]\", \"assert delete_tags([1, 2, 2, 3, 4], 2) == [1, 3, 4]\", \"assert delete_tags([5, 5, 5, 5], 5) == []\", \"assert delete_tags([], 1) == []\", \"a...
{ "split": "train", "index": 63846, "acecode_id": "bigcode_python_fns_49981", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that handles multiple exceptions that may arise during the processing of a request. Your function should take in an exception object and log the error message. It should then return a dictionary containing the following keys: 'success' (a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_exception(ValueError('Invalid value')) == {'success': False, 'error_code': 422, 'message': 'Invalid value'}\", \"assert handle_exception(IndexError('List index out of range')) == {'success': False, 'error_code': 422, 'message': 'List index out of rang...
{ "split": "train", "index": 63847, "acecode_id": "bigcode_python_fns_3822", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating construction parameters for a class named `OnExecutionComplete`. The class should accept a `target_action` and an `on_completion` callable. Your goal is to implement a function `validate_parameters(target_action, on_completion)` that checks the va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_parameters('valid-action', lambda: None) == True\", \"assert validate_parameters('another-action', print) == True\", \"assert validate_parameters('action', lambda x: x) == True\", \"assert validate_parameters('action', lambda: None) == True\", \"ass...
{ "split": "train", "index": 63848, "acecode_id": "bigcode_python_fns_12837", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `analyze_sentiment(text: str) -> str` that takes a string of text as input and returns the sentiment of the text as either 'positive', 'negative', or 'neutral'. You can assume that the sentiment analysis is based on a simplified rule-based approach where th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_sentiment('I am so happy today!') == 'positive'\", \"assert analyze_sentiment('This is a good day!') == 'positive'\", \"assert analyze_sentiment('I feel sad about this.') == 'negative'\", \"assert analyze_sentiment('This is a bad situation.') == 'neg...
{ "split": "train", "index": 63849, "acecode_id": "evol_7009", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that filters a list of dictionaries representing flow files based on a specific attribute key and value. Your function should take three parameters: a list of flow files, an attribute key, and an attribute value. Each flow file is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_flow_files([{'filename': 'example.txt', 'size': 100}, {'filename': 'test.txt', 'size': 200}], 'filename', 'example.txt') == [{'filename': 'example.txt', 'size': 100}]\", \"assert filter_flow_files([{'filename': 'example.txt', 'size': 100}, {'filename'...
{ "split": "train", "index": 63850, "acecode_id": "oss_6639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple event handling system in Python. The system should allow the registration of event handlers and the triggering of events. An event can have multiple handlers, and when triggered, all the associated handlers should be executed in the ord...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert event_system_handler([('click', lambda: 'Handler 1 executed'), ('click', lambda: 'Handler 2 executed')], 'click') == ['Handler 1 executed', 'Handler 2 executed']\", \"assert event_system_handler([('submit', lambda: 'Submit handler executed')], 'submit') == [...
{ "split": "train", "index": 63851, "acecode_id": "oss_33724", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list of integers 'code_vectors', write a function 'visualize_code_vectors' that returns a string representation of a title and the dimensions of the input array. The function should take the following parameters: 1) code_vectors (List[List[int]]): a 2D list represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert visualize_code_vectors([[1, 2, 3], [4, 5, 6]]) == 'Title: Code Vectors in Time, Dimensions: 2x3'\", \"assert visualize_code_vectors([[1]]) == 'Title: Code Vectors in Time, Dimensions: 1x1'\", \"assert visualize_code_vectors([[1, 2], [3, 4], [5, 6]]) == 'Titl...
{ "split": "train", "index": 63852, "acecode_id": "bigcode_python_fns_29983", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing objects, each with an associated set of tags and a description. Your task is to implement a function that searches for objects that match all the provided query terms. Each query term must match either the object's identifier (key), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_objects([{'id': '1', 'tags': ['apple', 'fruit'], 'description': 'A sweet fruit.'}, {'id': '2', 'tags': ['carrot', 'vegetable'], 'description': 'A crunchy vegetable.'}], ['apple', '1']) == ['1']\", \"assert search_objects([{'id': '1', 'tags': ['apple',...
{ "split": "train", "index": 63853, "acecode_id": "bigcode_python_fns_18943", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs a bitwise XOR operation on two integers. The function should take two parameters: 'a' and 'b', where 'a' is an 8-bit integer (0 to 255) and 'b' is a 16-bit integer (0 to 65535). The function should return the result of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bitwise_xor(0, 0) == 0\", \"assert bitwise_xor(255, 0) == 255\", \"assert bitwise_xor(0, 65535) == 65535\", \"assert bitwise_xor(255, 65535) == 65280\", \"assert bitwise_xor(128, 32768) == 32896\", \"assert bitwise_xor(255, 255) == 0\", \"assert bitwise_xor(...
{ "split": "train", "index": 63854, "acecode_id": "oss_37717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci_numbers(n)` that takes a single integer `n` (1 <= n <= 30) and returns the first `n` numbers of the Fibonacci sequence as a list. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_numbers(1) == [0]\", \"assert fibonacci_numbers(2) == [0, 1]\", \"assert fibonacci_numbers(3) == [0, 1, 1]\", \"assert fibonacci_numbers(4) == [0, 1, 1, 2]\", \"assert fibonacci_numbers(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci_numbers(6) == [0, ...
{ "split": "train", "index": 63855, "acecode_id": "evol_23769", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that searches for the phrase 'Hello World' in the provided text, ignoring any surrounding whitespace characters. The search should be case-insensitive. If the phrase is found, return 'Hello World'; otherwise, return None.\nPlease reason step by step, then write...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_hello_world('This example will show you how to print Hello World using Regular Expressions and hello world as well.') == 'Hello World'\", \"assert find_hello_world(' hello world ') == 'Hello World'\", \"assert find_hello_world('No matching phrase...
{ "split": "train", "index": 63856, "acecode_id": "evol_30077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of numbers, calculate the bias for each number based on its deviation from the mean. The bias for each number is defined as the standardized deviation raised to the specified power, scaled by a given effect size. Implement a function that takes in the list of numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_bias([5, 5, 5, 5], 1, 1) == [0.0, 0.0, 0.0, 0.0]\", \"assert calculate_bias([1, 1, 1, 1, 1], 3, 1) == [0.0, 0.0, 0.0, 0.0, 0.0]\", \"assert calculate_bias([1, 2], 1, 1) == [-1.0, 1.0]\", \"assert calculate_bias([1, 100], 1, 1) == [-1.0, 1.0]\", \"a...
{ "split": "train", "index": 63857, "acecode_id": "bigcode_python_fns_16909", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates opening a connection to a database. The function should take a string parameter `db_file` which represents the path to the database file. If the path is valid (i.e., it is a non-empty string), the function should return a m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert open_db_conn('/home/openwpm/Desktop/crawl-data.sqlite') == 'Connection to the database has been established.'\", \"assert open_db_conn('') == 'Connection failed.'\", \"assert open_db_conn('/etc/database.db') == 'Connection to the database has been establishe...
{ "split": "train", "index": 63858, "acecode_id": "bigcode_python_fns_36622", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a genus name or an empty entry. Your task is to create a function that generates a new list of integers where each integer is 1 if the corresponding string is a non-empty genus name and 0 if it is empty. Implement the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_genus_flag(['Aedes', 'Culex', '', 'Anopheles']) == [1, 1, 0, 1]\", \"assert has_genus_flag(['', '', '', '']) == [0, 0, 0, 0]\", \"assert has_genus_flag(['Mansonia', '']) == [1, 0]\", \"assert has_genus_flag(['']) == [0]\", \"assert has_genus_flag(['Toxor...
{ "split": "train", "index": 63859, "acecode_id": "bigcode_python_fns_20192", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a contact form input. The function should take three parameters: `full_name` (a string), `email` (a string), and `subject` (a string). The function should return a boolean value indicating whether the input is valid. The ru...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_contact_form('John Doe', 'john.doe@example.com', 'Hello') == True\", \"assert validate_contact_form('Jane Smith', 'jane.smith@domain.com', 'Inquiry') == True\", \"assert validate_contact_form('Alice Johnson', 'alice.johnson@company.org', 'Feedback')...
{ "split": "train", "index": 63860, "acecode_id": "oss_35683", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of restarting a service in a containerized environment. Given a version number of a service, your function should generate a command list that represents the steps needed to restart the service container. The co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_restart_commands('1.0.0') == ['pull traefik:1.0.0', 'stop traefik', 'rm traefik', 'run -d --restart=always --network=host -p=80:80 -p=443:443 --volume=/var/run/docker.sock:/var/run/docker.sock --volume=~/mypaas/traefik.toml:/traefik.toml --volume=~/...
{ "split": "train", "index": 63861, "acecode_id": "bigcode_python_fns_46029", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the reload action of a web browser tab. This function should take a list of strings representing the states of a web page after a reload and return the first state that is either 'interactive' or 'complete'. If no such ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_ready_state(['loading', 'loading', 'interactive', 'complete']) == 'interactive'\", \"assert get_ready_state(['loading', 'loading', 'loading']) == 'not ready'\", \"assert get_ready_state(['not ready', 'loading', 'complete']) == 'complete'\", \"assert get_...
{ "split": "train", "index": 63862, "acecode_id": "oss_34006", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer algorithm_id, return the corresponding Generation class name as a string. The mapping of algorithm IDs to Generation classes is defined as follows: 1 maps to 'Generation I', 2 maps to 'Generation II', 3 maps to 'Generation III', 4 maps to 'Generation IV', 5 map...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_generation_class(1) == 'Generation I'\", \"assert get_generation_class(2) == 'Generation II'\", \"assert get_generation_class(3) == 'Generation III'\", \"assert get_generation_class(4) == 'Generation IV'\", \"assert get_generation_class(5) == 'Generation...
{ "split": "train", "index": 63863, "acecode_id": "bigcode_python_fns_31521", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the average stock price for multiple stock symbols based on a list of stock prices. You will be given a list of tuples where each tuple contains a stock symbol (a string) and its corresponding price (a float). Your goal is to compute the average ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_prices([('AAPL', 150.00), ('AAPL', 155.00), ('GOOG', 2500.00), ('GOOG', 2550.00), ('AAPL', 160.00)]) == [('AAPL', 155.00), ('GOOG', 2525.00)]\", \"assert calculate_average_prices([('AAPL', 100.00), ('AAPL', 200.00), ('AAPL', 300.00)]) == [(...
{ "split": "train", "index": 63864, "acecode_id": "oss_5344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary of parameters where each key is a parameter name and each value is either a string, a boolean, or a list of values, write a function that converts this dictionary into a URI query string. The query string should start with a '?' and each key-value pair should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_query_str({}) == ''\", \"assert to_query_str({'a': 1}) == '?a=1'\", \"assert to_query_str({'a': True}) == '?a=true'\", \"assert to_query_str({'a': False}) == '?a=false'\", \"assert to_query_str({'a': 'test'}) == '?a=test'\", \"assert to_query_str({'a': [1...
{ "split": "train", "index": 63865, "acecode_id": "bigcode_python_fns_47562", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sentence represented as a string and two lists of words, modifiers and targets, write a function that marks each target in the sentence by its corresponding modifier if they are adjacent to each other. A target is considered marked if it is immediately preceded by a mod...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert markup_sentence('Hello world', [], ['world']) == 'Hello world'\", \"assert markup_sentence('Nothing to mark here', ['anything'], ['nothing']) == 'Nothing to mark here'\", \"assert markup_sentence('Testing with no modifiers', [], ['target']) == 'Testing with ...
{ "split": "train", "index": 63866, "acecode_id": "bigcode_python_fns_34661", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with determining if a given integer element should be included based on two lists of predicates: include_predicates and exclude_predicates. A predicate is a function that takes an integer and returns a boolean value. An element must not satisfy any of the exclude...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert included_element([lambda x: x > 0], [lambda x: x < 0], 1) == True\", \"assert included_element([lambda x: x > 0], [lambda x: x < 0], -1) == False\", \"assert included_element([], [lambda x: x < 0], 1) == True\", \"assert included_element([lambda x: x % 2 == ...
{ "split": "train", "index": 63867, "acecode_id": "bigcode_python_fns_15502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes two parameters: a string representing a machine learning model name and a boolean indicating whether the learning process should be initiated. The function should return a dictionary with two keys: 'learningModel' and 'doLearni...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_ml_manager('Neural Network', True) == {'learningModel': 'Neural Network', 'doLearning': True}\", \"assert create_ml_manager('Decision Tree', False) == {'learningModel': 'Decision Tree', 'doLearning': False}\", \"assert create_ml_manager('', True) == {...
{ "split": "train", "index": 63868, "acecode_id": "oss_2984", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a fish stocking event form. The form requires that at least one fish tag type must be selected if a tag retention value is provided. Implement a function `is_valid_event` that takes in two parameters: `fish_tags` (which can be a list of strings re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_event(['tag1', 'tag2'], 50) == True\", \"assert is_valid_event(['tag1'], None) == True\", \"assert is_valid_event(None, 50) == False\", \"assert is_valid_event([], 50) == False\", \"assert is_valid_event(['tag1'], 100) == True\", \"assert is_valid_e...
{ "split": "train", "index": 63869, "acecode_id": "bigcode_python_fns_25210", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that returns the corresponding HTTP status message based on a given HTTP status code. Implement a function `get_http_status_message` that takes an integer `status_code` as input and returns the corresponding HTTP status message. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_http_status_message(200) == 'OK'\", \"assert get_http_status_message(404) == 'Not Found'\", \"assert get_http_status_message(500) == 'Internal Server Error'\", \"assert get_http_status_message(403) == 'Forbidden'\", \"assert get_http_status_message(400) ...
{ "split": "train", "index": 63870, "acecode_id": "oss_8701", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total pay of an employee based on the hours worked and the hourly rate. Implement a function `computepay(hours: float, rate: float) -> float` that takes the number of hours worked and the hourly rate as parameters and returns the total pay ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert computepay(40, 10) == 400.0\", \"assert computepay(0, 10) == 0.0\", \"assert computepay(30, 15) == 450.0\", \"assert computepay(45, 10) == 475.0\", \"assert computepay(40, 0) == 0.0\", \"assert computepay(41, 10) == 415.0\", \"assert computepay(39, 12) == 46...
{ "split": "train", "index": 63871, "acecode_id": "oss_21375", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that simulates the parsing of command-line arguments provided as a string input. The function should interpret the command-line arguments and return a dictionary containing the parsed values based on the definitions specified in the inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_command_line_args(\\\"parser.add_argument('--groups', type=str, nargs='*', default=['Everyone'], help='Groups to access the tool')\\\\nparser.add_argument('--password', type=str, default=None, help='User password')\\\\nparser.add_argument('--sort_key',...
{ "split": "train", "index": 63872, "acecode_id": "oss_5748", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an integer number in the range from 1 to 4999, convert it to its corresponding Roman numeral representation. If the number is out of the specified range or not a positive integer, return None. Implement a function that takes a single integer as an argument and returns its...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_roman(1) == 'I'\", \"assert to_roman(3) == 'III'\", \"assert to_roman(4) == 'IV'\", \"assert to_roman(9) == 'IX'\", \"assert to_roman(58) == 'LVIII'\", \"assert to_roman(1994) == 'MCMXCIV'\", \"assert to_roman(2023) == 'MMXXIII'\", \"assert to_roman(3999)...
{ "split": "train", "index": 63873, "acecode_id": "bigcode_python_fns_3836", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that converts a given Unix timestamp to a datetime object and then back to a Unix timestamp. Specifically, you need to implement the following two functions: 1. `timestamp_to_datetime(timestamp)`: This function takes a Unix tim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert datetime_to_timestamp(timestamp_to_datetime(0)) == 0\", \"assert datetime_to_timestamp(timestamp_to_datetime(1633072800)) == 1633072800\", \"assert datetime_to_timestamp(timestamp_to_datetime(1622505600)) == 1622505600\", \"assert datetime_to_timestamp(times...
{ "split": "train", "index": 63874, "acecode_id": "oss_25740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, return a list of n unique random words from a predefined list of words. The predefined list of words is: ['apple', 'banana', 'cherry', 'date', 'elderberry', 'fig', 'grape', 'honeydew', 'kiwi', 'lemon', 'mango', 'nectarine', 'orange', 'papaya', 'quince', 'ras...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_random_words(0) == []\", \"assert len(get_random_words(3)) == 3\", \"assert len(get_random_words(15)) == 15\", \"assert get_random_words(2) != get_random_words(2)\", \"assert set(get_random_words(5)).issubset(set(['apple', 'banana', 'cherry', 'date', 'el...
{ "split": "train", "index": 63875, "acecode_id": "bigcode_python_fns_47595", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `get_value_at_path(data: dict, path: str) -> Any`. This function takes a dictionary `data`, which represents a hierarchical structure, and a string `path` as input. The `path` is a string that represents the hierarchy in the da...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_value_at_path({'root': {'node1': [1, 2, 3], 'node2': {'subnode1': 'value1', 'subnode2': 'value2'}}}, 'root::node2::subnode1') == 'value1'\", \"assert get_value_at_path({'root': {'node1': [1, 2, 3], 'node2': {'subnode1': 'value1', 'subnode2': 'value2'}}},...
{ "split": "train", "index": 63876, "acecode_id": "oss_6995", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that receives the parameters needed to initialize a WaveGlow vocoder model and returns a dictionary containing the model configuration and audio settings. The function should accept the following parameters: `n_mel_channels` (int), `n_flo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_waveglow(80, 12, 4, 2, 256, 8, 256, 3, 0.999, 22050) == ({'n_layers': 8, 'n_channels': 256, 'kernel_size': 3}, {'wav_value': 0.999, 'sampling_rate': 22050})\", \"assert get_waveglow(64, 16, 2, 1, 128, 4, 128, 5, 0.95, 16000) == ({'n_layers': 4, 'n_channe...
{ "split": "train", "index": 63877, "acecode_id": "bigcode_python_fns_6485", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings that represent integers, implement a function `complex_sum(lst)` that returns a list of strings. Each string in the output should indicate the number of prime digits in the corresponding input string. If any element in the input list is not a string or c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_sum(['1234567']) == ['The number of prime components in the 1st input string is 4']\", \"assert complex_sum(['3', '11111111']) == ['The number of prime components in the 1st input string is 1', 'The number of prime components in the 2nd input string ...
{ "split": "train", "index": 63878, "acecode_id": "evol_8927", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Develop a Python function that takes a list of integers as input and returns a new list containing only the unique integers from the input list, maintaining the original order of their first occurrence. For example, given the list [1, 2, 2, 3, 1], the function should return [1,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 1]) == [1, 2, 3]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4...
{ "split": "train", "index": 63879, "acecode_id": "evol_3459", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the Spearman rank correlation coefficient for two given lists of numerical values. The Spearman rank correlation coefficient is a non-parametric measure of statistical dependence between two variables. It assess...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_spearman_correlation([1, 2, 3], [3, 2, 1]) == -1.0\", \"assert calculate_spearman_correlation([10, 20, 30], [30, 20, 10]) == -1.0\", \"assert calculate_spearman_correlation([1, 2, 3, 4], [2, 3, 4, 5]) == 1.0\", \"assert calculate_spearman_correlati...
{ "split": "train", "index": 63880, "acecode_id": "oss_37184", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `count_even_numbers(nums)` that returns the number of even integers in the list. An even integer is defined as any integer that can be divided by 2 without a remainder. If the list is empty, the function should return 0. \n\n### Exampl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_even_numbers([1, 2, 3, 4, 5]) == 2\", \"assert count_even_numbers([10, 21, 32, 43, 54]) == 3\", \"assert count_even_numbers([-2, -1, 0, 1, 2]) == 3\", \"assert count_even_numbers([0, 1, 2, 3, 4, 5]) == 3\", \"assert count_even_numbers([100, 200, 300]) ...
{ "split": "train", "index": 63881, "acecode_id": "bigcode_python_fns_48633", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to modify the status of an order. The function should accept two parameters: an integer `order_id` representing the unique identifier of the order, and a string `new_status` representing the new status to be assigned to the order. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_order_status(1, 'Shipped') == 'Order status modified successfully'\", \"assert modify_order_status(2, 'Delivered') == 'Order status modified successfully'\", \"assert modify_order_status(3, 'Cancelled') == 'Order status modified successfully'\", \"ass...
{ "split": "train", "index": 63882, "acecode_id": "oss_30519", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a specific list of fruits. Your function should be named `get_fruits` and it should not take any parameters. The function should return a list containing the elements 'apple', 'banana', and 'orange' in that specific order. Yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_fruits() == ['apple', 'banana', 'orange']\", \"assert len(get_fruits()) == 3\", \"assert get_fruits()[0] == 'apple'\", \"assert get_fruits()[1] == 'banana'\", \"assert get_fruits()[2] == 'orange'\", \"assert 'apple' in get_fruits()\", \"assert 'banana' i...
{ "split": "train", "index": 63883, "acecode_id": "oss_24862", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a Python function named 'euclidean_distance' that computes the Euclidean distance between two points in n-dimensional space. The points will be provided as tuples or lists. The function should validate the inputs to ensure they are both tuples or lists of the same dim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert euclidean_distance((1, 2, 3), (4, 5, 6)) == 5.196152422706632\", \"assert euclidean_distance((0, 0), (3, 4)) == 5.0\", \"assert euclidean_distance((1, 1), (1, 1)) == 0.0\", \"assert euclidean_distance((1.5, 2.5), (3.5, 4.5)) == 2.8284271247461903\", \"assert...
{ "split": "train", "index": 63884, "acecode_id": "evol_29479", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that counts the frequency of each character in a given string up to the first whitespace character. The function should return the frequencies in a dictionary where the keys are the characters and the values are their respective counts. If there is no white...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_char_freq('hello world') == {'h': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert count_char_freq('abc def ghi') == {'a': 1, 'b': 1, 'c': 1}\", \"assert count_char_freq('') == {}\", \"assert count_char_freq('single') == {'s': 1, 'i': 1, 'n': 1, 'g': 1, 'l': 1, ...
{ "split": "train", "index": 63885, "acecode_id": "evol_10010", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string `equation` that represents a mathematical expression consisting of non-negative integers, addition (`+`), subtraction (`-`), multiplication (`*`), and division (`/`). Your task is to implement a function `evaluate_expression(equation: str) -> float` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('10-2*3+4/2') == 6.0\", \"assert evaluate_expression('1+2+3') == 6.0\", \"assert evaluate_expression('5*5') == 25.0\", \"assert evaluate_expression('0+0') == 0.0\", \"assert evaluate_expression('9/3*3+4') == 13.0\", \"assert evaluate_expr...
{ "split": "train", "index": 63886, "acecode_id": "bigcode_python_fns_16594", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of floating-point values and returns a new list with the values arranged in ascending order. The function should properly handle and ignore null values (represented as None) and ensure that duplicate values are included in the output. For ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_floats([4.5, 7.5, -2.5, None, 7.5, 1.5]) == [-2.5, 1.5, 4.5, 7.5, 7.5]\", \"assert sort_floats([None, None, 3.0, 5.0, 2.0]) == [2.0, 3.0, 5.0]\", \"assert sort_floats([-1.2, 0.0, -3.3, 2.1, None]) == [-3.3, -1.2, 0.0, 2.1]\", \"assert sort_floats([]) ==...
{ "split": "train", "index": 63887, "acecode_id": "evol_28052", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string representing a key and a dictionary containing key-value pairs. The function should return the value associated with the given key if it exists in the dictionary. If the key does not exist, the function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_value_from_dict('a', {'a': 'alpha', 'b': 'beta'}) == 'alpha'\", \"assert get_value_from_dict('b', {'a': 'alpha', 'b': 'beta'}) == 'beta'\", \"assert get_value_from_dict('c', {'a': 'alpha', 'b': 'beta'}) == 'Key not found'\", \"assert get_value_from_dict(...
{ "split": "train", "index": 63888, "acecode_id": "bigcode_python_fns_35014", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a sequence of function calls in a program, where each function call is represented by a unique uppercase letter. Your task is to generate a call graph in the DOT language format. The call graph should represent the relationships between the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_call_graph('A') == 'digraph G { }'\", \"assert generate_call_graph('AB') == 'digraph G { A -> B; }'\", \"assert generate_call_graph('XYZ') == 'digraph G { X -> Y; Y -> Z; }'\", \"assert generate_call_graph('Z') == 'digraph G { }'\", \"assert generat...
{ "split": "train", "index": 63889, "acecode_id": "bigcode_python_fns_37560", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a date object, implement a function that converts it into a datetime object by combining it with either the minimum or maximum time of the day. The function should accept two parameters: a date and a time_choice string that determines whether to use the minimum time ('min...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert date_to_datetime(datetime.date(2023, 1, 1), 'min') == datetime.datetime(2023, 1, 1, 0, 0)\", \"assert date_to_datetime(datetime.date(2023, 12, 31), 'min') == datetime.datetime(2023, 12, 31, 0, 0)\", \"assert date_to_datetime(datetime.date(2000, 2, 29), 'min'...
{ "split": "train", "index": 63890, "acecode_id": "bigcode_python_fns_35511", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of musical notes on individual staves of music sheets. Your task is to implement a function `calculate_total_notes(staves: List[int]) -> int` that returns the total number of musical notes across all staves. A stave can h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_notes([3, 5, 2, 4]) == 14\", \"assert calculate_total_notes([1, 1, 1, 1, 1]) == 5\", \"assert calculate_total_notes([0, 0, 0, 0]) == 0\", \"assert calculate_total_notes([10]) == 10\", \"assert calculate_total_notes([7, 0, 3]) == 10\", \"asser...
{ "split": "train", "index": 63891, "acecode_id": "bigcode_python_fns_40529", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a tweet represented as a dictionary with the following structure: { 'user': {'name': str, 'screen_name': str}, 'created_at': str, 'retweeted_status': {'content': str} }. Your task is to implement a function `notify_retweet(tweet: Dict[str, Any]) -> str` that forma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert notify_retweet({'user': {'name': 'Alice', 'screen_name': 'alice123'}, 'created_at': '2023-10-01T12:00:00Z', 'retweeted_status': {'content': 'Hello, world!'}}) == 'Alice @alice123 retweeted your tweet: Hello, world!'\", \"assert notify_retweet({'user': {'name...
{ "split": "train", "index": 63892, "acecode_id": "bigcode_python_fns_48401", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of queries, where each query is represented as a list containing two integers, [n, k]. Your task is to implement a function that calculates the number of unique ways to construct an array of length n such that the product of the elements in that array equal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert waysToFillArray([[2, 6]]) == [4]\", \"assert waysToFillArray([[5, 1]]) == [1]\", \"assert waysToFillArray([[73, 660]]) == [50734910]\", \"assert waysToFillArray([[1, 1]]) == [1]\", \"assert waysToFillArray([[2, 2]]) == [2]\", \"assert waysToFillArray([[3, 3]...
{ "split": "train", "index": 63893, "acecode_id": "evol_30767", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a given dictionary into a YAML string representation. The function should take a dictionary as input and return a string that represents the dictionary in YAML format. The dictionary contains keys that are strings and values ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dict_to_yaml({'key': 'value'}) == '%YAML 1.1\\\\n---\\\\nkey: value\\\\n'\", \"assert dict_to_yaml({'key1': 'value1', 'key2': 2}) == '%YAML 1.1\\\\n---\\\\nkey1: value1\\\\nkey2: 2\\\\n'\", \"assert dict_to_yaml({'key': {'nested_key': 'nested_value'}}) == '%...
{ "split": "train", "index": 63894, "acecode_id": "bigcode_python_fns_41254", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `check_value_type(value: Optional[object], allow_array: bool = False, allow_dict: Union[bool, str] = False) -> None`. This function is designed to validate the type of a given value based on specific rules. The function should check t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_value_type(None) is None\", \"assert check_value_type('string') is None\", \"assert check_value_type(['type_name'], allow_array=True) is None\", \"assert check_value_type({'key': {'type': 'type_name'}}, allow_dict=True) is None\", \"assert check_value_...
{ "split": "train", "index": 63895, "acecode_id": "bigcode_python_fns_24902", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of unique molecular identifiers (UMIs) represented as strings, along with their respective counts in a dictionary format. Your task is to correct the counts by merging UMIs that are similar based on the Hamming distance. Two UMIs are considered similar if t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_umi_counts({'A': 5, 'A': 2}) == ['A']\", \"assert correct_umi_counts({'A': 0, 'B': 0}) == []\", \"assert correct_umi_counts({'AAA': 4, 'AAB': 1, 'ABA': 1}) == ['AAA']\", \"assert correct_umi_counts({'AAAA': 10, 'AAAB': 5, 'AABA': 3}) == ['AAAA']\", \...
{ "split": "train", "index": 63896, "acecode_id": "bigcode_python_fns_39078", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a string `body` and a string `title`. Your task is to implement a function `notify(body: str, title: str) -> bool` that simulates the sending of a notification with the given `body` and `title`. The function should return `True` if the notification is sent success...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert notify('This is a test notification.', 'Test Title') == True\", \"assert notify('', 'Test Title') == False\", \"assert notify('This is a test notification.', '') == True\", \"assert notify('This is a test notification that exceeds the character limit' * 50, ...
{ "split": "train", "index": 63897, "acecode_id": "bigcode_python_fns_4138", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates the first n numbers of the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should take an integer n as input a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_seq(1) == [0]\", \"assert fibonacci_seq(2) == [0, 1]\", \"assert fibonacci_seq(3) == [0, 1, 1]\", \"assert fibonacci_seq(4) == [0, 1, 1, 2]\", \"assert fibonacci_seq(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci_seq(6) == [0, 1, 1, 2, 3, 5]\", \"asse...
{ "split": "train", "index": 63898, "acecode_id": "evol_25119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves all valid bridges from a given list of entries. Each entry can be either a valid bridge object or an invalid one. A valid bridge is defined as an object that is an instance of the `HueBridge` class and has a property `api` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_valid_bridges([None, 'string', 0, object()]) == []\", \"assert get_valid_bridges([]) == []\", \"assert get_valid_bridges([object(), object(), object()]) == []\", \"assert get_valid_bridges([HueBridge(False), HueBridge(False)]) == []\", \"assert get_valid...
{ "split": "train", "index": 63899, "acecode_id": "bigcode_python_fns_8001", "num_tests": 5 }