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 timestamps representing the start and end times of various segments, implement a function to calculate the total duration of all segments. Each segment is represented by a tuple of start and end timestamps. The function should return a single integer representin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_duration([(0, 5), (1, 2), (3, 7)]) == 7\", \"assert total_duration([(1, 2), (2, 3), (3, 4)]) == 3\", \"assert total_duration([(1, 5)]) == 4\", \"assert total_duration([(1, 3), (2, 4), (3, 5)]) == 4\", \"assert total_duration([(0, 10), (5, 10), (10, 15)... | {
"split": "train",
"index": 80700,
"acecode_id": "bigcode_python_fns_39800",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to perform linear interpolation on a list of numbers, where some of the numbers can be None, representing missing values. The function should fill in the missing values using linear interpolation based on the indices of the list. Your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpolate_list([1, None, 3]) == [1, 2, 3]\", \"assert interpolate_list([1, 2, None, 4]) == [1, 2, 3, 4]\", \"assert interpolate_list([1, None, None, 4]) == [1, 2, 3, 4]\", \"assert interpolate_list([1, 2, None, None, 5]) == [1, 2, 3, 4, 5]\", \"assert inte... | {
"split": "train",
"index": 80701,
"acecode_id": "oss_5353",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a sequence of particle positions represented as a list of floats, implement a function that simulates a random-walk noise in the velocity applied to this sequence. The function should take in the position sequence and a standard deviation of the noise at the last step, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_random_walk_noise([0.0, 1.0, 2.0], 0.5) is not None\", \"assert len(apply_random_walk_noise([0.0, 1.0, 2.0], 0.5)) == 3\", \"assert apply_random_walk_noise([-1.0, 0.0, 1.0], 0.1) != [-1.0, 0.0, 1.0]\", \"assert apply_random_walk_noise([0.0, 0.0, 0.0], ... | {
"split": "train",
"index": 80702,
"acecode_id": "oss_10338",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that performs a deep search on a dynamically nested list to find all elements containing the number 3. The nested list can have any number of dimensions and may include various data types such as integers, floats, and strings. Your search should be case-insen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deep_search([[1, 2, [3, 4]], [5, 6]]) == [3]\", \"assert deep_search([[1, 2, [3.0, 4]], [5, 'three']]) == [3.0]\", \"assert deep_search([[1, 2, [5, 6]], [7, 'three', [3]]]) == [3]\", \"assert deep_search([[[3]], [4, 5], [6]]) == [3]\", \"assert deep_search([... | {
"split": "train",
"index": 80703,
"acecode_id": "evol_15938",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that handles the unification of two numeric values and the extraction of a row from a list of tuples. The function `unify_and_extract` takes two parameters: `lhs` and `rhs`, which are both numeric values (int or float), and `rowt`, a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unify_and_extract(2, 3, [(1, 2), (3, 4)]) == {'unified_value': 5, 'extracted_row': {'col1': 1, 'col2': 2}}\", \"assert unify_and_extract(1.5, 2.5, [(10, 20), (30, 40)]) == {'unified_value': 4.0, 'extracted_row': {'col1': 10, 'col2': 20}}\", \"assert unify_an... | {
"split": "train",
"index": 80704,
"acecode_id": "oss_16827",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_random_number(low: int, high: int) -> int` that generates a random integer between the given `low` and `high` values, inclusive. The function should use Python's built-in random number generation capabilities. Note that you do not need to handle any e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_number(1, 10) in range(1, 11)\", \"assert generate_random_number(5, 5) == 5\", \"assert generate_random_number(-10, 0) in range(-10, 1)\", \"assert generate_random_number(0, 100) in range(0, 101)\", \"assert generate_random_number(50, 60) in ... | {
"split": "train",
"index": 80705,
"acecode_id": "evol_16711",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given configuration entry is already present in a list of existing entries. Each configuration entry consists of a unique bridge ID and a host IP address. Your function should take two arguments: a list of existing config... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_config_entries([{'bridge_id': 'id', 'host': '1.2.3.4'}], {'bridge_id': 'id', 'host': '1.2.3.4'}) == {'type': 'abort', 'reason': 'already_configured'}\", \"assert check_config_entries([{'bridge_id': 'id', 'host': '1.2.3.4'}], {'bridge_id': 'new_id', 'ho... | {
"split": "train",
"index": 80706,
"acecode_id": "bigcode_python_fns_9906",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function `delete_records_from_list(data: List[int], condition: Callable[[int], bool]) -> List[int]` that takes a list of integers and a condition function. The function should return a new list containing only the integers from the original list that do not s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_records_from_list([1, 2, 3, 4, 5], lambda x: x > 3) == [1, 2, 3]\", \"assert delete_records_from_list([10, 15, 20, 25], lambda x: x % 5 == 0) == []\", \"assert delete_records_from_list([], lambda x: x < 0) == []\", \"assert delete_records_from_list([1... | {
"split": "train",
"index": 80707,
"acecode_id": "evol_21559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates sending a luck message in a chat application. The function `send_luck_message` takes two parameters: `chat_id` (an integer representing the chat identifier) and `reply_to_message_id` (an integer representing the message ide... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_luck_message(1, 100) == {'chat_id': 1, 'reply_to_message_id': 100, 'emoji': '\\ud83c\\udfb2'}\", \"assert send_luck_message(3, -1) == {'chat_id': 3, 'reply_to_message_id': -1, 'emoji': '\\ud83c\\udfb2'}\", \"assert send_luck_message(4, 200) == {'chat_id... | {
"split": "train",
"index": 80708,
"acecode_id": "bigcode_python_fns_17188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of bounding boxes represented as a 2D array, where each bounding box is defined by its center coordinates (xc, yc), width (w), and height (h), convert these bounding boxes into their minimum and maximum corner coordinates (xmin, ymin, xmax, ymax). The input is an a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_bbox([[0, 0, 2, 2]]) == [[-1.0, -1.0, 1.0, 1.0]]\", \"assert convert_bbox([[1, 1, 4, 4]]) == [[-1.0, -1.0, 3.0, 3.0]]\", \"assert convert_bbox([[2, 2, 6, 4]]) == [[-1.0, 0.0, 5.0, 4.0]]\", \"assert convert_bbox([[3, 3, 2, 2]]) == [[2.0, 2.0, 4.0, 4.0... | {
"split": "train",
"index": 80709,
"acecode_id": "bigcode_python_fns_8340",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_password(length: int) -> str` that generates a random password with the specified length. The password must only include the following characters: lowercase letters (excluding 'i' and 'o'), uppercase letters (excluding 'I' and 'O'), and digits (ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password(1) != ''\", \"assert len(generate_password(8)) == 8\", \"assert len(generate_password(12)) == 12\", \"assert generate_password(0) == ''\", \"assert generate_password(2) != generate_password(2)\", \"assert generate_password(5).count('a') <= ... | {
"split": "train",
"index": 80710,
"acecode_id": "bigcode_python_fns_46878",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_palindrome(s: str) -> bool` that checks if a given string is a palindrome. A palindrome is defined as a sequence of characters that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. Your function should return `True`... | 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 ere I saw Elba') == True\", \"assert is_palindrome('No lemon, no melon') ==... | {
"split": "train",
"index": 80711,
"acecode_id": "oss_1856",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `import_file` that simulates the loading and merging of nodes from a specified file. The function should take in two parameters: a string `file_name` representing the name of the file to import, and a boolean `float_nodes` that indicates ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert import_file('valid_file.txt', True) == ['Node_1', 'Node_2', 'Node_3']\", \"assert import_file('another_file.txt', False) == ['Node_1', 'Node_2']\", \"assert import_file('sample_file.txt', False) == ['Node_1']\", \"assert import_file('file_with_two_nodes.txt'... | {
"split": "train",
"index": 80712,
"acecode_id": "bigcode_python_fns_39350",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a hashed password and a string representing a password entered by a user. Your task is to implement a function `verify_password(hashed_password: str, input_password: str) -> bool` that verifies if the entered password, when hashed, matches th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_password('drowssap', 'password') == True\", \"assert verify_password('drowssap', 'drowssap') == False\", \"assert verify_password('!dlroW', 'World!') == True\", \"assert verify_password('!dlroW', 'Hello') == False\", \"assert verify_password('12345', ... | {
"split": "train",
"index": 80713,
"acecode_id": "bigcode_python_fns_10253",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom random number generator that uses a linear congruential generator (LCG) algorithm. The LCG algorithm generates a sequence of pseudo-randomized numbers using the formula: Xn+1 = (a * Xn + c) % m, where Xn is the current number, a is a mu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_numbers(1664525, 1013904223, 2**32, 1) == [0]\", \"assert generate_random_numbers(1664525, 1013904223, 2**32, 2) == [0, 1013904223]\", \"assert generate_random_numbers(1664525, 1013904223, 2**32, 0) == []\", \"assert generate_random_numbers(1... | {
"split": "train",
"index": 80714,
"acecode_id": "oss_19726",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a policy object and a configuration dictionary for an algorithm. The policy can either have a predefined distribution class or, based on the configuration and action space, you need to determine which distribution class to return. Implement a function `get_distrib... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_distribution_class({'dist_class': 'CustomDist'}, {'model': {}}, 'Discrete') == 'CustomDist'\", \"assert get_distribution_class({'dist_class': None}, {'model': {'custom_action_dist': True}}, 'Discrete') == 'CustomDist'\", \"assert get_distribution_class({... | {
"split": "train",
"index": 80715,
"acecode_id": "bigcode_python_fns_23500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a fixed parameter in the format 'parameter_name value'. Your task is to write a function `parse_fixed_params(params: List[str]) -> Dict[str, int]` that converts this list into a dictionary, where the keys are the par... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_fixed_params(['_logFile log.txt', '_maxChrNum -10', '_minChrNum -1', '_branchMul 999', '_simulationsNum 1000', '_logValue 6', '_maxOptimizationIterations 5', '_epsilonLLimprovement 0.01', '_optimizePointsNum 10,2,1', '_optimizeIterNum 0,1,3', '_gainCon... | {
"split": "train",
"index": 80716,
"acecode_id": "bigcode_python_fns_19681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain a mix of letters and special characters. Your task is to implement a function that counts the number of uppercase letters in the string. The function should ignore all non-letter characters. Write a function `count_uppercase_letters(s: st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_uppercase_letters('Hello, World!') == 2\", \"assert count_uppercase_letters('Python3') == 1\", \"assert count_uppercase_letters('lowercase') == 0\", \"assert count_uppercase_letters('') == 0\", \"assert count_uppercase_letters('1234567890!@#$%^&*()') =... | {
"split": "train",
"index": 80717,
"acecode_id": "bigcode_python_fns_32925",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a file has been modified recently. The function should take in two parameters: `current_timestamp` (an integer representing the current time in seconds since the epoch) and `last_modified_timestamp` (an integer representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_file_modified(1700000000, 1700000040) == True\", \"assert check_file_modified(1700000000, 1700000000) == True\", \"assert check_file_modified(1700000000, 1700000039) == True\", \"assert check_file_modified(1700000000, 1700000020) == True\", \"assert ch... | {
"split": "train",
"index": 80718,
"acecode_id": "bigcode_python_fns_29692",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `first_Three_Words(text)` that takes a string as input and returns a list of the first three words from the string, each represented as a tuple containing the word capitalized and its length. If the input is not a string, raise a TypeError with the message 'Inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_Three_Words(' You make me believe in miracles. ') == [('You', 3), ('Make', 4), ('Me', 2)]\", \"assert first_Three_Words('') == 'The input string is empty.'\", \"assert first_Three_Words(' ') == 'The input string is empty.'\", \"assert first_Thre... | {
"split": "train",
"index": 80719,
"acecode_id": "evol_7669",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented as an adjacency list, where each key is a node and the value is a dictionary of neighboring nodes and their respective edge weights. Your task is to implement a function `dijkstras(graph: Dict[str, Dict[str, int]], start_node: str) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dijkstras({'A': {'B': 1, 'C': 4}, 'B': {'C': 2, 'D': 5}, 'C': {'D': 1}, 'D': {}}, 'A') == {'A': 0, 'B': 1, 'C': 3, 'D': 4}\", \"assert dijkstras({'A': {'B': 1}, 'B': {'C': 2}, 'C': {'D': 1}, 'D': {}}, 'A') == {'A': 0, 'B': 1, 'C': 3, 'D': 4}\", \"assert dijk... | {
"split": "train",
"index": 80720,
"acecode_id": "evol_21604",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to manage service alerts in a monitoring system. Your function should have the following requirements: \n\n1. The function `acknowledge_service_alert` takes two parameters: `service_id` (an integer) and `slack_alias` (a string). \n2. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert acknowledge_service_alert(1, 'user123') == 'Alert acknowledged for user user123 in service 1.'\", \"assert acknowledge_service_alert(2, 'user456') == 'Alert acknowledged for user user456 in service 2.'\", \"assert acknowledge_service_alert(-1, 'user123') == ... | {
"split": "train",
"index": 80721,
"acecode_id": "oss_13333",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are integers representing scores and the values are lists of uppercase letters. Your task is to implement a function named `transform` that converts this dictionary into a new format where the keys are lowercase letters and the values a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform({1: ['A', 'E', 'I'], 2: ['D', 'G'], 3: ['B', 'C']}) == {'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'g': 2, 'i': 1}\", \"assert transform({1: ['A', 'A'], 2: ['B'], 3: ['C', 'C', 'C']}) == {'a': 2, 'b': 2, 'c': 9}\", \"assert transform({1: ['X'], 2: ['Y... | {
"split": "train",
"index": 80722,
"acecode_id": "oss_2898",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a simple library system for faculty members. The system allows faculty members to issue and return books, with a maximum limit of 3 books that they can issue at any given time. Implement a function `manage_books(issued_count: int, action: str) -> in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_books(0, 'issue') == 1\", \"assert manage_books(1, 'issue') == 2\", \"assert manage_books(2, 'issue') == 3\", \"assert manage_books(3, 'issue') == 3\", \"assert manage_books(2, 'return') == 1\", \"assert manage_books(1, 'return') == 0\", \"assert mana... | {
"split": "train",
"index": 80723,
"acecode_id": "oss_10857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that accepts two numeric strings as parameters. The function should check if all digits of the second numeric string appear in the first numeric string in the same order. If they do, the function should return a list containing the absolute differences betwee... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_nums('000000000', '0') == [0]\", \"assert check_nums('4444', '44') == [0, 0]\", \"assert check_nums('111111', '11') == [0, 0]\", \"assert check_nums('222', '2') == [0]\", \"assert check_nums('555555', '555') == [0, 0, 0]\", \"assert check_nums('1234567... | {
"split": "train",
"index": 80724,
"acecode_id": "evol_36086",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset that contains movie information in the form of a list of dictionaries. Each dictionary represents a movie with the following keys: 'Title', 'Genres', and 'Year'. Write a function that takes the dataset and a movie title as input, and returns the genres a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_movie_info([{'Title': 'Inception', 'Genres': 'Action, Sci-Fi', 'Year': 2010}, {'Title': 'The Matrix', 'Genres': 'Action, Sci-Fi', 'Year': 1999}], 'Inception') == ('Action, Sci-Fi', 2010)\", \"assert get_movie_info([{'Title': 'Inception', 'Genres': 'Actio... | {
"split": "train",
"index": 80725,
"acecode_id": "bigcode_python_fns_21421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates showing the history of operations over a Network Slice Instance (NSI). The function will take a string input representing the name or ID of the Network Slice Instance and return a list of operations performed on that NS... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert show_nsi_operations('nsi1') == ['create', 'update', 'delete']\", \"assert show_nsi_operations('nsi2') == ['create']\", \"assert show_nsi_operations('nsi3') == []\", \"assert show_nsi_operations('nsi8') == []\", \"assert show_nsi_operations('nsi12') == []\", ... | {
"split": "train",
"index": 80726,
"acecode_id": "bigcode_python_fns_49357",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_characters(*strings)` that takes multiple strings as input and returns a dictionary where each key is a unique alphabetical character (case sensitive) or special character found in the input strings, and the corresponding value is the count of occurr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_characters('hello', 'world') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_characters('123', '!@#') == {'1': 1, '2': 1, '3': 1, '!': 1, '@': 1, '#': 1}\", \"assert count_characters('abc', 'ABC') == {'a': 1, 'b': 1, 'c': ... | {
"split": "train",
"index": 80727,
"acecode_id": "evol_24802",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to process the results of a voting system. The function should identify and return the proposal IDs that have received '0' votes. You are given a list of tuples, where each tuple represents a proposal and its corresponding vote count.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert discard_zero_vote_proposals([('P1', 5), ('P2', 0), ('P3', 3), ('P4', 0), ('P5', 8)]) == ['P2', 'P4']\", \"assert discard_zero_vote_proposals([('P1', 0), ('P2', 0), ('P3', 0)]) == ['P1', 'P2', 'P3']\", \"assert discard_zero_vote_proposals([('P1', 1), ('P2', 2... | {
"split": "train",
"index": 80728,
"acecode_id": "oss_23717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_maximum(x: int, y: int) -> int` that takes two integers, `x` and `y`, as input and returns the larger of the two integers. If they are equal, return either of them. The function should handle negative integers as well.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum(5, 10) == 10\", \"assert find_maximum(10, 5) == 10\", \"assert find_maximum(5, 5) == 5\", \"assert find_maximum(-5, -10) == -5\", \"assert find_maximum(-10, -4) == -4\", \"assert find_maximum(0, 0) == 0\", \"assert find_maximum(100, 100) == 100\... | {
"split": "train",
"index": 80729,
"acecode_id": "evol_22405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing the content-disposition header from an HTTP response. Write a function `extract_filename(header: str) -> str` that extracts and returns the filename specified in the header. The filename can be specified using either 'filename=' or 'filename*... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_filename('attachment; filename=\\\"example.txt\\\"') == 'example.txt'\", \"assert extract_filename('inline; filename=\\\"file.pdf\\\"') == 'file.pdf'\", \"assert extract_filename('attachment; filename=\\\"file with spaces.txt\\\"') == 'file with spac... | {
"split": "train",
"index": 80730,
"acecode_id": "bigcode_python_fns_46766",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that takes a nested list of any dimension (including higher-order matrices) and transforms it into a single linear list. Additionally, implement a second function that takes a linear list and a structure template (in the form of a nested list) and reco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten([[[1, 2], [3, 4]], [[5, 6], [7, 8]]]) == [1, 2, 3, 4, 5, 6, 7, 8]\", \"assert flatten([1, [2, [3, 4]], 5]) == [1, 2, 3, 4, 5]\", \"assert flatten([]) == []\", \"assert flatten([[[[]]]]) == []\", \"assert flatten([[1, 2], [3, 4], [5]]) == [1, 2, 3, 4,... | {
"split": "train",
"index": 80731,
"acecode_id": "evol_2789",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list `num` containing two sublists. The first sublist `num[0]` contains integers, and the second sublist `num[1]` contains lists of integers. Your task is to write a function that takes this list as input and returns a new list where the integers in `num[0]` are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_lists([[3, 1, 4, 2], [[9, 7, 8], [6, 5], [11, 10]]]) == [[1, 2, 3, 4], [[7, 8, 9], [5, 6], [10, 11]]]\", \"assert sort_lists([[5, 3, 8, 1], [[3, 2], [4]]]) == [[1, 3, 5, 8], [[2, 3], [4]]]\", \"assert sort_lists([[10, 20, 30], [[1, 2, 3], [9, 8, 7]]]) =... | {
"split": "train",
"index": 80732,
"acecode_id": "oss_3152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a list of categories. The function should be able to handle the following operations: adding a category, removing a category, retrieving all categories, and clearing all categories. The function takes a list of operations and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_categories([('add', 'CAT1'), ('add', 'CAT2'), ('get', None), ('remove', 'CAT1'), ('get', None), ('add', 'CAT3'), ('add', 'CAT4'), ('get', None), ('clear', None), ('get', None)]) == [2, 1, 3, 0]\", \"assert manage_categories([('add', 'CAT1'), ('get', N... | {
"split": "train",
"index": 80733,
"acecode_id": "oss_20078",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function that takes a list of numbers and returns a dictionary where the keys are the input numbers and the values are tuples containing the following five elements: a boolean indicating if the count of divisors is even, the list of divisors, the sum of the d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyse_number([6]) == {6: (True, [1, 2, 3, 6], 12, 3, (6, 1))}\", \"assert analyse_number([-10]) == {-10: (True, [1, 2, 5, 10], 18, 5, (10, 1))}\", \"assert analyse_number([2.5]) == {2.5: (True, [1, 2], 3, 2, (2, 1))}\", \"assert analyse_number([12]) == {12... | {
"split": "train",
"index": 80734,
"acecode_id": "evol_35137",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a single digit (0-9). Your task is to write a function that takes this list of strings as input and performs two operations on it. First, it should join the strings using a hyphen (-) as the separator and return the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert join_digits(['1', '2', '3', '4']) == ('1-2-3-4', '1234')\", \"assert join_digits(['0', '1', '2']) == ('0-1-2', '012')\", \"assert join_digits(['9']) == ('9', '9')\", \"assert join_digits(['3', '5', '7']) == ('3-5-7', '357')\", \"assert join_digits(['1', '0',... | {
"split": "train",
"index": 80735,
"acecode_id": "oss_2247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of strings as input and returns a triplet consisting of three lists: 1) the original list reversed, 2) every second element from the reversed list, and 3) a list of missing numbers in the range of the length of the original list. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_stack(['first', 'second', 'third']) == (['third', 'second', 'first'], ['second'], [0, 1, 2])\", \"assert process_stack(['a', 'b', 'c', 'd', 'e']) == (['e', 'd', 'c', 'b', 'a'], ['d', 'b'], [0, 1, 2, 3, 4])\", \"assert process_stack(['one', 'two', 'th... | {
"split": "train",
"index": 80736,
"acecode_id": "evol_35050",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings called `lines` and a string called `keyword`. Your task is to implement a function `count_lines_with_keyword(lines: List[str], keyword: str) -> int` that returns the number of strings in the `lines` list that contain the `keyword`. The `keyword` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_lines_with_keyword(['Hello World', 'Hello', 'World'], 'Hello') == 2\", \"assert count_lines_with_keyword(['apple', 'banana', 'cherry'], 'a') == 2\", \"assert count_lines_with_keyword(['dog', 'cat', 'parrot'], 'fish') == 0\", \"assert count_lines_with_k... | {
"split": "train",
"index": 80737,
"acecode_id": "oss_3011",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a device update in a home automation system. The function `update_device` takes two parameters: `host` (a string representing the host of the device) and `device` (either a string representing a special cons... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_device('192.168.1.1', 'CONF_ALL') == 'dynalite-update-192.168.1.1'\", \"assert update_device('10.0.0.5', 'CONF_ALL') == 'dynalite-update-10.0.0.5'\", \"assert update_device('172.16.0.1', 'CONF_ALL') == 'dynalite-update-172.16.0.1'\", \"assert update_d... | {
"split": "train",
"index": 80738,
"acecode_id": "bigcode_python_fns_49050",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given three numeric arrays, return a single output array containing the elements of all three input arrays alternately starting with the first array. If any array is shorter than the others, the remaining elements of the longer arrays should still be included in the output arra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alternate_arrays([1, 2, 3], [4, 5, 6], [7, 8, 9]) == [1, 4, 7, 2, 5, 8, 3, 6, 9]\", \"assert alternate_arrays([], [1, 2], [3, 4, 5]) == [1, 3, 2, 4, 5]\", \"assert alternate_arrays([1], [2], [3]) == [1, 2, 3]\", \"assert alternate_arrays([1, 3], [2], []) == ... | {
"split": "train",
"index": 80739,
"acecode_id": "evol_8414",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `load_dprnn_tasnet` that simulates the loading of a pre-trained DPRNNTasNet model. The function should accept a parameter `name_url_or_file`, which can be a string representing a model name, a URL to download the model, or a path to a model file. If the par... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_dprnn_tasnet(None) == 'DPRNNTasNet instance created without pretrained weights'\", \"assert load_dprnn_tasnet('model_name') == 'DPRNNTasNet instance created with pretrained weights from model_name'\", \"assert load_dprnn_tasnet('https://example.com/mode... | {
"split": "train",
"index": 80740,
"acecode_id": "bigcode_python_fns_45571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Your task is to implement a function that takes this list and returns a new list containing only the ages that are greater than or equal to 18, indicating that these individuals are adults. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_adults([15, 22, 17, 18, 30]) == ([22, 18, 30], 3)\", \"assert filter_adults([12, 13, 14]) == ([], 0)\", \"assert filter_adults([18, 19, 20, 21]) == ([18, 19, 20, 21], 4)\", \"assert filter_adults([5, 6, 7, 8, 9, 10]) == ([], 0)\", \"assert filter_adul... | {
"split": "train",
"index": 80741,
"acecode_id": "bigcode_python_fns_6136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given three strings, implement a function `create_string(s1, s2, s3)` that returns a new string composed of the first letter of each input string in reverse order. For example, if the inputs are 'Hello', 'World', and 'Everyone', the output should be 'EWH'.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_string('Hello', 'World', 'Everyone') == 'EWH'\", \"assert create_string('Apple', 'Banana', 'Cherry') == 'CBA'\", \"assert create_string('Red', 'Green', 'Blue') == 'BGR'\", \"assert create_string('Dog', 'Cat', 'Mouse') == 'MCD'\", \"assert create_strin... | {
"split": "train",
"index": 80742,
"acecode_id": "evol_19257",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns the string with its characters reversed. For example, if the input is 'Hello World!', the output should be '!dlroW olleH'.\nPlease reason step by step, then write a self-contained Python solution. Give your final pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('Hello World!') == '!dlroW olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('') == ''\", \"assert reverse_string('A') == 'A'\", \"assert reverse_string('ab') == '... | {
"split": "train",
"index": 80743,
"acecode_id": "evol_8327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that matches a given URL against a set of predefined routes and extracts dynamic values from those URLs. Each route is defined by a URL pattern that may include placeholders for dynamic segments, such as IDs. Write a function `proc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_route('/journal/new-entry', {'create': '/journal/new-entry'}) == ('create', {})\", \"assert process_route('/journal/123/edit-entry', {'update': '/journal/{id:\\\\d+}/edit-entry'}) == ('update', {'id': '123'})\", \"assert process_route('/journal/456/d... | {
"split": "train",
"index": 80744,
"acecode_id": "oss_13689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary contains information about an event, including a 'state' (string) and a 'date' (string in 'YYYY-MM-DD' format). Your task is to implement a function that processes this list of event dictionaries and adds four new featu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert data_feature_engineering([{'state': 'Alabama', 'date': '2023-01-01'}]) == [{'state': 'Alabama', 'date': '2023-01-01', 'state_code': 'AL', 'weekday': 6, 'month': 'Jan', 'year': 2023}]\", \"assert data_feature_engineering([{'state': 'Texas', 'date': '2023-12-2... | {
"split": "train",
"index": 80745,
"acecode_id": "bigcode_python_fns_26784",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the display of horizontal progress bars using a given theme. The function should take two parameters: a boolean `screenshot_on` which indicates whether to take a screenshot of the progress bars, and a string `theme` that sp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_progress_bars(False, 'flatly') == ['red.Horizontal.TProgressbar', 'green.Horizontal.TProgressbar', 'blue.Horizontal.TProgressbar', 'yellow.Horizontal.TProgressbar']\", \"assert display_progress_bars(False, 'darkly') == ['red.Horizontal.TProgressbar',... | {
"split": "train",
"index": 80746,
"acecode_id": "bigcode_python_fns_6433",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words, and your task is to find the indices of the words that appear most frequently in the list. If there are multiple words with the same maximum frequency, return the indices of the first occurring word(s) in the list. Implement a function `find_best_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_best_subset_indices([\\\"apple\\\", \\\"banana\\\", \\\"apple\\\", \\\"orange\\\", \\\"banana\\\", \\\"apple\\\"]) == [0, 2, 5]\", \"assert find_best_subset_indices([\\\"cat\\\", \\\"dog\\\", \\\"cat\\\", \\\"mouse\\\", \\\"dog\\\", \\\"dog\\\"]) == [1,... | {
"split": "train",
"index": 80747,
"acecode_id": "oss_1167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that merges two pre-sorted lists into a single sorted list. The function should take two lists as input and return a new list that contains all the elements from both input lists in sorted order. Implement the function `merge_sorted_lists(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_sorted_lists([1, 2, 3], []) == [1, 2, 3]\", \"assert merge_sorted_lists([], []) == []\", \"assert merge_sorted_lists([... | {
"split": "train",
"index": 80748,
"acecode_id": "evol_32360",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing the content of each cell in a worksheet. Your task is to implement a function that resizes the columns of the worksheet to fit the content inside the cells of the columns. The function should return a list of integers representing th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert autosize_columns([['Single'], ['A'], ['B'], ['C']]) == [6]\", \"assert autosize_columns([['Empty', '', 'Cell'], ['Another', 'Cell', 'Here']]) == [7, 4, 4]\", \"assert autosize_columns([['1', '22', '333', '4444'], ['A', 'B', 'C', 'D']]) == [1, 2, 3, 4]\", \"a... | {
"split": "train",
"index": 80749,
"acecode_id": "bigcode_python_fns_40376",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_expression(attr1: int, attr2: int, input_val: Union[int, float]) -> Union[int, float, None]` that takes three parameters: `attr1`, `attr2`, and `input_val`. The function should calculate the expression `attr1 + attr2 * input_val`. If `input_val` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_expression(1, 2, 5) == 11\", \"assert calculate_expression(0, 0, 0) == 0\", \"assert calculate_expression(1, 2, 0) == 1\", \"assert calculate_expression(-1, 2, 2) == 3\", \"assert calculate_expression(5, 3, 1) == 8\", \"assert calculate_expression(... | {
"split": "train",
"index": 80750,
"acecode_id": "evol_13894",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array `nums` composed of `n` positive integers. Your task is to calculate the sum of all non-empty continuous subarrays from this array, sort these sums in non-decreasing order, thereby generating a new array of `n * (n + 1) / 2` numbers. Your goal is to return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rangeSum([1,2,3,4], 4, 1, 5) == 13\", \"assert rangeSum([1,2,3,4], 4, 3, 4) == 6\", \"assert rangeSum([1,2,3,4], 4, 1, 10) == 50\", \"assert rangeSum([1], 1, 1, 1) == 1\", \"assert rangeSum([2,3,5], 3, 1, 4) == 15\", \"assert rangeSum([100], 1, 1, 1) == 100\... | {
"split": "train",
"index": 80751,
"acecode_id": "evol_2171",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing signal numbers. Your task is to implement a function `process_signals(signal_list: List[int]) -> List[str]` that returns a list of strings corresponding to each signal. The output should be 'Graceful Exit' for signal numbers that ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_signals([]) == []\", \"assert process_signals([1]) == ['Graceful Exit']\", \"assert process_signals([2]) == ['Graceful Exit']\", \"assert process_signals([15]) == ['Graceful Exit']\", \"assert process_signals([3]) == ['Graceful Exit']\", \"assert pro... | {
"split": "train",
"index": 80752,
"acecode_id": "bigcode_python_fns_27853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple user registration system. Your goal is to create a function that takes a list of tuples, where each tuple contains a username and an email address, and returns a list of dictionaries representing the registered users. Each dictionary sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_users([('user1', 'user1@example.com'), ('user2', 'user2@example.com')]) == [{'username': 'user1', 'email': 'user1@example.com'}, {'username': 'user2', 'email': 'user2@example.com'}]\", \"assert register_users([('user1', 'user1@example.com'), ('user1... | {
"split": "train",
"index": 80753,
"acecode_id": "oss_13620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries where each dictionary represents an agent with keys 'ROLE', 'OTHERROLE', 'TYPE', and an optional key 'notes' which is a list of strings, write a function `get_submitter_email(agents: List[Dict[str, Union[str, List[str]]]]) -> Optional[str]` that ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_submitter_email([]) is None\", \"assert get_submitter_email([{'ROLE': 'OTHER', 'OTHERROLE': 'SUBMITTER', 'TYPE': 'INDIVIDUAL', 'notes': ['not_an_email']}]) is None\", \"assert get_submitter_email([{'ROLE': 'OTHER', 'OTHERROLE': 'SUBMITTER', 'TYPE': 'INDI... | {
"split": "train",
"index": 80754,
"acecode_id": "bigcode_python_fns_21087",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `extract_integer` that takes a float or a string representation of a number as input. The function should return the integer component of the input. If the input is zero, the function should return zero. If the input is an excessively large number (greater ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_integer(5.75) == 5\", \"assert extract_integer(-3.14) == -3\", \"assert extract_integer(0.0) == 0\", \"assert extract_integer('12.99') == 12\", \"assert extract_integer('-0.123') == -0\", \"assert extract_integer('0') == 0\", \"assert extract_integer... | {
"split": "train",
"index": 80755,
"acecode_id": "evol_3705",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that simulates an auction for a product. The function should accept the title, description, starting bid, and deadline for the auction and return a dictionary containing the product details along with a message indicating the auction has started. Ensure tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert auction_product('Vintage Clock', 'An antique clock from the 19th century.', 100.0, '2023-10-31 12:00:00') == {'title': 'Vintage Clock', 'description': 'An antique clock from the 19th century.', 'starting_bid': 100.0, 'deadline': '2023-10-31 12:00:00', 'messa... | {
"split": "train",
"index": 80756,
"acecode_id": "evol_17886",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `even_fibfib(n: int) -> int` that computes the n-th element of the even FibFib sequence, which is defined as the sequence of numbers generated from the Fibonacci sequence where each number is the sum of the previous three Fibonacci numbers. If n is less tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even_fibfib(0) == 0\", \"assert even_fibfib(1) == 0\", \"assert even_fibfib(5) == 0\", \"assert even_fibfib(9) == 0\", \"assert even_fibfib(13) == 0\", \"assert even_fibfib(17) == 0\", \"assert even_fibfib(-1) == 'Invalid Input'\"]}"
} | {
"split": "train",
"index": 80757,
"acecode_id": "evol_11697",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function named `generate_random_sample(shape: Tuple[int], low: float, high: float) -> List[float]` that generates random samples from a uniform distribution. The function should take three parameters: a tuple `shape` that defines the di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_random_sample((1, 5), 10, 20)) == 5\", \"assert all(10 <= x < 20 for x in generate_random_sample((3,), 10, 20))\", \"assert generate_random_sample((0,), 0, 1) == []\", \"assert len(generate_random_sample((4, 4), -10, 0)) == 16\", \"assert all(-1... | {
"split": "train",
"index": 80758,
"acecode_id": "oss_37554",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple banking system function. Write a function `bank_account_operations(operations: List[Tuple[str, Union[int, str]]]) -> Tuple[int, str]` that simulates a series of banking operations. The function should take a list of operations, where ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 1000), ('withdraw', 500)]) == (500, 'Name: John Doe, Account Number: ')\", \"assert bank_account_operations([('set_account_number', '123456'), ('deposit', 2000), ('withdraw', 1000)]) == (1000, 'Name: John Doe, Account Num... | {
"split": "train",
"index": 80759,
"acecode_id": "oss_4082",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a request dictionary and returns a formatted string containing the request information. The request dictionary may contain the following keys: 'aid' (string), 'content' (string), 'city_id' (string), 'city_name' (string)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_request_info({'aid': '12345', 'content': 'Sample content', 'city_id': '567', 'city_name': 'Sample City', 'debug': True}) == 'Request ID: 12345, Content: Sample content, City ID: 567, City Name: Sample City, Debug: True'\", \"assert format_request_info... | {
"split": "train",
"index": 80760,
"acecode_id": "oss_25962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of nodes, where each node is represented as a dictionary containing an 'id' key. Your task is to implement a function that retrieves the node dictionary identified by a supplied node ID. If the node ID does not exist in the list, return None. Write a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_node([{'id': '1'}, {'id': '2'}, {'id': '3'}], '2') == {'id': '2'}\", \"assert get_node([{'id': '1'}, {'id': '2'}, {'id': '3'}], '4') == None\", \"assert get_node([], '1') == None\", \"assert get_node([{'id': 'a'}, {'id': 'b'}, {'id': 'c'}], 'c') == {'id'... | {
"split": "train",
"index": 80761,
"acecode_id": "bigcode_python_fns_4434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the lengths of different strokes. Your task is to create a function that colors each stroke based on its index. The coloring rule is simple: if the index of the stroke is even, color it with 'red', and if the index is odd, color it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert colorize_strokes([5, 10, 15]) == ['red', 'blue', 'red']\", \"assert colorize_strokes([1]) == ['red']\", \"assert colorize_strokes([2, 4, 6, 8]) == ['red', 'blue', 'red', 'blue']\", \"assert colorize_strokes([]) == []\", \"assert colorize_strokes([3, 6, 9, 12... | {
"split": "train",
"index": 80762,
"acecode_id": "bigcode_python_fns_30608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function in Python to determine the least common multiple (LCM) of two positive integers where x and y are strictly positive integers between 1 and 10^5. The function should be implemented in such a way that it has a time complexity of O(log n).\nPlease reason step by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm(3, 5) == 15\", \"assert lcm(4, 6) == 12\", \"assert lcm(10, 15) == 30\", \"assert lcm(7, 9) == 63\", \"assert lcm(12, 15) == 60\", \"assert lcm(1, 100) == 100\", \"assert lcm(100, 100) == 100\", \"assert lcm(21, 6) == 42\", \"assert lcm(5, 12) == 60\", \... | {
"split": "train",
"index": 80763,
"acecode_id": "evol_12817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_current_version()` that retrieves the current version of a specific software system. The version is represented as an integer. Your function should return the integer value representing the version. Assume that the version of the sof... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_current_version() == 3\", \"assert get_current_version() == 3\", \"assert get_current_version() == 3\", \"assert get_current_version() == 3\", \"assert get_current_version() == 3\", \"assert get_current_version() == 3\", \"assert get_current_version() ==... | {
"split": "train",
"index": 80764,
"acecode_id": "bigcode_python_fns_29514",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a Python dictionary as input and returns a string representing the dictionary in a pretty-printed JSON format. The output should have the following properties: the keys should not be sorted, and the indentation should be 4 spac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_pretty_json({'name': 'Alice', 'age': 30}) == '{\\\\n \\\"name\\\": \\\"Alice\\\",\\\\n \\\"age\\\": 30\\\\n}'\", \"assert to_pretty_json({'user': {'id': 1, 'name': 'John'}}) == '{\\\\n \\\"user\\\": {\\\\n \\\"id\\\": 1,\\\\n \\\"na... | {
"split": "train",
"index": 80765,
"acecode_id": "bigcode_python_fns_37286",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even integers from the original list, in the same order they appeared. Implement the following function: `def filter_even_numbers(numbers: List[int]) -> List[int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, 1, 3, 5, 7]) == [0]\", \"assert filter_even_numbers([11, 13, 17]) == []\", \"assert filter_even_numbers([2, 4, 6,... | {
"split": "train",
"index": 80766,
"acecode_id": "oss_10850",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Write a function that takes this list as an input and returns a new list containing only the ages that are greater than or equal to 18. The output list should maintain the original order of the ages. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_adult_ages([15, 18, 21, 17, 20]) == [18, 21, 20]\", \"assert filter_adult_ages([10, 12, 14, 16]) == []\", \"assert filter_adult_ages([18, 19, 20, 21]) == [18, 19, 20, 21]\", \"assert filter_adult_ages([22, 25, 30]) == [22, 25, 30]\", \"assert filter_a... | {
"split": "train",
"index": 80767,
"acecode_id": "bigcode_python_fns_3317",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that uses recursion to calculate the sum of all elements in a given tuple of integers. The function should take a tuple as its only parameter and return the sum of its elements.\nPlease reason step by step, then write a self-contained Python solution. Gi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_recursive((5, 10, 15, 20, 25)) == 75\", \"assert sum_recursive((1, 2, 3, 4, 5)) == 15\", \"assert sum_recursive((0, 0, 0)) == 0\", \"assert sum_recursive((-1, -2, -3)) == -6\", \"assert sum_recursive((100, 200, 300)) == 600\", \"assert sum_recursive((10,... | {
"split": "train",
"index": 80768,
"acecode_id": "evol_6964",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that swaps the first and last characters of the string. If the string has only one character or is empty, return the string unchanged.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_chars('build') == 'duilb'\", \"assert swap_chars('hello') == 'oellh'\", \"assert swap_chars('a') == 'a'\", \"assert swap_chars('') == ''\", \"assert swap_chars('abcde') == 'ebcda'\", \"assert swap_chars('Python') == 'nythoP'\", \"assert swap_chars('1234... | {
"split": "train",
"index": 80769,
"acecode_id": "evol_7433",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating interest accrual based on various notional values. You will receive a variable `NT` representing the notional value. The interest accrual will be calculated based on the following rules: If `NT` is equal to a constant value `NTIED` (which is 1), ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_interest_accrual(1) == 0.05\", \"assert calculate_interest_accrual(2) == 0.06\", \"assert calculate_interest_accrual(3) == 0.06\", \"assert calculate_interest_accrual(0) == 0.00\", \"assert calculate_interest_accrual(1.5) == 0.03\", \"assert calcul... | {
"split": "train",
"index": 80770,
"acecode_id": "oss_17006",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of device temperature readings taken at regular intervals. Each reading is a float representing the temperature in degrees Celsius. Your task is to implement a function that checks if there is a variation in the temperature readings. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_temperature_variation([20.0, 21.0, 20.0]) == True\", \"assert has_temperature_variation([25.0, 25.0, 25.0]) == False\", \"assert has_temperature_variation([30.0, 30.1]) == True\", \"assert has_temperature_variation([15.5, 15.5, 15.5, 15.5]) == False\", \... | {
"split": "train",
"index": 80771,
"acecode_id": "bigcode_python_fns_27785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of non-negative integers, create a new array where each element is the factorial of the corresponding element in the original array. Additionally, the function should accept a parameter to specify the order of the output array: either 'asc' for ascending order or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_array([0, 1, 2, 3], 'asc') == [1, 1, 2, 6]\", \"assert factorial_array([0, 1, 2, 3], 'desc') == [6, 2, 1, 1]\", \"assert factorial_array([4, 5], 'asc') == [24, 120]\", \"assert factorial_array([4, 5], 'desc') == [120, 24]\", \"assert factorial_arra... | {
"split": "train",
"index": 80772,
"acecode_id": "evol_14072",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of whole numbers, construct a function that returns a new list containing the elements of the input list in reverse order without using any built-in utility functions such as reverse(). The function should handle lists containing up to 10^6 elements efficiently.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_seq([7, 1, 4, 9, 3, 8, 6]) == [6, 8, 3, 9, 4, 1, 7]\", \"assert reverse_seq([1]) == [1]\", \"assert reverse_seq([]) == []\", \"assert reverse_seq([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_seq([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert re... | {
"split": "train",
"index": 80773,
"acecode_id": "evol_25145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates parsing a configuration dictionary. The function 'parse_config' should take a dictionary as input, where the dictionary represents configuration settings with keys and values. Your function should retrieve the following spe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config({'defaults': {'redis_host': 'localhost', 'redis_port': 6379, 'redis_db': 0, 'redis_timeout': 1, 'sleep_time': 30, 'expire_time': 300, 'rb_maxlen': 4}}) == {'redis_host': 'localhost', 'redis_port': 6379, 'redis_db': 0, 'redis_timeout': 1, 'sleep_... | {
"split": "train",
"index": 80774,
"acecode_id": "bigcode_python_fns_7718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of six strings representing velocity limits for a robot, convert these strings to floats and return a dictionary where the keys are 'a1' to 'a6' and the values are the corresponding float values. If any string cannot be converted to a float, return an error message... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_velocity_limits(['1.0', '2.0', '3.0', '4.0', '5.0', '6.0']) == {'a1': 1.0, 'a2': 2.0, 'a3': 3.0, 'a4': 4.0, 'a5': 5.0, 'a6': 6.0}\", \"assert get_velocity_limits(['1.5', 'invalid', '3.2', '4.6', '5.1', '6.0']) == {'a1': 1.5, 'a3': 3.2, 'a4': 4.6, 'a5': 5... | {
"split": "train",
"index": 80775,
"acecode_id": "bigcode_python_fns_13139",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `metadata_cols` that contains a list of column names separated by tabs. Your task is to parse this string and convert it into a tuple of individual column names. Write a function `parse_metadata_cols(metadata_cols: str) -> tuple` that takes the input `met... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_metadata_cols('COL1\\\\tCOL2\\\\tCOL3') == ('COL1', 'COL2', 'COL3')\", \"assert parse_metadata_cols('\\\\tCOL2\\\\t\\\\tCOL3\\\\t') == ('COL2', 'COL3')\", \"assert parse_metadata_cols('') == ()\", \"assert parse_metadata_cols('A\\\\tB\\\\tC\\\\tD') == ... | {
"split": "train",
"index": 80776,
"acecode_id": "oss_4132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two binary tree data structures, implement a function `similar_elements(tree1, tree2)` that returns a list of elements that are present in both trees. The trees are represented as arrays where the elements are inserted in a specific order. Each tree can have duplicate val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert similar_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert similar_elements([], [1, 2, 3]) == []\", \"assert similar_elements([1, 1, 1], [1, 1]) == [1]\", \"assert similar_elements([10, 20, 30], [30, 40, 50]) == [30]\", \"assert similar_elements([5, 5, 5], [5]... | {
"split": "train",
"index": 80777,
"acecode_id": "evol_11673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a turn in a dice game. Implement a function `take_turn(num_rolls: int, opponent_score: int, dice: Callable[[], int] = six_sided) -> int` that simulates rolling `num_rolls` dice and returns the points scored for the turn. The function should follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert take_turn(0, 49) == free_bacon(49)\", \"assert take_turn(2, 30, lambda: 4) == 8\", \"assert take_turn(5, 15, lambda: 2) == 10\", \"assert take_turn(0, 99) == free_bacon(99)\", \"assert take_turn(4, 25, lambda: 6) == 24\", \"assert take_turn(2, 50, lambda: 5)... | {
"split": "train",
"index": 80778,
"acecode_id": "bigcode_python_fns_12270",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_secure_code_phrase()` that returns a secure code phrase consisting of at least 8 characters, including at least one letter, one number, and one special symbol. The code phrase should be randomly generated and must be at least 8 characters long. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_secure_code_phrase()) >= 8\", \"assert any(c.isalpha() for c in generate_secure_code_phrase())\", \"assert any(c.isdigit() for c in generate_secure_code_phrase())\", \"assert any(c in string.punctuation for c in generate_secure_code_phrase())\",... | {
"split": "train",
"index": 80779,
"acecode_id": "evol_13361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing booking slots for a conference room. The slots are represented by integers, and you need to create a function `book_slot` that checks if a user can book a specific slot. The function takes two parameters: a list of integers `booked_slots` representi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert book_slot([1, 3, 5], 3) == 'That slot is already booked, please try another one.'\", \"assert book_slot([1, 3, 5], 2) == 'Slot 2 booked successfully.'\", \"assert book_slot([2, 4, 6], 3) == 'Slot 3 booked successfully.'\", \"assert book_slot([], 1) == 'Slot ... | {
"split": "train",
"index": 80780,
"acecode_id": "oss_17464",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a dictionary containing information about feature dimensions for different models. The dictionary maps model names to their respective feature dimensions. Your goal is to create a new dictionary that groups the m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_models_by_dimension({'model_A': 2048, 'model_B': 2048, 'model_C': 1024}) == {2048: ['model_A', 'model_B'], 1024: ['model_C']}\", \"assert group_models_by_dimension({'model_X': 512, 'model_Y': 256, 'model_Z': 512}) == {512: ['model_X', 'model_Z'], 256: ... | {
"split": "train",
"index": 80781,
"acecode_id": "oss_28216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a recursive function that computes the sum of all numeric values in a given list. The list may contain other lists that also need to be summed up. Your function should ignore any non-numeric values, including strings and other data types. Implement a single function named... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_sum([1, 2, 3]) == 6\", \"assert recursive_sum([1, 'a', 3.5]) == 4.5\", \"assert recursive_sum([[], [1, 2], 3]) == 6\", \"assert recursive_sum([1, [2, [3, 4]], 'ignore', 5]) == 15\", \"assert recursive_sum([10, [20, 'text', [30]], 40]) == 100\", \"a... | {
"split": "train",
"index": 80782,
"acecode_id": "evol_1873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a style modification event in a style management system. The function `modify_style(style_name: str, scale_factor: int) -> str` takes two parameters: a `style_name` which is a string representing the name of the style, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_style('dummy style', 3) == 'Style \\\"dummy style\\\" modified to scale 3.'\", \"assert modify_style('test style', 1) == 'Style \\\"test style\\\" modified to scale 1.'\", \"assert modify_style('example style', 0) == 'Error: Scale factor must be great... | {
"split": "train",
"index": 80783,
"acecode_id": "bigcode_python_fns_27788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of file names that represent data files in a specific format. Given a list of file names, you need to implement a function that returns a new list containing only the file names that should be processed based on specific criteria. The crite... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files(['data_participant1_session1.fif', 'data_participant2_session1.fif', 'data_participant1_session2.fif'], 1, None) == ['data_participant1_session1.fif', 'data_participant1_session2.fif']\", \"assert filter_files(['data_participant1_session1.fif', ... | {
"split": "train",
"index": 80784,
"acecode_id": "bigcode_python_fns_37997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that can parse a simple string representation of sensor measurements. The input string will contain the base sensor information followed by several measurements. The base information will be formatted as 'base_name:base_time:base_unit:bas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_sensor_data('sensor1:1622563200:Celsius:25.5,name1:1622563201:Celsius:26.0,name2:1622563202:Celsius:24.0') == {'base_name': 'sensor1', 'base_time': '1622563200', 'base_unit': 'Celsius', 'base_value': '25.5', 'measurements': [('name1', '1622563201', 'Ce... | {
"split": "train",
"index": 80785,
"acecode_id": "oss_19358",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique integers from the original list, preserving the order of their first occurrence. Write a function named `unique_numbers` that takes a single parameter: a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_numbers([1, 2, 2, 3, 4]) == [1, 3, 4]\", \"assert unique_numbers([5, 5, 5, 5]) == []\", \"assert unique_numbers([10, 20, 30, 10, 20]) == [30]\", \"assert unique_numbers([1, 1, 2, 2, 3, 3, 4]) == [4]\", \"assert unique_numbers([]) == []\", \"assert uni... | {
"split": "train",
"index": 80786,
"acecode_id": "oss_26120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of complex numbers, where each complex number is represented as a tuple of two integers (real, imaginary). Your task is to implement a function that multiplies these two lists of complex numbers element-wise and returns a new list of the resulting comple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_multiplication([(1, 2)], [(3, 4)]) == [(3 - 8, 4 + 6)]\", \"assert complex_multiplication([], [(1, 1)]) == []\", \"assert complex_multiplication([(5, 5)], [(1, 1)]) == [(5 - 5, 5 + 5)]\", \"assert complex_multiplication([(0, 1)], [(1, 0)]) == [(0 - 0... | {
"split": "train",
"index": 80787,
"acecode_id": "bigcode_python_fns_15539",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that filters a list of file paths based on a set of excluded paths. Implement a function `filter_file_paths(file_paths: List[str], excluded_paths: List[str]) -> List[str]` that takes in a list of file paths and a list of excluded paths. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_file_paths(['file1.txt', 'file2.txt', 'file3.txt'], ['file2.txt']) == ['file1.txt', 'file3.txt']\", \"assert filter_file_paths(['.hiddenfile', 'visiblefile.txt'], ['.hiddenfile']) == ['visiblefile.txt']\", \"assert filter_file_paths(['readme.md', 'doc... | {
"split": "train",
"index": 80788,
"acecode_id": "bigcode_python_fns_25619",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks for discrepancies between two lists of block hashes from a blockchain network. The function should take two lists of tuples, `db_blocks` and `node_blocks`, where each tuple contains an integer height and a string hash. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_fork_height([(5, 'hash5'), (4, 'hash4'), (3, 'hash3')], [(5, 'hash5'), (4, 'hash4'), (3, 'hash3')]) == -1\", \"assert find_fork_height([(5, 'hash5'), (4, 'hash4'), (3, 'hash3')], [(5, 'hash5'), (4, 'hash4'), (2, 'hash2')]) == 3\", \"assert find_fork_hei... | {
"split": "train",
"index": 80789,
"acecode_id": "bigcode_python_fns_16939",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `get_null_param(param_name: str, default_value: Optional[str]) -> Optional[str]` that returns the default value if the parameter name corresponds to a predefined mapping and the default value is not None. If the parameter name is provided ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_null_param('application_name', None) == 'default_app_name'\", \"assert get_null_param('application_name', 'custom_app_name') == 'custom_app_name'\", \"assert get_null_param('service_account_email', None) == 'default_email'\", \"assert get_null_param('ser... | {
"split": "train",
"index": 80790,
"acecode_id": "oss_32339",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple contains three elements: a module name (string), a list of imported names (list of strings), and a boolean indicating whether the module is a package. Your task is to write a function `get_imports(import_tuples: List[Tuple[str, Li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_imports([('moduleA', ['func1', 'func2'], False), ('moduleB', [], False), ('moduleC', ['func3'], True)]) == [('moduleA', ['func1', 'func2']), ('moduleC', ['func3'])]\", \"assert get_imports([('moduleX', [], False), ('moduleY', ['func4'], True), ('moduleZ'... | {
"split": "train",
"index": 80791,
"acecode_id": "bigcode_python_fns_29367",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a state of an entity represented as a dictionary. The state includes a key 'state' representing the current speed of the entity and a key 'attributes' which is another dictionary containing a key 'options' that is a list of possible speed options. Write a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_entity_speed({'state': 'ridiculous_speed', 'attributes': {'options': ['light_speed', 'ridiculous_speed', 'ludicrous_speed']}}) == True\", \"assert test_entity_speed({'state': 'normal_speed', 'attributes': {'options': ['light_speed', 'ridiculous_speed', ... | {
"split": "train",
"index": 80792,
"acecode_id": "bigcode_python_fns_41095",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cumulative_sum(n: int) -> int` that calculates the cumulative sum of all positive integral numbers from 1 to a given number 'n'. The function should return 0 if 'n' is less than 1. Please ensure that the function can handle large input values efficiently.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_sum(1) == 1\", \"assert cumulative_sum(2) == 3\", \"assert cumulative_sum(3) == 6\", \"assert cumulative_sum(4) == 10\", \"assert cumulative_sum(5) == 15\", \"assert cumulative_sum(10) == 55\", \"assert cumulative_sum(20) == 210\", \"assert cumula... | {
"split": "train",
"index": 80793,
"acecode_id": "evol_10295",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `first_unique(lst)` that takes a list of integers `lst` and returns the first non-repeating integer in the list. If all integers are repeating, return -1.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_unique([1, 2, 3, 4, 4, 3, 2, 1]) == -1\", \"assert first_unique([1, 2, 3, 4, 5, 6]) == 1\", \"assert first_unique([4, 5, 4, 6, 5, 7]) == 6\", \"assert first_unique([7, 8, 9, 7, 8]) == 9\", \"assert first_unique([10, 11, 12, 10, 11]) == 12\", \"assert f... | {
"split": "train",
"index": 80794,
"acecode_id": "evol_5320",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `conf` where keys are strings, and each key maps to another dictionary. You also have a variable `var` which can either be a string or a list of strings. Your task is to modify the `conf` dictionary by overriding its keys with the values from the inne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert overrides({'k': {'m': 5}}, 'k') == {'k': {'m': 5}, 'm': 5}\", \"assert overrides({'p': {'q': 1}}, ['p']) == {'p': {'q': 1}, 'q': 1}\", \"assert overrides({'a': {'b': 1}, 'b': {'c': 2}}, ['a', 'b']) == {'a': {'b': 1}, 'b': 1, 'c': 2}\", \"assert overrides({'f... | {
"split": "train",
"index": 80795,
"acecode_id": "bigcode_python_fns_36685",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a new string with all the vowels removed. The function should be case-insensitive and should handle empty strings appropriately.\nPlease reason step by step, then write a self-contained Python solution. Give your fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_vowels('Hello World') == 'Hll Wrld'\", \"assert remove_vowels('Python') == 'Pythn'\", \"assert remove_vowels('AEIOU') == ''\", \"assert remove_vowels('') == ''\", \"assert remove_vowels('a quick brown fox') == ' qck brwn fx'\", \"assert remove_vowels(... | {
"split": "train",
"index": 80796,
"acecode_id": "evol_32785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `execute_command` that takes a SQL command string and an optional flag `tuples_only`. The function should return a tuple containing a return code (0 for success, 1 for failure), the output of the command if `tuples_only` is True, or an empty string if `tuples_o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('SELECT * FROM users', True) == (0, 'Command executed successfully')\", \"assert execute_command('SELECT * FROM products', True) == (0, 'Command executed successfully')\", \"assert execute_command('DROP TABLE orders', False) == (0, '')\", \"a... | {
"split": "train",
"index": 80797,
"acecode_id": "bigcode_python_fns_29781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a color from the CIE XYZ color space to the sRGB color space. Write a function named `xyz_to_rgb` that takes a tuple of three floats representing the XYZ color values (x, y, z) in the range [0, 100]. The function should return a tuple of three int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert xyz_to_rgb((0, 0, 0)) == (0, 0, 0)\", \"assert xyz_to_rgb((41.24, 21.26, 1.93)) == (255, 0, 0)\", \"assert xyz_to_rgb((0, 100, 0)) == (0, 255, 0)\", \"assert xyz_to_rgb((95.047, 100, 108.883)) == (255, 255, 255)\", \"assert xyz_to_rgb((0, 0, 0.001)) == (0, 0... | {
"split": "train",
"index": 80798,
"acecode_id": "bigcode_python_fns_25",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of VLAN IDs and are tasked with implementing a function that checks if each VLAN ID is valid. A valid VLAN ID is defined as an integer between 1 and 4095, inclusive. Your function should take a list of VLAN IDs as input and return a list of boolean values i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_vlans([1, 100, 200, 3000, 4095]) == [True, True, True, True, True]\", \"assert validate_vlans([0, 1, 4096]) == [False, True, False]\", \"assert validate_vlans([100, 200, 300, 400, 500]) == [True, True, True, True, True]\", \"assert validate_vlans([5... | {
"split": "train",
"index": 80799,
"acecode_id": "oss_4993",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.