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": "Implement a function called 'is_full_stack' that checks if a given stack has reached its maximum capacity. The function should take two parameters: an integer 'max_size' representing the maximum size of the stack, and a list 'data' representing the current items in the stack. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_full_stack(5, [1, 2, 3, 4, 5]) == True\", \"assert is_full_stack(3, [1, 2]) == False\", \"assert is_full_stack(0, []) == True\", \"assert is_full_stack(2, [1]) == False\", \"assert is_full_stack(4, [1, 2, 3, 4]) == True\", \"assert is_full_stack(1, [1]) =...
{ "split": "train", "index": 76600, "acecode_id": "evol_1200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that takes a list of numerical values and normalizes it such that the sum of the normalized values equals 1. The function should handle floating point precision issues appropriately. The input list will contain non-negative numbers only. Write a func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_values([2, 4, 6, 8]) == [0.1, 0.2, 0.3, 0.4]\", \"assert normalize_values([1, 1, 1]) == [1/3, 1/3, 1/3]\", \"assert normalize_values([0, 0, 0]) == [0, 0, 0]\", \"assert normalize_values([1, 2, 3]) == [1/6, 1/3, 1/2]\", \"assert normalize_values([10...
{ "split": "train", "index": 76601, "acecode_id": "evol_22402", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a spell checker using the Levenshtein distance algorithm. The Levenshtein distance between two words is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one word into the other. You need t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert spell_checker(['cat', 'bat', 'rat', 'hat'], 'at', 1) == ['cat', 'bat', 'rat', 'hat']\", \"assert spell_checker(['apple', 'banana', 'orange', 'pineapple', 'kiwi'], 'aple', 1) == ['apple']\", \"assert spell_checker(['car', 'bar', 'far', 'tar'], 'ar', 1) == ['c...
{ "split": "train", "index": 76602, "acecode_id": "oss_23309", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the number of uppercase vowels present solely at even indices of an input string. An uppercase vowel is defined as 'A', 'E', 'I', 'O', or 'U'. The function should take a single input string and return the count of uppercase vowels found at e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_upper('aBCdEf') == 1\", \"assert count_upper('AbCdEfG') == 2\", \"assert count_upper('DBBE') == 0\", \"assert count_upper('AEIOU') == 3\", \"assert count_upper('abcde') == 0\", \"assert count_upper('abcdefg') == 0\", \"assert count_upper('A') == 1\", \...
{ "split": "train", "index": 76603, "acecode_id": "evol_1635", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a notification for a new user registration. The function takes a user's email as input and returns a dictionary containing the email notification details. The dictionary should have the following keys: 'to_emails', 'subject...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_registration_notification('user1@example.com') == {'to_emails': ['admin@example.com'], 'subject': 'New User Registration', 'html_content': 'A new user, user1@example.com, has registered for the CIMAC-CIDC Data Portal. If you are a CIDC Admin, please...
{ "split": "train", "index": 76604, "acecode_id": "bigcode_python_fns_28505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of regular expression patterns and a dictionary containing strings as keys and their corresponding frequencies as values. Your task is to implement a function that counts the total occurrences of each pattern matching any of the strings in the dictionary. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rex_coverage(['a', 'b'], {'a': 2, 'b': 1}, False) == [2, 1]\", \"assert rex_coverage(['c', 'd'], {'cat': 1, 'dog': 1}, False) == [1, 1]\", \"assert rex_coverage(['e', 'f'], {'egg': 1, 'fig': 1}, False) == [1, 1]\", \"assert rex_coverage(['^g', 'h$'], {'grape...
{ "split": "train", "index": 76605, "acecode_id": "bigcode_python_fns_14307", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `toggle_case` that takes a string as input and returns a new string where each character's case is toggled. For example, if the input string is 'hello World', the output should be 'HELLO wORLD'.\nPlease reason step by step, then write a self-contained Python so...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert toggle_case('hello world') == 'HELLO WORLD'\", \"assert toggle_case('HELLO WORLD') == 'hello world'\", \"assert toggle_case('Python3') == 'pYTHON3'\", \"assert toggle_case('12345') == '12345'\", \"assert toggle_case('!@#$%') == '!@#$%'\", \"assert toggle_cas...
{ "split": "train", "index": 76606, "acecode_id": "evol_2028", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_sd(numbers)` that takes a list of numbers and returns the standard deviation of the numbers in the list. The standard deviation is defined as the square root of the variance, where the variance is the average of the squared differences from the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sd([1, 2, 3, 4, 5]) == 1.4142135623730951\", \"assert calculate_sd([10, 10, 10, 10]) == 0.0\", \"assert calculate_sd([1, 1, 1, 1, 1]) == 0.0\", \"assert calculate_sd([1, 2, 3]) == 0.816496580927726\", \"assert calculate_sd([5, 5, 5, 5, 5]) == 0.0\"...
{ "split": "train", "index": 76607, "acecode_id": "evol_34597", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You need to implement the function `initialize_client()` that simulates the initialization of a client application. The function should perform the following tasks in order: 1) Register client actions. 2) Set up a default stats collector. 3) Configure the platform architecture ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_client() == None\", \"assert initialize_client() == None\", \"assert initialize_client() == None\", \"assert initialize_client() == None\", \"assert initialize_client() == None\", \"assert initialize_client() == None\", \"assert initialize_client(...
{ "split": "train", "index": 76608, "acecode_id": "bigcode_python_fns_18449", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that generates the Fibonacci sequence up to a given non-negative integer and returns a list of the prime numbers found in that sequence. If the input is not an integer or is less than 0, the function should return an error message: 'Error: Input is not a non-n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_prime(0) == []\", \"assert fibonacci_prime(1) == []\", \"assert fibonacci_prime(2) == [2]\", \"assert fibonacci_prime(4) == [2, 3]\", \"assert fibonacci_prime(5) == [2, 3, 5]\", \"assert fibonacci_prime(6) == [2, 3, 5]\", \"assert fibonacci_prime(7...
{ "split": "train", "index": 76609, "acecode_id": "evol_33363", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple network topology. Your goal is to implement a function `create_network_topology` that takes a list of device names and a list of connections, and returns a dictionary representing the network topology. The keys of the dictionary should be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_network_topology(['router1', 'switch1'], [('router1', 'switch1')]) == {'router1': ['switch1'], 'switch1': ['router1']}\", \"assert create_network_topology(['router1', 'switch1', 'pc1'], [('router1', 'switch1'), ('switch1', 'pc1')]) == {'router1': ['sw...
{ "split": "train", "index": 76610, "acecode_id": "oss_28561", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the management of parameters for a neural network layer. The function should accept an output dimension and a dictionary of custom parameters. It will then return a dictionary that combines default parameters with the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_layer_params(64, {}) == {'activation': 'linear', 'dropout': 0.0, 'batch_norm': False}\", \"assert manage_layer_params(128, {'activation': 'relu'}) == {'activation': 'relu', 'dropout': 0.0, 'batch_norm': False}\", \"assert manage_layer_params(256, {'dr...
{ "split": "train", "index": 76611, "acecode_id": "oss_28097", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that simulates connecting to a cloud server using given credentials. The function should take a dictionary representing server connection details (including 'host', 'username', and 'password') and return a string indicating whether the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_server({'host': '192.168.1.1', 'username': 'admin', 'password': 'secret'}) == 'successful'\", \"assert connect_to_server({'host': '192.168.1.1', 'username': 'admin'}) == 'failed'\", \"assert connect_to_server({'host': '192.168.1.1', 'password': 's...
{ "split": "train", "index": 76612, "acecode_id": "bigcode_python_fns_46639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a metadata key and its associated raw value. Your task is to implement a function called `humanize_metadata(tag: str, value: Any) -> Optional[str]` that converts the raw value into a human-readable format based on the given key. The function should return a human-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert humanize_metadata('date', 1633072800) == '2021-10-01'\", \"assert humanize_metadata('temperature', 25.0) == '77.0\\u00b0F'\", \"assert humanize_metadata('currency', 100.50) == '$100.50'\", \"assert humanize_metadata('date', 0) == '1970-01-01'\", \"assert hum...
{ "split": "train", "index": 76613, "acecode_id": "bigcode_python_fns_39283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function `delete_connection(connections: List[str], name: Optional[str]) -> str` that simulates deleting a connection from a list of connection names. The function takes in a list of connection names and an optional connection name to be deleted...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_connection(['conn1', 'conn2', 'conn3'], 'conn2') == 'Deleted connection \\\"conn2\\\".'\", \"assert delete_connection(['conn1', 'conn2', 'conn3'], None) == 'Deleted connection \\\"conn1\\\".'\", \"assert delete_connection(['conn1'], 'conn1') == 'Delet...
{ "split": "train", "index": 76614, "acecode_id": "bigcode_python_fns_38732", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the loading of a module from a specified directory. The function should accept two inputs: a string 'directory' representing the path to a directory and a string 'module_name' representing the name of the module you want to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_module('/path/to/module', 'my_module') == '/path/to/module/my_module'\", \"assert load_module('/usr/local/lib', 'numpy') == '/usr/local/lib/numpy'\", \"assert load_module('/home/user/projects', 'my_project') == '/home/user/projects/my_project'\", \"asse...
{ "split": "train", "index": 76615, "acecode_id": "oss_7324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested list, implement a function that flattens the list into a single-level list. The input will be a list that may contain integers or other lists, and the output should be a flat list containing all integers in the same order as they appear in the original nested lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten([1, 2, [3, 4], 5]) == [1, 2, 3, 4, 5]\", \"assert flatten([[1, 2], [3, [4, 5]], 6]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\", \"assert flatten([]) == []\", \"assert flatten([[[1], [2]], 3]) == [1, 2, 3]\", \"ass...
{ "split": "train", "index": 76616, "acecode_id": "bigcode_python_fns_44370", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of GitHub repository information and returns the total number of stars for repositories that pass a specific check. You are given a list of dictionaries, where each dictionary represents a GitHub repository an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_stars_for_checked_repositories([], lambda repo: True) == 0\", \"assert total_stars_for_checked_repositories([{'name': 'repo1', 'stars': 10, 'language': 'Python'}], lambda repo: True) == 10\", \"assert total_stars_for_checked_repositories([{'name': 'rep...
{ "split": "train", "index": 76617, "acecode_id": "oss_18184", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a logging function that accepts a key-value pair, where the key is a string and the value can be of any type. Your function should store the most recent value associated with each unique key. If a key is logged more than once, the latest value shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_key_value('a', 1) is None\", \"assert log_key_value('b', 'test') is None\", \"assert log_key_value('a', 2) is None\", \"assert log_key_value('c', 3.5) is None\", \"assert log_key_value('b', 'updated') is None\", \"assert log_key_value('d', True) is None\...
{ "split": "train", "index": 76618, "acecode_id": "bigcode_python_fns_30340", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes three parameters: a label (string), a lower bound (integer), and an upper bound (integer). The function should return a dictionary with the label as the key and a list of boolean values as the value. The list should contain boo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_boolean_array('test1', 0, 4) == {'test1': [True, False, True, False, True]}\", \"assert create_boolean_array('labelA', 1, 3) == {'labelA': [False, True, False]}\", \"assert create_boolean_array('labelB', -2, 2) == {'labelB': [True, False, True, False,...
{ "split": "train", "index": 76619, "acecode_id": "bigcode_python_fns_18037", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns the sum of all even integers in the list. If there are no even integers, return 0. Your function should handle both positive and negative integers. Write a function called `sum_of_evens` that take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, -2, -4, 1]) == -6\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([-1, -3, 5, 7]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([]) == 0\", \"as...
{ "split": "train", "index": 76620, "acecode_id": "oss_6048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that computes the geometric mean of all the numbers in a given list. The geometric mean is defined as the nth root of the product of n numbers, where n is the number of elements in the list. You may assume that the list will contain only positive numbers and wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert geometric_mean([1, 1, 1, 1]) == 1.0\", \"assert geometric_mean([2, 8]) == 4.0\", \"assert geometric_mean([3, 27]) == 9.0\", \"assert geometric_mean([9, 16]) == 12.0\", \"assert geometric_mean([2, 2, 2, 2, 2]) == 2.0\", \"assert geometric_mean([6, 6, 6, 6]) =...
{ "split": "train", "index": 76621, "acecode_id": "evol_25748", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a string representing a datetime in the format 'YYYY-MM-DD HH:MM:SS'. Your task is to write a function that parses this string into a datetime object. If the string cannot be parsed due to an incorrect format, the function should return a default datetime object r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_datetime('2023-01-01 00:00:00').year == 2023\", \"assert parse_datetime('2023-01-01 00:00:00').month == 1\", \"assert parse_datetime('2023-01-01 00:00:00').day == 1\", \"assert parse_datetime('2023-01-01 00:00:00').hour == 0\", \"assert parse_datetime(...
{ "split": "train", "index": 76622, "acecode_id": "bigcode_python_fns_1766", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a Python function that simulates user authentication by comparing a given username and password against a predefined list of valid credentials. The function should return a JSON object indicating whether the authentication was successful or not. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_authenticate('user1', 'pass1') == '{\\\"authenticated\\\": true, \\\"message\\\": \\\"Authentication successful\\\"}'\", \"assert simple_authenticate('user2', 'pass2') == '{\\\"authenticated\\\": true, \\\"message\\\": \\\"Authentication successful\\\...
{ "split": "train", "index": 76623, "acecode_id": "oss_34294", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple button interface for a software application. Implement a function called `create_buttons` that takes in a string representing the background color and returns a dictionary containing the following keys: 'buttons' and 'version_label'. The 'b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_buttons('white') == {'buttons': ['Install', 'Cancel'], 'version_label': 'ver. 1.0.0'}\", \"assert create_buttons('black') == {'buttons': ['Install', 'Cancel'], 'version_label': 'ver. 1.0.0'}\", \"assert create_buttons('red') == {'buttons': ['Install',...
{ "split": "train", "index": 76624, "acecode_id": "bigcode_python_fns_44295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of a specified number of messages from a chat channel. The function should take in two parameters: `num_messages` (an integer representing the number of messages to delete) and `max_messages` (an integer re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_messages(100, 150) == 100\", \"assert delete_messages(50, 100) == 50\", \"assert delete_messages(150, 100) == 100\", \"assert delete_messages(0, 100) == 0\", \"assert delete_messages(100, 0) == 0\", \"assert delete_messages(75, 75) == 75\", \"assert d...
{ "split": "train", "index": 76625, "acecode_id": "evol_20789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. Your task is to write a function that calculates the average score of the game, excluding the highest and lowest scores. Write a function `calculate_average_score(scores)` that takes in a list of integers `scor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([10, 20, 30, 40, 50]) == 30.0\", \"assert calculate_average_score([1, 2, 3, 4, 5, 6]) == 3.5\", \"assert calculate_average_score([5, 5, 5, 5, 5]) == 5.0\", \"assert calculate_average_score([100, 90, 80, 70, 60]) == 80.0\", \"assert ca...
{ "split": "train", "index": 76626, "acecode_id": "oss_34201", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string s, write a function to determine if it is a palindrome or if it can be rearranged to form a palindrome. The function should return true if the string is a palindrome or if there exists an anagram of the string that is a palindrome. It should return false otherwis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome_or_anagram('malayalam') == True\", \"assert is_palindrome_or_anagram('hello') == False\", \"assert is_palindrome_or_anagram('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome_or_anagram('race a car') == False\", \"assert is_pal...
{ "split": "train", "index": 76627, "acecode_id": "evol_28408", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of transaction dates represented as strings in the format 'YYYY-MM-DD'. Your task is to implement a function `get_latest_transaction_date(transactions: List[str]) -> str` that returns the latest transaction date from the list. If the list is empty, return '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_latest_transaction_date(['2023-01-01', '2023-02-15', '2023-03-30']) == '2023-03-30'\", \"assert get_latest_transaction_date(['2022-12-31', '2023-01-01']) == '2023-01-01'\", \"assert get_latest_transaction_date(['2023-07-15', '2023-06-10', '2023-08-01']) ...
{ "split": "train", "index": 76628, "acecode_id": "bigcode_python_fns_47820", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples where each tuple contains a label (string), a predicted label (string), and a confidence level (float). Your task is to implement a function `aggregate_results(results: List[Tuple[str, str, float]]) -> Dict[str, Dict[str, float]]` that aggregates ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_results([('cat', 'feline', 0.9), ('cat', 'feline', 0.85), ('dog', 'canine', 0.8), ('dog', 'canine', 0.95)]) == {'cat': {'feline': 0.875}, 'dog': {'canine': 0.875}}\", \"assert aggregate_results([('apple', 'fruit', 1.0), ('apple', 'fruit', 0.9), ('b...
{ "split": "train", "index": 76629, "acecode_id": "bigcode_python_fns_18843", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function called `print_number_with_index` that takes this list as input and returns a list of formatted strings where each string describes the number and its index in the format: 'Number at index {index} is {number}'. For example, if the input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_number_with_index([10, 20, 30]) == ['Number at index 0 is 10', 'Number at index 1 is 20', 'Number at index 2 is 30']\", \"assert print_number_with_index([1, 2, 3, 4, 5]) == ['Number at index 0 is 1', 'Number at index 1 is 2', 'Number at index 2 is 3', ...
{ "split": "train", "index": 76630, "acecode_id": "oss_21215", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a dictionary containing role information and generates a report based on the provided data. The function should take the dictionary as input and return a dictionary containing the report. The input dictionary represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_role_data({'roles': {'grains.list_absent': ['web', 'dev']}}) == {'name': 'grains.list_absent', 'changes': {}, 'result': True, 'comment': 'Roles processed successfully', 'comments': []}\", \"assert process_role_data({'roles': {'users.list_absent': ['a...
{ "split": "train", "index": 76631, "acecode_id": "oss_31106", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `equation` representing a mathematical equation in the form 'number1 operator number2', where 'number1' and 'number2' are integers and 'operator' is one of the four basic arithmetic operations: '+', '-', '*', or '/'. Your task is to implement a function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate('3 + 5') == 8\", \"assert calculate('10 - 4') == 6\", \"assert calculate('6 * 7') == 42\", \"assert calculate('8 / 2') == 4\", \"assert calculate('1 + 1') == 2\", \"assert calculate('100 - 75') == 25\", \"assert calculate('50 / 5') == 10\", \"asser...
{ "split": "train", "index": 76632, "acecode_id": "bigcode_python_fns_7720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers that may include negative numbers and zeroes, implement a function that performs insertion sort on the array. Additionally, return the number of shifts made during the sorting process. The function should only return the number of shifts, not the sort...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insertionSort([1, 4, -2, 7, 0, 5]) == 6\", \"assert insertionSort([3, 1, 2]) == 2\", \"assert insertionSort([10, 9, 8, 7]) == 6\", \"assert insertionSort([0, 0, 0, 0]) == 0\", \"assert insertionSort([]) == 0\", \"assert insertionSort([1]) == 0\", \"assert in...
{ "split": "train", "index": 76633, "acecode_id": "evol_12567", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Develop a function `below_zero` that receives a list of integers representing deposit and withdrawal operations in a bank account, and outputs whether the account balance ever becomes negative. If the balance drops below zero, the function should return True, the first transact...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert below_zero([10, 20, -5]) == (False, None, 25)\", \"assert below_zero([0, 0, 0]) == (False, None, 0)\", \"assert below_zero([-1, 1, -1]) == (True, -1, -1)\", \"assert below_zero([100, -50, -60]) == (True, -60, -10)\", \"assert below_zero([1, 2, 3, -7]) == (Tr...
{ "split": "train", "index": 76634, "acecode_id": "evol_33056", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a task manager with a basic queue system. The task manager will take a list of tasks represented as strings and return a list of processed tasks, where each task is appended with the suffix ' processed'. Your function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_tasks(['Task 1', 'Task 2', 'Task 3']) == ['Task 1 processed', 'Task 2 processed', 'Task 3 processed']\", \"assert process_tasks(['Task A']) == ['Task A processed']\", \"assert process_tasks([]) == []\", \"assert process_tasks(['Single Task']) == ['Si...
{ "split": "train", "index": 76635, "acecode_id": "oss_13489", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that finds all prime numbers less than or equal to a given integer `n` using the Sieve of Eratosthenes algorithm. The function should take a single integer input `n` and return a list of all prime numbers up to `n`. Note that the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(0) == []\", \"assert sieve_of_eratosthenes(1) == []\", \"assert sieve_of_eratosthenes(2) == [2]\", \"assert sieve_of_eratosthenes(3) == [2, 3]\", \"assert sieve_of_eratosthenes(4) == [2, 3]\", \"assert sieve_of_eratosthenes(5) == [2, 3,...
{ "split": "train", "index": 76636, "acecode_id": "oss_13032", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that sorts the array in ascending order using the merge sort algorithm. The function should return a new array that contains all the elements of the input array sorted from smallest to largest. You can assume that the input array...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sort([3, 1, 4, 1, 5, 9, 2, 6, 5]) == [1, 1, 2, 3, 4, 5, 5, 6, 9]\", \"assert merge_sort([5]) == [5]\", \"assert merge_sort([2, 1]) == [1, 2]\", \"assert merge_sort([1, 2]) == [1, 2]\", \"assert merge_sort([4, 3, 2, 1]) == [1, 2, 3, 4]\", \"assert merge...
{ "split": "train", "index": 76637, "acecode_id": "bigcode_python_fns_41168", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a Python function that checks if the sum of all individual numbers in an array of integers falls within a specified inclusive range defined by a lower and upper bound. Additionally, the function should ensure that the array contains an even count of numbers. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_within_bounds([2, 4, 6, 8], 10, 30) == True\", \"assert sum_within_bounds([0, 0, 0, 0], 0, 0) == True\", \"assert sum_within_bounds([2, 3, 5], 1, 10) == False\", \"assert sum_within_bounds([10, 20, 30, 40], 50, 100) == True\", \"assert sum_within_bounds(...
{ "split": "train", "index": 76638, "acecode_id": "evol_9363", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing countries, where each dictionary contains the keys 'id', 'name', 'population', and 'gdp', write a function `get_country_names_by_population(countries: List[Dict[str, Union[int, str, float]]], min_population: int) -> List[str]` that retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_country_names_by_population([{'id': 1, 'name': 'Country1', 'population': 10000000, 'gdp': 150000.0}, {'id': 2, 'name': 'Country2', 'population': 8000000, 'gdp': 120000.0}], 5000000) == ['Country1', 'Country2']\", \"assert get_country_names_by_population(...
{ "split": "train", "index": 76639, "acecode_id": "oss_20749", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `compute_roots(a, b, c)` that calculates the roots of a complex quadratic equation given the coefficients a, b, and c. The function should handle all cases, including real and complex roots, as well as special cases such as when the equation has only one ro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_roots(1, -3, 2) == (2+0j, 1+0j)\", \"assert compute_roots(1, 0, -1) == (1+0j, -1+0j)\", \"assert compute_roots(1, 2, 5) == (-1+2j, -1-2j)\", \"assert compute_roots(1, 4, 4) == (-2+0j, -2+0j)\", \"assert compute_roots(2, 4, 2) == (-1+0j, -1+0j)\", \"a...
{ "split": "train", "index": 76640, "acecode_id": "evol_9261", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to generate a formatted string representing a delete action for a Pokémon trading board database. The function should take in the user's gamertag, the name of the Pokémon to be deleted, and the name of the trading board. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_delete_action('Ash', 'Pikachu', 'TRADE_BOARD') == 'To delete Pok\\u00e9mon Pikachu from TRADE_BOARD for user Ash, execute the delete command.'\", \"assert generate_delete_action('Misty', 'Squirtle', 'WATER_TRADE') == 'To delete Pok\\u00e9mon Squirtl...
{ "split": "train", "index": 76641, "acecode_id": "oss_18701", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a URL. Your task is to implement a function that extracts all the valid URLs from a given string. A valid URL starts with 'http://' or 'https://', followed by any characters except whitespace. The function should return a list of unique valid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_valid_urls('No URLs here! Just text.') == []\", \"assert extract_valid_urls('This is a test with no valid URLs') == []\", \"assert extract_valid_urls('http://localhost:8000 is a local server') == ['http://localhost:8000']\", \"assert extract_valid_ur...
{ "split": "train", "index": 76642, "acecode_id": "bigcode_python_fns_28108", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string representing the name of a compressed archive file and returns a list of its contents. The archive file can be in various formats, and the contents are represented as a list of strings. For this problem, you are to sim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_archive_contents('archive1.7z') == ['file1.txt', 'file2.txt', 'file3.doc']\", \"assert list_archive_contents('archive2.zip') == ['image1.png', 'image2.jpg']\", \"assert list_archive_contents('archive3.tar') == ['script.sh', 'readme.md']\", \"assert list...
{ "split": "train", "index": 76643, "acecode_id": "bigcode_python_fns_49676", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that computes the throttle output for an autonomous vehicle based on its target and current velocities. The throttle output must be constrained within a specified range of minimum and maximum values. Implement the function `compute_th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_throttle(10.0, 5.0) == 0.25\", \"assert compute_throttle(0.0, 0.0) == 0.0\", \"assert compute_throttle(5.0, 10.0) == 0.0\", \"assert compute_throttle(20.0, 15.0) == 0.25\", \"assert compute_throttle(15.0, 15.0) == 0.0\", \"assert compute_throttle(3.0...
{ "split": "train", "index": 76644, "acecode_id": "oss_8627", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing initial states of an environment. Your task is to evaluate a policy by applying a simple transformation to each initial state. The transformation will be to double each integer in the list. Implement a function `evaluate_policy(init...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_policy([1, 2, 3]) == [2, 4, 6]\", \"assert evaluate_policy([0, -1, -2]) == [0, -2, -4]\", \"assert evaluate_policy([5]) == [10]\", \"assert evaluate_policy([]) == []\", \"assert evaluate_policy([-3, 0, 3]) == [-6, 0, 6]\", \"assert evaluate_policy([...
{ "split": "train", "index": 76645, "acecode_id": "bigcode_python_fns_27241", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the total cost of a list of grocery items based on their prices. The function should take a list of item names and a corresponding list of their prices as input. Your function should return the total cost of all items. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_cost(['Apples', 'Bananas', 'Milk', 'Bread'], [1.2, 0.5, 2.5, 1.0]) == 5.2\", \"assert calculate_total_cost(['Oranges', 'Yogurt', 'Eggs'], [2.0, 1.5, 3.0]) == 6.5\", \"assert calculate_total_cost(['Rice', 'Pasta'], [3.0, 1.5]) == 4.5\", \"asse...
{ "split": "train", "index": 76646, "acecode_id": "oss_1703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining whether a data update is necessary based on the presence of files for a given source and year, along with a clobber flag. Write a function `check_if_need_update(source: str, year: int, states: List[str], clobber: bool) -> bool` that checks if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_if_need_update('sourceA', 2021, ['NY', 'CA'], True) == True\", \"assert check_if_need_update('sourceB', 2020, ['TX'], False) == True\", \"assert check_if_need_update('sourceB', 2020, ['TX'], True) == True\", \"assert check_if_need_update('sourceC', 201...
{ "split": "train", "index": 76647, "acecode_id": "bigcode_python_fns_23618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a dictionary of parameters and returns a tuple containing specific values extracted from that dictionary. The function should extract the following parameters: 'pretrained_files', 'min_pretrained_embeddings', 'only_incl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_parameters({'pretrained_files': {'file1': 1}, 'min_pretrained_embeddings': 10, 'only_include_pretrained_words': True, 'tokens_to_add': ['token1', 'token2']}) == ({'file1': 1}, 10, True, ['token1', 'token2'])\", \"assert extract_parameters({'pretraine...
{ "split": "train", "index": 76648, "acecode_id": "oss_11070", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `power(x: int, n: int) -> int` that calculates the nth power of a given integer x without using any built-in exponent or power functions. The function should handle cases where n is zero or negative. For any integer x, if n is zero, the result should be 1. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert power(3, 5) == 243\", \"assert power(2, 3) == 8\", \"assert power(5, 0) == 1\", \"assert power(7, 1) == 7\", \"assert power(-2, 2) == 4\", \"assert power(0, 4) == 0\", \"assert power(1, 100) == 1\", \"assert power(3, 0) == 1\", \"assert power(-3, 3) == -27\"...
{ "split": "train", "index": 76649, "acecode_id": "evol_21563", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a variable number of arguments, each representing a simple mathematical expression in the form of strings. Your function should evaluate these expressions and return the sum of their results. The expressions can include add...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expressions('10 - 3', '5 + 2') == 14\", \"assert evaluate_expressions('invalid', '2 * 3') == 6\", \"assert evaluate_expressions('10', '20', '30') == 60\", \"assert evaluate_expressions('1 + 2 + 3', '4 - 2') == 8\", \"assert evaluate_expressions('5 *...
{ "split": "train", "index": 76650, "acecode_id": "bigcode_python_fns_41631", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Construct a Python function that takes a list of integers as input and returns a new list containing only the elements that do not repeat in the input list, maintaining their original order. The function should run in O(n) time complexity. For instance, given the array [1,2,3,3...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert eliminate_repeats([1, 1, 1, 1, 1]) == []\", \"assert eliminate_repeats([4, 5, 6, 4, 5, 6]) == []\", \"assert eliminate_repeats([7, 8, 9, 10, 7]) == [8, 9, 10]\", \"assert eliminate_repeats([]) == []\", \"assert eliminate_repeats([1, 2, 3, 4, 5]) == [1, 2, 3,...
{ "split": "train", "index": 76651, "acecode_id": "evol_32214", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `data` containing JSON data, implement a function `extract_unique_letters(data: str) -> List[str]` that extracts all the letters from the JSON string. The extracted letters should be returned as a sorted list of unique letters. The letters should be case insensit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_letters('{\\\"items\\\": [\\\"Apple\\\", \\\"Banana\\\", 42], \\\"count\\\": 2}') == ['a', 'b', 'e', 'l', 'n', 'p']\", \"assert extract_unique_letters('{\\\"text\\\": \\\"Hello, World!\\\"}') == ['d', 'e', 'h', 'l', 'o', 'r', 'w']\", \"assert ...
{ "split": "train", "index": 76652, "acecode_id": "oss_22643", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of key sequences representing the order in which keys were pressed on a keypad. Each key sequence is a string of digits. Your task is to analyze the key sequences and determine the minimum number of unique digits required to represent all the key sequences....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_unique_digits(['123', '456', '789']) == 9\", \"assert min_unique_digits(['111', '222', '333']) == 3\", \"assert min_unique_digits(['123', '123', '123']) == 3\", \"assert min_unique_digits(['0', '1', '2']) == 3\", \"assert min_unique_digits(['1', '2', '3'...
{ "split": "train", "index": 76653, "acecode_id": "oss_13886", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total energy and optical values based on given input parameters. The function should take two floating-point numbers, `energy_input` and `optical_input`, as arguments. It will simulate the behavior of two separate ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_properties(1.0, 1.0) == (1.0, 2.0)\", \"assert calculate_properties(5.0, 3.0) == (5.0, 6.0)\", \"assert calculate_properties(0.0, 0.0) == (0.0, 0.0)\", \"assert calculate_properties(-1.0, 4.0) == (-1.0, 8.0)\", \"assert calculate_properties(2.5, 2....
{ "split": "train", "index": 76654, "acecode_id": "oss_13362", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that removes all spaces from a given string. The function should take a single input parameter, which is the input string. It should return a new string with all spaces removed. For example, given the input string 'Hello World', the output should be 'HelloW...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_spaces('Hello World') == 'HelloWorld'\", \"assert remove_spaces(' Leading and trailing spaces ') == 'Leadingandtrailingspaces'\", \"assert remove_spaces('NoSpacesHere') == 'NoSpacesHere'\", \"assert remove_spaces(' A B C ') == 'ABC'\", \"assert re...
{ "split": "train", "index": 76655, "acecode_id": "evol_35908", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `extract_font_features` that processes a list of font features. Each feature is represented as a dictionary with the keys: 'name', 'type', and 'description'. Your function should take in a list of these feature dictionaries and ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_font_features([{'name': 'Feature1', 'type': 'ligature', 'description': 'Ligature feature'}, {'name': 'Feature2', 'type': 'stylistic set', 'description': 'Stylish set feature'}], 'ligature') == [{'name': 'Feature1', 'type': 'ligature', 'description': ...
{ "split": "train", "index": 76656, "acecode_id": "oss_9222", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of user passcodes and a target passcode, determine if the target passcode exists in the list. Write a function `is_passcode_valid(passcodes: List[str], target: str) -> bool` that takes in a list of strings `passcodes` representing the valid passcodes and a string `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_passcode_valid(['1234', 'abcd', 'passcode'], '1234') == True\", \"assert is_passcode_valid(['1234', 'abcd', 'passcode'], '5678') == False\", \"assert is_passcode_valid(['abc', 'def', 'ghi'], 'abc') == True\", \"assert is_passcode_valid(['abc', 'def', 'ghi...
{ "split": "train", "index": 76657, "acecode_id": "bigcode_python_fns_4757", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `hex_to_bin(hex_num: str) -> str` that takes a hexadecimal number as a string and converts it to its binary representation as a string. The input will be a valid hexadecimal number. The function should return the binary string without the leading '0b'.\nPle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_bin('A1') == '10100001'\", \"assert hex_to_bin('0') == '0'\", \"assert hex_to_bin('1F') == '11111'\", \"assert hex_to_bin('2A') == '101010'\", \"assert hex_to_bin('FF') == '11111111'\", \"assert hex_to_bin('7B') == '1111011'\", \"assert hex_to_bin('10...
{ "split": "train", "index": 76658, "acecode_id": "evol_17569", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an array of integers `numbers` that is already sorted in ascending order, find two numbers such that they add up to a specific `target` number. Return the indices of the two numbers (1-indexed) as an integer array `answer` of size `2`, where `1 <= answer[0] < answer[1] <=...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert two_sum([2, 7, 11, 15], 9) == [1, 2]\", \"assert two_sum([2, 3, 4], 6) == [1, 3]\", \"assert two_sum([-1, 0], -1) == [1, 2]\", \"assert two_sum([1, 2, 3, 4, 5], 8) == [3, 5]\", \"assert two_sum([0, 1, 2, 3, 4], 5) == [2, 5]\", \"assert two_sum([1, 2, 3, 4, 5...
{ "split": "train", "index": 76659, "acecode_id": "evol_19817", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a role-based access control system for a service. The system should generate a role based on the service name and the name of the function being accessed. Additionally, it should allow for the specification of other authorized roles. Write a fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_roles('example_service', 'read_data', 'admin|manager') == ['admin', 'manager', 'example_service_read_data']\", \"assert update_roles('billing_service', 'process_payment', 'user|editor') == ['user', 'editor', 'billing_service_process_payment']\", \"ass...
{ "split": "train", "index": 76660, "acecode_id": "oss_10595", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple banking operation that tracks the total number of withdrawals and deposits across multiple bank accounts. Write a function `bank_operations(operations)` that takes a list of operations, where each operation is a tuple containing an acti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 200), ('withdraw', 150), ('withdraw', 50), ('deposit', 300)]) == (2, 2)\", \"assert bank_operations([('withdraw', 100)]) == (0, 0)\", \"assert bank_operations([]) == (0, 0)\", \"assert bank_operations([('withdraw', 10), ('deposit...
{ "split": "train", "index": 76661, "acecode_id": "oss_4431", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string representing a Python import statement, write a function `get_import_name(import_stmt: str) -> str` that returns the module and name of the imported item if the import statement is of type `from ... import ...`, otherwise return `None`. The input string will be i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_import_name('from math import sqrt') == 'from math import sqrt'\", \"assert get_import_name('from os import path') == 'from os import path'\", \"assert get_import_name('import sys') == None\", \"assert get_import_name('from collections import defaultdict...
{ "split": "train", "index": 76662, "acecode_id": "bigcode_python_fns_11819", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing the performance statistics of a fictional Python program. Your goal is to write a function called `analyze_performance` that takes a list of dictionaries, each representing a function's performance data. The function should calculate the total time...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_performance([{ 'function_name': 'function1', 'time_spent': 1.2, 'num_calls': 5 }, { 'function_name': 'function2', 'time_spent': 0.5, 'num_calls': 10 }]) == {'total_time': 1.7, 'function_stats': { 'function1': { 'time': 1.2, 'calls': 5 }, 'function2':...
{ "split": "train", "index": 76663, "acecode_id": "oss_20171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers as input and returns the sum of all the odd numbers in the list. If the input list is empty or does not contain any odd numbers, the function should return 0. Your task is to implement the function `su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_odd_numbers([1, 2, 3, 4, 5, 6]) == 9\", \"assert sum_odd_numbers([1, 3, 5, 7]) == 16\", \"assert sum_odd_numbers([]) == 0\", \"assert sum_odd_numbers([2, 4, 6]) == 0\", \"assert sum_odd_numbers([11, 12, 13, 14]) == 24\", \"assert sum_odd_numbers([-1, -2,...
{ "split": "train", "index": 76664, "acecode_id": "oss_19247", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the redirection process for a web application module. Write a function called `redirect_to_module(module_action_id: str) -> str` that takes a module action ID as input and returns a redirect URL string formatted as '/we...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert redirect_to_module('module_action_123') == '/web#action=module_action_123'\", \"assert redirect_to_module('') == 'Invalid module action ID'\", \"assert redirect_to_module('module_action_abc') == '/web#action=module_action_abc'\", \"assert redirect_to_module(...
{ "split": "train", "index": 76665, "acecode_id": "evol_633", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the average of a series of numbers. The function takes a list of integers as input and a termination value. The function should process the list and return the total count of numbers entered before the termination value an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([5, 7, 3, 10, 0, 999], 999) == (5, 5.0)\", \"assert calculate_average([1, 2, 3, 4, 5, 999], 999) == (5, 3.0)\", \"assert calculate_average([10, 20, 30, 999], 999) == (3, 20.0)\", \"assert calculate_average([999], 999) == (0, 0.0)\", \"asser...
{ "split": "train", "index": 76666, "acecode_id": "oss_28475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `authenticate_and_generate_session(auth_token: str) -> str` that simulates the authentication of a client based on an authentication token. The function should perform the following tasks:\n1. Validate the provided `auth_token`. Assum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert authenticate_and_generate_session('invalid_token') == 'Invalid authentication token'\", \"assert authenticate_and_generate_session('token999') == 'Invalid authentication token'\", \"assert authenticate_and_generate_session('token000') == 'Invalid authenticat...
{ "split": "train", "index": 76667, "acecode_id": "oss_16323", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of strings that represent DNA sequences. Your task is to implement a function that identifies and returns a set of sequences that appear more than once in the input list. Each sequence is considered to be a duplicate if it appears at least two times. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_duplicate_sequences(['ATCG', 'GCTA', 'ATCG']) == {'ATCG'}\", \"assert find_duplicate_sequences(['A', 'B', 'C', 'A', 'B']) == {'A', 'B'}\", \"assert find_duplicate_sequences(['GATTACA', 'GATTACA', 'TAGCT']) == {'GATTACA'}\", \"assert find_duplicate_seque...
{ "split": "train", "index": 76668, "acecode_id": "bigcode_python_fns_6938", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer `jump_length` and a positive integer `d`, write a function `jumps_needed` that returns the minimum number of jumps of the given length required to reach or surpass the point (d, 0) from the origin (0, 0) on a 2D plane. The function should handle cases w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert jumps_needed(1, 5) == 5\", \"assert jumps_needed(2, 5) == 3\", \"assert jumps_needed(3, 10) == 4\", \"assert jumps_needed(4, 8) == 2\", \"assert jumps_needed(5, 5) == 1\", \"assert jumps_needed(10, 20) == 2\", \"assert jumps_needed(1, 1) == 1\", \"assert jum...
{ "split": "train", "index": 76669, "acecode_id": "evol_27233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that parses a given GitHub repository URL and extracts the repository owner and repository name. The function should handle various formats of GitHub repository URLs and return the extracted information in a structured format. Writ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_github_url('https://github.com/Luke-Poeppel/treeplotter') == {'owner': 'Luke-Poeppel', 'repository': 'treeplotter'}\", \"assert parse_github_url('https://www.github.com/owner/repoName') == {'owner': 'owner', 'repository': 'repoName'}\", \"assert parse_...
{ "split": "train", "index": 76670, "acecode_id": "oss_33018", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the maximum acceleration in the y-direction for a given set of observations. Each observation is represented by a dictionary with keys 'a_y' and 'obs_acc'. The 'a_y' key represents the current acceleration in the y-direct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_max_acceleration([{'a_y': 0.0, 'obs_acc': 0.0}, {'a_y': 1.0, 'obs_acc': 0.0}]) == [{'a_y': 0.0, 'obs_acc': 0.0}, {'a_y': 1.0, 'obs_acc': 0.0}]\", \"assert calculate_max_acceleration([{'a_y': 1.0, 'obs_acc': 1.0}, {'a_y': 1.0, 'obs_acc': 2.0}]) == [...
{ "split": "train", "index": 76671, "acecode_id": "oss_16890", "num_tests": 8 }
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. The order of the even integers in the new list should be the same as their order in the original list. Please implement the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 22, 33, 42]) == [10, 22, 42]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) =...
{ "split": "train", "index": 76672, "acecode_id": "evol_28518", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of dictionaries representing different AWS accounts and their resource statistics. Each dictionary contains the following keys: 'InstanceCount', 'UserCount', 'SecurityGroupCount', and 'ELBCount', which are all non-negati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_account_stats([{'InstanceCount': 5, 'UserCount': 2, 'SecurityGroupCount': 3, 'ELBCount': 1}, {'InstanceCount': 2, 'UserCount': 1, 'SecurityGroupCount': 1, 'ELBCount': 0}]) == {'AccountsCount': 2, 'InstanceCount': 7, 'UserCount': 3, 'SecurityGroupCo...
{ "split": "train", "index": 76673, "acecode_id": "bigcode_python_fns_28913", "num_tests": 12 }
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 numbers from the original list. The function should maintain the order of the even numbers as they appear in the original list. If there are no even numbers...
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([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([])...
{ "split": "train", "index": 76674, "acecode_id": "oss_25515", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two strings, `old_bucket_name` and `new_bucket_name`, and simulates the renaming of a storage bucket. The function should verify that the new bucket name is not identical to the old bucket name and should return a message indicating the result of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rename_bucket('my-old-bucket-name', 'my-new-bucket-name') == 'Bucket renamed successfully.'\", \"assert rename_bucket('my-old-bucket-name', 'my-old-bucket-name') == 'Error: New bucket name must be different from the old bucket name.'\", \"assert rename_bucke...
{ "split": "train", "index": 76675, "acecode_id": "evol_31496", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that subtracts two matrices element-wise. The function should take two 2D lists (matrices) of the same dimensions as input and return a new 2D list that represents the result of the subtraction. Each element in the resulting matrix should be the difference of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtract_matrices([[10, 9], [8, 5]], [[2, 3], [4, 1]]) == [[8, 6], [4, 4]]\", \"assert subtract_matrices([[1, 2], [3, 4]], [[4, 3], [2, 1]]) == [[-3, -1], [1, 3]]\", \"assert subtract_matrices([[0, 0], [0, 0]], [[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"asse...
{ "split": "train", "index": 76676, "acecode_id": "evol_20803", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary tree, write a function that determines whether it is a valid binary search tree (BST). A valid binary search tree is defined as a binary tree in which every node follows the properties: the left subtree of a node contains only nodes with keys less than the node's...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_bst(TreeNode(2, TreeNode(1), TreeNode(3))) == True\", \"assert is_valid_bst(TreeNode(5, TreeNode(1), TreeNode(4, TreeNode(3), TreeNode(6)))) == False\", \"assert is_valid_bst(TreeNode(2, TreeNode(2), None)) == False\", \"assert is_valid_bst(TreeNode...
{ "split": "train", "index": 76677, "acecode_id": "evol_14117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a notebook based on its unique identifier (ID). The function should take two parameters: a list of notebooks and an ID. Each notebook is represented as a dictionary with keys 'id' and 'content', where 'id' is an integer and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_notebook_content([{'id': 1, 'content': 'Notebook 1'}, {'id': 2, 'content': 'Notebook 2'}], 1) == 'Notebook 1'\", \"assert get_notebook_content([{'id': 1, 'content': 'Notebook 1'}, {'id': 2, 'content': 'Notebook 2'}], 2) == 'Notebook 2'\", \"assert get_no...
{ "split": "train", "index": 76678, "acecode_id": "bigcode_python_fns_11921", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples representing active bets, where each tuple contains two elements: the first element is a string representing the user's name, and the second element is a boolean indicating whether the bet is completed or not. Your task is to implement a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_active_bet_users([('Alice', False), ('Bob', True), ('Alice', False)]) == ['Alice']\", \"assert get_active_bet_users([('Charlie', False), ('Charlie', False), ('David', True), ('Eve', False)]) == ['Charlie', 'Eve']\", \"assert get_active_bet_users([('Frank...
{ "split": "train", "index": 76679, "acecode_id": "bigcode_python_fns_8156", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a countdown from a given integer `n` down to 1. The function should take an integer `n` as input and return a list of strings, each representing the current count in the countdown. The countdown should start from `n` an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countdown(3) == ['3', '2', '1']\", \"assert countdown(5) == ['5', '4', '3', '2', '1']\", \"assert countdown(1) == ['1']\", \"assert countdown(0) == []\", \"assert countdown(-1) == []\", \"assert countdown(10) == ['10', '9', '8', '7', '6', '5', '4', '3', '2',...
{ "split": "train", "index": 76680, "acecode_id": "oss_35019", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of exactly 5 integers, implement a function `process_integers(nums: List[int]) -> Tuple[List[int], List[int]]` that returns a tuple containing two lists. The first list should contain the integers in the original order, and the second list should contain the intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_integers([1, 2, 3, 4, 5]) == ([1, 2, 3, 4, 5], [5, 4, 3, 2, 1])\", \"assert process_integers([-1, 0, 1, 2, 3]) == ([-1, 0, 1, 2, 3], [3, 2, 1, 0, -1])\", \"assert process_integers([10, 20, 30, 40, 50]) == ([10, 20, 30, 40, 50], [50, 40, 30, 20, 10])\...
{ "split": "train", "index": 76681, "acecode_id": "oss_9994", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of announcements as input, where each announcement is represented as a string. Your goal is to return the list of announcements filtered to only include those that contain the word 'urgent'. The function should maint...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_urgent_announcements(['urgent: Meeting at 10 AM', 'Reminder: Bring documents', 'urgent: Project deadline approaching']) == ['urgent: Meeting at 10 AM', 'urgent: Project deadline approaching']\", \"assert filter_urgent_announcements(['No urgent tasks t...
{ "split": "train", "index": 76682, "acecode_id": "oss_11832", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two vectors x and y, each represented as a list of d real numbers, implement a Python function called `euclidean_distance` that computes the Euclidean distance between these two vectors. The Euclidean distance is defined as: distance = sqrt( (x1 - y1)^2 + (x2 - y2)^2 + .....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert euclidean_distance([1, 2, 3], [4, 5, 6]) == 5.196152422706632\", \"assert euclidean_distance([0, 0], [3, 4]) == 5.0\", \"assert euclidean_distance([1, 1], [1, 1]) == 0.0\", \"assert euclidean_distance([-1, -1], [1, 1]) == 2.8284271247461903\", \"assert eucli...
{ "split": "train", "index": 76683, "acecode_id": "oss_32776", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of words and a vocabulary list. Your task is to implement a function that filters the list of words, returning only those words that are present in the vocabulary list. Implement the function `filter_words(words: List[str], vocab: List[str]) -> List[str]`, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_words(['apple', 'banana', 'cherry'], ['banana', 'cherry']) == ['banana', 'cherry']\", \"assert filter_words(['apple', 'banana', 'cherry'], ['apple', 'grape']) == ['apple']\", \"assert filter_words(['dog', 'cat', 'fish'], ['bird', 'lizard']) == []\", \...
{ "split": "train", "index": 76684, "acecode_id": "bigcode_python_fns_13430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_shape_properties` that takes in a shape type (either 'circle' or 'rectangle') and the corresponding dimensions (either radius for a circle or width and height for a rectangle) and returns a tuple of (area, perimeter). The function should raise a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_shape_properties('circle', 5) == (78.53981633974483, 31.41592653589793)\", \"assert calculate_shape_properties('rectangle', 3, 4) == (12, 14)\", \"assert calculate_shape_properties('circle', 1) == (3.141592653589793, 6.283185307179586)\", \"assert ...
{ "split": "train", "index": 76685, "acecode_id": "evol_1788", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the uploading of an image file. The function should take two parameters: an image file name (string) and an image type (string). If the image type is 'private', it should return a string indicating that the image has been u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_image('photo.jpg', 'public') == 'Image uploaded publicly.'\", \"assert upload_image('photo.jpg', 'private') == 'Image uploaded privately.'\", \"assert upload_image('document.pdf', 'public') == 'Image uploaded publicly.'\", \"assert upload_image('docum...
{ "split": "train", "index": 76686, "acecode_id": "bigcode_python_fns_30011", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `classify_energy_sources(detections: List[Tuple[float, float, float, float, int]]) -> List[str]` that takes a list of detections from an object detection model. Each detection is a tuple containing the bounding box coordinates (x1, y1, x2, y2) and the class...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_energy_sources([(0.0, 0.0, 10.0, 10.0, 0)]) == ['solar panel']\", \"assert classify_energy_sources([(0.0, 0.0, 10.0, 10.0, 1)]) == ['wind turbine']\", \"assert classify_energy_sources([(0.0, 0.0, 10.0, 10.0, 2)]) == ['hydroelectric dam']\", \"assert...
{ "split": "train", "index": 76687, "acecode_id": "evol_33289", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine whether a job should bypass a JIRA check based on specific settings and author permissions. The function `bypass_jira_check` takes a dictionary `job` as input and returns a boolean value indicating whether the JIRA check ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bypass_jira_check({'settings': {'bypass_jira_check': True}, 'author_bypass': {'bypass_jira_check': False}}) == True\", \"assert bypass_jira_check({'settings': {'bypass_jira_check': False}, 'author_bypass': {'bypass_jira_check': True}}) == True\", \"assert by...
{ "split": "train", "index": 76688, "acecode_id": "oss_20840", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers representing grouped data and a list of index pointers. The function should return the number of groups in the data, which is determined by the length of the index pointers list minus one. Implement the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_groups([1, 2, 3, 4, 5], [0, 3, 5]) == 2\", \"assert count_groups([10, 20, 30], [0, 1, 2, 3]) == 3\", \"assert count_groups([], [0]) == 0\", \"assert count_groups([5, 6, 7, 8], [0, 4]) == 1\", \"assert count_groups([1, 2], [0, 1, 2]) == 2\", \"assert co...
{ "split": "train", "index": 76689, "acecode_id": "oss_23569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a version string of a Python package to a compatible RPM version string. The input version string follows PEP 440 format, which may include pre-release identifiers such as alpha (a), beta (b), and release candidate (rc). The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_rpm_version('1.0.0') == '1.0.0'\", \"assert convert_to_rpm_version('1.0.0a1') == '1.0.0~xalpha1'\", \"assert convert_to_rpm_version('1.0.0b1') == '1.0.0~xbeta1'\", \"assert convert_to_rpm_version('1.0.0rc1') == '1.0.0~xrc1'\", \"assert convert_to_...
{ "split": "train", "index": 76690, "acecode_id": "bigcode_python_fns_33913", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates the weights of a neural network using the gradient descent algorithm. You are given a weight matrix `W` and a gradient matrix `dW`, both represented as 2D lists (nested lists). Your task is to implement a function `update...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_weights([[5, 6], [7, 8]], [[0.5, 0.5], [0.5, 0.5]], 0.1) == [[4.95, 5.95], [6.95, 7.95]]\", \"assert update_weights([[0, 0], [0, 0]], [[1, 1], [1, 1]], 1) == [[-1, -1], [-1, -1]]\", \"assert update_weights([[10, 20], [30, 40]], [[1, 2], [3, 4]], 0.1) ...
{ "split": "train", "index": 76691, "acecode_id": "oss_29119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates retrieving installed software packages on a system. The function should return a list of package names as strings. Each package name should be unique and should follow a specific format: it should start with an alphanumeric...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted(get_installed_packages()) == sorted(['pkg1', 'pkg2', 'pkg3', 'pkg4'])\", \"assert len(get_installed_packages()) == 4\", \"assert 'pkg1' in get_installed_packages()\", \"assert 'pkg2' in get_installed_packages()\", \"assert 'pkg3' in get_installed_pack...
{ "split": "train", "index": 76692, "acecode_id": "bigcode_python_fns_5530", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a data structure that represents a regular expression, implement a function `represent(element: Element) -> str` that takes an instance of this data structure and returns its string representation. The `Element` class contains various attributes that can represent differe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert represent(Element('a')) == 'a'\", \"assert represent(Element('a*')) == 'a*'\", \"assert represent(Element('a|b')) == 'a|b'\", \"assert represent(Element('(ab|cd)')) == '(ab|cd)'\", \"assert represent(Element('ab?')) == 'ab?'\", \"assert represent(Element('a(...
{ "split": "train", "index": 76693, "acecode_id": "bigcode_python_fns_5704", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `find_largest(lst)` that takes a list of integers `lst` as input and returns the largest integer from that list. If the list is empty, the function should return None.\nPlease reason step by step, then write a self-contained Python solution. Give your final...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_largest([2, 4, 1, 6]) == 6\", \"assert find_largest([-1, -5, -3, -2]) == -1\", \"assert find_largest([10, 20, 30, 40]) == 40\", \"assert find_largest([5]) == 5\", \"assert find_largest([0, 0, 0]) == 0\", \"assert find_largest([]) == None\", \"assert fin...
{ "split": "train", "index": 76694, "acecode_id": "evol_24191", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list with the square of each integer. The function should handle both positive and negative integers, as well as zero. Your function should be named `square_numbers`, and it should take a si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_numbers([-2, -1, 0, 1, 2]) == [4, 1, 0, 1, 4]\", \"assert square_numbers([0]) == [0]\", \"assert square_numbers([3, 4, 5]) == [9, 16, 25]\", \"assert square_numbers([-3, -4, -5]) == [9, 16, 25]\", \"assert square_numbers([-1, 2, -3, 4]) == [1, 4, 9, 1...
{ "split": "train", "index": 76695, "acecode_id": "oss_32414", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `make_palindrome` that finds the shortest possible palindrome that begins with the provided string. The algorithm should follow these steps: 1. Identify the longest suffix of the given string that is a palindrome. 2. Reverse the prefix of the string (the pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('a') == 'a'\", \"assert make_palindrome('abba') == 'abba'\", \"assert make_palindrome('level') == 'level'\", \"assert make_palindrome('noon') == 'noon'\", \"assert make_palindrome('madam') == 'madam'\", \...
{ "split": "train", "index": 76696, "acecode_id": "evol_5568", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given two lists of strings, `a` and `b`, and you need to find the indices of the most similar pair of elements from these lists. The similarity of two strings is determined by a ratio, where a ratio of 1.0 means the strings are identical and a ratio of 0.0 means they ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_best_similar_match(0, 3, 0, 3, ['apple', 'banana', 'cherry'], ['appl', 'banan', 'cherry']) == (2, 2, 1.0)\", \"assert find_best_similar_match(0, 2, 0, 2, ['hello', 'world'], ['hello', 'world']) == (0, 0, 1.0)\", \"assert find_best_similar_match(0, 3, 0,...
{ "split": "train", "index": 76697, "acecode_id": "bigcode_python_fns_14830", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing various variable names. Your task is to write a function that takes this list as input and returns a new list containing only those variable names that end with the suffix '_type'. Write a function `filter_variable_names` that takes ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_variable_names(['counts', 'image', 'account_type', 'url']) == ['account_type']\", \"assert filter_variable_names(['user_type', 'profile', 'session_type']) == ['user_type', 'session_type']\", \"assert filter_variable_names(['data', 'info_type', 'value'...
{ "split": "train", "index": 76698, "acecode_id": "oss_25293", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates input metadata for a digital resource. The function should accept an optional dictionary parameter `data` that allows users to update specific fields of the metadata. The default metadata should include: a title set to 'A t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_input_metadata() == {'title': 'A title', 'authors': [{'first_name': 'An', 'last_name': 'author'}], 'description': 'A description', 'resource_type': {'general': 'other', 'specific': 'other'}, 'license': 'mit-license', 'permissions': 'all_view'}\", \"as...
{ "split": "train", "index": 76699, "acecode_id": "bigcode_python_fns_18375", "num_tests": 15 }