data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a string `word` that consists of digits and lowercase English letters. Your task is to implement a function `find_integers(word: str) -> dict` that processes the string by removing all non-digit characters, separating the resulting integers by spaces, and counting...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_integers('a123bc34d8ef34') == {'123': 1, '34': 2, '8': 1}\", \"assert find_integers('leet1234code234') == {'1234': 1, '234': 1}\", \"assert find_integers('hello123world456hello123') == {'123': 2, '456': 1}\", \"assert find_integers('abc') == {}\", \"ass...
{ "split": "train", "index": 71300, "acecode_id": "evol_32857", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the configuration of a work item linking policy in a project repository. The function `create_policy_configuration` takes in the following parameters: `repository_id` (string), `branch` (string), `blocking` (boolean), `enab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_policy_configuration('repo123', 'main', True, True) == {'repository_id': 'repo123', 'branch': 'main', 'blocking': True, 'enabled': True, 'branch_match_type': 'exact', 'organization': None, 'project': None}\", \"assert create_policy_configuration('repo...
{ "split": "train", "index": 71301, "acecode_id": "bigcode_python_fns_10539", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a single character from the English alphabet (case insensitive) and returns its position in the alphabet (1-indexed). If the character is not a valid letter, return None. For example, 'A' should return 1, 'B' should return 2, and 'Z' should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert semantic_decoder('A') == 1\", \"assert semantic_decoder('b') == 2\", \"assert semantic_decoder('C') == 3\", \"assert semantic_decoder('d') == 4\", \"assert semantic_decoder('e') == 5\", \"assert semantic_decoder('F') == 6\", \"assert semantic_decoder('g') ==...
{ "split": "train", "index": 71302, "acecode_id": "evol_8821", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a file dialog selection process. The function should accept parameters that define the characteristics of the file dialog and return a simulated list of selected files based on the given conditions. The function signature i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_dialog_simulation(bbo=1, cc='Cancel', cap='Select a file', ds=1, ff='', fm=0, dir='C:/') == []\", \"assert file_dialog_simulation(bbo=2, cc='Cancel', cap='Choose a file', ds=2, ff='*.txt;;*.csv', fm=1, dir='C:/Documents/') == []\", \"assert file_dialog_...
{ "split": "train", "index": 71303, "acecode_id": "bigcode_python_fns_3359", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a binary view object represented as a start address and a method to rebase it to a new base address. Implement a function `rebase_binary_view(start: int, new_base: int) -> int` that returns the new start address after rebasing. If the new base address is the same ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rebase_binary_view(1000, 2000) == 2000\", \"assert rebase_binary_view(1000, 1000) == 1000\", \"assert rebase_binary_view(500, 1000) == 1000\", \"assert rebase_binary_view(300, None) == 300\", \"assert rebase_binary_view(1500, 1500) == 1500\", \"assert rebase...
{ "split": "train", "index": 71304, "acecode_id": "bigcode_python_fns_6607", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of image names and a blacklist, write a function that filters out the images that are in the blacklist and returns a list of the remaining image names. The function should take three parameters: a list of strings 'images' representing the names of images, and a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_images(['image1', 'image2', 'image3'], ['image2']) == ['image1', 'image3']\", \"assert filter_images(['imageA', 'imageB', 'imageC'], ['imageA', 'imageC']) == ['imageB']\", \"assert filter_images(['img1', 'img2', 'img3', 'img4'], []) == ['img1', 'img2'...
{ "split": "train", "index": 71305, "acecode_id": "bigcode_python_fns_17578", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `nearest_number(num_list, target)` that returns the nearest whole number to a given target number within a given numerical sequence. The function should handle both whole and fractional numbers in the sequence, and should be robust against potential excepti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nearest_number([], 4) == 'Input list is empty'\", \"assert nearest_number([3, 6, 9, 12], 'hello') == 'Target number is not valid'\", \"assert nearest_number('hello', 4) == 'Input is not a list'\", \"assert nearest_number([1.5, 2.0, 2.5], 2.3) == 2.5\", \"ass...
{ "split": "train", "index": 71306, "acecode_id": "evol_65", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a script name based on specific criteria. The function should take a single string input, 'value', which represents the name of the script. The script name is considered valid if it meets the following conditions: 1. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_script('script1') == (None, 'script1')\", \"assert validate_script('') == (None, 'None')\", \"assert validate_script('None') == (None, 'None')\", \"assert validate_script('valid_script') == (None, 'valid_script')\", \"assert validate_script('my_scri...
{ "split": "train", "index": 71307, "acecode_id": "bigcode_python_fns_5922", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a python function called `custom_sorter`, which should take two parameters: a list of lists where each inner list contains strings and numbers, and a Boolean, `ascending`, that when True should sort everything in ascending order and when False in descending order. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_sorter([[1, 2, 'apple'], [3.5, 'banana']], True) == ([1, 2, 3.5], ['apple', 'banana'])\", \"assert custom_sorter([[1, 2, 'apple'], [3.5, 'banana']], False) == ([3.5, 2, 1], ['banana', 'apple'])\", \"assert custom_sorter([[1, 'apple', 2.5], ['banana', ...
{ "split": "train", "index": 71308, "acecode_id": "evol_34545", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a formatted SSH command to connect to a remote host based on the provided instance information. The instance information includes the host's IP address, username, and port number. Your function should take a dictionary as i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_ssh_command({'ip_address': '192.168.1.100', 'username': 'admin', 'port': 22}) == 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 22 admin@192.168.1.100'\", \"assert generate_ssh_command({'ip_address': '10.0.0.1', 'username': 'use...
{ "split": "train", "index": 71309, "acecode_id": "oss_30960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a fixed-point number represented by its integer and fractional bits. Your task is to implement a function `trim_fixed_point(m: int, n: int, signed: bool, bits: Dict[str, int]) -> Dict[str, int]` that trims the fixed-point representation based on the following crit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trim_fixed_point(3, 2, True, {'msb': 1, 'lsb': 0}) == {'msb': 1, 'lsb': 1, 'm': 3, 'n': 2}\", \"assert trim_fixed_point(2, 1, False, {'msb': 1, 'lsb': 0}) == {'msb': 1, 'lsb': 1, 'm': 2, 'n': 1}\", \"assert trim_fixed_point(1, 3, False, {'msb': 1, 'lsb': 0})...
{ "split": "train", "index": 71310, "acecode_id": "bigcode_python_fns_45723", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of strings based on a debug mode setting and returns specific information. The function should take in two parameters: `settings` (a dictionary containing configuration settings) and `lines` (a list of strings...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_lines({'DEBUG': True}, ['line1', 'line2', 'line3', 'line4', 'line5', 'line6']) == ['line1', 'line2', 'line3', 'line4', 'line5']\", \"assert process_lines({'DEBUG': True}, ['line1', 'line2']) == ['line1', 'line2']\", \"assert process_lines({'DEBUG': F...
{ "split": "train", "index": 71311, "acecode_id": "oss_19552", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_valid_email(email: str) -> bool` that checks if the input string `email` is a valid email address based on the defined regex pattern. A valid email must start with one or more alphanumeric characters, can optionally include a single period or underscore...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_email('myName@domain.com') == True\", \"assert is_valid_email('user.name@sub.domain.com') == True\", \"assert is_valid_email('username@domain.org') == True\", \"assert is_valid_email('user_name@domain.net') == True\", \"assert is_valid_email('user@d...
{ "split": "train", "index": 71312, "acecode_id": "evol_19379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given string is a palindrome. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Implement a function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('Able was I saw Elba') == True\", \"assert is_palindrome('Madam, in Eden, I\\u2019m Ada...
{ "split": "train", "index": 71313, "acecode_id": "oss_24488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer total, write a function `count_series(total)` that determines the number of possible arithmetic series made up of sequential odd integer values that sum up to the given total. The function should return the count of such series.\nPlease reason step by s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_series(1) == 1\", \"assert count_series(0) == 0\", \"assert count_series(7) == 1\", \"assert count_series(21) == 2\", \"assert count_series(5) == 1\", \"assert count_series(11) == 1\", \"assert count_series(13) == 1\", \"assert count_series(17) == 1\",...
{ "split": "train", "index": 71314, "acecode_id": "evol_32078", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the retrieval of tasks for a project. Write a function named `get_available_tasks` that returns a dictionary of available tasks. Each task should be represented as a key-value pair, where the key is the task name (a string) and the value is anothe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_available_tasks() == {'task1': {'description': 'Complete task 1', 'priority': 'High'}, 'task2': {'description': 'Review task 2', 'priority': 'Medium'}, 'task3': {'description': 'Test task 3', 'priority': 'Low'}}\", \"assert get_available_tasks()['task1']...
{ "split": "train", "index": 71315, "acecode_id": "oss_5821", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that calculates the sum of all integers in the list and finds the maximum integer in the list. The function should return a tuple containing the sum and the maximum integer. If the list is empty, return (0, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_and_max([1, 2, 3]) == (6, 3)\", \"assert calculate_sum_and_max([-1, -2, -3]) == (-6, -1)\", \"assert calculate_sum_and_max([0]) == (0, 0)\", \"assert calculate_sum_and_max([]) == (0, None)\", \"assert calculate_sum_and_max([5, 10, 15]) == (30, ...
{ "split": "train", "index": 71316, "acecode_id": "oss_19643", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a specified value associated with a given ID. The function should take two parameters: 'id' (a string representing the unique identifier) and 'key' (a string representing the specific name whose value you want to retrieve)....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_value_by_id('123', 'name1') == 'Value1'\", \"assert get_value_by_id('123', 'name2') == 'Value2'\", \"assert get_value_by_id('789', 'name1') == 'Not Found'\", \"assert get_value_by_id('123', 'name4') == 'Not Found'\", \"assert get_value_by_id('', 'name1')...
{ "split": "train", "index": 71317, "acecode_id": "bigcode_python_fns_34823", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function named `handle_transaction` that processes a financial transaction amount. The function should accept the transaction amount either as a string or as a number (integer or float) and convert it to a Decimal object. Additionally, the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_transaction('10.50') == Decimal('10.50')\", \"assert handle_transaction(10) == Decimal('10')\", \"assert handle_transaction(-5) == Decimal('-5')\", \"assert handle_transaction('3.14') == Decimal('3.14')\", \"assert handle_transaction('1.2345') == Deci...
{ "split": "train", "index": 71318, "acecode_id": "oss_19139", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple bot configuration manager. The bot should be initialized with a default configuration dictionary. Your function should take a list of key-value pairs representing configuration overrides and apply them to the bot's configuration. If a key a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_bot_config({'prefix': '/', 'baseHelpText': 'All available commands:'}, [('prefix', '!'), ('newKey', 'newValue')]) == {'prefix': '!', 'baseHelpText': 'All available commands:', 'newKey': 'newValue'}\", \"assert update_bot_config({'token': 'test-token',...
{ "split": "train", "index": 71319, "acecode_id": "bigcode_python_fns_42393", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two lists of equal length and returns a new list containing tuples, where each tuple consists of elements from the two input lists at the same index. The function should raise a ValueError if the two lists are not of equal length.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_lists([1, 2, 3], ['a', 'b', 'c']) == [(1, 'a'), (2, 'b'), (3, 'c')]\", \"assert combine_lists(['x', 'y'], [10, 20]) == [('x', 10), ('y', 20)]\", \"assert combine_lists([True, False], ['yes', 'no']) == [(True, 'yes'), (False, 'no')]\", \"assert combin...
{ "split": "train", "index": 71320, "acecode_id": "evol_22647", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two strings `source` and `target`, write a function `leveinshtein_distance(source: str, target: str) -> int` that computes the Levenshtein distance between the two strings. The Levenshtein distance is defined as the minimum number of single-character edits (insertions, de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert leveinshtein_distance('kitten', 'sitting') == 3\", \"assert leveinshtein_distance('flaw', 'lawn') == 2\", \"assert leveinshtein_distance('intention', 'execution') == 5\", \"assert leveinshtein_distance('', 'abc') == 3\", \"assert leveinshtein_distance('abc',...
{ "split": "train", "index": 71321, "acecode_id": "bigcode_python_fns_31175", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two dictionaries: `index2label_map` and `real_label_dict`. Your task is to implement a function `generate_intersection_mapping(index2label_map, real_label_dict)` that returns a new dictionary containing only the key-value pairs that are common to both dictionaries...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_intersection_mapping({1: 'apple', 2: 'banana'}, {2: 'banana', 3: 'orange'}) == {2: 'banana'}\", \"assert generate_intersection_mapping({0: 'red', 1: 'blue', 2: 'green'}, {0: 'red', 1: 'yellow'}) == {0: 'red'}\", \"assert generate_intersection_mappin...
{ "split": "train", "index": 71322, "acecode_id": "oss_1877", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a property based on certain rules. Implement a function `validate_property(property: str) -> str` that takes a string representing a property and returns a validation message. The function should follow these rules: \n1. If the property contains t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_property('valid_feature') == 'The property is valid.'\", \"assert validate_property('') == 'No property specified.'\", \"assert validate_property('random_property') == 'Unknown property.'\", \"assert validate_property('this_is_a_valid_property') == ...
{ "split": "train", "index": 71323, "acecode_id": "bigcode_python_fns_43323", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of strings and returns a tuple containing the processed list of strings and a tuple of two integers. The function should take a list of strings as input and perform the following operations: 1. Remove any duplica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_strings(['hello', 'world', 'hello']) == (['hello', 'world'], (5, 10))\", \"assert process_strings(['a', 'b', 'a', 'c']) == (['a', 'b', 'c'], (1, 3))\", \"assert process_strings(['test', 'test', 'test']) == (['test'], (4, 4))\", \"assert process_strin...
{ "split": "train", "index": 71324, "acecode_id": "oss_4084", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given two strings, write a Python function that deletes all non-overlapping occurrences of the second string from the first string and returns the modified first string.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a singl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_occurrences('hello world', 'world') == 'hello '\", \"assert delete_occurrences('abcdef', 'xyz') == 'abcdef'\", \"assert delete_occurrences('abcabcabc', 'abc') == ''\", \"assert delete_occurrences('bananas', 'na') == 'bas'\", \"assert delete_occurrence...
{ "split": "train", "index": 71325, "acecode_id": "evol_15678", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates different types of actions based on the provided parameters. The function should be named `generate_action` and take two arguments: `action_type` (a string representing the type of action to be created) and `action_data` (a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_action('email', {'recipient': 'test@example.com', 'subject': 'Hello', 'body': 'World'}) == {'action': 'email', 'data': {'recipient': 'test@example.com', 'subject': 'Hello', 'body': 'World'}}\", \"assert generate_action('notification', {'user_id': 1,...
{ "split": "train", "index": 71326, "acecode_id": "oss_27914", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that validates an EAN-13 barcode number. The EAN-13 barcode consists of 13 digits, and the last digit is a checksum calculated based on the first 12 digits. The checksum is determined by the following process: multiply each of the first 12 digits by alterna...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_ean13('9780201310054') == True\", \"assert validate_ean13('1234567890128') == True\", \"assert validate_ean13('1234567890123') == False\", \"assert validate_ean13('9780201310053') == False\", \"assert validate_ean13('4006381333931') == True\", \"ass...
{ "split": "train", "index": 71327, "acecode_id": "evol_29506", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that can parse a given code snippet and extract specific information from it. The code snippet is a configuration file for a build system and contains declarations for different types of build targets. Each declaration consists of a t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_targets('kt_jvm_library = _kt_jvm_library\\\\nkt_jvm_binary = _kt_jvm_binary') == [('kt_jvm_library', '_kt_jvm_library'), ('kt_jvm_binary', '_kt_jvm_binary')]\", \"assert extract_targets('kt_jvm_binary = my_binary\\\\nkt_jvm_library = my_library') ==...
{ "split": "train", "index": 71328, "acecode_id": "oss_5122", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes hand bone roll data for a 3D rig. The function should take in a dictionary representing the bone structure of a hand, where the keys are finger names ('thumb', 'index', 'middle', 'ring', 'pinky') and the values are l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_finger_rolls({'thumb': [30.0, 15.0, 45.0], 'index': [20.0, 25.0, 30.0], 'middle': [10.0, 10.0, 10.0], 'ring': [0.0, 5.0, 10.0], 'pinky': [5.0, 5.0, 5.0]}) == {'thumb': 90.0, 'index': 75.0, 'middle': 30.0, 'ring': 15.0, 'pinky': 15.0}\", \"assert ca...
{ "split": "train", "index": 71329, "acecode_id": "oss_33700", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `process_request` that handles requests for a ticket management system based on several parameters. The function should take five parameters: `component`, `status`, `milestone`, `query`, and `no_quick_jump`, and return a string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_request('UI', 'open', 'v1', 'search', '1') == 'Processed without quick jump for UI, open, v1, search'\", \"assert process_request('Backend', 'closed', 'v2', 'list', '0') == 'Processed with quick jump for Backend, closed, v2, list'\", \"assert process...
{ "split": "train", "index": 71330, "acecode_id": "oss_14111", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented by the number of nodes and two lists: `supply`, which contains the supply values for each node, and `demand`, which contains the demand values for each node. Additionally, you have two lists of lists: `flows_in`, where each sublist con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_flow_balanced(0, [10, 5], [5, 10], [[4], []], [[5], []]) == False\", \"assert is_flow_balanced(0, [10, 5], [5, 10], [[5], []], [[6], []]) == False\", \"assert is_flow_balanced(1, [10, 5], [10, 10], [[], [5]], [[5], []]) == True\", \"assert is_flow_balance...
{ "split": "train", "index": 71331, "acecode_id": "bigcode_python_fns_1201", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a wind measurement system that processes wind speed data. You need to write a function, `process_wind_speed(sensor_data: List[float], dao: List[float]) -> List[str]`, that takes in two parameters: a list of wind speed values from a sensor and a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_wind_speed([10.5, 12.3, 15.6], []) == []\", \"assert process_wind_speed([10.5, 'invalid', 15.6], []) == ['Invalid wind speed retrieved from the sensor']\", \"assert process_wind_speed([], []) == []\", \"assert process_wind_speed(['wrong', 'data', 'he...
{ "split": "train", "index": 71332, "acecode_id": "oss_17838", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a user can create a copy of a package based on certain criteria. The function should take four parameters: `user_username` (a string representing the username of the user), `package_full_name` (a string representing the ful...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_copy_package('alice', 'package1', ['package1', 'package2'], 'typeA') == 'You already have a package with that name'\", \"assert can_copy_package('bob', 'package3', ['package4', 'package5'], 'typeB') == 'Package can be copied'\", \"assert can_copy_package...
{ "split": "train", "index": 71333, "acecode_id": "bigcode_python_fns_43359", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer array 'arr' of length 'N', write a function 'align_peaks' that checks if the peaks of the first half of the array are aligned with the peaks of the second half. A peak is defined as an element that is greater than its adjacent elements. The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert align_peaks([1, 2, 3, 1, 5, 1, 2]) == False\", \"assert align_peaks([1, 2, 1, 2]) == False\", \"assert align_peaks([1, 2, 3, 4, 0, 5, 6]) == False\", \"assert align_peaks([1, 1, 1, 1, 1]) == False\", \"assert align_peaks([1, 2, 3, 2, 1, 0, 4]) == False\", \"...
{ "split": "train", "index": 71334, "acecode_id": "bigcode_python_fns_7429", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of letters and returns a new list containing the same letters in reverse order. Write a function called `reverse_letters` that takes a list of letters as input and returns a new list with the letters in reverse o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_letters(['a', 'b', 'c']) == ['c', 'b', 'a']\", \"assert reverse_letters(['x', 'y', 'z']) == ['z', 'y', 'x']\", \"assert reverse_letters(['hello', 'world']) == ['world', 'hello']\", \"assert reverse_letters([]) == []\", \"assert reverse_letters(['a'])...
{ "split": "train", "index": 71335, "acecode_id": "oss_7021", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that replaces specified words in a given string with asterisks, where the number of asterisks corresponds to the length of each word. The function should take two parameters: a string 'text' and a list of strings 'words_to_obscure'. It should return the mod...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert obscure_words('The quick brown fox jumped over the lazy dog.', ['fox', 'dog']) == 'The quick brown *** jumped over the lazy ***.'\", \"assert obscure_words('Hello world!', ['world']) == 'Hello *****!'\", \"assert obscure_words('Python is fun!', ['fun']) == '...
{ "split": "train", "index": 71336, "acecode_id": "evol_23612", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `total_match(lst1, lst2)` that takes two lists of strings and returns the list with a total character count (excluding spaces) that is less than or equal to the other list. If both lists have the same character count, return the first list. Remove duplicate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_match([], []) == []\", \"assert total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) == ['hi', 'admin']\", \"assert total_match(['123', '456'], ['789']) == []\", \"assert total_match(['abc', '123', 'def'], ['abc', 'def']) == ['abc', 'def']\",...
{ "split": "train", "index": 71337, "acecode_id": "evol_26104", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are asked to implement a function that calculates the area and perimeter of a rectangle based on the provided width and height. Write a function called `calculate_rectangle_properties` that takes two parameters: `width` (float) and `height` (float). The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rectangle_properties(3, 4) == (12, 14)\", \"assert calculate_rectangle_properties(5, 0) == (0, 10)\", \"assert calculate_rectangle_properties(0, 5) == (0, 10)\", \"assert calculate_rectangle_properties(6, 0) == (0, 12)\", \"assert calculate_rectang...
{ "split": "train", "index": 71338, "acecode_id": "oss_2817", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a sentence. Your task is to implement a function that converts each sentence into a list of its words, removing any punctuation marks and converting all characters to lowercase. The function should return a list of l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_sentences_to_words(['Hello, world!', 'This is a test.']) == [['hello', 'world'], ['this', 'is', 'a', 'test']]\", \"assert convert_sentences_to_words(['Python is great.', 'I love coding!']) == [['python', 'is', 'great'], ['i', 'love', 'coding']]\", \"...
{ "split": "train", "index": 71339, "acecode_id": "bigcode_python_fns_23084", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a new list containing only the unique integers from the input list, preserving the original order. The input list may contain both positive and negative integers, as well as zeros. The output list should not contain an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert unique_integers([-1, -2, -1, 0, 2, 0]) == [-1, -2, 0, 2]\", \"assert unique_integers([0, 0, 0, 0]) == [0]\", \"assert unique_integers([5, 3, 5, 3, 5]) == [5, 3]\", \"assert unique_integers([10, 20, 10...
{ "split": "train", "index": 71340, "acecode_id": "bigcode_python_fns_12899", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the setup of a lighting control system with various configurable options. Your function should accept a dictionary representing the configuration of the system, which includes details about bridges, areas, presets, and temp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_lighting_control({'bridges': [{'host': '1.2.3.4', 'port': 1234}], 'areas': [{'name': 'Living Room'}]}) == True\", \"assert setup_lighting_control({'bridges': [{'host': '1.2.3.4', 'port': 1234}], 'areas': []}) == False\", \"assert setup_lighting_control...
{ "split": "train", "index": 71341, "acecode_id": "bigcode_python_fns_27115", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two lists of integers, list1 and list2, write a function `find_common_elements` that returns a list of integers that are present in both lists. The output list should contain only unique elements and should be sorted in ascending order. If there are no common elements, re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_elements([1, 2, 3], [3, 4, 5]) == [3]\", \"assert find_common_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert find_common_elements([1, 2, 3, 3], [3, 3, 3]) == [3]\", \"assert find_common_elements([], [1, 2, 3]) == []\", \"assert find_common_elem...
{ "split": "train", "index": 71342, "acecode_id": "bigcode_python_fns_41905", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the processing of block cleanup requests in a simplified blockchain node. You are given a list of inventory vectors, where each vector is represented as a tuple containing an `InventoryType` and a `block_hash`. Addition...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_block_cleanup_request([(1, 'hash1'), (1, 'hash2')], True) == 'Enqueued hash1, Enqueued hash2'\", \"assert handle_block_cleanup_request([(1, 'hash3')], False) == 'Enqueued hash3'\", \"assert handle_block_cleanup_request([(1, 'hash4')], True) == 'Enqueu...
{ "split": "train", "index": 71343, "acecode_id": "oss_15031", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to categorize data into time buckets based on timestamps. The function should take a list of entries, each containing a string value and an integer timestamp, and categorize them into time buckets based on a specified interval. Each t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_times_buckets([('A', 1), ('B', 2), ('C', 3)], 1, 5, 2) == [[('A', 1), ('B', 2)], [('C', 3)]]\", \"assert get_times_buckets([('D', 0), ('E', 1), ('F', 2), ('G', 3)], 0, 5, 2) == [[('D', 0), ('E', 1)], [('F', 2), ('G', 3)]]\", \"assert get_times_buckets([(...
{ "split": "train", "index": 71344, "acecode_id": "oss_35788", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with generating a dictionary for an elastic scattering experiment. The dictionary should contain the following keys with their corresponding random values: 'qmin' (float between 0 and 1.5), 'qmax' (float between 19 and 25), 'qbin' (float between 0.8 and 0.12), 'r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_experiment()['qmin'] >= 0 and generate_experiment()['qmin'] <= 1.5\", \"assert generate_experiment()['qmax'] >= 19 and generate_experiment()['qmax'] <= 25\", \"assert generate_experiment()['rmin'] >= 0 and generate_experiment()['rmin'] <= 2.5\", \"a...
{ "split": "train", "index": 71345, "acecode_id": "bigcode_python_fns_4374", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `check_deployment_status` that checks the deployment status of a system managing resources. The function should return `True` if the deployment is successful and `False` if it is not. The deployment status is determined by a simple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_deployment_status(0) == True\", \"assert check_deployment_status(1) == False\", \"assert check_deployment_status(2) == True\", \"assert check_deployment_status(3) == False\", \"assert check_deployment_status(4) == True\", \"assert check_deployment_stat...
{ "split": "train", "index": 71346, "acecode_id": "oss_11625", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that takes this list as input and returns a new list that contains only the unique elements of the input list, maintaining their original order. If there are no unique elements, return an empty list. Implement t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 2, 1]) == [3]\", \"assert unique_elements([4, 5, 4, 6, 5]) == [6]\", \"assert unique_elements([7, 8, 9, 10, 9, 8, 7]) == [10]\", \"assert unique_elements([1, 1, 1, 1]) == []\", \"assert unique_elements([]) == []\", \"assert unique_e...
{ "split": "train", "index": 71347, "acecode_id": "bigcode_python_fns_34677", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that sanitizes a given filename by replacing any characters that are invalid for file names in Windows and Linux/Mac with underscores. The invalid characters are: <, >, :, \\, |, ?, and *. The input to the function will be a string repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sanitize_filename('my:file*name.txt') == 'my_file_name.txt'\", \"assert sanitize_filename('valid_filename.txt') == 'valid_filename.txt'\", \"assert sanitize_filename('file<name>.csv') == 'file_name_.csv'\", \"assert sanitize_filename('inv|alid?name.doc') == ...
{ "split": "train", "index": 71348, "acecode_id": "bigcode_python_fns_31644", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `current_price(symbol: str) -> float` that retrieves the current stock price of a given stock symbol. The function should return the latest closing price of the stock. If there is no available data for the given stock symbol, return -1. For demonstration pu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert current_price('AAPL') == 150.0\", \"assert current_price('GOOGL') == 2800.0\", \"assert current_price('TSLA') == 750.0\", \"assert current_price('MSFT') == -1\", \"assert current_price('NFLX') == -1\", \"assert current_price('AMZN') == -1\", \"assert current...
{ "split": "train", "index": 71349, "acecode_id": "evol_11909", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a URL name as input and returns the corresponding URL pattern from a predefined mapping. If the URL name is not found in the mapping, the function should return 'URL not found'. Your function should handle the following URL nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_url_pattern('home') == '/home/'\", \"assert get_url_pattern('about') == '/about/'\", \"assert get_url_pattern('contact') == '/contact/'\", \"assert get_url_pattern('services') == '/services/'\", \"assert get_url_pattern('gallery') == '/gallery/'\", \"ass...
{ "split": "train", "index": 71350, "acecode_id": "oss_33574", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates SQL statements based on input data for creating or updating a database table. The function should take a dictionary containing table metadata and return the appropriate SQL statement. The function signature is `generate_sql...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sql({'name': 'users', 'columns': [{'name': 'id', 'type': 'int'}, {'name': 'username', 'type': 'varchar(255)'}]}) == 'CREATE TABLE users (id int, username varchar(255));'\", \"assert generate_sql({'name': 'products', 'columns': [{'name': 'id', 'type'...
{ "split": "train", "index": 71351, "acecode_id": "bigcode_python_fns_22089", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a batch of molecular data. Each entry in the dictionary may contain the following keys: 'num_atoms' (a list of integers representing the number of atoms in each molecule), 'mol_size' (a list of integers representing the size of each molec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_molecular_data({'num_atoms': [2, 3], 'mol_size': [1, 1], 'energy': [0.1, 0.2], 'weights': [0.5, 0.6]}) == {'fp': [0, 0], 'conf_fps': [[0], [0]], 'learned_weights': [0.5, 0.6], 'energy': [[0.1], [0.2]]}\", \"assert process_molecular_data({'num_atoms':...
{ "split": "train", "index": 71352, "acecode_id": "bigcode_python_fns_27425", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple configuration reader function in Python. Your goal is to implement a function named `get_configuration` that takes no arguments and returns a dictionary containing two specific keys: 'input' and 'output'. The 'input' key should have a defau...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_configuration() == {'input': 'input.txt', 'output': 'output.txt', 'description': 'Configuration options for the input and output files.'}\", \"assert get_configuration()['input'] == 'input.txt'\", \"assert get_configuration()['output'] == 'output.txt'\",...
{ "split": "train", "index": 71353, "acecode_id": "oss_28703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that extracts the year from a copyright notice in a given source code string. The copyright notice is expected to be in the format 'Copyright [year] [owner]'. Your function should take a string representing the source code as input an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_copyright_year('# Copyright 2021 The Authors. All rights reserved.') == 2021\", \"assert extract_copyright_year('# Copyright 1999 Example Corp.') == 1999\", \"assert extract_copyright_year('# Copyright 2020 Company XYZ') == 2020\", \"assert extract_c...
{ "split": "train", "index": 71354, "acecode_id": "oss_14958", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that returns a mapping of connections to their respective drawing specifications. The input will be a dictionary where each key is a tuple containing a list of connections and the corresponding value is a drawing specification. Your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_hand_connection_style({('hand1', 'hand2'): 'style1', ('hand3',): 'style2'}) == {'hand1': 'style1', 'hand2': 'style1', 'hand3': 'style2'}\", \"assert get_hand_connection_style({('a', 'b', 'c'): 'styleA', ('d',): 'styleB'}) == {'a': 'styleA', 'b': 'styleA'...
{ "split": "train", "index": 71355, "acecode_id": "bigcode_python_fns_16312", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining if a customer wants exactly one of three available condiments for their hot dog: ketchup, mustard, and onion. Each condiment can either be selected (1) or not selected (0). Write a function `exactly_one_condiment(ketchup: int, mustard: int, onion...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert exactly_one_condiment(1, 0, 0) == True\", \"assert exactly_one_condiment(0, 1, 0) == True\", \"assert exactly_one_condiment(0, 0, 1) == True\", \"assert exactly_one_condiment(1, 1, 0) == False\", \"assert exactly_one_condiment(1, 0, 1) == False\", \"assert e...
{ "split": "train", "index": 71356, "acecode_id": "bigcode_python_fns_9117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the size of a recurrent neural network (RNN) based on certain conditions. The function should return the size of the RNN based on the following rules:\n\n1. If the parameter `rnn_size` is provided and is not None, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rnn_size(128, None, []) == 128\", \"assert calculate_rnn_size(None, 'projector', [{'output_size': 64}, {'output_size': 32}]) == 96\", \"assert calculate_rnn_size(None, 'projector', [{'output_size': 10}]) == 10\", \"assert calculate_rnn_size(256, No...
{ "split": "train", "index": 71357, "acecode_id": "oss_18946", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a file path. Write a function `is_file_path_valid(file_path: str) -> bool` that returns True if the given file path represents a valid file (i.e., it should contain at least one character and should not be empty). Otherwise, return False. A v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_file_path_valid('/home/user/file.txt') == True\", \"assert is_file_path_valid('file.txt') == True\", \"assert is_file_path_valid('/path/to/file/') == True\", \"assert is_file_path_valid('..//file') == True\", \"assert is_file_path_valid(' ') == False\"...
{ "split": "train", "index": 71358, "acecode_id": "bigcode_python_fns_30478", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of scenario names and a list of submitted scenarios. Your task is to validate the submitted scenarios against the allowed scenario names. If there are any submitted scenarios that are not in the allowed list, return a list of these illegal scenarios. If all...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_scenarios(['scenario1', 'scenario2', 'scenario3'], ['scenario1', 'scenario4']) == ['scenario4']\", \"assert validate_scenarios(['scenarioA', 'scenarioB'], ['scenarioC', 'scenarioA']) == ['scenarioC']\", \"assert validate_scenarios(['test1', 'test2',...
{ "split": "train", "index": 71359, "acecode_id": "bigcode_python_fns_15963", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `prime_factors(n)` that takes an integer `n` as input and returns a list of its unique prime factors sorted in descending order. You should not use any external resources and aim to implement this using a recursive approach.\nPlease reason step by step, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_factors(1) == []\", \"assert prime_factors(2) == [2]\", \"assert prime_factors(3) == [3]\", \"assert prime_factors(4) == [2]\", \"assert prime_factors(5) == [5]\", \"assert prime_factors(7) == [7]\", \"assert prime_factors(8) == [2]\", \"assert prime_f...
{ "split": "train", "index": 71360, "acecode_id": "evol_4899", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `is_palindrome_with_all_vowels(s: str) -> bool` that checks if the given string `s` is a palindrome and contains all the English vowels ('a', 'e', 'i', 'o', 'u'). The function should ignore case and non-alphabetical characters when making this determination...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome_with_all_vowels('A man, a plan, a canal: Panama') == False\", \"assert is_palindrome_with_all_vowels('Was it a car or a cat I saw?') == False\", \"assert is_palindrome_with_all_vowels('Able was I ere I saw Elba') == False\", \"assert is_palindr...
{ "split": "train", "index": 71361, "acecode_id": "evol_28663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that resets the number of messages for a user to zero. The function should take a dictionary representing the user's profile and reset the 'messages' field to zero. The profile dictionary will have the following structure: {'user': str, '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_user_messages({'user': 'Alice', 'messages': 5}) == {'user': 'Alice', 'messages': 0}\", \"assert reset_user_messages({'user': 'Bob', 'messages': 10}) == {'user': 'Bob', 'messages': 0}\", \"assert reset_user_messages({'user': 'Charlie', 'messages': 0}) =...
{ "split": "train", "index": 71362, "acecode_id": "bigcode_python_fns_19920", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a summary of an instance pool's characteristics based on the provided instance pool name and resource group. The function should take two parameters: `name` (string) which represents the Instance Pool Name, and `reso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_instance_pool_summary('my_instance_pool', 'my_resource_group') == {'id': '/subscriptions/12345678-1234-5678-1234-567812345678/resourceGroups/my_resource_group/providers/Microsoft.Sql/instancePools/my_instance_pool', 'name': 'my_instance_pool', 'type': 'M...
{ "split": "train", "index": 71363, "acecode_id": "oss_17355", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a dictionary in Python where the keys are strings and the values are also strings. Your task is to implement a function that checks if the dictionary contains any invalid entries. An entry is considered invalid if the value associated with any key is the string 'b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_dict_entries({'a': 'good', 'b': 'valid'}) == True\", \"assert check_dict_entries({'key1': 'value1', 'key2': 'value2'}) == True\", \"assert check_dict_entries({'name': 'John', 'age': '30'}) == True\", \"assert check_dict_entries({}) == True\", \"assert ...
{ "split": "train", "index": 71364, "acecode_id": "bigcode_python_fns_738", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a non-negative integer num, implement a function that converts it into a base-36 string representation. The base-36 representation uses the digits 0-9 for values 0-9 and the letters A-Z for values 10-35. Your function should return the base-36 string representation of the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numToString(0) == '0'\", \"assert numToString(1) == '1'\", \"assert numToString(9) == '9'\", \"assert numToString(10) == 'A'\", \"assert numToString(35) == 'Z'\", \"assert numToString(36) == '10'\", \"assert numToString(37) == '11'\", \"assert numToString(10...
{ "split": "train", "index": 71365, "acecode_id": "bigcode_python_fns_23754", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, determine if it is an Armstrong number. An Armstrong number is a number that is equal to the sum of its own digits each raised to the power of the number of digits in n. Implement the function `is_armstrong(n)` that returns True if n is an Armstrong number, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_armstrong(0) == True\", \"assert is_armstrong(1) == True\", \"assert is_armstrong(2) == True\", \"assert is_armstrong(3) == True\", \"assert is_armstrong(4) == True\", \"assert is_armstrong(5) == True\", \"assert is_armstrong(6) == True\", \"assert is_arm...
{ "split": "train", "index": 71366, "acecode_id": "evol_19453", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with decrypting a message that has been encrypted using a simple substitution cipher. Each letter in the message has been replaced by a different letter based on a fixed shift value. Your function should take an encrypted message and a shift value as input, and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decrypt_message('khoor zruog', 3) == 'hello world'\", \"assert decrypt_message('xlmw mw xli', 4) == 'this is the'\", \"assert decrypt_message('wklv lv d whvw phvvdjh', 3) == 'this is a test message'\", \"assert decrypt_message('z abcd', 1) == 'y zabc'\", \"a...
{ "split": "train", "index": 71367, "acecode_id": "oss_1944", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that aggregates data from a provided query into an existing dataset. The function should take two arguments: a list of integers representing the aggregated data from a query and a dictionary that serves as the original data with two keys:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_data([1, 2, 3], {'sum': 0, 'count': 0}) == {'sum': 6, 'count': 3}\", \"assert aggregate_data([], {'sum': 5, 'count': 2}) == {'sum': 5, 'count': 2}\", \"assert aggregate_data([10], {'sum': 1, 'count': 1}) == {'sum': 11, 'count': 2}\", \"assert aggre...
{ "split": "train", "index": 71368, "acecode_id": "bigcode_python_fns_39029", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a date in the format 'YYYY-MM-DD HH:MM:SS', write a function that converts this date into a day-of-year (DOY) format. The function should return the day of the year as an integer (ranging from 1 to 366) corresponding to the given date. It is guarante...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_doy('2023-01-01 00:00:00') == 1\", \"assert convert_to_doy('2023-02-28 12:00:00') == 59\", \"assert convert_to_doy('2023-03-01 00:00:00') == 60\", \"assert convert_to_doy('2023-04-15 15:30:00') == 105\", \"assert convert_to_doy('2023-07-04 12:00:0...
{ "split": "train", "index": 71369, "acecode_id": "bigcode_python_fns_4857", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing DNS query logs, each in the format 'IP1 > IP2: RequestType? DomainName', write a function that extracts the DomainName from each log entry and returns a list of unique DomainNames. The function should ignore the case of the DomainNames when ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_domains(['172.30.253.88 > 1.1.1.1: A? blah.com', '172.30.253.89 > 1.1.1.2: AAAA? BlAh.com']) == ['blah.com']\", \"assert extract_unique_domains(['192.168.0.1 > 8.8.8.8: A? google.com', '192.168.0.2 > 8.8.4.4: A? GOOGLE.COM']) == ['google.com']...
{ "split": "train", "index": 71370, "acecode_id": "bigcode_python_fns_31953", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_blog_post(title: str, body: str) -> dict` that simulates the creation of a blog post. The function should take the title and body of the post as input parameters and return a dictionary with a message indicating that a new post has been created alon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_blog_post('First Post', 'This is the body of the first post.') == {'message': 'new post created', 'title': 'First Post', 'body': 'This is the body of the first post.'}\", \"assert create_blog_post('Second Post', 'Another body for a post.') == {'messag...
{ "split": "train", "index": 71371, "acecode_id": "evol_29816", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that computes the determinant of a given 3x3 matrix. The matrix is represented as a list of three lists, each containing three integers. The determinant of a 3x3 matrix can be calculated using the formula: det(A) = a(ei - fh) - b(di - fg) + c(dh - eg), wher...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determinant([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == 0\", \"assert determinant([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 0\", \"assert determinant([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == 1\", \"assert determinant([[1, 2, 3], [0, 1, 4], [5, 6, 0]]) == 1\", \"assert de...
{ "split": "train", "index": 71372, "acecode_id": "evol_3422", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string path representing a file system path, implement a function `umount(path: str, bg: bool) -> int` that simulates the unmounting of a filesystem. If `bg` is `True`, the function should return 1 to indicate that the unmounting is performed in the background. If `bg` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert umount('/mnt/drive', False) == 0\", \"assert umount('/mnt/drive', True) == 1\", \"assert umount('/mnt/data', False) == 0\", \"assert umount('/mnt/data', True) == 1\", \"assert umount('/home/user', False) == 0\", \"assert umount('/home/user', True) == 1\", \"...
{ "split": "train", "index": 71373, "acecode_id": "bigcode_python_fns_28639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine whether a given undirected graph is bipartite. A graph is bipartite if its vertices can be divided into two disjoint sets such that every edge connects a vertex from one set to a vertex in the other set. Your task is to w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_bipartite([(1, 2), (2, 3), (3, 4), (4, 1)]) == True\", \"assert is_bipartite([(1, 2), (2, 3), (3, 1)]) == False\", \"assert is_bipartite([(1, 2), (2, 3)]) == True\", \"assert is_bipartite([(1, 2), (2, 3), (3, 4), (4, 5)]) == True\", \"assert is_bipartite(...
{ "split": "train", "index": 71374, "acecode_id": "oss_23928", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simplified version of a user object for a web application. Your function should be named `create_user_info` and should take two parameters: a string `username` and a dictionary `payload`. The function should extract the u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user_info('Alice', {'userId': 123}) == {'username': 'Alice', 'user_id': 123}\", \"assert create_user_info('Bob', {'userId': 456}) == {'username': 'Bob', 'user_id': 456}\", \"assert create_user_info('Charlie', {}) == {'username': 'Charlie', 'user_id': ...
{ "split": "train", "index": 71375, "acecode_id": "oss_21505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `hex_product(hex_num: str) -> int` that calculates the total product of non-zero digits in the given hexadecimal number. A hexadecimal number can include digits (0-9) and letters (A-F). Assume A=10, B=11, C=12, D=13, E=14, F=15. Ignore zeros in the calculation ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_product('1F3A') == 450\", \"assert hex_product('A0B') == 110\", \"assert hex_product('F00D') == 195\", \"assert hex_product('2A3') == 60\", \"assert hex_product('4E2') == 112\", \"assert hex_product('00F0') == 15\", \"assert hex_product('FF') == 225\", \...
{ "split": "train", "index": 71376, "acecode_id": "evol_19329", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Design an algorithm that evaluates a mathematical expression given in string format. The algorithm must verify if the expression is correctly formatted with balanced parentheses, correct operator precedence, and the correct sequence of operands and operators. It should handle n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('3 + 5') == 8\", \"assert evaluate_expression('10 - 2 * 3') == 4\", \"assert evaluate_expression('2 * (3 + 4)') == 14\", \"assert evaluate_expression('5 / 2') == 2.5\", \"assert evaluate_expression('(1 + 2) * (3 + 4)') == 21\", \"assert e...
{ "split": "train", "index": 71377, "acecode_id": "evol_9747", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_powers_of_two(n)` that takes an integer `n` as input and returns a list of the first `n` powers of two (i.e., 1, 2, 4, 8, ...). If `n` is less than or equal to 0, the function should return an empty list. The function should use recursion and mem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_powers_of_two(0) == []\", \"assert calculate_powers_of_two(1) == [1]\", \"assert calculate_powers_of_two(2) == [1, 2]\", \"assert calculate_powers_of_two(3) == [1, 2, 4]\", \"assert calculate_powers_of_two(4) == [1, 2, 4, 8]\", \"assert calculate_p...
{ "split": "train", "index": 71378, "acecode_id": "evol_35456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of different attributes for several images. Your task is to implement a function that takes in this list of scores and returns a list where each element is the average score of the attributes for each image. Each image ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_scores([[10, 20, 30], [5, 15], [0], [8, 12, 20, 30]]) == [20.0, 10.0, 0.0, 17.5]\", \"assert average_scores([[1, 2], [3], [], [4, 5, 6]]) == [1.5, 3.0, 0.0, 5.0]\", \"assert average_scores([[7, 14, 21], [3, 6], [12]]) == [14.0, 4.5, 12.0]\", \"assert...
{ "split": "train", "index": 71379, "acecode_id": "bigcode_python_fns_14779", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `permute(input_string: str) -> str` that takes a string of alphanumeric characters and returns the string with its characters arranged in reverse order. The function should handle empty strings and single-character strings appropriately.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert permute('abc123') == '321cba'\", \"assert permute('A1B2C3') == '3C2B1A'\", \"assert permute('1a2b3c') == 'c3b2a1'\", \"assert permute('') == ''\", \"assert permute('A') == 'A'\", \"assert permute('123') == '321'\", \"assert permute('hello') == 'olleh'\", \"a...
{ "split": "train", "index": 71380, "acecode_id": "evol_29193", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given HTML code snippet to extract specific information. The HTML code snippet represents a portion of a web page created using the Dash framework for building analytical web applications. The snippet includes elem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_html_info('''<html><body><br/><h6 id=\\\"Status\\\">Ready</h6></body></html>''') == {'tag_names': ['html', 'body', 'br', 'h6'], 'status_content': 'Ready'}\", \"assert extract_html_info('''<div><h1>Title</h1><html><h6 id=\\\"Status\\\">Processing</h6>...
{ "split": "train", "index": 71381, "acecode_id": "oss_23539", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string `s` that only contains three distinct characters: '(', ')', and '*', determine if the string is valid based on the following criteria: 1. Every left parenthesis '(' should have a corresponding right parenthesis ')'. 2. Every right parenthesis ')' should have a co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert checkValidString('()') == True\", \"assert checkValidString('(*)') == True\", \"assert checkValidString('(*))') == True\", \"assert checkValidString('((*)') == True\", \"assert checkValidString('(*(*))') == True\", \"assert checkValidString(')(') == False\",...
{ "split": "train", "index": 71382, "acecode_id": "evol_29288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple login system. Write a function `login(email: str, password: str) -> str` that simulates the login process for users based on their email and password. The function should return one of the following messages: \n- 'Email does not exist.'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert login('jay@gmail.com', 'b') == 'Incorrect password, try again.'\", \"assert login('jay@gmail.com', 'asdfasdf') == 'Logged in successfully!'\", \"assert login('nonexistent@gmail.com', 'anything') == 'Email does not exist.'\", \"assert login('aa@gmail.com', '1...
{ "split": "train", "index": 71383, "acecode_id": "bigcode_python_fns_33183", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of temperature readings recorded over a period of time. Each reading is represented as a floating-point number. Your task is to implement a function that takes this list of temperature readings and returns a new list that contains only the readings above a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_temperatures([30.5, 32.0, 29.0, 31.5, 28.0], 30.0) == [30.5, 32.0, 31.5]\", \"assert filter_temperatures([25.0, 26.5, 27.0, 24.0], 27.5) == []\", \"assert filter_temperatures([0.0, -5.0, 10.0, 5.0], 0.0) == [10.0, 5.0]\", \"assert filter_temperatures(...
{ "split": "train", "index": 71384, "acecode_id": "bigcode_python_fns_9582", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple contact management functionality. Your goal is to implement a function that simulates a contact list. This function should accept a list of contacts (each represented as a dictionary with keys: 'first_name', 'last_name', 'nickname', 'email'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_contacts([], 'ADD') == []\", \"assert manage_contacts([], 'DELETE_ALL') == []\", \"assert manage_contacts([{'first_name': 'John', 'last_name': 'Doe', 'nickname': 'Johnny', 'email': 'john@example.com', 'birthdate': '01 January 1990', 'phone_number': '1...
{ "split": "train", "index": 71385, "acecode_id": "oss_32285", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that returns the nth Catalan number. Implement this function using only recursion and without using any built-in functions or libraries.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert catalan(0) == 1\", \"assert catalan(1) == 1\", \"assert catalan(2) == 2\", \"assert catalan(3) == 5\", \"assert catalan(4) == 14\", \"assert catalan(5) == 42\", \"assert catalan(6) == 132\", \"assert catalan(7) == 429\", \"assert catalan(8) == 1430\", \"asse...
{ "split": "train", "index": 71386, "acecode_id": "evol_12122", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with generating a filename based on certain input parameters. The filename should be constructed using the following format: `output_dir + '/' + ofile_prefix + key + '_' + param_suffixes + '.csv'`. You are given a string `output_dir`, a string `ofile_prefix`, a d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_filenames('/output', 'result', {'use_feature_scaler': True, 'exclude_molecules': False}, {'accuracies': [0.91], 'correlations': [0.85]}) == ['/output/resultaccuracies_use_feature_scaler=True_exclude_molecules=False.csv', '/output/resultcorrelations_...
{ "split": "train", "index": 71387, "acecode_id": "bigcode_python_fns_30944", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a timekeeping device called a Tymist. The function `simulate_tymist(initial_time: float, seconds_to_advance: float) -> float` should take two parameters: an initial time in seconds (as a float) and a number of seconds t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_tymist(0.0, 10.5) == 10.5\", \"assert simulate_tymist(5.0, 0.0) == 5.0\", \"assert simulate_tymist(10.0, 20.0) == 30.0\", \"assert simulate_tymist(7.5, 2.5) == 10.0\", \"assert simulate_tymist(15.0, 10.0) == 25.0\", \"assert simulate_tymist(0.0, 0.0...
{ "split": "train", "index": 71388, "acecode_id": "oss_33091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages events and their statuses using a dictionary. The function should be able to launch an event, resolve an event, and retrieve the status of an event. The input to the function should be a list of operations containing event na...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_events([('launch', 'Event1'), ('status', 'Event1')]) == ['NOT_RESOLVED']\", \"assert manage_events([('launch', 'Event2'), ('status', 'Event2')]) == ['NOT_RESOLVED']\", \"assert manage_events([('resolve', 'Event3'), ('status', 'Event3')]) == ['Event no...
{ "split": "train", "index": 71389, "acecode_id": "oss_8334", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of items and determines if the list meets specific validation criteria. Write a function `validate_items` that takes in a list of strings `items`. The function should check if the length of the list is exactly...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_items(['item1', 'item2', 'item3', 'item4', 'item5']) == True\", \"assert validate_items(['item1', 'item2', 'item3', 'item4']) == False\", \"assert validate_items(['', 'item2', 'item3', 'item4', 'item5']) == False\", \"assert validate_items(['item1',...
{ "split": "train", "index": 71390, "acecode_id": "oss_33805", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of source points represented as tuples of (x, y, z) coordinates and a target point also represented as a tuple of (x, y, z) coordinates. Your task is to implement a function `align_points(sources: List[Tuple[int, int, int]], target: Tuple[int, int, int]) ->...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert align_points([(1, 1, 1), (2, 2, 2)], (3, 3, 3)) == [(3, 3, 3), (3, 3, 3)]\", \"assert align_points([(0, 0, 0)], (1, 1, 1)) == [(1, 1, 1)]\", \"assert align_points([(5, 5, 5)], (5, 5, 5)) == [(5, 5, 5)]\", \"assert align_points([(1, 2, 3), (4, 5, 6)], (7, 8, ...
{ "split": "train", "index": 71391, "acecode_id": "bigcode_python_fns_5298", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function `create_animal(species: str, weight: float) -> dict` that takes a species as a string and a weight as a float and returns a dictionary representation of an animal with the keys 'species' and 'weight'.\nPlease reason step by step, then write a self-contained Py...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_animal('Dog', 30.5) == {'species': 'Dog', 'weight': 30.5}\", \"assert create_animal('Cat', 10.2) == {'species': 'Cat', 'weight': 10.2}\", \"assert create_animal('Elephant', 5000.0) == {'species': 'Elephant', 'weight': 5000.0}\", \"assert create_animal...
{ "split": "train", "index": 71392, "acecode_id": "evol_29248", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a summary of quality annotations from a list of quality annotations and filtered annotations. Your function should return a dictionary that contains the count of quality annotations, the count of filtered annotations, and a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_annotations(['A', 'B', 'C'], ['D', 'E'], False) == {'quality_count': 3, 'filtered_count': 2, 'unique_annotations': ['A', 'B', 'C']}\", \"assert summarize_annotations(['A', 'A', 'B', 'C'], ['D', 'D'], False) == {'quality_count': 4, 'filtered_count':...
{ "split": "train", "index": 71393, "acecode_id": "bigcode_python_fns_17337", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates updating a user's karma score based on a command input. The function should accept two parameters: a string representing the user's nickname and a string representing a karma command ('++' to increase karma or '--' to decre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_karma('Alice', '++') == 1\", \"assert update_karma('Bob', '--') == -1\", \"assert update_karma('Charlie', '++') == 1\", \"assert update_karma('Alice', '--') == -1\", \"assert update_karma('Alice', '++') == 1\", \"assert update_karma('Alice', '--') == ...
{ "split": "train", "index": 71394, "acecode_id": "bigcode_python_fns_14609", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `create_tech_blog_post(title: str, author: str, content: str, tags: List[str]) -> Dict[str, Any]` that simulates the creation of a tech blog post. The function should take in a title, author, content, and a list of tech-related tags, and return a dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_tech_blog_post('Tech Trends 2022', 'John Doe', 'Some interesting content...', ['AI', 'VR', 'Big Data']) == {'title': 'Tech Trends 2022', 'author': 'John Doe', 'content': 'Some interesting content...', 'tags': ['AI', 'VR', 'Big Data'], 'comments': []}\...
{ "split": "train", "index": 71395, "acecode_id": "evol_10855", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that accepts several configuration parameters for a machine learning experiment and returns them as a dictionary. The function should accept the following parameters with their default values: \n- `nasbench_path`: Path to the NASBench dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert experiment_setup() == {'nasbench_path': '../data/nasbench_only108.tfrecord', 'config_path': '../configs/pretrain_config.json', 'out_dir': '.', 'root': '../data/cifar/', 'seed': 1, 'n_seeds': 10}\", \"assert experiment_setup(nasbench_path='/custom/path/nasben...
{ "split": "train", "index": 71396, "acecode_id": "oss_36108", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of words and returns a new list containing only the words that have all unique characters. The resulting list should be sorted first by the length of the words, and in case of a tie, sorted alphabetically. For example, given the input list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_unique_words(['aaa', 'bb', 'c', 'dddd']) == ['c']\", \"assert sort_unique_words(['x', 'y', 'z']) == ['x', 'y', 'z']\", \"assert sort_unique_words(['abcd', 'efgh', 'ijkl', 'mnop', 'qrst']) == ['abcd', 'efgh', 'ijkl', 'mnop', 'qrst']\", \"assert sort_uniq...
{ "split": "train", "index": 71397, "acecode_id": "evol_1478", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of dates and returns the minimum and maximum dates from the list. The input will be a list of string representations of dates in the format 'YYYY-MM-DD'. If the list is empty, the function should return an empty list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_min_max_dates(['2023-01-01', '2023-01-05', '2023-01-03']) == ['2023-01-01', '2023-01-05']\", \"assert get_min_max_dates(['2022-12-31', '2023-01-01']) == ['2022-12-31', '2023-01-01']\", \"assert get_min_max_dates(['2023-06-15']) == ['2023-06-15', '2023-06...
{ "split": "train", "index": 71398, "acecode_id": "bigcode_python_fns_34117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `reverse_sentence` that takes a string `sentence` as input and returns a new string where the words are in reverse order, and each word is also reversed. The function should ignore punctuation and should be case-insensitive during reversal. Handle any potential...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_sentence('Hello, World!') == 'dlrow olleh'\", \"assert reverse_sentence('Python is fun.') == 'nuf si nohtyp'\", \"assert reverse_sentence('A quick brown fox.') == 'xof nworb kciuq a'\", \"assert reverse_sentence('This is a test.') == 'tset a si siht'...
{ "split": "train", "index": 71399, "acecode_id": "evol_16615", "num_tests": 7 }