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 representing the appetite for different applications, write a function `calculate_total_appetite(appetite_list: List[int]) -> int` that calculates the total appetite by summing all the integers in the list. The function should return the total appetite ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_appetite([1, 2, 3]) == 6\", \"assert calculate_total_appetite([10, -10, 5]) == 5\", \"assert calculate_total_appetite([-1, -2, -3]) == -6\", \"assert calculate_total_appetite([0, 0, 0]) == 0\", \"assert calculate_total_appetite([5]) == 5\", \... | {
"split": "train",
"index": 75100,
"acecode_id": "bigcode_python_fns_17554",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of event names and a list of tags, return the names of events that are associated with the provided tags. If the tags list is empty, return the names of all events. Each event name is a string. Implement a function `filter_events(event_names: List[str], tags: List[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_events(['Speech', 'Workshop', 'Panel'], ['Workshop']) == ['Workshop']\", \"assert filter_events(['Speech', 'Workshop', 'Panel'], ['Speech', 'Panel']) == ['Speech', 'Panel']\", \"assert filter_events(['Speech', 'Workshop', 'Panel'], []) == ['Speech', '... | {
"split": "train",
"index": 75101,
"acecode_id": "bigcode_python_fns_31525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that computes the aggregate of a provided array containing diverse categories of constituents including nested arrays and strings. Numeric strings should be evaluated as numbers, while non-numeric strings should be discarded. Arrays should be explored, and thei... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_aggregate([1, 2, 3, 'a', 'b', [4, 'c', 5], '6', 'z']) == 21\", \"assert compute_aggregate([10, '20', [30, 'forty'], '50']) == 110\", \"assert compute_aggregate(['1', [2, 'three', [4, 'five']]]) == 7\", \"assert compute_aggregate([[], ['a', 'b', 'c'],... | {
"split": "train",
"index": 75102,
"acecode_id": "evol_15627",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function to convert a color from the RGB color model to the HSV color model. The RGB color model is represented by a triplet of integers (r, g, b), with each value ranging from 0 to 255. The HSV color model is represented by a triplet of floating-point numbers (h, s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert RGB_to_HSV(255, 0, 0) == (0.0, 1.0, 1.0)\", \"assert RGB_to_HSV(0, 255, 0) == (120.0, 1.0, 1.0)\", \"assert RGB_to_HSV(0, 0, 255) == (240.0, 1.0, 1.0)\", \"assert RGB_to_HSV(255, 255, 0) == (60.0, 1.0, 1.0)\", \"assert RGB_to_HSV(0, 255, 255) == (180.0, 1.0,... | {
"split": "train",
"index": 75103,
"acecode_id": "evol_13796",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom n-gram processing function that incorporates vector quantization and normalization techniques. Your function should take three parameters: 'vocab_size' (an integer representing the vocabulary size), 'embedding_dim' (an integer representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_ngram_layer(10000, 256, 'batch') == 'Ngrammer Layer: vocab_size=10000, embedding_dim=256, normalization=batch'\", \"assert create_ngram_layer(5000, 128, 'layer') == 'Ngrammer Layer: vocab_size=5000, embedding_dim=128, normalization=layer'\", \"assert ... | {
"split": "train",
"index": 75104,
"acecode_id": "oss_31205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of weights represented as floating-point numbers, write a function that checks if the sum of the weights is equal to 1.0. The function should return True if the sum equals 1.0, otherwise, it should return False. The input list can contain both positive and negative... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_weights([0.5, 0.5]) == True\", \"assert check_weights([1.0]) == True\", \"assert check_weights([]) == False\", \"assert check_weights([-0.5, 1.5]) == True\", \"assert check_weights([0.25, 0.25, 0.25, 0.25]) == True\", \"assert check_weights([0.1, 0.2, ... | {
"split": "train",
"index": 75105,
"acecode_id": "bigcode_python_fns_21520",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with organizing a list of body part identifiers into a structured format. Each identifier follows a naming convention where the body part name is followed by a number indicating the level of detail. Your goal is to implement a function `map_body_parts(identifiers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_body_parts(['RightHandPinky1', 'RightHandPinky2', 'RightHandPinky3', 'LeftFootThumb1', 'LeftFootThumb2']) == {'RightHandPinky': ['RightHandPinky1', 'RightHandPinky2', 'RightHandPinky3'], 'LeftFootThumb': ['LeftFootThumb1', 'LeftFootThumb2']}\", \"assert ... | {
"split": "train",
"index": 75106,
"acecode_id": "oss_32829",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes different computing environments based on a given mode. The function should take in a string representing the mode of computing environment and return a list of Mount objects based on the mode. The modes are 'loc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(get_mounts('local')) == 3\", \"assert len(get_mounts('docker')) == 3\", \"assert len(get_mounts('ec2')) == 3\", \"assert get_mounts('local')[0].mount_type == 'code'\", \"assert get_mounts('local')[1].mount_type == 'data'\", \"assert get_mounts('ec2')[1].... | {
"split": "train",
"index": 75107,
"acecode_id": "oss_20279",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether three given semi-axes can form a valid ellipsoid in 3D space. An ellipsoid can be defined by three semi-axes: a, b, and c. The function should take three positive integers as input, representing the lengths of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_ellipsoid(1, 2, 3) == True\", \"assert is_valid_ellipsoid(2, 2, 2) == True\", \"assert is_valid_ellipsoid(5, 10, 15) == True\", \"assert is_valid_ellipsoid(0, 2, 3) == False\", \"assert is_valid_ellipsoid(1, 0, 3) == False\", \"assert is_valid_ellip... | {
"split": "train",
"index": 75108,
"acecode_id": "oss_23341",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that selects an appropriate mover based on a given URL. The function, named `select_mover`, should take a URL as input and return a string indicating the type of mover that would handle the URL based on the following rules: \n1. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_mover('file://path/to/file.txt') == 'LocalObjectstoreSiteMover'\", \"assert select_mover('s3://bucket-name/file.txt') == 'S3ObjectstoreSiteMover'\", \"assert select_mover('azure://container-name/file.txt') == 'AzureObjectstoreSiteMover'\", \"assert se... | {
"split": "train",
"index": 75109,
"acecode_id": "oss_33007",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that removes all duplicate values from the list while maintaining the order of the remaining elements. The function should take a single parameter, which is the list of integers, and return a new list containing only the unique element... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([4, 5, 6, 4, 5, 6]) == [4, 5, 6]\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([10, 20, 20, 30, 10]) =... | {
"split": "train",
"index": 75110,
"acecode_id": "bigcode_python_fns_47258",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the median of a list after removing the two smallest distinct numbers. If the list has less than three distinct numbers, the function should raise a ValueError with the message 'Array should contain at least 3 distinct numbers'. Additionally... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_median([1, 2, 3, 4, 5]) == 4\", \"assert calculate_median([5, 3, 1, 2, 4]) == 4\", \"assert calculate_median([10, 20, 30, 40, 50]) == 40\", \"assert calculate_median([7, 8, 9]) == 9\", \"assert calculate_median([6, 2, 1, 4, 3]) == 4\", \"assert cal... | {
"split": "train",
"index": 75111,
"acecode_id": "evol_10951",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts information from a string representing a publication field. The input string may contain the following information: place of publication, publisher name, and year of publication. Your function should parse the input string a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_publication_info('New York: Penguin 2021') == {'place': 'New York', 'publisher': 'Penguin', 'year': '2021'}\", \"assert extract_publication_info('Tokyo: Kodansha') == {'place': 'Tokyo', 'publisher': 'Kodansha', 'year': None}\", \"assert extract_publi... | {
"split": "train",
"index": 75112,
"acecode_id": "bigcode_python_fns_13899",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple authentication flow. Write a Python function called `simulate_authentication` that takes no arguments. The function should randomly simulate the outcome of an authentication process which can either succeed ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_authentication() in ['Authenticated Session', 'Invalid client error occurred', 'Missing token error occurred']\", \"assert simulate_authentication() in ['Authenticated Session', 'Invalid client error occurred', 'Missing token error occurred']\", \"a... | {
"split": "train",
"index": 75113,
"acecode_id": "oss_19115",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents the text of a user interface (UI) widget. Your task is to implement a function `get_text_from_widget(widgets: List[str], index: int) -> str` that returns the text of the widget at the specified index. If the index is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_text_from_widget(['Hello', 'World', 'Test'], 0) == 'Hello'\", \"assert get_text_from_widget(['Hello', 'World', 'Test'], 1) == 'World'\", \"assert get_text_from_widget(['Hello', 'World', 'Test'], 2) == 'Test'\", \"assert get_text_from_widget(['Hello', 'Wo... | {
"split": "train",
"index": 75114,
"acecode_id": "bigcode_python_fns_47909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_duplicates(nums)` that returns a list of all duplicate integers found in the input list. The order of the duplicates in the output list should be the same as their first occurrence in the input list. If there are no duplicates, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 1]) == [1]\", \"assert find_duplicates([4, 5, 6, 7, 8, 4, 5]) == [4, 5]\", \"assert find_duplicates([]) == []\", \"assert find_duplicates([1, 2, 3, 4]) == []\", \"assert find_duplicates([1, 1, 1, 1]) == [1]\", \"assert find_duplicat... | {
"split": "train",
"index": 75115,
"acecode_id": "bigcode_python_fns_20914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a spam detection function. The function should analyze user-generated content and determine if it is spam or not based on the provided parameters: author, email, body, user_ip, user_agent, url, referrer, and blog_domain. The function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_spam('user1', 'user1@spam.com', 'This is a test message', '192.168.1.2', 'Mozilla/5.0', 'http://example.com', 'unknown', 'example.com') == True\", \"assert is_spam('user2', 'user2@gmail.com', 'Buy now and get 50% off', '192.168.1.3', 'Mozilla/5.0', 'http:... | {
"split": "train",
"index": 75116,
"acecode_id": "oss_2390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a variable `src_tokens` that can either be a tuple or a single object. If `src_tokens` is a tuple, it contains at least one element, and you need to return the first element of the tuple. If `src_tokens` is not a tuple, return it as is. Implement a function `get_f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_first_element((1, 2, 3)) == 1\", \"assert get_first_element(('a', 'b', 'c')) == 'a'\", \"assert get_first_element((True, False)) == True\", \"assert get_first_element((1.1, 2.2)) == 1.1\", \"assert get_first_element((None, 42)) == None\", \"assert get_fi... | {
"split": "train",
"index": 75117,
"acecode_id": "bigcode_python_fns_13465",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `word`, implement a function `normalize_word(word: str) -> str` that normalizes the input word based on the following rules: 1) If the word is an acronym consisting of uppercase letters followed by a period (e.g., 'U.S.A.'), remove the periods and return the acro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_word('U.S.A.') == 'USA'\", \"assert normalize_word('hello') == 'greetings'\", \"assert normalize_word('HELLO') == 'GREETINGS'\", \"assert normalize_word('Hello') == 'Greetings'\", \"assert normalize_word('A.B.C.') == 'ABC'\", \"assert normalize_wor... | {
"split": "train",
"index": 75118,
"acecode_id": "bigcode_python_fns_9636",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sets a global configuration for a system. The function `set_global_configuration(config)` accepts a single parameter `config`, which is a dictionary that contains key-value pairs representing various configuration settings. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_global_configuration({'setting1': 'value1'}) == {'setting1': 'value1'}\", \"assert set_global_configuration({'feature_enabled': True}) == {'feature_enabled': True}\", \"assert set_global_configuration({'timeout': 30, 'retries': 5}) == {'timeout': 30, 're... | {
"split": "train",
"index": 75119,
"acecode_id": "bigcode_python_fns_16172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given string ends with the substring 'py'. The function should return True if it does, and False otherwise. The input string can contain any characters and may be of any length, including an empty string.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ends_with_py('hello worldpy') == True\", \"assert ends_with_py('python') == False\", \"assert ends_with_py('myp') == False\", \"assert ends_with_py('') == False\", \"assert ends_with_py('abcdepy') == True\", \"assert ends_with_py('testpy') == True\", \"asser... | {
"split": "train",
"index": 75120,
"acecode_id": "evol_31570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that maps 3D coordinates (x, y, z) to specific items. Your task is to implement a function that converts this dictionary into a list of tuples, where each tuple contains the coordinates and the corresponding item. The output should be a list of tuples... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_node_dict_to_list({(1, 2, 3): 'item1', (0, 1, 2): 'item2'}) == [(0, 1, 2, 'item2'), (1, 2, 3, 'item1')]\", \"assert convert_node_dict_to_list({(0, 0, 0): 'air', (0, 0, 1): 'door'}) == [(0, 0, 0, 'air'), (0, 0, 1, 'door')]\", \"assert convert_node_dic... | {
"split": "train",
"index": 75121,
"acecode_id": "bigcode_python_fns_44296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a permission system for a web application. Each user can have various permissions for different resources defined as pairs of strings. You need to implement the function `has_permission(permissions, resource, permission)` that checks if a user h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_permission([('file1', 'read'), ('file2', 'write')], 'file1', 'read') == True\", \"assert has_permission([('file1', 'read'), ('file2', 'write')], 'file1', 'write') == False\", \"assert has_permission([('file1', 'read'), ('file2', 'write')], 'file2', 'writ... | {
"split": "train",
"index": 75122,
"acecode_id": "oss_14293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a circular integer array `nums`, return an array where each element at index `i` is replaced by the first smaller number to its traversing-order next in the array. If no smaller number exists, replace it with `-1`. The array is circular, meaning the next element of `nums[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_smaller_elements([3,2,3]) == [2,-1,2]\", \"assert next_smaller_elements([4,3,2,1,2]) == [3,2,1,-1,1]\", \"assert next_smaller_elements([5,4,3,2,1]) == [4,3,2,1,-1]\", \"assert next_smaller_elements([10,1,10,1]) == [1,-1,1,-1]\", \"assert next_smaller_el... | {
"split": "train",
"index": 75123,
"acecode_id": "evol_31269",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of astronomical observations, where each observation is represented as a dictionary with keys 'ra', 'dec', and 'band'. Your task is to fit parameters for these observations based on their coordinates and band. The fitting process will append the fitted para... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fit_parameters([{'ra': 1.0, 'dec': 2.0, 'band': 'g'}]) == [{'tau': 0.5, 'sigma': 0.1, 'band': 'g', 'ra': 1.0, 'dec': 2.0}]\", \"assert fit_parameters([{'ra': 3.0, 'dec': 4.0, 'band': 'r'}]) == [{'tau': 0.6, 'sigma': 0.2, 'band': 'r', 'ra': 3.0, 'dec': 4.0}]\... | {
"split": "train",
"index": 75124,
"acecode_id": "bigcode_python_fns_44369",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a grid representing a 2D game board, where each cell is represented by a character. The grid is represented as a list of strings, where each string represents a row of the grid. Among the characters, 'M' represents mines, while any other printable character repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_mines(['M', 'M', 'M']) == ['M', 'M', 'M']\", \"assert count_mines(['X', 'X', 'X']) == ['0', '0', '0']\", \"assert count_mines(['X', 'M']) == ['1', 'M']\", \"assert count_mines(['M', 'X']) == ['M', '1']\", \"assert count_mines(['X', 'M', 'X']) == ['1', ... | {
"split": "train",
"index": 75125,
"acecode_id": "oss_16743",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a variable number of arguments representing the names of new idols to be added to a group. The function should return a list of strings formatted as 'Idol {index}: {name}' where {index} is the 1-based index of the idol in the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_new_idol('Alice', 'Bob', 'Charlie') == ['Idol 1: Alice', 'Idol 2: Bob', 'Idol 3: Charlie']\", \"assert insert_new_idol('Diana') == ['Idol 1: Diana']\", \"assert insert_new_idol('Eve', 'Frank') == ['Idol 1: Eve', 'Idol 2: Frank']\", \"assert insert_new... | {
"split": "train",
"index": 75126,
"acecode_id": "bigcode_python_fns_33001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes a string of code as input and returns a modified string with all brackets matched. If there are unmatched brackets, the function should return a string indicating the number of unmatched brackets and the type of bracket ('()', '{}', or '[]'). The in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_brackets('function() { return [x]; }') == 'All brackets matched.'\", \"assert match_brackets('function() { return (x;') == '1 unmatched bracket: ('\", \"assert match_brackets('function() { }') == 'All brackets matched.'\", \"assert match_brackets('((()... | {
"split": "train",
"index": 75127,
"acecode_id": "evol_7621",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `user_registration(user_info: Dict[str, Any]) -> str` that simulates the registration of a user by accepting a dictionary containing user information, such as username and email. The function should return a success message if the registration is successful... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_registration({'username': 'testuser1', 'email': 'testuser1@example.com'}) == 'User registered successfully!'\", \"assert user_registration({'username': 'john_doe', 'email': 'john@example.com'}) == 'User registered successfully!'\", \"assert user_registr... | {
"split": "train",
"index": 75128,
"acecode_id": "evol_35621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a caching mechanism for a bibliographic record. Write a function `update_cache` that takes a string `opis_bibliograficzny` as input and returns a new string that updates the input based on the following rules: 1. If the input string contains the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_cache('John NOWAK, Anna KOWALSKI') == 'John SMITH, Anna JOHNSON'\", \"assert update_cache('NOWAK') == 'SMITH'\", \"assert update_cache('KOWALSKI') == 'JOHNSON'\", \"assert update_cache('No names here') == 'No names here'\", \"assert update_cache('NOWA... | {
"split": "train",
"index": 75129,
"acecode_id": "oss_10081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of dictionaries representing election candidates based on the office they are seeking. Each dictionary contains the candidate's ID, name, and the office they are seeking. Write a function `filter_candidates_by_offi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_candidates_by_office([], 'Mayor') == []\", \"assert filter_candidates_by_office([{'id': '1', 'name': 'Alice', 'office_sought': 'Mayor'}], 'Mayor') == [{'id': '1', 'name': 'Alice', 'office_sought': 'Mayor'}]\", \"assert filter_candidates_by_office([{'i... | {
"split": "train",
"index": 75130,
"acecode_id": "oss_10429",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that sorts the strings in ascending order based on their computed numerical value. The numerical value of a string is calculated by adding up the Unicode values of all its characters. If two strings have the same numerical value, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings_by_value(['abc', 'ab', 'a']) == ['a', 'ab', 'abc']\", \"assert sort_strings_by_value(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert sort_strings_by_value(['z', 'y', 'x']) == ['x', 'y', 'z']\", \"assert sort_strings_by_value(['aaa', 'aa', 'a']) ... | {
"split": "train",
"index": 75131,
"acecode_id": "evol_23246",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `advanced_rearrange(string: str) -> str` that rearranges the characters in the string such that they are in non-decreasing order. If the string is already sorted, return it as is. If the rearrangement is not possible by simple character swap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_rearrange('aaa') == 'aaa'\", \"assert advanced_rearrange('abcdef') == 'abcdef'\", \"assert advanced_rearrange('aabbcc') == 'aabbcc'\", \"assert advanced_rearrange('abcde') == 'abcde'\", \"assert advanced_rearrange('a') == 'a'\", \"assert advanced_re... | {
"split": "train",
"index": 75132,
"acecode_id": "evol_36119",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple configuration management system. Implement a function `manage_config(operations)` that takes a list of operations and returns the results of `get_config` calls. The operations can be of three types: `set_config(key, value)`, `get_config(key... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_config([['set_config', 'username', 'john_doe'], ['get_config', 'username']]) == ['john_doe']\", \"assert manage_config([['set_config', 'username', 'john_doe'], ['set_config', 'password', 'secretpassword'], ['get_config', 'password']]) == ['secretpassw... | {
"split": "train",
"index": 75133,
"acecode_id": "oss_18788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a log entry. The log entry should contain a message, an author, and an optional creation time. If the creation time is not provided, it should default to the string 'now'. The function should accept the following parameters... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_log_entry('System started', 'Admin') == {'message': 'System started', 'author': 'Admin', 'created_at': 'now'}\", \"assert create_log_entry('User logged in', 'User123') == {'message': 'User logged in', 'author': 'User123', 'created_at': 'now'}\", \"ass... | {
"split": "train",
"index": 75134,
"acecode_id": "bigcode_python_fns_42395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing module names. Your task is to implement a function `is_blacklisted_module(module: str, blacklist: List[str]) -> bool` that returns `True` if the given module name matches any pattern in the blacklist, and `False` otherwise. The black... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_blacklisted_module('abc', ['a*', 'b*', 'c*']) == True\", \"assert is_blacklisted_module('def', ['a*', 'b*', 'c*']) == False\", \"assert is_blacklisted_module('test_mod', ['*mod', 'test*']) == True\", \"assert is_blacklisted_module('module', ['*le', 'mod*'... | {
"split": "train",
"index": 75135,
"acecode_id": "bigcode_python_fns_5852",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of several buildings. Your task is to write a function that returns a list of integers representing the maximum height of buildings that can be seen when looking from the left side. A building can be seen from the left i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert visible_buildings([3, 1, 4, 1, 5]) == [3, 0, 4, 0, 5]\", \"assert visible_buildings([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert visible_buildings([4, 3, 2, 1]) == [4, 0, 0, 0]\", \"assert visible_buildings([2, 3, 2, 3, 4]) == [2, 3, 0, 0, 4]\", \"assert visibl... | {
"split": "train",
"index": 75136,
"acecode_id": "bigcode_python_fns_19290",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary search tree (BST), implement a function that finds the lowest common ancestor (LCA) of two given nodes in the tree. The function should take three parameters: the root node of the BST and the two nodes for which the LCA needs to be found. If either of the nodes d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_LCA(root, 10, 14).value == 12\", \"assert find_LCA(root, 10, 8).value == 8\", \"assert find_LCA(root, 8, 4).value == 8\", \"assert find_LCA(None, 10, 14) == None\", \"assert find_LCA(root, 4, 8).value == 8\", \"assert find_LCA(root, 22, 22) == None\", \... | {
"split": "train",
"index": 75137,
"acecode_id": "evol_24771",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that takes a string representing JSON data and returns the corresponding dictionary. The string will be well-formed and contain valid JSON. Implement the function `parse_json_string(json_string: str) -> dict:`. The function should handle decodin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_json_string('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}') == {'name': 'Alice', 'age': 30}\", \"assert parse_json_string('{\\\"is_student\\\": false, \\\"courses\\\": [\\\"math\\\", \\\"science\\\"]}') == {'is_student': False, 'courses': ['math', 's... | {
"split": "train",
"index": 75138,
"acecode_id": "bigcode_python_fns_16557",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a date in RFC 3339 format (e.g., '2023-03-25T13:45:30Z'), write a function that checks if the date is valid according to the RFC 3339 specification. The function should return True if the date is valid, and False otherwise. If the input string is emp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert coerce_rfc_3339_date('2023-03-25T13:45:30Z') == True\", \"assert coerce_rfc_3339_date('2020-02-29T00:00:00Z') == True\", \"assert coerce_rfc_3339_date('2021-02-29T00:00:00Z') == False\", \"assert coerce_rfc_3339_date('2023-04-31T12:00:00Z') == False\", \"ass... | {
"split": "train",
"index": 75139,
"acecode_id": "bigcode_python_fns_7751",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, `nums`, and an array of `requests` where each request is represented as a pair of indices `[starti, endi]`, write a function that returns the maximum total product of all requests among all permutations of `nums`. The product of any two adjacent elem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product([1, 2, 3, 4, 5, 6], [[0, 1]]) == 30\", \"assert max_product([10, 5, 2, 1], [[0, 1], [2, 3]]) == 100\", \"assert max_product([1, 1, 1, 1], [[0, 3]]) == 1\", \"assert max_product([6, 5], [[0, 1]]) == 30\", \"assert max_product([1], [[0, 0]]) == 1\"... | {
"split": "train",
"index": 75140,
"acecode_id": "evol_29135",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing quotes in a group chat. Your goal is to implement a function `manage_quotes` that takes two arguments: a list of strings `commands` and a string `chat_id`. The `commands` list contains commands that either add a quote or recall a random quote. The c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_quotes(['#quote 1', '#recall'], 'chat1') == ['1']\", \"assert manage_quotes(['#quote 2', '#quote 3', '#recall'], 'chat1') == ['2']\", \"assert manage_quotes(['#recall'], 'chat1') == ['No quotes saved for this group.']\", \"assert manage_quotes(['#reca... | {
"split": "train",
"index": 75141,
"acecode_id": "oss_36059",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of class names and returns a string representation of a Python module which includes the specified classes and ensures that they are accessible to other modules using the `__all__` attribute. The function should acce... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_module_code(['SOLO', 'GIMVI', 'RNAStereoscope', 'SpatialStereoscope', 'CellAssign']) == \\\"class SOLO:\\\\n pass\\\\n\\\\nclass GIMVI:\\\\n pass\\\\n\\\\nclass RNAStereoscope:\\\\n pass\\\\n\\\\nclass SpatialStereoscope:\\\\n pass\\\\n\... | {
"split": "train",
"index": 75142,
"acecode_id": "oss_35027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_email(email: str) -> str` that checks the validity of an email address. The email address must match the standard email format using regular expressions and must also have a domain that belongs to a pre-approved list of domains: ['example.com', 't... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('user@example.com') == 'Valid email.'\", \"assert validate_email('user@test.com') == 'Valid email.'\", \"assert validate_email('user@notallowed.com') == 'Invalid email.'\", \"assert validate_email('user@.com') == 'Invalid email.'\", \"assert v... | {
"split": "train",
"index": 75143,
"acecode_id": "evol_28148",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the coefficients of two linear equations in the form ax + by = c, where a1, b1, c1 are the coefficients of the first equation and a2, b2, c2 are the coefficients of the second equation, implement a function that returns the solution as a tuple (x, y) if there is a unique ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve_linear_system(1, 1, 2, 2, 2, 4) == 'Infinite Solutions'\", \"assert solve_linear_system(1, 2, 3, 2, 4, 6) == 'Infinite Solutions'\", \"assert solve_linear_system(0, 0, 0, 0, 0, 0) == 'Infinite Solutions'\", \"assert solve_linear_system(1, -1, 0, 1, -1,... | {
"split": "train",
"index": 75144,
"acecode_id": "evol_938",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a race result in the format 'Name: Time', where 'Name' is the name of the racer and 'Time' is their finishing time in the format 'MM:SS', write a function that extracts the names of racers who finished in under 5 minutes. The function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_fast_racers(['Alice: 04:50', 'Bob: 05:10', 'Charlie: 03:45']) == ['Alice', 'Charlie']\", \"assert extract_fast_racers(['David: 06:00', 'Eve: 07:30']) == []\", \"assert extract_fast_racers(['Frank: 04:59', 'Grace: 05:00', 'Hank: 03:50']) == ['Frank', ... | {
"split": "train",
"index": 75145,
"acecode_id": "bigcode_python_fns_28413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of elements, return a list containing only the unique elements from the input list while maintaining the order of their first occurrence. A unique element is defined as an element that appears only once in the list. Write a function `unique_elements(lst: List[int])... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([1, 2, 1, 3]) == [2, 3]\", \"assert unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([1, 1, 1, 1]) == []\", \"assert unique_elements([5, 6, 5, 7, 8, 6]) == [7,... | {
"split": "train",
"index": 75146,
"acecode_id": "bigcode_python_fns_17452",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer `num`, write a function that converts this decimal number into its equivalent octal representation and returns it as a string. The octal representation should not contain any leading zeros. For example, if the input is `8`, the output should be `'10... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decimal_to_octal(0) == '0'\", \"assert decimal_to_octal(1) == '1'\", \"assert decimal_to_octal(7) == '7'\", \"assert decimal_to_octal(8) == '10'\", \"assert decimal_to_octal(9) == '11'\", \"assert decimal_to_octal(15) == '17'\", \"assert decimal_to_octal(16)... | {
"split": "train",
"index": 75147,
"acecode_id": "bigcode_python_fns_25028",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the addition of a new column to a users table in a database migration script. The table `users` has the following columns: `id` (Integer, Primary Key), `username` (String, Unique), and `email` (String, Unique). You need... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_is_admin_column() == ['id', 'username', 'email', 'is_admin']\", \"assert add_is_admin_column() != ['id', 'username', 'email']\", \"assert 'is_admin' in add_is_admin_column()\", \"assert len(add_is_admin_column()) == 4\", \"assert add_is_admin_column().co... | {
"split": "train",
"index": 75148,
"acecode_id": "oss_24454",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary contains a 'frames' key that maps to a list of integers representing frame numbers. Your task is to implement a function `extract_frames(collection: List[Dict[str, List[int]]]) -> List[int]` that extracts all the frame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_frames([{'frames': [1, 2, 3]}, {'frames': [4, 5]}]) == [1, 2, 3, 4, 5]\", \"assert extract_frames([{'frames': []}, {'frames': []}]) == []\", \"assert extract_frames([{'frames': [10, 20]}, {'frames': [30]}]) == [10, 20, 30]\", \"assert extract_frames(... | {
"split": "train",
"index": 75149,
"acecode_id": "bigcode_python_fns_47144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of mixed type elements that can include strings, integers, floats, and sublists, implement a function `smallest_string(mixed_list)` that retrieves the smallest alphanumeric string from the array. Alphanumeric strings are those composed of letters and numbers, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_string(['123', 'A2', 'B34', '2G1A', 'Code', 'Words', '789A', 222, 0.2, ['Sublist', 12]]) == '123'\", \"assert smallest_string(['abc', 'ABC', 'Abc']) == 'ABC'\", \"assert smallest_string(['a', 'b', 'c']) == 'a'\", \"assert smallest_string(['xyz', 'xy... | {
"split": "train",
"index": 75150,
"acecode_id": "evol_29715",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that processes a tree structure representing a mutation operation in a programming language. The tree is represented as an object with a 'type' and 'children' attributes. Your function should accept a tree object and return a dictionary th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_mutation(Tree('mutation', [Token('value1')])) == {'$OBJECT': 'mutation', 'mutation': 'value1', 'arguments': []}\", \"assert process_mutation(Tree('mutation', [])) == {'$OBJECT': 'mutation', 'mutation': None, 'arguments': []}\", \"assert process_mutat... | {
"split": "train",
"index": 75151,
"acecode_id": "bigcode_python_fns_9388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words representing a multi-word domain name. Your task is to transform this list into a valid domain name string by joining the words with underscores, converting all characters to lowercase, and prefixing the string with 'DOMAIN_NAME=' and suffixing it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_domain_name(['United', 'States', 'of', 'America']) == \\\"NODE_TYPE=domain; DOMAIN_NAME='united_states_of_america'\\\"\", \"assert create_domain_name(['Hello', 'World']) == \\\"NODE_TYPE=domain; DOMAIN_NAME='hello_world'\\\"\", \"assert create_domain_... | {
"split": "train",
"index": 75152,
"acecode_id": "bigcode_python_fns_4462",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `normalize_list(arr)` that normalizes the values in the list by subtracting the mean of the list from each element. The mean should be calculated as the average of all elements in the list. The function should return a new list contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_list([1, 2, 3, 4, 5]) == [-2.0, -1.0, 0.0, 1.0, 2.0]\", \"assert normalize_list([10, 20, 30]) == [-10.0, 0.0, 10.0]\", \"assert normalize_list([-1, 0, 1]) == [-1.0, 0.0, 1.0]\", \"assert normalize_list([0]) == [0.0]\", \"assert normalize_list([]) =... | {
"split": "train",
"index": 75153,
"acecode_id": "bigcode_python_fns_6869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists, `hits` and `annotations`. The `hits` list contains pairs of sequence IDs and their corresponding percentage identity values, while the `annotations` list contains mapping of sequence IDs to their genus and species. Your task is to implement a function `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_sequences([('seq1', 99.5), ('seq2', 95.0)], [('seq1', 'GenusA', 'SpeciesA'), ('seq3', 'GenusB', 'SpeciesB')]) == [('seq1', 99.5, 'GenusA', 'SpeciesA')]\", \"assert match_sequences([('seq1', 90.0)], [('seq1', 'GenusC', 'SpeciesC'), ('seq2', 'GenusD', 'S... | {
"split": "train",
"index": 75154,
"acecode_id": "bigcode_python_fns_12689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sorted arrays, write a function to find the common elements that exist in both arrays. Implement your function without using built-in intersect functions. The solution should have a time complexity lower than O(n^2).\nPlease reason step by step, then write a self-cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_common_elements([1, 2, 5, 8, 9, 10], [2, 5, 6, 9]) == [2, 5, 9]\", \"assert find_common_elements([1, 3, 4, 5], [2, 3, 5, 7]) == [3, 5]\", \"assert find_common_elements([10, 20, 30], [15, 20, 25, 30]) == [20, 30]\", \"assert find_common_elements([], [1, ... | {
"split": "train",
"index": 75155,
"acecode_id": "evol_7684",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the maximum subarray sum in a list of integers, with the constraint that the subarray must have a minimum length of 2. The function should return the maximum subarray sum that meets this criterion.\nPlease reason step by step, then write a self-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, 3, 1, -4]) == 4\", \"assert max_subarray_sum([1, 2, 3, 4]) == 10\", \"assert max_subarray_sum([5, -1, 2, 3]) == 9\", \"assert max_subarray_sum([-1, 0, 1, 2]) == 3\", \"assert max_subarray_sum([4, -1, 2, 1]) == 6\", \"assert max_subarray... | {
"split": "train",
"index": 75156,
"acecode_id": "evol_22085",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the largest prime factor of a given float number, which can be positive, negative, or a decimal. The input is guaranteed to have an absolute value greater than 1, and it is not a prime number. You should process the number to find its prime fac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert accurate_largest_prime_factor(2048.12) == 2\", \"assert accurate_largest_prime_factor(100.5) == 5\", \"assert accurate_largest_prime_factor(-100.5) == 5\", \"assert accurate_largest_prime_factor(-45.25) == 5\", \"assert accurate_largest_prime_factor(75.3) ==... | {
"split": "train",
"index": 75157,
"acecode_id": "evol_1056",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the sum of the cubes of integers within a given range. The function should take three parameters: `lo` (lower bound of the range, inclusive), `hi` (upper bound of the range, inclusive), and `p` (the power to which e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_cubes(1, 1) == 1\", \"assert sum_of_cubes(1, 2) == 9\", \"assert sum_of_cubes(1, 3) == 36\", \"assert sum_of_cubes(2, 2) == 8\", \"assert sum_of_cubes(2, 3) == 35\", \"assert sum_of_cubes(1, 4) == 100\", \"assert sum_of_cubes(3, 3) == 27\", \"assert s... | {
"split": "train",
"index": 75158,
"acecode_id": "oss_8010",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that describes various devices and their associated middleware. Your task is to implement a function that processes this configuration and returns a list of meter reader nodes. Each meter reader node should be constructed based on the de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_configuration({'devices': {}, 'middleware': {'type': 'volkszaehler', 'middleware_url': 'http://example.com'}}) == []\", \"assert map_configuration({'devices': {'2': {'id': 'meter2', 'protocol': 'PLAIN', 'channels': {'humidity': {'uuid': '456', 'interval'... | {
"split": "train",
"index": 75159,
"acecode_id": "bigcode_python_fns_45661",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns all prime Fibonacci numbers within a specified range. The function should take two integer parameters, `start` and `end`. If no range is provided, the function should default to returning prime Fibonacci numbers from 1 to 100. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_fibonacci(1, 100) == [2, 3, 5, 13, 89]\", \"assert prime_fibonacci(10, 100) == [13, 89]\", \"assert prime_fibonacci(100, 200) == []\", \"assert prime_fibonacci(0, 50) == [2, 3, 5, 13]\", \"assert prime_fibonacci(50, 150) == [89]\", \"assert prime_fibon... | {
"split": "train",
"index": 75160,
"acecode_id": "evol_8076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that accepts a one-dimensional dictionary as input. Return a list of all the keys whose associated values are of type integer and greater than 50. The dictionary may contain a mix of other datatypes.\nPlease reason step by step, then write a self-contained Py... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_keys_with_large_ints({'a': 100, 'b': 'hello', 'c': 51, 'd': 20}) == ['a', 'c']\", \"assert find_keys_with_large_ints({'k1': 60, 'k2': 45, 'k3': 70, 'k4': 'test'}) == ['k1', 'k3']\", \"assert find_keys_with_large_ints({'x': 10, 'y': 80, 'z': 40}) == ['y'... | {
"split": "train",
"index": 75161,
"acecode_id": "evol_23323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, each representing a rule hierarchy. Each rule hierarchy contains two keys: 'rules' and 'rule_homomorphisms'. The 'rules' key maps a string (the name of the graph) to another dictionary representing a rule, while the 'rule_homomorphisms' key maps ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compose_rule_hierarchies({'rules': {}, 'rule_homomorphisms': {}}, {}, {}, {'rules': {}, 'rule_homomorphisms': {}}, {}, {}) == ({'rules': {}, 'rule_homomorphisms': {}}, {}, {})\", \"assert compose_rule_hierarchies({'rules': {'C': {}}, 'rule_homomorphisms': {}... | {
"split": "train",
"index": 75162,
"acecode_id": "bigcode_python_fns_7834",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a search function for a simplified search algorithm. The function `search_custom` takes two parameters: `params`, a dictionary containing search parameters, and `args`, a list of additional arguments for the search. The `params` dictionary conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_custom({'query': 'a', 'filters': [], 'limit': 3}, []) == ['apple', 'banana', 'grape']\", \"assert search_custom({'query': 'berry', 'filters': [], 'limit': 2}, []) == []\", \"assert search_custom({'query': 'a', 'filters': ['banana'], 'limit': 2}, []) =... | {
"split": "train",
"index": 75163,
"acecode_id": "oss_33991",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of messages, where each message is represented as a dictionary containing details about the message. Your task is to group these messages based on a specific grouping function. The grouping function takes a message as input and returns a key by which to gro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_messages(lambda msg: msg['type'], [{'type': 'A', 'is_complete': True}, {'type': 'B', 'is_complete': True}, {'type': 'A', 'is_complete': True}]) == {'A': [{'type': 'A', 'is_complete': True}, {'type': 'A', 'is_complete': True}], 'B': [{'type': 'B', 'is_c... | {
"split": "train",
"index": 75164,
"acecode_id": "bigcode_python_fns_24346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers `features`, where each inner list represents a vector of features for a sample, write a function `gram_matrix(features)` that calculates the Gram matrix of the feature representation matrix. The Gram matrix is defined as the dot product of the featur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gram_matrix([[1]]) == [[1]]\", \"assert gram_matrix([[1, 2], [3, 4]]) == [[5, 11], [11, 25]]\", \"assert gram_matrix([[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert gram_matrix([[1, 2, 3], [4, 5, 6]]) == [[14, 32], [32, 77]]\", \"assert gram_matrix([[1, 0]... | {
"split": "train",
"index": 75165,
"acecode_id": "bigcode_python_fns_48562",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates pagination for a list of quotes stored in memory. The function should accept two parameters: a list of quotes and an integer page number, and it should return a list of quotes for that specific page. Each page should contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_quotes_by_page(['Quote 1', 'Quote 2', 'Quote 3'], 1) == ['Quote 1', 'Quote 2']\", \"assert get_quotes_by_page(['Quote 1', 'Quote 2', 'Quote 3'], 2) == ['Quote 3']\", \"assert get_quotes_by_page(['Quote 1', 'Quote 2', 'Quote 3'], 3) == []\", \"assert get_... | {
"split": "train",
"index": 75166,
"acecode_id": "oss_10315",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a class called `SquirtGag` that represents a gag used in a game to combat enemies. The `SquirtGag` class should have the following attributes: `propType`, `modelPath`, `damage`, `startSfx`, `loopSfx`, `endSfx`, `animName`, and `healPoints`. Addition... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert SquirtGag('WaterGun', 'path/to/water-gun.model', 12, 'null', 'watergun_loop', 'null', 'squirt', 5).propType == 'WaterGun'\", \"assert SquirtGag('WaterGun', 'path/to/water-gun.model', 12, 'null', 'watergun_loop', 'null', 'squirt', 5).modelPath == 'path/to/wat... | {
"split": "train",
"index": 75167,
"acecode_id": "oss_29376",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_max_value(input_list)` that takes a list of mixed data types, including integers, floats, strings (representing numbers), and nested lists. Your function should find and return the maximum numerical value from this list, considering all levels of nest... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_value([1, '15', [12, '7', [4, '1.5', '50', [12.5, '9']], 8], 10, [6]]) == 50.0\", \"assert find_max_value(['a', 'b', 'c']) == 'No numerical values found.'\", \"assert find_max_value([[], '5', [1.5, 'abc', [3]]]) == 5.0\", \"assert find_max_value(['1... | {
"split": "train",
"index": 75168,
"acecode_id": "evol_8583",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple login system based on user authentication data from a request object. The function should take a dictionary as input, representing the request. This dictionary contains two keys: 'authenticated_userid' (which can b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login({'authenticated_userid': 'user123', 'params': {'username': 'user123'}}) == {'logged_in': True, 'form_enabled': False, 'status': 'Already logged in', 'status_type': 'info', 'username': 'user123'}\", \"assert login({'authenticated_userid': None, 'params'... | {
"split": "train",
"index": 75169,
"acecode_id": "bigcode_python_fns_13644",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a dictionary where each character in the string is a key and its corresponding ASCII value is the value. For example, given the input 'xyz', the function should return {'x': 120, 'y': 121, 'z': 122}.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str_to_dict('') == {}\", \"assert str_to_dict('a') == {'a': 97}\", \"assert str_to_dict('abc') == {'a': 97, 'b': 98, 'c': 99}\", \"assert str_to_dict('hello') == {'h': 104, 'e': 101, 'l': 108, 'o': 111}\", \"assert str_to_dict('Python') == {'P': 80, 'y': 121... | {
"split": "train",
"index": 75170,
"acecode_id": "evol_10697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of items, where each item has a method called `get_accessible_cases_for_user(user)` that returns a list of accessible cases for a given user. Write a function `get_accessible_cases(item, user)` that takes an item and a user as input and returns the list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_accessible_cases(item_with_cases, 'user1') == ['case1', 'case2']\", \"assert get_accessible_cases(item_with_no_cases, 'user2') == []\", \"assert get_accessible_cases(item_with_cases, 'user10') == []\", \"assert get_accessible_cases(item_with_cases, 'user... | {
"split": "train",
"index": 75171,
"acecode_id": "bigcode_python_fns_13676",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages alerts for cryptocurrency price updates. The function should take in a list of current prices for various cryptocurrencies and a list of alerts defined by the cryptocurrency symbol and the price threshold. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_crypto_alerts([('BTC', 50000), ('ETH', 4000)], [('BTC', 48000), ('ETH', 4100)]) == ['ALERT: BTC has reached the price of 50000']\", \"assert check_crypto_alerts([('BTC', 45000), ('ETH', 3900)], [('BTC', 45000), ('ETH', 4000)]) == ['ALERT: BTC has reach... | {
"split": "train",
"index": 75172,
"acecode_id": "oss_27974",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that filters a list of file names based on a set of patterns and returns the matching files. Write a function called `filter_files` that takes in two parameters: 1. `file_names` (list of strings): A list of file names to be filtere... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files(['file1.txt', 'file2.csv', 'data.json', 'script.py'], ['*.txt', '*.json']) == ['file1.txt', 'data.json']\", \"assert filter_files(['file1.txt', 'file2.csv', 'data.json', 'script.py'], ['*.csv']) == ['file2.csv']\", \"assert filter_files(['image.... | {
"split": "train",
"index": 75173,
"acecode_id": "oss_5070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes two strings as arguments and returns the longest common substring between them. If there are multiple substrings of the same maximum length, return the first one found. The function should be defined as `def longest_common_substring(str_1: str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_substring('abc', 'abc') == 'abc'\", \"assert longest_common_substring('abcd', 'dabc') == 'abc'\", \"assert longest_common_substring('abcdef', 'ghijkl') == ''\", \"assert longest_common_substring('a', 'a') == 'a'\", \"assert longest_common_subs... | {
"split": "train",
"index": 75174,
"acecode_id": "evol_16410",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an unordered nested list of numerical values, implement a function `find_max_in_nested_list(nested_list)` that extracts the highest numerical value from the list without using built-in sorting or max functions. The input can be a mix of integers and nested lists. Your fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_in_nested_list([[4, 8, 15], [16, 23, [42, 10]], [29, 31]]) == 42\", \"assert find_max_in_nested_list([[1], [2], [3]]) == 3\", \"assert find_max_in_nested_list([[10], [20], [30, [40, [50]]]]) == 50\", \"assert find_max_in_nested_list([[-1, -2, -3], [... | {
"split": "train",
"index": 75175,
"acecode_id": "evol_30538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, x and w, where x contains integers and w contains positive weights corresponding to each element in x, write a function `weighted_sum(x: List[int], w: List[int]) -> int` that calculates the weighted sum of the absolute values of the elements in x using the weig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weighted_sum([-1, -2, -3], [1, 1, 1]) == 6\", \"assert weighted_sum([0, 0, 0], [1, 2, 3]) == 0\", \"assert weighted_sum([-10, -20, 30], [2, 2, 2]) == 120\", \"assert weighted_sum([1, 2, 3], [1, 2, 3]) == 14\", \"assert weighted_sum([1], [5]) == 5\", \"assert... | {
"split": "train",
"index": 75176,
"acecode_id": "bigcode_python_fns_9800",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the serialization of a person data structure into a JSON string. The function should take a dictionary representing a person with the following fields: `name` (a string), `age` (an integer), and `email` (a string). If the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_person({'name': 'Alice', 'age': 28, 'email': 'alice@example.com'}) == '{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 28, \\\"email\\\": \\\"alice@example.com\\\"}'\", \"assert serialize_person({'name': 'Bob', 'age': 35, 'email': 'bob@example.com'}) ==... | {
"split": "train",
"index": 75177,
"acecode_id": "oss_15043",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of command-line options provided as strings. Your function should accept a list of options and return a dictionary containing the parsed options. The options include: '-f FILE' or '--file=FILE' which specifies the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_options([]) == {'rules_file': '-', 'keywords': False, 'verbose': False}\", \"assert parse_options(['-f', 'rules.txt']) == {'rules_file': 'rules.txt', 'keywords': False, 'verbose': False}\", \"assert parse_options(['--file', 'data.json']) == {'rules_fil... | {
"split": "train",
"index": 75178,
"acecode_id": "oss_24411",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers, param1 and param2, write a function named `sum_two_numbers` that returns their sum. The function should take two parameters, param1 and param2, and return a single integer that represents the sum of the two parameters.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_two_numbers(1, 2) == 3\", \"assert sum_two_numbers(-1, 1) == 0\", \"assert sum_two_numbers(0, 0) == 0\", \"assert sum_two_numbers(100, 200) == 300\", \"assert sum_two_numbers(-50, -50) == -100\", \"assert sum_two_numbers(5, 5) == 10\", \"assert sum_two_n... | {
"split": "train",
"index": 75179,
"acecode_id": "oss_7569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that generates the first n prime numbers. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Your function should take an integer n as input and return a list of the first n prim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_primes(1) == [2]\", \"assert generate_primes(2) == [2, 3]\", \"assert generate_primes(3) == [2, 3, 5]\", \"assert generate_primes(4) == [2, 3, 5, 7]\", \"assert generate_primes(5) == [2, 3, 5, 7, 11]\", \"assert generate_primes(6) == [2, 3, 5, 7, 11... | {
"split": "train",
"index": 75180,
"acecode_id": "oss_36604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function that accepts a string of text and returns a list containing the first alphabetical character from each individual word in the provided string. If a word does not contain any alphabetical characters, it should not contribute any character to the output list.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_alpha_char('This is an example') == ['T', 'i', 'a', 'e']\", \"assert first_alpha_char('Hello World! 123') == ['H', 'W']\", \"assert first_alpha_char('A quick brown fox') == ['A', 'q', 'b', 'f']\", \"assert first_alpha_char('123 456 !@#') == []\", \"ass... | {
"split": "train",
"index": 75181,
"acecode_id": "evol_20252",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `check_value` that evaluates a given integer value against specified lower and upper bounds, returning a status object based on the evaluation. The status object should contain the following attributes: `metric_type`, `status`, `descr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_value(5, 1, 10, 100) == {'metric_type': 'PERCENTILE', 'status': 'SUCCESS', 'description': 'value 5 in range [1, 10]', 'count_score': 100}\", \"assert check_value(0, 1, 10, 100) == {'metric_type': 'PERCENTILE', 'status': 'FAILURE', 'description': 'value... | {
"split": "train",
"index": 75182,
"acecode_id": "oss_15587",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function named 'create_person' that takes two parameters, 'name' (a string) and 'age' (an integer). The function should return a dictionary representing a person, where the keys are 'name' and 'age', and their corresponding values are the parameters passed to the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_person('Alice', 30) == {'name': 'Alice', 'age': 30}\", \"assert create_person('Bob', 25) == {'name': 'Bob', 'age': 25}\", \"assert create_person('Charlie', 0) == {'name': 'Charlie', 'age': 0}\", \"assert create_person('Diana', -1) == None\", \"assert ... | {
"split": "train",
"index": 75183,
"acecode_id": "evol_32036",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a stock data object that contains information about a stock's name, code, and market, as well as a query object that specifies the type of data (daily, weekly, monthly, etc.) to be retrieved. Your task is to implement a function `get_stock_title(stock, query)` tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_stock_title({'name': 'ABC Corp', 'code': '123', 'market': 'NYSE', 'id': '001'}, {'kType': 'DAY'}) == 'NYSE 123 ABC Corp \\uff08\\u65e5\\u7ebf\\uff09'\", \"assert get_stock_title({'name': 'XYZ Inc', 'code': '', 'market': 'NASDAQ', 'id': '002'}, {'kType': ... | {
"split": "train",
"index": 75184,
"acecode_id": "bigcode_python_fns_6920",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_email(email: str, domains: List[str]) -> bool` that verifies if an email address is valid and its domain belongs to a predefined list of acceptable domains. The email is considered valid if it follows the standard email format. The domain part of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('test@example.com', ['example.com', 'test.com']) == True\", \"assert validate_email('user@domain.com', ['example.com', 'test.com']) == False\", \"assert validate_email('invalid-email', ['example.com']) == False\", \"assert validate_email('user... | {
"split": "train",
"index": 75185,
"acecode_id": "evol_19001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer lag, return the number of neighboring pixels in a square grid that can be reached with the specified lag distance. The grid is considered to have a central pixel, and the neighboring pixels are those that are within a square of size (2 * lag + 1) centered on th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert num_neighbours(0) == 0\", \"assert num_neighbours(1) == 8\", \"assert num_neighbours(2) == 24\", \"assert num_neighbours(3) == 48\", \"assert num_neighbours(4) == 80\"]}"
} | {
"split": "train",
"index": 75186,
"acecode_id": "bigcode_python_fns_43549",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string `resource` that contains a resource identifier followed by optional parameters, separated by semicolons (';'). Your task is to implement a function `get_connection_params(resource: str) -> Tuple[str, List[str]]` that takes the string `resource` as input a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_connection_params('db_user;host=localhost;port=5432') == ('db_user', ['host=localhost', 'port=5432'])\", \"assert get_connection_params('api_key;timeout=30') == ('api_key', ['timeout=30'])\", \"assert get_connection_params('single_resource') == ('single_... | {
"split": "train",
"index": 75187,
"acecode_id": "bigcode_python_fns_12137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of stack events and returns a list of processed event data. Each stack event is represented as a dictionary with the following keys: 'Timestamp', 'ResourceType', 'ResourceStatus', and optionally 'ResourceStatusRe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_stack_events([{'Timestamp': '2023-01-01T00:00:00Z', 'ResourceType': 'AWS::S3::Bucket', 'ResourceStatus': 'CREATE_COMPLETE'}, {'Timestamp': '2023-01-01T01:00:00Z', 'ResourceType': 'AWS::EC2::Instance', 'ResourceStatus': 'CREATE_IN_PROGRESS', 'Resource... | {
"split": "train",
"index": 75188,
"acecode_id": "oss_6901",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that may contain a wildcard character '*', write a function that splits the string into two parts. The first part should contain all characters before the first occurrence of the wildcard, while the second part should contain the wildcard and everything that foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_on_wildcard('a/b/c/d*e/f/*.txt') == ('a/b/c/d', '*e/f/*.txt')\", \"assert split_on_wildcard('*e/f/*.txt') == ('', '*e/f/*.txt')\", \"assert split_on_wildcard('a/b/c/d') == ('a/b/c/d', '')\", \"assert split_on_wildcard('abc*def') == ('abc', '*def')\", \... | {
"split": "train",
"index": 75189,
"acecode_id": "bigcode_python_fns_41266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents the content of a YAML file. This string may contain a front matter section delimited by '---' at the beginning and possibly at the end. Your task is to implement a function that extracts the front matter from the given string and returns i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_yaml_frontmatter('---\\\\nkey: value\\\\n---\\\\ncontent here') == {'key': 'value'}\", \"assert extract_yaml_frontmatter('---\\\\nname: John\\\\nage: 30\\\\n---\\\\nThis is the content.') == {'name': 'John', 'age': 30}\", \"assert extract_yaml_frontm... | {
"split": "train",
"index": 75190,
"acecode_id": "bigcode_python_fns_26955",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating metadata for a given source. Implement a function `validate_metadata(source_meta)` that takes a dictionary `source_meta` representing metadata for a source. The dictionary contains the following keys: 'data_license', 'data_license_url', 'version',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_metadata({'data_license': 'custom', 'data_license_url': 'https://www.ncbi.nlm.nih.gov/home/about/policies/', 'version': '20220101', 'data_url': 'ftp://ftp.ncbi.nlm.nih.gov', 'rdp_url': 'https://reusabledata.org/ncbi-gene.html', 'genome_assemblies': ... | {
"split": "train",
"index": 75191,
"acecode_id": "bigcode_python_fns_43269",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that contains information about the current graphical backend and its settings. Write a function `is_tk_window_focus_active(config: dict) -> bool` that checks if the TkAgg backend is being used and if the 'tk.window_focus' setting is ena... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_tk_window_focus_active({'backend': 'TkAgg', 'tk.window_focus': True}) == True\", \"assert is_tk_window_focus_active({'backend': 'TkAgg', 'tk.window_focus': False}) == False\", \"assert is_tk_window_focus_active({'backend': 'Qt5Agg', 'tk.window_focus': Tru... | {
"split": "train",
"index": 75192,
"acecode_id": "bigcode_python_fns_26704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating file names for a data processing application. Your function should take a string `file_name` as input and return `True` if the file name meets the following criteria: 1. The file name must not exceed a maximum length of 50 characters. 2. The file ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_file_name('example.txt') == True\", \"assert is_valid_file_name('valid_file_name.txt') == True\", \"assert is_valid_file_name('another_valid_file') == True\", \"assert is_valid_file_name('a' * 50) == True\", \"assert is_valid_file_name('') == True\"... | {
"split": "train",
"index": 75193,
"acecode_id": "oss_10289",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list `board`, where each element represents a cell on a game board and is an integer indicating the color of the cell. Your task is to implement the `get_color_count` function, which takes this `board` as input and returns a dictionary containing the count of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_color_count([[1, 2], [2, 1]]) == {1: 2, 2: 2}\", \"assert get_color_count([[1, 1], [1, 1]]) == {1: 4}\", \"assert get_color_count([[1, 2], [3, 4]]) == {1: 1, 2: 1, 3: 1, 4: 1}\", \"assert get_color_count([[0, 0], [0, 0], [0, 1]]) == {0: 5, 1: 1}\", \"ass... | {
"split": "train",
"index": 75194,
"acecode_id": "oss_30602",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the state of a number. Your task is to implement a function that calculates the final value of the number after incrementing it by a fixed step amount, which is also provided as input. The function should return the final value of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_value(4, 1, 3) == 7\", \"assert calculate_final_value(0, 5, 2) == 10\", \"assert calculate_final_value(10, -2, 5) == 0\", \"assert calculate_final_value(20, 0, 10) == 20\", \"assert calculate_final_value(-5, 3, 4) == 7\", \"assert calculate_f... | {
"split": "train",
"index": 75195,
"acecode_id": "bigcode_python_fns_11405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a numerical array `nums` and a positive integer `k`, determine if it's possible to partition this array into `k` non-empty subsets, each having the same sum. Implement a function `canPartitionKSubsets(nums: List[int], k: int) -> bool` that returns `True` if such a partiti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canPartitionKSubsets([4, 3, 2, 3, 5, 2, 1], 4) == True\", \"assert canPartitionKSubsets([1, 1, 1, 1], 2) == True\", \"assert canPartitionKSubsets([2, 2, 2, 2], 2) == True\", \"assert canPartitionKSubsets([5, 5, 5, 5], 4) == True\", \"assert canPartitionKSubs... | {
"split": "train",
"index": 75196,
"acecode_id": "evol_13913",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, your task is to write a function that finds all unique pairs of integers in the list that sum up to a specified target sum. Each pair should be returned as a tuple in ascending order, and the order of the pairs in the output does not matter. The input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unique_pairs([1, 3, 2, 2], 4) == [(1, 3), (2, 2)]\", \"assert find_unique_pairs([2, 2, 2, 2], 4) == [(2, 2)]\", \"assert find_unique_pairs([], 5) == []\", \"assert find_unique_pairs([0, 0, 0, 0], 0) == [(0, 0)]\", \"assert find_unique_pairs([1, 2, 3], 7... | {
"split": "train",
"index": 75197,
"acecode_id": "oss_26042",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a service registry for data services. The function should take a list of available data services (represented as strings) and an image name (also a string). The function should simulate making HTTP requests ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_image_data(['http://serviceA', 'http://serviceB'], 'image2') == [{'data': 'image data from serviceA'}, {'error': 'Service unavailable for http://serviceB'}]\", \"assert fetch_image_data([], 'image4') == []\", \"assert fetch_image_data(['http://service1... | {
"split": "train",
"index": 75198,
"acecode_id": "oss_7554",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `linear_feature_columns` and `dnn_feature_columns`. Your task is to implement a function `create_model(linear_feature_columns: List[int], dnn_feature_columns: List[int], bridge_type: str, tau: float) -> str` that simulates the creation of a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_model([1, 2, 3], [4, 5, 6], 'pointwise_addition', 0.1) == 'Model with Pointwise Addition'\", \"assert create_model([1, 2, 3], [4, 5, 6], 'hadamard_product', 0.1) == 'Model with Hadamard Product'\", \"assert create_model([1, 2, 3], [4, 5, 6], 'concaten... | {
"split": "train",
"index": 75199,
"acecode_id": "bigcode_python_fns_7573",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.