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": "Write a function that takes a list of strings as input and returns the same list after sorting the strings based on their lengths in ascending order. If two strings have the same length, they should remain in the same order as they were in the original list. For example, given ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_words(['apple', 'banana', 'pear', 'kiwi']) == ['pear', 'kiwi', 'apple', 'banana']\", \"assert process_words(['cat', 'a', 'dog', 'elephant']) == ['a', 'cat', 'dog', 'elephant']\", \"assert process_words(['sun', 'moon', 'star', 'planet']) == ['sun', 'm...
{ "split": "train", "index": 61800, "acecode_id": "oss_25824", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a maze where '.' represents empty spaces, '#' represents walls, 'S' is the starting point, and 'E' is the endpoint. The maze may also contain portals represented by pairs of matching letters (e.g., 'a' and 'A'). When you step on one letter o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minSteps(['S..#', '...#', '##..', '...E']) == 6\", \"assert minSteps(['S#.#E']) == -1\", \"assert minSteps(['S##', '#.#', 'E.#']) == -1\", \"assert minSteps(['S..', '###', 'E..']) == -1\", \"assert minSteps(['S##', '###', 'E..']) == -1\", \"assert minSteps([...
{ "split": "train", "index": 61801, "acecode_id": "oss_26355", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of integers and returns a new list containing the integers in reverse order. You must implement this function without using any built-in Python functions for reversing a list. The function signature should be: def reverse_list(input_lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_list([7, 1, 4, 9, 3, 8, 6]) == [6, 8, 3, 9, 4, 1, 7]\", \"assert reverse_list([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_list([-1, -2, -3]) == [-3, -2, -1]\", \"assert reverse_list([100, 200, 300]) == [300, 200, 100]\", \"assert reverse_...
{ "split": "train", "index": 61802, "acecode_id": "evol_30428", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `is_user_underage(birthdate: str) -> bool` that takes a string representing a date of birth in the format 'DD-MM-YYYY'. The function should return True if the user is underage (i.e., under 18 years old) and False otherwise. If the date is not in the correct for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_user_underage('31-12-2004') == False\", \"assert is_user_underage('29-02-2004') == False\", \"assert is_user_underage('30-09-2002') == False\", \"assert is_user_underage('15-05-2004') == False\", \"assert is_user_underage('12-12-2000') == False\", \"asser...
{ "split": "train", "index": 61803, "acecode_id": "evol_31789", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the epochs of log entries. Your task is to create a function that takes this list and returns a new list where each element is incremented by the maximum value found in the input list. If the input list is empty, return an empty lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment_epochs([1, 2, 3]) == [4, 5, 6]\", \"assert increment_epochs([5, 10, 15]) == [20, 25, 30]\", \"assert increment_epochs([0, 0, 0]) == [0, 0, 0]\", \"assert increment_epochs([100]) == [200]\", \"assert increment_epochs([1, 2, 3, 4, 5]) == [6, 7, 8, 9,...
{ "split": "train", "index": 61804, "acecode_id": "bigcode_python_fns_11561", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `intersection(*sets)` that takes any number of sets and returns a sorted list of unique elements that are present in all the given sets. Do not use any built-in Python set functions or methods. You should also implement your own sorting mechanism to ensure ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersection({1, 2, 3}, {2, 3, 4}, {3, 2, 5}) == [2, 3]\", \"assert intersection({1, 2}, {2, 3}, {2, 2}) == [2]\", \"assert intersection({5, 6, 7}, {7, 8, 9}, {7, 10}) == [7]\", \"assert intersection({1, 2, 3}, {4, 5, 6}) == []\", \"assert intersection({}, {...
{ "split": "train", "index": 61805, "acecode_id": "evol_29182", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of 2D points represented as tuples (x, y) and a center point represented as a tuple (xc, yc), write a function `calc_distances(points: List[Tuple[int, int]], center: Tuple[int, int]) -> List[float]` that calculates the Euclidean distance of each point from the cent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_distances([(0, 0), (3, 4)], (0, 0)) == [0.0, 5.0]\", \"assert calc_distances([(1, 1), (2, 2), (3, 3)], (0, 0)) == [1.4142135623730951, 2.8284271247461903, 4.242640687119285]\", \"assert calc_distances([(1, 2)], (1, 1)) == [1.0]\", \"assert calc_distance...
{ "split": "train", "index": 61806, "acecode_id": "bigcode_python_fns_29258", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and returns the count of palindrome words in that string. A palindrome is a word that reads the same backward as forward, ignoring case and punctuation. For example, in the input 'Madam Arora teaches malayalam.', the function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_palindromes_in_text('Madam Arora teaches malayalam.') == 3\", \"assert find_palindromes_in_text('Hello world') == 0\", \"assert find_palindromes_in_text('Was it a car or a cat I saw?') == 3\", \"assert find_palindromes_in_text('Civic duty') == 1\", \"as...
{ "split": "train", "index": 61807, "acecode_id": "evol_15863", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of sector performance percentages represented as floats. Your task is to implement a function that takes a list of floats and returns a new list where each value is the percentage change from the previous sector's performance. The first sector's percentage ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_performance_change([50.5, 50.5, 50.5]) == [0.0, 0.0, 0.0]\", \"assert calculate_performance_change([200.0, 180.0, 240.0]) == [0.0, -10.0, 33.33]\", \"assert calculate_performance_change([10.0, 5.0, 15.0]) == [0.0, -50.0, 200.0]\", \"assert calculat...
{ "split": "train", "index": 61808, "acecode_id": "bigcode_python_fns_11319", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a function `recovered()` that is supposed to return the total number of people that have recovered from a certain event based on the input list of integers, where each integer represents the number of people recovered on a particular day. Your task is to implement...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_recovered([1, 2, 3]) == 6\", \"assert total_recovered([0, 0, 0]) == 0\", \"assert total_recovered([10, 5, 15]) == 30\", \"assert total_recovered([7]) == 7\", \"assert total_recovered([]) == 0\", \"assert total_recovered([1]) == 1\", \"assert total_reco...
{ "split": "train", "index": 61809, "acecode_id": "bigcode_python_fns_14896", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes an image represented as a 2D list of pixel values. The function should apply a specific image processing operation, such as converting the image to grayscale, and return the processed image as a 2D list of pixel valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_image([[255, 255, 255], [0, 0, 0]]) == [[255, 255, 255], [0, 0, 0]]\", \"assert process_image([[123, 234, 45], [12, 34, 56]]) == [[134, 134, 134], [34, 34, 34]]\", \"assert process_image([[0, 0, 0], [255, 255, 255]]) == [[0, 0, 0], [255, 255, 255]]\"...
{ "split": "train", "index": 61810, "acecode_id": "oss_7774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D grid consisting of 1s (land) and 0s (water), return the minimum number of days required to disconnect the grid such that there are no connected groups of land cells. An island is defined as a maximal 4-directionally connected group of 1s. In one day, you can change a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minDays([[1,1]]) == 2\", \"assert minDays([[1,0,1,0]]) == 0\", \"assert minDays([[1]]) == 1\", \"assert minDays([[0]]) == 0\", \"assert minDays([[1,0,0],[0,0,0],[0,0,1]]) == 0\", \"assert minDays([[1,1],[0,0]]) == 2\", \"assert minDays([[1,0,1],[0,1,0],[1,0,...
{ "split": "train", "index": 61811, "acecode_id": "evol_34457", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function that translates an input string into Morse code. The function should take a string as input and return a string representing the Morse code equivalent of the input, where each Morse code symbol is separated by a space, and words are separated by a slash ('/'). ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert text_to_morse('SOS') == '... --- ... '\", \"assert text_to_morse('123') == '.---- ..--- ...-- '\", \"assert text_to_morse('A B C') == '.- / -... / -.-. '\", \"assert text_to_morse('Goodbye!') == '--. --- --- -.. -... -.-- . '\", \"assert text_to_morse('Morse...
{ "split": "train", "index": 61812, "acecode_id": "evol_9401", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple card drawing game using Python. You have a standard deck of 52 cards, which consists of 4 suits (hearts, diamonds, clubs, spades) and 13 cards in each suit. Write a function `draw_cards(num_cards: int) -> List[str]` that simulates drawing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_cards(0) == []\", \"assert len(draw_cards(10)) == 10\", \"assert len(draw_cards(52)) == 52\", \"assert len(draw_cards(60)) == 52\", \"assert '2 of hearts' not in draw_cards(1)\", \"assert len(set(draw_cards(30))) == 30\"]}" }
{ "split": "train", "index": 61813, "acecode_id": "oss_1479", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that returns the largest prime factor of a given integer 'n'. The function should handle both positive and negative integers. You can assume that the absolute value of 'n' is greater than 1 and that 'n' is not a prime number but a power of a prime. Optimize...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_prime_factor(13195) == 29\", \"assert largest_prime_factor(2048) == 2\", \"assert largest_prime_factor(-13195) == 29\", \"assert largest_prime_factor(-2048) == 2\", \"assert largest_prime_factor(100) == 5\", \"assert largest_prime_factor(-100) == 5\"...
{ "split": "train", "index": 61814, "acecode_id": "evol_6117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `validate_email` that checks if a given email address is valid based on the following criteria: it must contain at least one period ('.'), one '@' symbol, and can only include alphanumeric characters along with underscores ('_'), periods ('.'), and h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('test.email@example.com') == True\", \"assert validate_email('user_name@domain.co') == True\", \"assert validate_email('first.last@sub.domain.com') == True\", \"assert validate_email('user-name@domain.com') == True\", \"assert validate_email('...
{ "split": "train", "index": 61815, "acecode_id": "evol_17404", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given two lists of strings, `list1` and `list2`. Each string represents a font name. Your task is to determine the union of the two lists, which means you should return a list containing unique font names from both lists. The output list should be sorted in alphabetical...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert union_of_fonts(['ab', 'bc', 'cd'], ['bc', 'de', 'ef']) == ['ab', 'bc', 'cd', 'de', 'ef']\", \"assert union_of_fonts(['a', 'b'], ['c', 'd']) == ['a', 'b', 'c', 'd']\", \"assert union_of_fonts(['x', 'y', 'z'], ['x', 'y', 'z']) == ['x', 'y', 'z']\", \"assert un...
{ "split": "train", "index": 61816, "acecode_id": "bigcode_python_fns_5904", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s consisting only of lowercase letters, implement the function is_happy(s) that returns True if the string is considered 'happy'. A string is deemed happy if it meets the following conditions: it has a minimum length of 3, every trio of consecutive letters are di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_happy('abc') == False\", \"assert is_happy('aabb') == False\", \"assert is_happy('abcde') == False\", \"assert is_happy('ababab') == False\", \"assert is_happy('abbcc') == False\", \"assert is_happy('abcabc') == True\", \"assert is_happy('xyzxyz') == True...
{ "split": "train", "index": 61817, "acecode_id": "evol_26480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing a traceback from a Python exception. Your task is to parse this traceback and extract the relevant information to identify the root cause of the exception. Write a function `extract_exception_details(traceback)` that takes a list of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_exception_details(['Traceback', 'in function', 'ValueError: invalid input']) == {'top_exception_type': 'ValueError', 'top_exception_message': 'invalid input', 'embedded_exception_type': None, 'embedded_exception_message': None}\", \"assert extract_ex...
{ "split": "train", "index": 61818, "acecode_id": "oss_30631", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function called `optimized_sort` that takes an array of integers as input and returns the array sorted in ascending order. The function should utilize an optimized sorting algorithm such as Quicksort or Merge sort. The input array may contain duplicates and will hav...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimized_sort([5, 4, 6, 7, 1]) == [1, 4, 5, 6, 7]\", \"assert optimized_sort([]) == []\", \"assert optimized_sort([3, 3, 3]) == [3, 3, 3]\", \"assert optimized_sort([2, 1]) == [1, 2]\", \"assert optimized_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert...
{ "split": "train", "index": 61819, "acecode_id": "evol_6931", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a VPN negotiation process. Implement a function `vpn_negotiation(session_id: int) -> Union[int, bool]` that takes a 64-bit integer `session_id` as input, which represents the client's session identifier. The function should return the server's ses...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vpn_negotiation(0) == 1\", \"assert vpn_negotiation(1) == 2\", \"assert vpn_negotiation(10) == 11\", \"assert vpn_negotiation(100) == 101\", \"assert vpn_negotiation(123456789012345) == 123456789012346\", \"assert vpn_negotiation(-1) == False\", \"assert vpn...
{ "split": "train", "index": 61820, "acecode_id": "bigcode_python_fns_5640", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integers, a and b. Implement a function called `check_if_integer_division` that performs the division of a by b and checks if the result is an integer. The function should return True if the result of the division is an integer, and False otherwise. Note that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_if_integer_division(15, 4) == False\", \"assert check_if_integer_division(20, 5) == True\", \"assert check_if_integer_division(0, 1) == True\", \"assert check_if_integer_division(10, 3) == False\", \"assert check_if_integer_division(25, 5) == True\", \...
{ "split": "train", "index": 61821, "acecode_id": "evol_28072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple plugin manager system that can register and manage plugins. Write a function `manage_plugins()` that accepts a list of tuples, each containing a string (the plugin name) and a boolean (indicating whether the plugin is internal or not). The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_plugins([('plugin1', False), ('plugin2', True), ('plugin3', False)]) == (['plugin1', 'plugin2', 'plugin3'], ['plugin2'])\", \"assert manage_plugins([]) == ([], [])\", \"assert manage_plugins([('pluginX', False), ('pluginY', True), ('pluginX', True)]) ...
{ "split": "train", "index": 61822, "acecode_id": "bigcode_python_fns_41901", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string report, you need to determine if it contains both the words 'degen' and 'spine' in any of its sentences. A sentence is defined as a sequence of characters that ends with a period (.). If any sentence contains both words (case insensitive), return True. Otherwise,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert LF_degen_spine('The patient shows signs of degen. The spine is healthy.') == False\", \"assert LF_degen_spine('There is degen in the spine. It is severe.') == True\", \"assert LF_degen_spine('No mention of anything relevant.') == False\", \"assert LF_degen_s...
{ "split": "train", "index": 61823, "acecode_id": "bigcode_python_fns_7515", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function to calculate the maximum possible profit that can be earned by buying and selling stocks given a list of daily stock prices and a transaction fee. You are allowed to buy and sell the stock multiple times, but you cannot engage in multiple transactions at th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxProfit([1, 3, 2, 8, 4, 9], 2) == 8\", \"assert maxProfit([5, 4, 3, 2, 1], 1) == 0\", \"assert maxProfit([10], 5) == 0\", \"assert maxProfit([1, 2, 3], 0) == 2\", \"assert maxProfit([5, 6, 7, 8, 9], 0) == 4\", \"assert maxProfit([1, 2], 2) == 0\", \"assert...
{ "split": "train", "index": 61824, "acecode_id": "evol_14904", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to configure parameters for training a bi-directional recurrent neural network (RNN) with the CTC (Connectionist Temporal Classification) cost function for speech recognition. The function should accept four parameters: corpus (a string t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_rnn_parameters('rl', 'english', 32, 'mfcc') == {'corpus': 'rl', 'language': 'english', 'batch_size': 32, 'feature_type': 'mfcc'}\", \"assert configure_rnn_parameters('ls', 'spanish', 16, 'mel') == {'corpus': 'ls', 'language': 'spanish', 'batch_size...
{ "split": "train", "index": 61825, "acecode_id": "oss_820", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing times in 12-hour format (e.g., '2:30 PM', '12:15 AM'), write a function that converts these times into 24-hour format (e.g., '14:30', '00:15'). The input will be a list of time strings, and the output should be a list of corresponding time s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_24_hour_format(['2:30 PM', '12:15 AM']) == ['14:30', '00:15']\", \"assert convert_to_24_hour_format(['11:59 PM', '12:00 AM']) == ['23:59', '00:00']\", \"assert convert_to_24_hour_format(['3:45 AM', '6:00 PM']) == ['03:45', '18:00']\", \"assert con...
{ "split": "train", "index": 61826, "acecode_id": "bigcode_python_fns_46983", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a managed object with various properties. Your task is to implement a function `extract_properties(managed_objects: List[Dict[str, Any]], path_set: Optional[List[str]] = None) -> List[Dict[str, Any]]` that e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_properties([{'name': 'Object1', 'type': 'TypeA', 'value': 10}, {'name': 'Object2', 'type': 'TypeB', 'value': 20}], None) == [{'name': 'Object1', 'type': 'TypeA', 'value': 10}, {'name': 'Object2', 'type': 'TypeB', 'value': 20}]\", \"assert extract_pro...
{ "split": "train", "index": 61827, "acecode_id": "bigcode_python_fns_28239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that determines whether a given list of field names and data types can be used to create a structured data type (dtype) without requiring any additional parameters. The dtype is a representation used to describe the layout of a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_reconstruct_dtype(['A', 'B', 'C'], [int, float, bool]) == True\", \"assert can_reconstruct_dtype(['X', 'Y'], [str, list]) == True\", \"assert can_reconstruct_dtype(['name', 'age'], [str, int]) == True\", \"assert can_reconstruct_dtype(['id', 'score'], [i...
{ "split": "train", "index": 61828, "acecode_id": "oss_22272", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that sets up logging for a web application. The function should configure the logging to output log messages to either the standard output (stdout) or a file. Your task is to complete the `setup_logging` function by adding the nece...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_logging(False) == 'Logging to stdout activated.'\", \"assert type(setup_logging(False)) == str\", \"assert setup_logging(False).startswith('Logging to')\", \"assert setup_logging(False).endswith('.log') == False\", \"assert 'ERROR' not in setup_logging...
{ "split": "train", "index": 61829, "acecode_id": "oss_34657", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of whole numbers, write a function that returns a new list containing the numbers in reverse order without using any built-in functions for reversal. The function should take a single parameter: a list of integers. For example, given the input [7, 1, 4, 9, 3, 8, 6]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert invert_sequence([7, 1, 4, 9, 3, 8, 6]) == [6, 8, 3, 9, 4, 1, 7]\", \"assert invert_sequence([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert invert_sequence([10, 20, 30]) == [30, 20, 10]\", \"assert invert_sequence([0]) == [0]\", \"assert invert_sequence([]) ...
{ "split": "train", "index": 61830, "acecode_id": "evol_31018", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of elements, write a function that transforms the list into a dictionary, where each element at an even index becomes a key and the element at the following odd index becomes its corresponding value. If the list has an odd length, the last element should be ignored...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_list_to_dict([1, 'a', 2, 'b', 3, 'c']) == {1: 'a', 2: 'b', 3: 'c'}\", \"assert transform_list_to_dict(['x', 10, 'y', 20, 'z']) == {'x': 10, 'y': 20}\", \"assert transform_list_to_dict([True, 'yes', False, 'no']) == {True: 'yes', False: 'no'}\", \"a...
{ "split": "train", "index": 61831, "acecode_id": "evol_21569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two dictionaries, `dict_to_merge` and `merged_dict`. Write a function `merge_dicts(dict_to_merge: Dict[str, Any], merged_dict: Dict[str, Any]) -> Dict[str, Any]` that recursively merges the contents of `dict_to_merge` into `merged_dict`. If a key from `dict_to_mer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_dicts({'a': 1}, {'b': 2}) == {'b': 2, 'a': 1}\", \"assert merge_dicts({'a': {'c': 3}}, {'a': 2}) == {'a': {'c': 3}}\", \"assert merge_dicts({}, {'a': 1}) == {'a': 1}\", \"assert merge_dicts({'a': 1}, {}) == {'a': 1}\", \"assert merge_dicts({'a': {'b': ...
{ "split": "train", "index": 61832, "acecode_id": "bigcode_python_fns_15190", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers and an integer k, write a function `top_k_elements(arr: List[int], k: int) -> List[int]` that returns the k largest elements from the list in descending order. If there are fewer than k elements in the list, return all the elements sorted in descending ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert top_k_elements([3, 1, 2, 4, 5], 3) == [5, 4, 3]\", \"assert top_k_elements([5, 5, 4, 4, 3, 2, 1], 3) == [5, 4, 3]\", \"assert top_k_elements([1, 2, 3, 4, 5], 1) == [5]\", \"assert top_k_elements([-1, -2, -3, -4], 2) == [-1, -2]\", \"assert top_k_elements([],...
{ "split": "train", "index": 61833, "acecode_id": "bigcode_python_fns_20697", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings, implement a function that capitalizes all elements of the array, excluding any words that are longer than six letters. Additionally, if a word ends with the letter 'e', it should also be capitalized regardless of its length. The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert capitalize_words(['welcome', 'to', 'my', 'website', 'apple', 'pear']) == ['WELCOME', 'TO', 'MY', 'WEBSITE', 'APPLE', 'PEAR']\", \"assert capitalize_words(['a', 'b', 'c', 'longword', 'test', 'grape']) == ['A', 'B', 'C', 'longword', 'TEST', 'GRAPE']\", \"asser...
{ "split": "train", "index": 61834, "acecode_id": "evol_11488", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with determining if it's possible to distribute an array of integers, `nums`, to a set of customers, where each customer has a specific requirement for identical integers. Given an array, `nums`, containing integers with possible repetitions, and an array, `quant...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert canDistribute([1, 2, 3, 4], [2]) == False\", \"assert canDistribute([1, 2, 3, 3], [2]) == True\", \"assert canDistribute([1, 1, 2, 2], [2, 2]) == True\", \"assert canDistribute([1, 1, 2, 3], [2, 2]) == False\", \"assert canDistribute([1, 1, 1, 1, 1], [2, 3])...
{ "split": "train", "index": 61835, "acecode_id": "evol_1189", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sequences of floating-point numbers, 'times' and 'z_expectations', implement a function that calculates and returns the decay constant based on the provided times and z_expectations. The decay constant is defined as the mean of the 'z_expectations' divided by the mean...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_decay_constant([1.0, 2.0, 3.0], [2.0, 4.0, 6.0]) == 2.0\", \"assert calculate_decay_constant([1.0, 1.0, 1.0], [1.0, 1.0, 1.0]) == 1.0\", \"assert calculate_decay_constant([0.0, 0.0], [1.0, 1.0]) == None\", \"assert calculate_decay_constant([2.0, 4....
{ "split": "train", "index": 61836, "acecode_id": "bigcode_python_fns_39465", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of category names, implement a function that returns a list of unique category names sorted in alphabetical order. The input will be a list of strings, where each string represents a category name. The function should ensure that there are no duplicate category nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted_categories(['Fruits', 'Vegetables', 'Dairy', 'Fruits', 'Meat']) == ['Dairy', 'Fruits', 'Meat', 'Vegetables']\", \"assert unique_sorted_categories(['Books', 'Toys', 'Books', 'Electronics', 'Toys']) == ['Books', 'Electronics', 'Toys']\", \"assert...
{ "split": "train", "index": 61837, "acecode_id": "bigcode_python_fns_9444", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string and a specific letter, implement a function `count_letter(string, letter)` that counts the number of occurrences of the letter within the string and returns a tuple containing the count and a list of indices where the letter appears. The function should handle ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_letter('hello, world', 'l') == (3, [2, 3, 10])\", \"assert count_letter('Python Programming', 'P') == (2, [0, 7])\", \"assert count_letter('OpenAI', 'o') == (0, [])\", \"assert count_letter('banana', 'a') == (3, [1, 3, 5])\", \"assert count_letter('A q...
{ "split": "train", "index": 61838, "acecode_id": "evol_15913", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the registration of a device. The registration process checks if the device ID has already been registered and returns a response accordingly. The function will take in a list of device IDs and a target device ID. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_device(['device1', 'device2', 'device3'], 'device1') == 'Registration already exists for device_id = device1'\", \"assert register_device(['device1', 'device2', 'device3'], 'device4') == 'Device with id device4 has been successfully registered.'\", ...
{ "split": "train", "index": 61839, "acecode_id": "bigcode_python_fns_16676", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_symbol_occurrence(sequence: str, symbol: str, count: int) -> bool` that takes an alphanumeric string `sequence`, a character `symbol`, and an integer `count`. The function should return `True` if `symbol` appears exactly `count` times in `sequence`, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_symbol_occurrence('abc123abc', 'a', 2) == True\", \"assert check_symbol_occurrence('hello world', 'o', 2) == True\", \"assert check_symbol_occurrence('testcase', 't', 2) == True\", \"assert check_symbol_occurrence('abcdefg', 'h', 0) == True\", \"assert...
{ "split": "train", "index": 61840, "acecode_id": "evol_4300", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary containing integer keys and string values, your task is to write a function that takes this dictionary as input and returns a new dictionary containing only the keys that are present in the input dictionary and have non-empty string values. The new dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_and_uppercase({}) == {}\", \"assert filter_and_uppercase({1: 'a'}) == {1: 'A'}\", \"assert filter_and_uppercase({1: 'a', 2: ''}) == {1: 'A'}\", \"assert filter_and_uppercase({1: 'a', 2: 'b'}) == {1: 'A', 2: 'B'}\", \"assert filter_and_uppercase({1: 'x...
{ "split": "train", "index": 61841, "acecode_id": "oss_3502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a representation of a new model called 'Article' in a simple database schema. The 'Article' model should have the following fields: a 'title' which is a string with a maximum length of 100 characters, a 'content' which is a string (text), and an 'au...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_article('A Valid Title', 'This is the content of the article.', 'John Doe') == {'title': 'A Valid Title', 'content': 'This is the content of the article.', 'author': 'John Doe'}\", \"assert create_article('A Title That Is Exactly One Hundred Character...
{ "split": "train", "index": 61842, "acecode_id": "oss_8828", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `selector`, determine if it is a partial link text selector. A selector is considered a partial link text selector if it starts with any of the following prefixes: 'partial_link=', 'partial_link_text=', 'partial_text=', 'p_link=', 'p_link_text=', or 'p_text='. Im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_partial_link_text_selector('partial_link=example') == True\", \"assert is_partial_link_text_selector('partial_link_text=example') == True\", \"assert is_partial_link_text_selector('partial_text=example') == True\", \"assert is_partial_link_text_selector('...
{ "split": "train", "index": 61843, "acecode_id": "bigcode_python_fns_24599", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function that takes a string of comma-separated words as input, removes any duplicate words, sorts the unique words in alphabetical order, and returns a list of those words along with a dictionary that counts the occurrences of each word. For example, given the input 'a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_string('apple, orange, grape, apple') == (['apple', 'grape', 'orange'], {'apple': 2, 'grape': 1, 'orange': 1})\", \"assert process_string('banana, apple, banana') == (['apple', 'banana'], {'banana': 2, 'apple': 1})\", \"assert process_string('kiwi, k...
{ "split": "train", "index": 61844, "acecode_id": "evol_28027", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a flood warning system for a river that monitors water levels from various monitoring stations. Your goal is to implement a function `check_flood_warning(water_levels: List[float], threshold: float) -> str` that determines if a flood warning sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_flood_warning([1.0, 2.0, 3.0], 4.0) == 'Water level is safe.'\", \"assert check_flood_warning([4.5, 3.2, 5.0], 5.0) == 'Water level is safe.'\", \"assert check_flood_warning([6.0, 2.0, 3.0], 5.0) == 'Flood Warning: High water level detected!'\", \"asse...
{ "split": "train", "index": 61845, "acecode_id": "oss_15030", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the peak learning rate given a base learning rate, global batch size, and an optional base batch size. The function should also handle a warm-up factor and a decay schedule. Implement the function `calculate_peak_lr(base_l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_peak_lr(0.01, 32) == 0.01\", \"assert calculate_peak_lr(0.005, 128, base_batch_size=32, scaling='linear') == 0.02\", \"assert calculate_peak_lr(0.03, 80, base_batch_size=20, scaling='linear') == 0.12\", \"assert calculate_peak_lr(0.1, 200, base_bat...
{ "split": "train", "index": 61846, "acecode_id": "bigcode_python_fns_37299", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given package's metadata, represented as a dictionary with keys such as 'author', 'author_email', 'license', and 'classifiers'. The 'classifiers' key holds a list of strings representing various classifications for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_package_metadata({'author': 'John Doe', 'author_email': 'john.doe@example.com', 'license': 'MIT', 'classifiers': ['License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3']}) == 'Author: John Doe, Email: john.doe@example.com, Lice...
{ "split": "train", "index": 61847, "acecode_id": "oss_16278", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that analyzes a list of import statements to extract and count the number of imported modules. The function should take a list of strings as input, where each string represents an import statement. The function should return a dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_imports(['import os', 'import re', 'import sys', 'import unittest', 'import traffic_control', 'import traffic_control', 'import os', 'import re', 'import sys', 'import unittest']) == {'os': 2, 're': 2, 'sys': 2, 'unittest': 2, 'traffic_control': 2}\", ...
{ "split": "train", "index": 61848, "acecode_id": "oss_32", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `register_user(name: str, email: str, password: str, address: str) -> str` that registers a new client into a data structure called 'users'. The function should check for potential errors during registration: If any of the parameters are missing, return 'Al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_user('John', 'john@example.com', '1234', '999 Main St.') == 'Registration successful.'\", \"assert register_user('John', 'johnexample.com', '1234', '999 Main St.') == 'Invalid email address.'\", \"assert register_user('John', 'john@example.com', '12...
{ "split": "train", "index": 61849, "acecode_id": "evol_26179", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a target integer. Your task is to implement a function that returns True if any two distinct integers in the list sum up to the target integer, and False otherwise. You can assume that the input list will not contain any duplicates. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 9) == True\", \"assert has_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert has_pair_with_sum([10, 15, 3, 7], 17) == True\", \"assert has_pair_with_sum([-1, -2, -3, -4], -5) == True\", \"assert has_pair_with_sum([0, ...
{ "split": "train", "index": 61850, "acecode_id": "oss_14804", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes three inputs: an array of non-negative integers, a non-negative integer, and a string. The function should return an array of strings where each string is the result of the input string being repeated a number of times specified by the corresponding...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert repeat_string([2, 3, 4], 4, 'Hello') == ['HelloHello', 'HelloHelloHello', 'HelloHelloHelloHello']\", \"assert repeat_string([0, 1, 2], 2, 'Hi') == ['','Hi','HiHi']\", \"assert repeat_string([1, 1, 1], 1, 'A') == ['A', 'A', 'A']\", \"assert repeat_string([2, ...
{ "split": "train", "index": 61851, "acecode_id": "evol_7274", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a formatted help page for a command-line utility. The help page should display a list of features, each prefixed with a bullet point symbol. You are given a dictionary of features, where each key is the name of a fea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_help_page({'Feature 1': 'red', 'Feature 2': 'blue'}) == '* Feature 1\\\\n* Feature 2'\", \"assert generate_help_page({'Automatic help page generation': 'teal', 'Highlighting': 'aquamarine', 'Lightweight': 'khaki'}) == '* Automatic help page generati...
{ "split": "train", "index": 61852, "acecode_id": "oss_3499", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of objects, each representing a parameter with an associated type. Your task is to implement a function that checks whether all parameters in the list are of the expected type. If any parameter does not match the expected type, the function should raise an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_parameter_types([TypeWrapper('foo'), TypeWrapper('bar')], str) is None\", \"assert check_parameter_types([TypeWrapper(1), TypeWrapper(2)], int) is None\", \"assert check_parameter_types([TypeWrapper(1), TypeWrapper(2)], int) is None\", \"assert check_p...
{ "split": "train", "index": 61853, "acecode_id": "bigcode_python_fns_46708", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a callable function and a dictionary of local variables. The function should return a dictionary of keyword arguments extracted from the local variables that are not equal to a specified default value. Your function should hand...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_non_default_kwargs(lambda x, y=10: None, {'x': 5, 'y': 10}, 10) == {'x': 5}\", \"assert get_non_default_kwargs(lambda a, b, c=0: None, {'a': 1, 'b': 2, 'c': 0}, 0) == {'a': 1, 'b': 2}\", \"assert get_non_default_kwargs(lambda x, y: None, {'x': 0, 'y': 1}...
{ "split": "train", "index": 61854, "acecode_id": "bigcode_python_fns_14749", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of car attributes represented as a dictionary where keys are the attribute names and values are lists of corresponding values. Your task is to rename the columns of this dictionary based on a specified mapping. You will receive two lists: one containing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rename_columns({'Brand': ['Chevrolet Bel Air', 'Lotus Esprit'], 'Price': [49995, 59950], 'Year': [1957, 1977], 'Sign': ['Rooster', 'Snake']}, ['Brand', 'Price', 'Year', 'fake_column'], ['Marque', 'Cost', 'Zodiac', 'bogus_column']) == {'Marque': ['Chevrolet B...
{ "split": "train", "index": 61855, "acecode_id": "bigcode_python_fns_12069", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple scoring system for a game called 'Whack-a-Mole'. In this version of the game, you need to implement a function `whack_a_mole_game(grid_size: int, num_moles: int, time_limit: float) -> int` that calculates the player's score based on how m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert whack_a_mole_game(5, 10, 30) == 10\", \"assert whack_a_mole_game(3, 5, 10) == 5\", \"assert whack_a_mole_game(4, 0, 15) == 0\", \"assert whack_a_mole_game(6, 3, 5) == 3\", \"assert whack_a_mole_game(2, 2, 4) == 2\", \"assert whack_a_mole_game(10, 20, 60) == ...
{ "split": "train", "index": 61856, "acecode_id": "oss_37386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes incoming requests represented as strings. The requests can contain specific actions that trigger different responses. Implement a function called `process_request` that takes a string input representing the request and retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_request('ACTION1') == 'Performed Action 1'\", \"assert process_request('ACTION2') == 'Performed Action 2'\", \"assert process_request('ACTION3') == 'Unknown Action'\", \"assert process_request('') == 'Unknown Action'\", \"assert process_request('ACTI...
{ "split": "train", "index": 61857, "acecode_id": "oss_31697", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of n-dimensional points, implement a function to apply a simplified version of the UMAP algorithm that reduces the dimensionality of the dataset to 2 dimensions. The input will be a list of tuples, where each tuple represents a point in n-dimensional space. Your fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reduce_dimensions([(0, 0, 0), (1, 1, 1)]) == [(0.5, 0.5)]\", \"assert reduce_dimensions([(1, 2), (3, 4), (5, 6)]) == [(3.0, 4.0)]\", \"assert reduce_dimensions([(1, 2, 3), (1, 2, 3), (1, 2, 3)]) == [(1.0, 2.0)]\", \"assert reduce_dimensions([(1, 0), (0, 1)])...
{ "split": "train", "index": 61858, "acecode_id": "oss_35512", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where each key is a class name (a string) and each value is a list of students (also strings) enrolled in that class. Your task is to write a function that takes this dictionary as input and returns a list containing the class names repeated according...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_classes_names_list({'Math': ['Alice', 'Bob'], 'Science': ['Charlie']}) == ['Math', 'Math', 'Science']\", \"assert create_classes_names_list({'History': ['Dave', 'Eve', 'Frank'], 'Art': []}) == ['History', 'History', 'History']\", \"assert create_class...
{ "split": "train", "index": 61859, "acecode_id": "bigcode_python_fns_5898", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of sentences, where each sentence is a string. Your task is to create a function that processes each sentence and returns a list of processed sentences. The processing involves trimming any leading or trailing whitespace from each sentence and converting it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_sentences([' Hello World ', ' PYTHON programming ']) == ['hello world', 'python programming']\", \"assert process_sentences([' LeetCode ', ' AI Assistant ']) == ['leetcode', 'ai assistant']\", \"assert process_sentences([' Data Science', 'Machine...
{ "split": "train", "index": 61860, "acecode_id": "bigcode_python_fns_11739", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `calculate_fibonacci_and_factorial(n)` that takes an integer `n` as input and returns a tuple containing the Fibonacci number at index `n` and the factorial of that Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_fibonacci_and_factorial(0) == (0, 1)\", \"assert calculate_fibonacci_and_factorial(1) == (1, 1)\", \"assert calculate_fibonacci_and_factorial(2) == (1, 1)\", \"assert calculate_fibonacci_and_factorial(3) == (2, 2)\", \"assert calculate_fibonacci_an...
{ "split": "train", "index": 61861, "acecode_id": "evol_32593", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with defining a function that takes a list of constants, where each constant is represented as a dictionary containing its `value` and `type`. The function should return a dictionary that maps each constant's value to its corresponding type. The input will be a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_constants([{ 'value': 'pi', 'type': 'float' }, { 'value': 'e', 'type': 'float' }, { 'value': 'gravity', 'type': 'float' }]) == {'pi': 'float', 'e': 'float', 'gravity': 'float'}\", \"assert map_constants([{ 'value': 'light_speed', 'type': 'int' }, { 'valu...
{ "split": "train", "index": 61862, "acecode_id": "bigcode_python_fns_43799", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `count_even_numbers_divisible_by_four(n: int) -> int` that takes a non-negative integer `n` and returns the count of all even numbers between 0 and `n` (inclusive) that are divisible by 4. If the input is a negative number or a non-integer, the function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_even_numbers_divisible_by_four(0) == 1\", \"assert count_even_numbers_divisible_by_four(1) == 1\", \"assert count_even_numbers_divisible_by_four(2) == 1\", \"assert count_even_numbers_divisible_by_four(3) == 1\", \"assert count_even_numbers_divisible_b...
{ "split": "train", "index": 61863, "acecode_id": "evol_4540", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates random values based on given parameter specifications for integers and floats. Write a function `generate_random_value(param)` that takes in a parameter object `param` and returns a random value based on the specific...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_value(int_param(lo=5, hi=10)) >= 5 and generate_random_value(int_param(lo=5, hi=10)) < 10\", \"assert generate_random_value(int_param(lo=0, hi=100)) >= 0 and generate_random_value(int_param(lo=0, hi=100)) < 100\", \"assert generate_random_val...
{ "split": "train", "index": 61864, "acecode_id": "oss_32991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `even_odd_count(num)` that takes an integer `num` (which can be positive or negative) and returns a tuple with the count of even and odd digits in the number. Ignore the negative sign when counting the digits. For example, `even_odd_count(-12)` should return `(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert even_odd_count(-12) == (1, 1)\", \"assert even_odd_count(123) == (1, 2)\", \"assert even_odd_count(0) == (1, 0)\", \"assert even_odd_count(2468) == (4, 0)\", \"assert even_odd_count(-13579) == (0, 5)\", \"assert even_odd_count(1001) == (2, 2)\", \"assert eve...
{ "split": "train", "index": 61865, "acecode_id": "evol_15213", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a function called `current_timestamp` that returns the current Unix timestamp as a floating point number. The Unix timestamp is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT). Your function should not take any parameters. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert current_timestamp() >= 1690000000.0\", \"assert isinstance(current_timestamp(), float)\", \"assert abs(current_timestamp() - current_timestamp()) < 1.0\", \"assert current_timestamp() > 1680000000.0\", \"assert current_timestamp() > 1660000000.0\", \"assert ...
{ "split": "train", "index": 61866, "acecode_id": "bigcode_python_fns_18119", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of file objects, each represented by a dictionary containing 'md5', 'file_name', and 'file_type', implement a function that removes a file from the list based on its MD5 hash. If the file is found and removed, return a success message. If the file is not found, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_file_by_md5([{'md5': 'abc123', 'file_name': 'file1', 'file_type': 'txt'}, {'md5': 'def456', 'file_name': 'file2', 'file_type': 'jpg'}], 'abc123') == 'File with MD5 hash abc123 deleted.'\", \"assert delete_file_by_md5([{'md5': 'abc123', 'file_name': 'f...
{ "split": "train", "index": 61867, "acecode_id": "bigcode_python_fns_11867", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function `find_removal_point(lst, val)` that identifies the optimal rightmost index for the removal of a specified value from a sorted list. The function should work with various data types, including integers, floats, strings, tuples, and lists of lists. It ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_removal_point([1, 2, 3, 4, 5], 3) == 2\", \"assert find_removal_point([5, 4, 4, 3, 2, 1], 4) == 2\", \"assert find_removal_point([(1, 2), (2, 3), (3, 4)], (3, 4)) == 2\", \"assert find_removal_point([[1, 2], [2, 3], [3, 4]], [2, 3]) == 1\", \"assert fin...
{ "split": "train", "index": 61868, "acecode_id": "evol_2829", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with writing a Python function that generates a setup configuration for a Python package. The function should return a dictionary containing the following details: package name, version, description, author name, author email, URL, list of packages, list of scrip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_setup_dict('grade-manager', '1.0.0', 'Python package for managing and analyzing student grades.', 'John Doe', 'john.doe@example.com', 'https://www.github.com/johndoe/grade-manager', ['bin/grade-summary'], [('grade-manager', ['style.css'])]) == {'nam...
{ "split": "train", "index": 61869, "acecode_id": "oss_3167", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a singly linked list, implement a function that rotates the list to the right by N places. If N is negative, rotate to the left. If N is greater than the length of the list, it should effectively wrap around. Handle cases where the linked list is empty or contains only on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate(None, 2) == None\", \"assert rotate(ListNode(1), 0).val == 1\", \"assert rotate(ListNode(1), 1).val == 1\", \"assert rotate(ListNode(1), -1).val == 1\", \"assert rotate(ListNode(1), 2).val == 1\", \"assert rotate(ListNode(1, ListNode(2)), 1).val == 2\...
{ "split": "train", "index": 61870, "acecode_id": "evol_27249", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function called `create_car` that takes two parameters: `model` (a string representing the car model) and `year` (an integer representing the car's manufacturing year). The function should return a dictionary representing a car with the keys 'model' and 'year'.\nPle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_car('Toyota Camry', 2020) == {'model': 'Toyota Camry', 'year': 2020}\", \"assert create_car('Honda Accord', 2018) == {'model': 'Honda Accord', 'year': 2018}\", \"assert create_car('Ford Mustang', 2021) == {'model': 'Ford Mustang', 'year': 2021}\", \"a...
{ "split": "train", "index": 61871, "acecode_id": "evol_18887", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_hex_color(color: str) -> bool` that validates whether a given string is a valid hexadecimal color code. A valid hexadecimal color code starts with a '#' followed by either 3 or 6 hexadecimal characters (0-9, a-f, A-F). The function should be case ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_hex_color('#FFF') == True\", \"assert validate_hex_color('#FFFFFF') == True\", \"assert validate_hex_color('#abc') == True\", \"assert validate_hex_color('#abcdef') == True\", \"assert validate_hex_color('#123456') == True\", \"assert validate_hex_c...
{ "split": "train", "index": 61872, "acecode_id": "evol_9415", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing three evaluation metrics for information retrieval systems: Recall, Mean Reciprocal Rank (MRR), and Mean Average Precision (MAP). Your goal is to implement a single function, `map_score(y_true, y_pred, k)`, that calculates the Mean Average Preci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_score({1: [1], 2: [2]}, {1: [1], 2: [2]}, 1) == 1.0\", \"assert map_score({1: [1, 2]}, {1: [2, 3]}, 2) == 0.5\", \"assert map_score({1: [1, 2]}, {1: [3, 4]}, 2) == 0.0\", \"assert map_score({1: [1]}, {1: [1]}, 1) == 1.0\", \"assert map_score({1: [1]}, {1...
{ "split": "train", "index": 61873, "acecode_id": "oss_3398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `filter_even_numbers` that returns a new list containing only the numbers that are perfectly divisible by 2. The function should take a single parameter, which is the list of integers.\nPlease reason step by step, then write a self-con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6, 7, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([1, 3, 5, 7, 9]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbe...
{ "split": "train", "index": 61874, "acecode_id": "evol_27307", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting a simplified representation of HTML nodes into an HTML string. Your function should handle three types of inputs: a string representing plain text, a list of nodes, or a custom object called NodeElement. The NodeElement object has a 'tag' attribut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert node_to_html('Hello World') == 'Hello World'\", \"assert node_to_html(['Hello', ' ', 'World']) == 'Hello World'\", \"assert node_to_html(NodeElement('div', {'class': 'container'}, ['Content'])) == '<div class=\\\"container\\\">Content</div>'\", \"assert node...
{ "split": "train", "index": 61875, "acecode_id": "bigcode_python_fns_34544", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom exception class for a voice chat application. The application has a limitation on the number of members that can be connected to a voice channel simultaneously. When attempting to play a voice clip, if the maximum member limit is exceeded, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert VoiceConnectionException().args[0] == 'Cannot connect to voice channel to play the clip: too many members connected'\", \"assert isinstance(VoiceConnectionException(), VoiceConnectionException)\", \"assert isinstance(VoiceConnectionException(), Exception)\",...
{ "split": "train", "index": 61876, "acecode_id": "oss_9881", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, listA and listB. Write a function merge_unique_elements that takes these two lists as input and returns a new list that contains all unique elements from both lists, without any duplicates. The order of the elements in the resulting list sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_unique_elements([3, 5, 8, 10], [4, 8, 10, 12, 15]) == [3, 5, 8, 10, 4, 12, 15]\", \"assert merge_unique_elements([1, 2, 3], [3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert merge_unique_elements([1, 1, 1], [1, 1, 1]) == [1]\", \"assert merge_unique_elements([...
{ "split": "train", "index": 61877, "acecode_id": "evol_13706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a simple stack data structure using a linked list. A stack is a Last-In-First-Out (LIFO) data structure that supports two main operations: push, which adds an element to the top of the stack, and pop, which removes the top element from the stack. Your task is to imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stack_operations([('push', 10), ('push', -7), ('pop', None)]) == [-7]\", \"assert stack_operations([('push', 5), ('pop', None), ('pop', None)]) == [5, None]\", \"assert stack_operations([('push', 15), ('push', 20), ('push', 25), ('pop', None)]) == [25]\", \"...
{ "split": "train", "index": 61878, "acecode_id": "oss_26543", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a host name, determine if it does not match a specific naming convention. The naming convention requires that the host name must follow the pattern: three alphanumeric characters, a hyphen, one or more alphanumeric characters, a hyphen, exactly two d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert non_device_name_convention('lab-nxos-001.lab.dfjt.local') == True\", \"assert non_device_name_convention('abc-def-12.dfjt.local') == True\", \"assert non_device_name_convention('abc-123-01.dfjt.local') == True\", \"assert non_device_name_convention('lab-juno...
{ "split": "train", "index": 61879, "acecode_id": "bigcode_python_fns_34806", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a nested dictionary, write a function that flattens the dictionary by concatenating keys at each level with a specified join symbol. If the nested dictionary contains lists, each element of the lists should be treated as a separate key in the flattened dictionary. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_dict({'a': 1, 'b': {'c': 2}}, '->') == {'a': 1, 'b->c': 2}\", \"assert flatten_dict({'x': [1, 2, 3], 'y': {'z': 4}}, '-') == {'x-0': 1, 'x-1': 2, 'x-2': 3, 'y-z': 4}\", \"assert flatten_dict({'key1': {'key2': {'key3': 5}}}, '/') == {'key1/key2/key3':...
{ "split": "train", "index": 61880, "acecode_id": "bigcode_python_fns_42610", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Design a function `safe_execute` that takes a function `f` and its arguments `*args` and `**kwargs`, and executes the function. If the function executes successfully, return its result. If the function raises an exception, return the string 'Error occurred'. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert safe_execute(lambda x: x + 1, 2) == 3\", \"assert safe_execute(lambda x: 1 / x, 0) == 'Error occurred'\", \"assert safe_execute(lambda: 'Hello, World!') == 'Hello, World!'\", \"assert safe_execute(lambda x: x * 2, 5) == 10\", \"assert safe_execute(lambda x, ...
{ "split": "train", "index": 61881, "acecode_id": "bigcode_python_fns_49112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers a and b (1 <= a, b <= 10^6), write a function to calculate the least common multiple (LCM) of these two integers. The LCM of two integers is the smallest positive integer that is divisible by both numbers. You need to implement a function `lcm(a: int, b: int)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcm(1, 1) == 1\", \"assert lcm(1, 2) == 2\", \"assert lcm(2, 3) == 6\", \"assert lcm(4, 5) == 20\", \"assert lcm(6, 8) == 24\", \"assert lcm(12, 15) == 60\", \"assert lcm(7, 9) == 63\", \"assert lcm(10, 10) == 10\", \"assert lcm(9, 12) == 36\", \"assert lcm(...
{ "split": "train", "index": 61882, "acecode_id": "bigcode_python_fns_33824", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes a training pipeline for a machine learning model. The function should take two parameters: `model_class` (a string representing the architecture of the model) and `model_config` (a dictionary containing the model's parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_pipeline('TFModel', {'learning_rate': 0.01}) == {'current_loss': 0, 'model': {'model_class': 'TFModel', 'model_config': {'learning_rate': 0.01}}, 'training_details': 'Training initialized'}\", \"assert initialize_pipeline('CNN', {'num_layers': 3})...
{ "split": "train", "index": 61883, "acecode_id": "bigcode_python_fns_33948", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing job demand rates, write a function that calculates the mean demand rate after simulating a specified number of job arrivals. The function should return the mean demand rate as a float. Ensure that the mean is calculated accurately based on ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_mean_demand_rate([10, 20, 30, 40], 1000) == 25.0\", \"assert calculate_mean_demand_rate([0, 0, 0, 0], 1000) == 0.0\", \"assert calculate_mean_demand_rate([1, 2, 3, 4, 5], 10000) == 3.0\", \"assert calculate_mean_demand_rate([5], 1000) == 5.0\", \"a...
{ "split": "train", "index": 61884, "acecode_id": "bigcode_python_fns_8758", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `modify_deque(operations: List[str]) -> List[str]` that simulates a deque data structure. The function will take a list of operations as input, where each operation is either 'push_front X' to add an element X to the front of the deque, 'push_back X' to add...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_deque(['push_back A', 'push_back B', 'pop_front']) == ['B']\", \"assert modify_deque(['push_front A', 'push_front B', 'push_back C', 'pop_back']) == ['B', 'A']\", \"assert modify_deque(['pop_front']) == []\", \"assert modify_deque(['push_back A', 'pus...
{ "split": "train", "index": 61885, "acecode_id": "evol_33947", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a status code and an optional request body. Your task is to implement a function that returns an HTTP response message based on the status code and the presence of the request body. If the status code is 200, return 'OK'. If the status code is 202 and there is a r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_http_response(200) == 'OK'\", \"assert get_http_response(202, 'Some body') == 'Accepted'\", \"assert get_http_response(202) == 'Error'\", \"assert get_http_response(400) == 'Error'\", \"assert get_http_response(500) == 'Error'\", \"assert get_http_respon...
{ "split": "train", "index": 61886, "acecode_id": "bigcode_python_fns_33777", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a `RestraintManager` that manages restraints in a molecular modeling application. The manager should have the capability to add and delete restraints from a GUI list. Write a function `manage_restraints` that takes the following parameters: a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_restraints(['---'], 3, 5) == ['---']\", \"assert manage_restraints(['---', '---'], 3, 5) == ['---', '---']\", \"assert manage_restraints(['---', '---', '---'], 3, 5) == ['---', '---', '---']\", \"assert manage_restraints([], 3, 0) == []\", \"assert ma...
{ "split": "train", "index": 61887, "acecode_id": "oss_5606", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts the customer ID from a given string representation of JSON data. The function should take a single argument, which is the JSON string, and return the customer ID. If the customer ID is not present in the JSON data or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_customer_id('{\\\"customerId\\\": \\\"CUST12345\\\", \\\"name\\\": \\\"John Doe\\\", \\\"email\\\": \\\"john.doe@example.com\\\"}') == 'CUST12345'\", \"assert extract_customer_id('{\\\"name\\\": \\\"John Doe\\\", \\\"email\\\": \\\"john.doe@example.c...
{ "split": "train", "index": 61888, "acecode_id": "oss_34185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string containing multiple lines of text and returns a set of unique values found in the text. Each line of text may contain leading or trailing whitespace that should be ignored. The first line of the text should be skipped w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_values('Line 1\\\\nValue1\\\\nValue2\\\\nValue1\\\\n Value2 \\\\n Value3\\\\n') == {'Value1', 'Value2', 'Value3'}\", \"assert extract_unique_values('Header\\\\nData1\\\\nData2\\\\nData3\\\\nData1\\\\n') == {'Data1', 'Data2', 'Data3'}\", \"asse...
{ "split": "train", "index": 61889, "acecode_id": "bigcode_python_fns_25246", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset represented as a dictionary where the keys are string identifiers and the values are lists of integers. Your task is to implement a function that converts this dataset into a DataFrame-like structure represented as a list of dictionaries, where each dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_dataset_to_dataframe({'A': [1, 2, 3], 'B': [4, 5, 6]}) == [{'Identifier': 'A', 'Values': [1, 2, 3]}, {'Identifier': 'B', 'Values': [4, 5, 6]}]\", \"assert convert_dataset_to_dataframe({'X': [7], 'Y': [8, 9]}) == [{'Identifier': 'X', 'Values': [7]}, {...
{ "split": "train", "index": 61890, "acecode_id": "bigcode_python_fns_38639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples where each tuple contains a key (a string) and an expiration time (an integer). Write a function called `find_expired_items` that takes this list of tuples and an integer `current_time`. The function should return a list of keys that have expired,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_expired_items([('k1', 1), ('k2', 2), ('k3', 3)], 0) == []\", \"assert find_expired_items([('k1', 1), ('k2', 2), ('k3', 3)], 2) == ['k1']\", \"assert find_expired_items([('k1', 1), ('k2', 2)], 3) == ['k1', 'k2']\", \"assert find_expired_items([('k1', 1),...
{ "split": "train", "index": 61891, "acecode_id": "bigcode_python_fns_3803", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string representation of a chemical formula, your task is to write a function that converts this string into a standardized format where each element is represented by its chemical symbol followed by the number of atoms of that element in the formula. For example, the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert standardize_formula('C6H12O6') == 'C6H12O6'\", \"assert standardize_formula('C2H5OH') == 'C2H6O'\", \"assert standardize_formula('H2O') == 'H2O'\", \"assert standardize_formula('C3H8') == 'C3H8'\", \"assert standardize_formula('C4H10') == 'C4H10'\", \"assert...
{ "split": "train", "index": 61892, "acecode_id": "bigcode_python_fns_3454", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_string_concat(nums)` that takes a list of integers, where each integer is treated as a Unicode code point value. If the integer is negative, add 65536 to it before processing. The function should concatenate the characters corresponding to these Un...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string_concat([65, 66, 67]) == 'CBA'\", \"assert reverse_string_concat([72, 101, 108, 108, 111]) == 'olleH'\", \"assert reverse_string_concat([100, 101, 102]) == 'fed'\", \"assert reverse_string_concat([255]) == '\\u00ff'\", \"assert reverse_string_c...
{ "split": "train", "index": 61893, "acecode_id": "evol_23666", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement the sigmoid activation function, which takes a list of real numbers and returns a new list where each element has been transformed by the sigmoid function. The sigmoid function is defined as: sigmoid(x) = 1 / (1 + exp(-x)). Your function should not handle any derivati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sigmoid_activation([0]) == [0.5]\", \"assert sigmoid_activation([-1]) == [0.268941]\", \"assert sigmoid_activation([1]) == [0.731059]\", \"assert sigmoid_activation([-10]) == [0.000045]\", \"assert sigmoid_activation([10]) == [0.999955]\", \"assert sigmoid_a...
{ "split": "train", "index": 61894, "acecode_id": "bigcode_python_fns_26839", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function that merges two nested dictionaries. If a key exists in both dictionaries, the value from the second dictionary should overwrite the value from the first dictionary. If both values are dictionaries, the function should recursively merge them. If the key exists ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_dicts({'a': 1}, {'b': 2}) == {'a': 1, 'b': 2}\", \"assert merge_dicts({'a': {'b': 1}}, {'a': {'c': 2}}) == {'a': {'b': 1, 'c': 2}}\", \"assert merge_dicts({'x': {'y': 1}}, {'x': {'y': 2}}) == {'x': {'y': 2}}\", \"assert merge_dicts({'a': 1, 'b': 2}, {'...
{ "split": "train", "index": 61895, "acecode_id": "evol_8222", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_trio()` that generates a trio of unique random strings, each consisting of alphanumeric and special characters. Each string should have a specified length. The function should return a list containing these three unique strings. The characters used in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_trio(5) != []\", \"assert len(generate_trio(8)) == 3\", \"assert all(len(s) == 5 for s in generate_trio(5))\", \"assert len(set(generate_trio(6))) == 3\", \"assert len(generate_trio(10)) == 3\", \"assert all(char in string.ascii_letters + string.dig...
{ "split": "train", "index": 61896, "acecode_id": "evol_13360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a caching mechanism for a location lookup system. Your job is to create a function `get_location(location_id, cache)` that simulates fetching a location object based on its unique `location_id`. The `cache` is a dictionary that stores previously...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_location(1, {}) == 'Location 1'\", \"assert get_location(2, {1: 'Location 1'}) == 'Location 2'\", \"assert get_location(1, {1: 'Location 1'}) == 'Location 1'\", \"assert get_location(3, {1: 'Location 1', 2: 'Location 2'}) == 'Location 3'\", \"assert get_...
{ "split": "train", "index": 61897, "acecode_id": "oss_20666", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of text strings, write a Python function to count the number of occurrences of predefined offensive or vulgar words in these strings and identify the indices of the strings in which they appear. The predefined list of offensive words is ['stupid', 'jerk', 'moron']....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abusive_words(['This stupid jerk is a complete moron!', 'jerk is here', 'stupid and moron']) == (6, [1, 2, 3])\", \"assert abusive_words(['No bad words here!', 'Just normal text.']) == (0, [])\", \"assert abusive_words(['stupid', 'jerk', 'moron']) == (3, [1,...
{ "split": "train", "index": 61898, "acecode_id": "evol_24192", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a collection of algorithms and their corresponding databases. Your function will be called `manage_algorithms`. It should take a list of tuples, where each tuple contains an algorithm name and a database name, and it should p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_algorithms([('Sorting', 'MySQL'), ('Searching', 'PostgreSQL'), ('Sorting', 'MongoDB')]) == {'Sorting': 'MongoDB', 'Searching': 'PostgreSQL'}\", \"assert manage_algorithms([('Graph', 'Neo4j'), ('Graph', 'Cassandra'), ('Machine Learning', 'TensorFlow')]...
{ "split": "train", "index": 61899, "acecode_id": "oss_23020", "num_tests": 16 }