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 strings representing terms and a string representing a search prefix, implement a function `find_matching_terms(terms: List[str], prefix: str) -> List[str]` that returns a list of terms that contain the given prefix. The terms should be case-insensitive, meaning...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_matching_terms(['Dog', 'Cat', 'Fish'], 'c') == ['Cat']\", \"assert find_matching_terms(['Hello', 'World', 'hello', 'world'], 'he') == ['Hello', 'hello']\", \"assert find_matching_terms(['Python', 'Java', 'C++', 'JavaScript'], 'java') == ['Java', 'JavaSc...
{ "split": "train", "index": 70700, "acecode_id": "bigcode_python_fns_40556", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `sum_of_primes(n: int) -> int` that calculates the sum of all prime numbers from 1 to the given positive integer `n`. The function should return 0 if `n` is less than 2, as there are no prime numbers less than 2.\nPlease reason step by step, then write a self-c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_primes(1) == 0\", \"assert sum_of_primes(2) == 2\", \"assert sum_of_primes(3) == 5\", \"assert sum_of_primes(4) == 5\", \"assert sum_of_primes(5) == 10\", \"assert sum_of_primes(10) == 17\", \"assert sum_of_primes(20) == 77\", \"assert sum_of_primes(3...
{ "split": "train", "index": 70701, "acecode_id": "evol_25112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total hours worked by employees, considering both regular hours and overtime. You are given the following parameters: \n- `normal_shift`: The duration of a normal shift in hours (an integer).\n- `days_for_work`: The number of days worked by e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_hours(5, 40, 0) == 180\", \"assert calculate_total_hours(8, 0, 0) == 0\", \"assert calculate_total_hours(11, 10, 0) == 99\", \"assert calculate_total_hours(4, 45, 2) == 342\", \"assert calculate_total_hours(6, 20, 0) == 108\", \"assert calcul...
{ "split": "train", "index": 70702, "acecode_id": "oss_29422", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a unique identifier. This identifier should be a string of a specified length, consisting of alphanumeric characters (0-9, a-z). The function should take one parameter, `length`, which indicates the desired length of the id...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_id(5).isalnum() and len(generate_unique_id(5)) == 5\", \"assert generate_unique_id(10).isalnum() and len(generate_unique_id(10)) == 10\", \"assert generate_unique_id(1).isalnum() and len(generate_unique_id(1)) == 1\", \"assert generate_unique...
{ "split": "train", "index": 70703, "acecode_id": "bigcode_python_fns_37654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of timestamps representing events in a football match, determine the percentage of successful recoveries of possession by a team within 10 seconds of their last pass. A recovery is considered successful if the team completes a pass or takes a shot within that time ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recoveries_percentage([(1, 'Team A', True), (5, 'Team B', True), (10, 'Team A', True)], 'Team A') == 100.0\", \"assert recoveries_percentage([(1, 'Team A', True), (12, 'Team B', True), (15, 'Team A', True)], 'Team A') == 0.0\", \"assert recoveries_percentage...
{ "split": "train", "index": 70704, "acecode_id": "bigcode_python_fns_41594", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `file_content_preview(content: str, n: int) -> str` that takes a string `content` representing the content of a file and an integer `n` representing the number of characters to preview from the beginning of the content. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_content_preview('Hello, World!', 5) == 'Hello'\", \"assert file_content_preview('LeetCode', 8) == 'LeetCode'\", \"assert file_content_preview('Data Structures', 0) == ''\", \"assert file_content_preview('Machine Learning', -5) == ''\", \"assert file_con...
{ "split": "train", "index": 70705, "acecode_id": "bigcode_python_fns_38525", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of cities, each associated with a continent and a country. Your task is to create a function that combines these data into a structured format where each city is represented along with its corresponding continent and country. The output should be a list of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_city_data([]) == []\", \"assert combine_city_data([('Sydney', 'Australia', 'Australia'), ('Melbourne', 'Australia', 'Australia')]) == [{'City': 'Melbourne', 'Continent': 'Australia', 'Country': 'Australia'}, {'City': 'Sydney', 'Continent': 'Australia...
{ "split": "train", "index": 70706, "acecode_id": "bigcode_python_fns_1014", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an array of integers, your task is to implement a function that calculates the sum of all even numbers and the sum of all odd numbers in the array. The function should return a tuple containing the sum of even numbers and the sum of odd numbers, respectively. If the input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_even_odd([1, 2, 3, 4, 5]) == (6, 9)\", \"assert sum_even_odd([0, -1, -2, -3, -4]) == (-6, -4)\", \"assert sum_even_odd([]) == (0, 0)\", \"assert sum_even_odd([10, 20, 30]) == (60, 0)\", \"assert sum_even_odd([-1, -3, -5, -7]) == (0, -16)\", \"assert sum_...
{ "split": "train", "index": 70707, "acecode_id": "bigcode_python_fns_37104", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a decimal number to its equivalent value in satoshis, which is the smallest unit of Bitcoin. The input will be a decimal number representing the amount of Bitcoin, and the output should be an integer representing the amount in satoshis. One Bi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_to_satoshi(0.00256741) == 256741\", \"assert normalize_to_satoshi(1.0) == 100000000\", \"assert normalize_to_satoshi(0.0) == 0\", \"assert normalize_to_satoshi(-0.002) == -200000\", \"assert normalize_to_satoshi(0.5) == 50000000\", \"assert normali...
{ "split": "train", "index": 70708, "acecode_id": "evol_2813", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates dropping a table in a database environment. The function, `drop_table`, will take two parameters: `table_name`, a string representing the name of the table to drop, and `db_engine`, a string representing the database connec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert drop_table('users', 'sqlite') == 'Table users dropped successfully.'\", \"assert drop_table('products', 'postgres') == 'Table products dropped successfully.'\", \"assert drop_table('non_existing_table', 'mysql') == 'Table non_existing_table does not exist.'\...
{ "split": "train", "index": 70709, "acecode_id": "bigcode_python_fns_11403", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple session manager for an application. The function should accept a list of commands, where each command is a string that can be one of the following: 'initialize', 'reset_session', 'reset_to_defaults', 'optimize', or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert session_manager(['initialize']) == [{'status': 'initialized'}]\", \"assert session_manager(['reset_session']) == [{'status': 'session reset'}]\", \"assert session_manager(['reset_to_defaults']) == [{'status': 'defaults reset'}]\", \"assert session_manager(['...
{ "split": "train", "index": 70710, "acecode_id": "bigcode_python_fns_21893", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of strings and a tuple containing a prefix and a suffix, implement a function that filters the list to include only those strings that start with the given prefix and end with the given suffix. The resulting list should be sorted based on the length of the strings ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_by_prefix_and_suffix([], ('a', 'z')) == []\", \"assert filter_by_prefix_and_suffix(['test', 'tent', 'text', 'tint'], ('t', 't')) == ['test', 'tent', 'text', 'tint']\", \"assert filter_by_prefix_and_suffix(['a', 'ab', 'abc', 'abcd'], ('a', 'd')) == ['a...
{ "split": "train", "index": 70711, "acecode_id": "evol_17067", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `find_sequences(data_set: str, sequences: List[str]) -> Dict[str, Optional[int]]` that locates specific number sequences within a given numerical data set. The function should return a dictionary where each key is a number sequence from the input list and e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_sequences('123456789101112131415161718192021', ['999']) == {'999': None}\", \"assert find_sequences('123456789101112131415161718192021', []) == {}\", \"assert find_sequences('123456789101112131415161718192021', ['123', '456', '789']) == {'123': 0, '456'...
{ "split": "train", "index": 70712, "acecode_id": "evol_29402", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an array of integers and a list of conditional functions, implement a function `pluck(arr, cond_fn_list)` that returns the first element in the array that satisfies all the conditions defined by the functions in `cond_fn_list` along with its index. If no element satisfies...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pluck([4, 2, 3], [lambda x: x % 2 == 0, lambda x: x < 3]) == [2, 1]\", \"assert pluck([1, 2, 3, 4], [lambda x: x % 2 == 1, lambda x: x < 4]) == [1, 0]\", \"assert pluck([9, 6, 3, 0], [lambda x: x % 3 == 0, lambda x: x < 0]) == []\", \"assert pluck([5, 0, 3, ...
{ "split": "train", "index": 70713, "acecode_id": "evol_444", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that sorts an array of integers using the Shell Sort algorithm. The function should take a list of integers as its input and return a new list that contains the integers sorted in ascending order. For instance, given the input list [14, 52, 7, 1, 9, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shell_sort([14, 52, 7, 1, 9, 75, 3]) == [1, 3, 7, 9, 14, 52, 75]\", \"assert shell_sort([5, 3, 8, 6, 2]) == [2, 3, 5, 6, 8]\", \"assert shell_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert shell_sort([1]) == [1]\", \"assert shell_sort([]) == []...
{ "split": "train", "index": 70714, "acecode_id": "evol_13924", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a positive integer n, implement a function that splits the list into sublists, each containing n elements. If the list cannot be split evenly, the last sublist may contain fewer than n elements. The function should return a list of these sublists. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_split([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert list_split([1, 2, 3, 4, 5], 3) == [[1, 2, 3], [4, 5]]\", \"assert list_split([], 1) == []\", \"assert list_split([1, 2, 3], 1) == [[1], [2], [3]]\", \"assert list_split([1, 2, 3, 4], 4) == [...
{ "split": "train", "index": 70715, "acecode_id": "bigcode_python_fns_23447", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `find_maximum` that returns the maximum integer in the list. If the list is empty, return None. The function should take a single argument, which is a list of integers, and should return an integer or None. You can assume that the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4]) == -1\", \"assert find_maximum([0, 0, 0, 0]) == 0\", \"assert find_maximum([-5, -4, -3, -2, -1]) == -1\", \"assert find_maximum([10]) == 10\", \"assert find_maximum([100, 200, 300]...
{ "split": "train", "index": 70716, "acecode_id": "bigcode_python_fns_22305", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `compute_median` that calculates the median of an array of integers. The function should handle erroneous inputs, such as non-integer values or empty lists, by returning None. Do not use any sort or comparison operators in your implementation. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_median([1, 3, 2]) == 2\", \"assert compute_median([1, 2, 3, 4]) == 2.5\", \"assert compute_median([5]) == 5\", \"assert compute_median([]) == None\", \"assert compute_median([1, 'a', 3]) == None\", \"assert compute_median([1, None, 3]) == None\", \"a...
{ "split": "train", "index": 70717, "acecode_id": "evol_35460", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the daily stock prices of a company. Implement a function `calculate_daily_difference(prices: List[int]) -> List[int]` that calculates the daily difference in stock prices. The daily difference is defined as the difference between t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_daily_difference([100, 110, 105]) == [0, 10, -5]\", \"assert calculate_daily_difference([50, 50, 50]) == [0, 0, 0]\", \"assert calculate_daily_difference([200]) == [0]\", \"assert calculate_daily_difference([10, 20, 30, 40]) == [0, 10, 10, 10]\", \...
{ "split": "train", "index": 70718, "acecode_id": "bigcode_python_fns_46812", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list of predictions where each row represents the probabilities of a class for a particular instance and an integer indicating the number of classes, implement a function `predict_to_score(predicts: List[List[float]], num_class: int) -> float` that calculates the sco...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_to_score([[0.0, 0.0, 0.0]], 3) == 0.0\", \"assert predict_to_score([[0.5, 0.3, 0.2]], 2) == 0.3\", \"assert predict_to_score([[0.4, 0.6]], 2) == 0.6\", \"assert predict_to_score([[0.0, 0.0, 0.0]], 2) == 0.0\", \"assert predict_to_score([[1.0, 0.0, 0....
{ "split": "train", "index": 70719, "acecode_id": "bigcode_python_fns_29630", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple game of rock-paper-scissors. The function should take two arguments representing the choices of two players and return the result of the game based on the standard rules of rock-paper-scissors. The choices c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock', 'scissors') == 'Player 1 wins'\", \"assert rock_paper_scissors('scissors', 'paper') == 'Player 1 wins'\", \"assert rock_paper_scissors('paper', 'rock') == 'Player 1 wins'\", \"assert rock_paper_scissors('scissors', 'rock') == 'Pla...
{ "split": "train", "index": 70720, "acecode_id": "oss_35489", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `connect(**kwargs)` that simulates establishing a connection to a service. The function should return a connection object. The connection object should have a method `execute_query(query: str) -> str` that takes a SQL query as a strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect().execute_query('SELECT * FROM users') == 'Query executed successfully.'\", \"assert connect().close() == 'Connection closed.'\", \"assert connect().execute_query('DELETE FROM users WHERE id = 1') == 'Query executed successfully.'\", \"assert connect...
{ "split": "train", "index": 70721, "acecode_id": "bigcode_python_fns_9204", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines the type of a post based on its properties. The input is a dictionary representing the post, which contains a key 'properties' that maps to another dictionary. The function should identify the post type based on the fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_post_type({'properties': {'rsvp': ['yes']}}) == 'rsvp'\", \"assert get_post_type({'properties': {'in-reply-to': ['123']}}) == 'reply'\", \"assert get_post_type({'properties': {'repost-of': ['456']}}) == 'repost'\", \"assert get_post_type({'properties': {...
{ "split": "train", "index": 70722, "acecode_id": "bigcode_python_fns_7014", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a string that represents a list of comma-separated values, write a function `header_elements(fieldname: str, fieldvalue: str) -> List[str]` that returns a sorted list of these values in reverse order. If the `fieldvalue` is empty, the function should return an empty list....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert header_elements('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)') == ['Mozilla/5.0 (Windows NT 10.0; Win64; x64)']\", \"assert header_elements('Accept', 'text/html, application/xhtml+xml, image/jxr, */*') == ['text/html', 'image/jxr', 'application/x...
{ "split": "train", "index": 70723, "acecode_id": "bigcode_python_fns_8488", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of strings by extracting a specific substring from each string. The function should take two parameters: a list of strings and a substring to extract. The substring should be extracted from each string if it exists; ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_substrings(['hello world', 'python programming', 'test case'], 'o') == ['o', 'o', 'Not Found']\", \"assert extract_substrings(['apple', 'banana', 'cherry'], 'a') == ['a', 'a', 'Not Found']\", \"assert extract_substrings(['abcdef', 'ghijkl', 'mnopqr']...
{ "split": "train", "index": 70724, "acecode_id": "oss_36597", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists, one containing names (strings) and the other containing corresponding ages (integers), create a function that combines these two lists into a dictionary. If a name appears more than once, increment its age by 1 for each duplicate found. The function should rais...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine(['Alice', 'Bob', 'Alice'], [30, 25, 30]) == {'Alice': 31, 'Bob': 25}\", \"assert combine(['Diana', 'Eve'], [40, 35]) == {'Diana': 40, 'Eve': 35}\", \"assert combine(['Frank', 'Grace', 'Frank', 'Hannah'], [28, 30, 28, 22]) == {'Frank': 29, 'Grace': 30...
{ "split": "train", "index": 70725, "acecode_id": "evol_25974", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of model field alteration operations and returns a dictionary containing the model names and the corresponding fields that are being altered. Each operation in the list is represented by a dictionary containin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_migration_operations([]) == {}\", \"assert process_migration_operations([{'model_name': 'model1', 'name': 'field1'}]) == {'model1': ['field1']}\", \"assert process_migration_operations([{'model_name': 'model1', 'name': 'field1'}, {'model_name': 'mode...
{ "split": "train", "index": 70726, "acecode_id": "oss_7170", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a sequence of integers using a simple recurrent neural network (RNN) model. Implement a function `process_sequence` that takes a list of integers as input and returns the sum of the integers in the list. The function should also return the maximum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_sequence([1, 2, 3, 4, 5]) == (15, 5, 1)\", \"assert process_sequence([-1, -2, -3]) == (-6, -1, -3)\", \"assert process_sequence([0, 0, 0]) == (0, 0, 0)\", \"assert process_sequence([10]) == (10, 10, 10)\", \"assert process_sequence([]) == (0, float('...
{ "split": "train", "index": 70727, "acecode_id": "oss_3092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an input `x`, implement a function that converts `x` into a tuple of length two. If `x` is already a tuple of length two, return it as is. If `x` is not a tuple, return a new tuple where both elements are `x`. Your function should handle any type of input. Write the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tuplify2d(5) == (5, 5)\", \"assert tuplify2d('hello') == ('hello', 'hello')\", \"assert tuplify2d((1, 2)) == (1, 2)\", \"assert tuplify2d((3.14, 2.71)) == (3.14, 2.71)\", \"assert tuplify2d(None) == (None, None)\", \"assert tuplify2d(True) == (True, True)\",...
{ "split": "train", "index": 70728, "acecode_id": "bigcode_python_fns_43374", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that inserts a given value into the middle of a singly linked list. The linked list is represented by a series of nodes, where each node contains a data value and a pointer to the next node. If the linked list is empty, the new value ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_in_middle(Node(1), 2).data == 1 and add_in_middle(Node(1), 2).next.data == 2\", \"assert add_in_middle(Node(1), 2).next.next == None\", \"assert add_in_middle(Node(1), 2).next.next == None\", \"assert add_in_middle(Node(1), 2).next.next == None\", \"asse...
{ "split": "train", "index": 70729, "acecode_id": "evol_11193", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a configuration management system for a software application that allows toggling configuration parameters. Implement a function `toggle_boolean_parameter(configurations: dict, key: str) -> bool` that takes in a dictionary of configurations and a ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert toggle_boolean_parameter({'GDPR_LOG_ON_ANONYMISE': True}, 'GDPR_LOG_ON_ANONYMISE') == False\", \"assert toggle_boolean_parameter({'GDPR_LOG_ON_ANONYMISE': False}, 'GDPR_LOG_ON_ANONYMISE') == True\", \"assert toggle_boolean_parameter({'GDPR_LOG_ON_ANONYMISE':...
{ "split": "train", "index": 70730, "acecode_id": "oss_7335", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given the root of a binary tree, where the root's level is defined as 1, and the subsequent levels of its offspring are incremented by 1, implement a function that identifies the smallest level x that yields the highest cumulative value of all nodes present at that level. You c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxLevelSum(TreeNode(1, TreeNode(7), TreeNode(0, TreeNode(7), TreeNode(-8)))) == 2\", \"assert maxLevelSum(TreeNode(989, None, TreeNode(10250, TreeNode(98693), TreeNode(-89388)))) == 2\", \"assert maxLevelSum(TreeNode(-1, TreeNode(-2), TreeNode(-3))) == 1\",...
{ "split": "train", "index": 70731, "acecode_id": "evol_6228", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates an AWS event. The function should take in the following parameters: `eventID`, `eventName`, `eventVersion`, `eventSource`, `awsRegion`, `dynamodb`, and `userIdentity`. Each of these parameters can be of type `str` or `None`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_event('123', 'testEvent', '1.0', 'aws.source', 'us-west-2', {'key': 'value'}, {'user': 'identity'}) == True\", \"assert validate_event('123', 'testEvent', '1.0', 'aws.source', 'us-west-2', {}, {'user': 'identity'}) == False\", \"assert validate_even...
{ "split": "train", "index": 70732, "acecode_id": "oss_6560", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset represented as a list of samples and a dictionary specifying how many samples should be allocated for training and validation. Write a function `split_dataset(dataset, split_info)` that splits the dataset into training and validation sets based on the pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_dataset(list(range(3000)), {'train': 2000, 'val': 1000}) == (list(range(2000)), list(range(2000, 3000)))\", \"assert split_dataset(['a', 'b', 'c', 'd', 'e'], {'train': 3, 'val': 2}) == (['a', 'b', 'c'], ['d', 'e'])\", \"assert split_dataset([1, 2, 3, 4...
{ "split": "train", "index": 70733, "acecode_id": "oss_21938", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file names in a folder. Your task is to create a function that renames these files by appending a sequential number to each file name, starting from 1. The new names should retain the original file name but will be followed by a numb...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rename_files(['file', 'file', 'document']) == ['file (1)', 'file (2)', 'document (1)']\", \"assert rename_files(['image', 'image', 'image']) == ['image (1)', 'image (2)', 'image (3)']\", \"assert rename_files(['report', 'report', 'report', 'summary']) == ['r...
{ "split": "train", "index": 70734, "acecode_id": "bigcode_python_fns_34461", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that determines whether a given year is a leap year or not. A leap year is defined as a year that is evenly divisible by 4, with the exception of end-of-century years, which must be divisible by 400 to be considered a leap year. Yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_leap_year(2000) == True\", \"assert is_leap_year(1900) == False\", \"assert is_leap_year(1600) == True\", \"assert is_leap_year(2020) == True\", \"assert is_leap_year(2021) == False\", \"assert is_leap_year(2400) == True\", \"assert is_leap_year(1700) == ...
{ "split": "train", "index": 70735, "acecode_id": "oss_4794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing fitting results from a data analysis project. Implement the function `process_fit_results` that takes a fitting result object and two boolean flags, and returns specific calculated values based on the input parameters. The fitting result object co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_fit_results({'parvals': [1.0, 2.0, 3.0, 4.0], 'covar': [], 'parmins': [], 'parmaxes': []}, True, True) == (3.0, None, 4.0, 0.0, 0.0)\", \"assert process_fit_results({'parvals': [0.5, 1.5, 2.5, 3.5], 'covar': [], 'parmins': [], 'parmaxes': []}, False,...
{ "split": "train", "index": 70736, "acecode_id": "oss_36237", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `foo(x, y)` that takes two parameters `x` and `y`. The function should ensure that both `x` and `y` are numeric values. If either `x` or `y` is not numeric, the function should return the string 'Error: both x and y must be numeric values'. If both values a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert foo(5, 10) == (0, 5)\", \"assert foo(-3, -7) == (0, 4)\", \"assert foo(2.5, 3.5) == (0, 1.0)\", \"assert foo(0, 0) == (0, 0)\", \"assert foo(10, 10) == (0, 0)\", \"assert foo(1, 'a') == 'Error: both x and y must be numeric values'\", \"assert foo('b', 5) == ...
{ "split": "train", "index": 70737, "acecode_id": "evol_28020", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `sort_even(l: list)` that rearranges the elements of the list in the following manner: for elements at even indices, place the sorted negative integers (from even indices) first, followed by the sorted non-negative integers (from e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_even([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert sort_even([10, 15, 20, 25, 30]) == [10, 15, 20, 25, 30]\", \"assert sort_even([-2, -1, 0, 1, 2]) == [-2, -1, 0, 1, 2]\", \"assert sort_even([-3, -1, -4, 2, 6]) == [-4, -1, -3, 2, 6]\", \"assert sort_e...
{ "split": "train", "index": 70738, "acecode_id": "evol_3922", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given three integers upper, middle, and lower representing the number of available slots in three rows, and a list of integers column, implement a function that fills these rows based on the following rules: For each element in the column: If the element is 2, fill one slot in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert some_func(0, 0, 0, [2, 2]) == []\", \"assert some_func(0, 1, 0, [1, 1]) == []\", \"assert some_func(1, 0, 1, [2, 1]) == []\", \"assert some_func(0, 2, 0, [1, 2]) == []\", \"assert some_func(0, 0, 0, [1]) == []\"]}" }
{ "split": "train", "index": 70739, "acecode_id": "evol_16003", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a string of code to serialize a given value expression into a target expression based on its type. The function should take the following parameters: a target expression string, a value expression string, and a type ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_value('result', '42', 'simple') == 'result = 42'\", \"assert serialize_value('result', 'hello', 'simple') == 'result = hello'\", \"assert serialize_value('result', 'true', 'simple') == 'result = true'\", \"assert serialize_value('result', '3.14', '...
{ "split": "train", "index": 70740, "acecode_id": "bigcode_python_fns_23732", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the ranks of various rulers in a kingdom, write a function that updates the ranks according to the following rules: if a ruler's rank is less than 1 or greater than 6, it should be set to 0 (indicating an invalid rank). Additionally, if a r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_ranks([1, 2, 3, 7], True) == [2, 3, 4, 0]\", \"assert update_ranks([0, 5, 6, -1], False) == [0, 5, 6, 0]\", \"assert update_ranks([4, 4, 4, 4], True) == [5, 5, 5, 5]\", \"assert update_ranks([], True) == []\", \"assert update_ranks([6, 6, 6], False) =...
{ "split": "train", "index": 70741, "acecode_id": "bigcode_python_fns_41994", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a target sum, write a function that returns all unique pairs of integers from the list that add up to the target sum. Each integer in the list can only be used once in the output pairs. The output should be a list of tuples, where each tuple contain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pairs([1, 2, 3, 4, 5, 6], 7) == [(1, 6), (2, 5), (3, 4)]\", \"assert find_pairs([1, 1, 1, 1], 2) == [(1, 1)]\", \"assert find_pairs([], 0) == []\", \"assert find_pairs([5, 5, 5, 5], 10) == [(5, 5)]\", \"assert find_pairs([10, 20, 30, 40], 50) == [(10, 4...
{ "split": "train", "index": 70742, "acecode_id": "evol_15388", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `set_price(location: int, algo: int, order: int, price: float) -> str` that simulates setting a price for a specific order in a pricing system. The function takes in four parameters: \n1. `location` (an integer) represents the locatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_price(0, 0, 1881, 2.1) == 'Success'\", \"assert set_price(1, 1, 1882, 0.0) == 'Error'\", \"assert set_price(2, 1, 1883, 10.5) == 'Success'\", \"assert set_price(3, 2, 1884, -3.2) == 'Error'\", \"assert set_price(0, 1, 1885, 5.5) == 'Success'\", \"assert ...
{ "split": "train", "index": 70743, "acecode_id": "bigcode_python_fns_27900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a hierarchical path in a user interface, where elements are separated by a '|' character. Each element in the path must be non-empty and should not contain any leading or trailing spaces. Your task is to write a function `is_valid_ui_path(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_ui_path('MainWindow|Menu|File') == True\", \"assert is_valid_ui_path('MainWindow|') == False\", \"assert is_valid_ui_path('|Menu|File') == False\", \"assert is_valid_ui_path('MainWindow|Menu||File') == False\", \"assert is_valid_ui_path('MainWindow|...
{ "split": "train", "index": 70744, "acecode_id": "bigcode_python_fns_3306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary string `s` and an integer `k`, write a function `has_all_binary_codes(s: str, k: int) -> bool` that returns `true` if every binary code of length `k` is a substring of `s`. Otherwise, return `false`. A binary code of length `k` consists of all combinations of `0`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_all_binary_codes('00110110', 2) == True\", \"assert has_all_binary_codes('00110', 2) == True\", \"assert has_all_binary_codes('0110', 1) == True\", \"assert has_all_binary_codes('0110', 2) == False\", \"assert has_all_binary_codes('0000000001011100', 4) ...
{ "split": "train", "index": 70745, "acecode_id": "evol_17881", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing only the unique elements of the original list, in the order they first appeared. The input list may contain duplicates. Your function should have the following signature: `def unique_elements(arr: Lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 1, 2, 2, 3, 3]) == [1, 2, 3]\", ...
{ "split": "train", "index": 70746, "acecode_id": "bigcode_python_fns_2641", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a command string that can include assignments, labels to add, and labels to remove. The command string follows the format where an assignment is represented as 'key=value', labels to add are prefixed with '+', and labels to remove are prefixed with '-'. Your task ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_command('status=Open +urgent', {'summary': None, 'status': None, 'owner_id': None, 'cc_ids': [], 'labels': []}) == (None, 'Open', None, [], ['urgent'])\", \"assert parse_command('status=Closed -feature', {'summary': 'Current summary', 'status': 'In Pro...
{ "split": "train", "index": 70747, "acecode_id": "bigcode_python_fns_49985", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple bank account. Write a function `bank_account_operations(operations: List[Tuple[str, int]]) -> Tuple[int, int]` that takes a list of operations to perform on a bank account. The operations are represented as tuples, where the first element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100), ('withdraw', 50), ('withdraw', 200), ('deposit', 150)]) == (200, 3)\", \"assert bank_account_operations([('deposit', 200), ('withdraw', 100), ('withdraw', 100)]) == (0, 3)\", \"assert bank_account_operations([('with...
{ "split": "train", "index": 70748, "acecode_id": "oss_805", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the sum of squares of numbers in a given list. The function should take a list of integers as its input and return the sum of the squares of these integers. Your function should handle both positive and negative intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3]) == 14\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([0]) == 0\", \"assert sum_of_squares([]) == 0\", \"assert sum_of_squares([1, -1, 2]) == 6\", \"assert sum_of_squares([5, 5, 5]) == 75\", \"assert sum_of...
{ "split": "train", "index": 70749, "acecode_id": "oss_22157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `calculate_sum_of_squares(arr)` that returns the sum of the squares of all the integers in the list. The input list can contain both positive and negative integers, as well as zero. The function should return an integer representing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_of_squares([1, -2, 3]) == 14\", \"assert calculate_sum_of_squares([0, 0, 0]) == 0\", \"assert calculate_sum_of_squares([5, 12, -7]) == 218\", \"assert calculate_sum_of_squares([-1, -1, -1]) == 3\", \"assert calculate_sum_of_squares([]) == 0\", ...
{ "split": "train", "index": 70750, "acecode_id": "bigcode_python_fns_6450", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `get_change(m)` that takes a non-negative integer `m` as input. The function should return the minimum number of coins needed to make change for the value `m` using coins with denominations of 1, 3, and 4. For example, if `m` is 6, the min...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_change(0) == 0\", \"assert get_change(1) == 1\", \"assert get_change(2) == 2\", \"assert get_change(3) == 1\", \"assert get_change(4) == 1\", \"assert get_change(5) == 2\", \"assert get_change(6) == 2\", \"assert get_change(7) == 2\", \"assert get_change...
{ "split": "train", "index": 70751, "acecode_id": "oss_27529", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates all possible anagrams of a given word. The function should return a list of unique anagrams derived from the input keyword. For example, given the input 'CART', the function should return a list containing all the unique combinations of the lette...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_anagrams('A') == ['A']\", \"assert generate_anagrams('AB') == ['AB', 'BA']\", \"assert generate_anagrams('ABC') == ['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA']\", \"assert generate_anagrams('AAB') == ['AAB', 'ABA', 'BAA']\", \"assert generate_anagrams...
{ "split": "train", "index": 70752, "acecode_id": "evol_10546", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a float number x, implement a function that rounds it to the nearest quarter (0.25). For example, if x is 1.2, it should round to 1.25, and if x is 1.3, it should round to 1.25 as well. The function should return the rounded number as a float. The input number x will alwa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert round_to_nearest_quarter(1.2) == 1.25\", \"assert round_to_nearest_quarter(1.3) == 1.25\", \"assert round_to_nearest_quarter(2.0) == 2.0\", \"assert round_to_nearest_quarter(2.1) == 2.0\", \"assert round_to_nearest_quarter(2.2) == 2.25\", \"assert round_to_n...
{ "split": "train", "index": 70753, "acecode_id": "bigcode_python_fns_31262", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function `process_message(data: dict) -> str` that takes in a dictionary `data` containing user information with keys `name`, `age`, and `city`. The function should process this information and return a string summary of the user in the following format: 'Nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_message({'name': 'Alice', 'age': 30, 'city': 'New York'}) == 'Name: Alice, Age: 30, City: New York'\", \"assert process_message({'name': 'Bob', 'age': 25, 'city': 'Los Angeles'}) == 'Name: Bob, Age: 25, City: Los Angeles'\", \"assert process_message(...
{ "split": "train", "index": 70754, "acecode_id": "evol_19867", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibfib_with_offset(n: int, offset: int) -> int` that calculates the n-th element in the doubly recursive Fibonacci (FibFib) sequence with an offset. The function should handle non-negative integers for both `n` and `offset`. If `n` or `offset` is negative,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibfib_with_offset(0, 0) == 0\", \"assert fibfib_with_offset(1, 0) == 1\", \"assert fibfib_with_offset(2, 0) == 1\", \"assert fibfib_with_offset(3, 0) == 2\", \"assert fibfib_with_offset(0, 5) == 5\", \"assert fibfib_with_offset(1, 5) == 6\", \"assert fibfib...
{ "split": "train", "index": 70755, "acecode_id": "evol_2710", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that encrypts a given plaintext string using a simple substitution cipher. The substitution cipher will shift each letter in the plaintext by a fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would bec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encrypt_substitution_cipher('abc', 1) == 'bcd'\", \"assert encrypt_substitution_cipher('xyz', 2) == 'zab'\", \"assert encrypt_substitution_cipher('Hello, World!', 3) == 'Khoor, Zruog!'\", \"assert encrypt_substitution_cipher('Shift by zero', 0) == 'Shift by ...
{ "split": "train", "index": 70756, "acecode_id": "oss_26563", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple game of rock-paper-scissors between a user and the computer. Your function should determine the winner of each round based on the classic rules: rock beats scissors, scissors beats paper, and paper beats rock. The function will take an in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rock_paper_scissors_game(1, ['rock'], ['scissors']) == (1, 0, 'You win the game!')\", \"assert rock_paper_scissors_game(3, ['rock', 'rock', 'rock'], ['scissors', 'paper', 'scissors']) == (2, 1, 'You win the game!')\", \"assert rock_paper_scissors_game(2, ['s...
{ "split": "train", "index": 70757, "acecode_id": "oss_17208", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the rendering of a homepage for a web application. The function takes a dictionary representing the current user and returns a formatted string that includes the user's name, their login status, an error display status base...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_homepage({'name': 'Alice', 'is_authenticated': True}, 'True', {'LOGIN_BANNER': 'Welcome back!'}) == 'Alice is logged in: True. Display error: True. Login banner: Welcome back!'\", \"assert render_homepage({'name': 'Bob', 'is_authenticated': False}, 'F...
{ "split": "train", "index": 70758, "acecode_id": "bigcode_python_fns_25349", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `c` and `r`, construct a Toeplitz matrix. A Toeplitz matrix has constant diagonals, with `c` as its first column and `r` as its first row. The first element of `c` should be used to fill the top left corner of the matrix, and the first row of the re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_toeplitz([1, 2, 3]) == [[1, 2, 3], [2, 1, 2], [3, 2, 1]]\", \"assert construct_toeplitz([1]) == [[1]]\", \"assert construct_toeplitz([1, 2], [3]) == [[1, 2], [2, 1]]\", \"assert construct_toeplitz([5], [10]) == [[5]]\", \"assert construct_toeplitz(...
{ "split": "train", "index": 70759, "acecode_id": "bigcode_python_fns_38113", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `cross_multiply(a: float, b: float, c: float, d: float) -> Union[str, Tuple[str, bool]]` that accepts four numerical values representing two ratios (a/b) and (c/d). The function should perform cross-multiplication to determine if the two ratios are equivale...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cross_multiply(1, 2, 2, 4) == 'The ratios are equivalent.'\", \"assert cross_multiply(1, 3, 2, 6) == 'The ratios are equivalent.'\", \"assert cross_multiply(1, 2, 3, 4) == 'The ratios are not equivalent.'\", \"assert cross_multiply(2, 5, 4, 10) == 'The ratio...
{ "split": "train", "index": 70760, "acecode_id": "evol_33040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and your task is to implement a function that returns a new list containing only the even numbers from the original list, maintaining their original order. Write a function `filter_even_numbers(arr: List[int]) -> List[int]` that takes a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([0, -1, -2, -3, -4]) == [0, -2, -4]\", \"assert filter_even_numbers([-2, -1, 1, 2]) == [-2, 2]\", \"ass...
{ "split": "train", "index": 70761, "acecode_id": "bigcode_python_fns_17703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_recent_articles(articles: List[str], update: bool) -> List[str]` that retrieves the 10 most recent articles from the provided list of articles. If `update` is set to True, you should return the articles as they are provided, regardle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_recent_articles(['Article A', 'Article B', 'Article C'], False) == ['Article C', 'Article B', 'Article A']\", \"assert get_recent_articles(['Article A', 'Article B', 'Article C'], True) == ['Article A', 'Article B', 'Article C']\", \"assert get_recent_ar...
{ "split": "train", "index": 70762, "acecode_id": "bigcode_python_fns_38126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers where every element appears twice except for one, write a function `find_unique_element` to find and return the unique element that appears only once. The input will be a list of integers `nums`, and the output should be the integer that is unique in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_element([1, 2, 1]) == 2\", \"assert find_unique_element([4, 3, 4, 3, 2, 1, 1]) == 2\", \"assert find_unique_element([10, 20, 10, 30, 20]) == 30\", \"assert find_unique_element([5, 5, 6, 7, 6]) == 7\", \"assert find_unique_element([99, 1, 1, 2, 2,...
{ "split": "train", "index": 70763, "acecode_id": "oss_6490", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s consisting of lowercase English letters, implement a function that returns the length of the longest substring without repeating characters. The function signature is: def longest_unique_substring(s: str) -> int.\nPlease reason step by step, then write a self-c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_unique_substring('abcabcbb') == 3\", \"assert longest_unique_substring('bbbbb') == 1\", \"assert longest_unique_substring('pwwkew') == 3\", \"assert longest_unique_substring('') == 0\", \"assert longest_unique_substring('au') == 2\", \"assert longest...
{ "split": "train", "index": 70764, "acecode_id": "evol_17636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of names and a single name to check, implement a function `lookup_name(name: str, names: List[str]) -> bool` that returns `True` if the name exists in the list of names, and `False` otherwise. The function should be case-sensitive. \n\n### Example:\n- Input: `name ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lookup_name('Alice', ['Bob', 'Charlie', 'Alice']) == True\", \"assert lookup_name('alice', ['Bob', 'Charlie', 'Alice']) == False\", \"assert lookup_name('Eve', ['Eve', 'Mallory']) == True\", \"assert lookup_name('Mallory', ['Eve', 'Mallory']) == True\", \"as...
{ "split": "train", "index": 70765, "acecode_id": "bigcode_python_fns_36480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the daily stock prices of a company. Write a function `max_profit` that calculates the maximum profit that can be obtained by buying and selling the stock at most once. If it is not possible to make any profit, return 0. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([2, 1, 2, 1, 2]) == 1\", \"asser...
{ "split": "train", "index": 70766, "acecode_id": "oss_2005", "num_tests": 16 }
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 unique elements from the input list, preserving the order of their first appearance. Implement the function `unique_elements(lst: List[int]) -> List[int]` where ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([5, 5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([1, 2, 1, 3, 2, 4]) == [1, ...
{ "split": "train", "index": 70767, "acecode_id": "oss_20394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of lists of words, where each inner list represents a batch of words. Your task is to implement a function that pads each batch of words to the length of the longest list in the input. Padding should be done by appending the string 'PAD' to the end of the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pad_words([['cat'], ['dog', 'bark'], ['fish', 'swim', 'water']]) == {'padded_words': [['cat', 'PAD', 'PAD'], ['dog', 'bark', 'PAD'], ['fish', 'swim', 'water']], 'original_lengths': [1, 2, 3]}\", \"assert pad_words([[], ['only one'], []]) == {'padded_words': ...
{ "split": "train", "index": 70768, "acecode_id": "bigcode_python_fns_14016", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the factorial of a non-negative integer n using an iterative approach. The factorial of n (denoted as n!) is defined as the product of all positive integers from 1 to n. The function should return 1 if n is 0, as 0! is defined to be 1. For a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 70769, "acecode_id": "evol_12552", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the product of two matrices. The function should be able to handle cases when the matrices are not square. The number of columns in the first matrix must be equal to the number of rows in the second matrix for the multiplication to be feasible...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_mul([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert matrix_mul([[2]], [[3]]) == [[6]]\", \"assert matrix_mul([[1, 2]], [[3], [4]]) == [[11]]\", \"assert matrix_mul([[1, 2, 3]], [[4], [5], [6]]) == [[32]]\", \"assert matrix_mul(...
{ "split": "train", "index": 70770, "acecode_id": "evol_23846", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a metaclass in Python named `ProviderMeta` that ensures all classes derived from it implement a method called `provide_info`. If a class does not implement this method, a `NotImplementedError` should be raised. Your goal is to implement the `Provide...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ExampleClass().provide_info() == 'Information provided by ExampleClass'\", \"assert ExampleClass.__name__ == 'ExampleClass'\", \"assert isinstance(ExampleClass(), ExampleClass)\", \"assert callable(ExampleClass().provide_info)\", \"assert ExampleClass.provid...
{ "split": "train", "index": 70771, "acecode_id": "oss_21045", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of activities, where each activity is represented by a dictionary with fields: 'id', 'status', and 'user_id'. The 'status' can take values as follows: 0 (Created), 1 (Late), 2 (Pending Partner), and 3 (Pending Client). Your task is to implement a function t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_pending_activities([{'id': 1, 'status': 0, 'user_id': 1}, {'id': 2, 'status': 1, 'user_id': 1}, {'id': 3, 'status': 4, 'user_id': 1}], 0) == 2\", \"assert count_pending_activities([{'id': 1, 'status': 0, 'user_id': 1}, {'id': 2, 'status': 1, 'user_id':...
{ "split": "train", "index": 70772, "acecode_id": "bigcode_python_fns_21086", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a variable `space` that can either be an instance of `Box` or `Discrete`, implement a function `check_space(space)` that returns a tuple containing two elements. The first element should be the dimension of the space: if `space` is a `Box`, return its shape; if it is a `D...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_space(Box((3, 3))) == ((3, 3), False)\", \"assert check_space(Box((1,))) == ((1,), False)\", \"assert check_space(Discrete(5)) == (5, True)\", \"assert check_space(Discrete(1)) == (1, True)\", \"assert check_space(Box((2, 2, 2))) == ((2, 2, 2), False)\...
{ "split": "train", "index": 70773, "acecode_id": "bigcode_python_fns_34588", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a JSON response string containing details about payment cards. Your function should extract the card ID and the corresponding location for each card object present in the JSON response. Write a function `extractCardDeta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extractCardDetails('{\\\"data\\\":[{\\\"id\\\":\\\"card_1\\\",\\\"location\\\":\\\"/location_1\\\"},{\\\"id\\\":\\\"card_2\\\",\\\"location\\\":\\\"/location_2\\\"}]}') == [('card_1', '/location_1'), ('card_2', '/location_2')]\", \"assert extractCardDetails(...
{ "split": "train", "index": 70774, "acecode_id": "oss_2095", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that searches for a specific item in a list of dictionaries based on a given key-value pair. Your function should return the first dictionary in the list that contains the specified key-value pair. If no such dictionary is foun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_item_by_key_value([{'name': 'Alice'}, {'name': 'Bob'}], 'name', 'Alice') == {'name': 'Alice'}\", \"assert find_item_by_key_value([{'name': 'Alice'}, {'name': 'Bob'}], 'name', 'Charlie') == None\", \"assert find_item_by_key_value([{'age': 30}, {'age': 25...
{ "split": "train", "index": 70775, "acecode_id": "oss_7976", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers as input and returns a tuple containing the second largest and second smallest values from that list. If the list contains less than two unique elements, return (None, None).\nPlease reason step by step, then write a self-conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_largest_smallest([1, 4, 7, 3, 8]) == (7, 3)\", \"assert second_largest_smallest([5, 5, 5, 5]) == (None, None)\", \"assert second_largest_smallest([1, 2, 3, 4, 5]) == (4, 2)\", \"assert second_largest_smallest([9, 1, 3, 7, 5]) == (7, 3)\", \"assert sec...
{ "split": "train", "index": 70776, "acecode_id": "evol_21098", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing paths in a file system. Your task is to create a function `remove_unwanted_paths(paths: List[str]) -> List[str]` that removes all paths that contain the substring 'site-packages' or 'Extras'. The function should return a new list tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_unwanted_paths(['/usr/local/lib/site-packages/somepackage', '/usr/bin/somebinary', '/usr/local/Extras/somefile']) == ['/usr/bin/somebinary']\", \"assert remove_unwanted_paths(['/home/user/project', '/home/user/project/site-packages', '/home/user/Extra...
{ "split": "train", "index": 70777, "acecode_id": "bigcode_python_fns_43911", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that converts a postfix expression into an infix expression and evaluates the result. The function should take a string containing only integers and binary operators ('+', '-', '*', '/'), each separated by a space, representing a postfix expression. Your task i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert postfix_to_infix('2 3 4 * +') == '(2 + (3 * 4)) = 14'\", \"assert postfix_to_infix('5 0 /') == 'Error: Division by zero'\", \"assert postfix_to_infix('8 4 2 / -') == '(8 - (4 / 2)) = 6.0'\", \"assert postfix_to_infix('1 2 3 + +') == '(1 + (2 + 3)) = 6'\", \"...
{ "split": "train", "index": 70778, "acecode_id": "evol_28100", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing heights of buildings in a skyline. Your task is to write a function that generates a list of tuples indicating the position and height of the skyline's critical points. A critical point is defined as a position where the height of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_skyline_points([1, 2, 3, 4]) == [(0, 1), (1, 2), (2, 3), (3, 4)]\", \"assert get_skyline_points([4, 4, 4, 4]) == [(0, 4)]\", \"assert get_skyline_points([8]) == [(0, 8)]\", \"assert get_skyline_points([1, 2]) == [(0, 1), (1, 2)]\", \"assert get_skyline_p...
{ "split": "train", "index": 70779, "acecode_id": "bigcode_python_fns_17655", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a year (an integer) and a month (an integer between 1 and 12), return the name of the month followed by the year, the first date of the month, and the last date of the month in the format of a tuple (month_name, first_date, last_date). The first_date should be represented...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_month_info(2021, 1) == ('January_2021', '2021-01-01', '2021-01-31')\", \"assert get_month_info(2020, 2) == ('February_2020', '2020-02-01', '2020-02-29')\", \"assert get_month_info(2022, 3) == ('March_2022', '2022-03-01', '2022-03-31')\", \"assert get_mon...
{ "split": "train", "index": 70780, "acecode_id": "bigcode_python_fns_41704", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a user has administrative privileges based on their role. The function should take a boolean parameter `is_admin` which indicates whether the user is an admin or not. If the user is an admin, the function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_access(True) == 'Access granted'\", \"assert check_access(False) == 'Access denied'\", \"assert check_access(True) == 'Access granted'\", \"assert check_access(False) == 'Access denied'\", \"assert check_access(True) == 'Access granted'\", \"assert che...
{ "split": "train", "index": 70781, "acecode_id": "oss_27136", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a network ping analysis for a given hostname or IP address. Your function should take a string input representing a hostname or IP address and return a dictionary containing the following information: - 'destination'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ping_analysis('localhost') == {'destination': 'localhost', 'reachable': True, 'average_rtt': 20.3}\", \"assert ping_analysis('example.com') == {'destination': 'example.com', 'reachable': False, 'average_rtt': 0}\", \"assert ping_analysis('192.168.1.1') == {'...
{ "split": "train", "index": 70782, "acecode_id": "oss_29940", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a point represented by its coordinates (x, y) and a polygon defined by a list of its vertices in the form of (x1, y1), (x2, y2), ..., (xn, yn), determine if the point is inside the polygon or not. The polygon is closed and can have any number of vertices. Your task is to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_point_in_polygon((0, 0), [(1, 1), (1, -1), (-1, -1), (-1, 1)]) == True\", \"assert is_point_in_polygon((0, 0), [(1, 1), (2, 0), (1, -1)]) == False\", \"assert is_point_in_polygon((2, 2), [(0, 0), (4, 0), (4, 4), (0, 4)]) == True\", \"assert is_point_in_po...
{ "split": "train", "index": 70783, "acecode_id": "bigcode_python_fns_36160", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `check_anagram(string1: str, string2: str) -> bool` that determines whether two given strings are anagrams of each other. The function should consider all characters, including special characters and numbers, and ignore capitalization. Two strings are consi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_anagram('Listen', 'Silent') == True\", \"assert check_anagram('Triangle', 'Integral') == True\", \"assert check_anagram('Apple', 'Paple') == True\", \"assert check_anagram('12345', '54321') == True\", \"assert check_anagram('!@#$', '$#@!') == True\", \...
{ "split": "train", "index": 70784, "acecode_id": "evol_7481", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a list of integers and returns the product of all unique integers in the list. If the list is empty, return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_product([1, 2, 3, 2, 1]) == 6\", \"assert unique_product([4, 5, 6]) == 120\", \"assert unique_product([1, 1, 1, 1]) == 1\", \"assert unique_product([]) == 1\", \"assert unique_product([10, 10, 20, 30]) == 6000\", \"assert unique_product([-1, -2, -3]) ...
{ "split": "train", "index": 70785, "acecode_id": "evol_3256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of integer values and returns a dictionary mapping each integer to its square and cube. Implement the function `process_integers` with the following signature: `def process_integers(integers: List[int]) -> Dict[int, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_integers([1, 2, 3]) == {1: (1, 1), 2: (4, 8), 3: (9, 27)}\", \"assert process_integers([4, 5]) == {4: (16, 64), 5: (25, 125)}\", \"assert process_integers([0]) == {0: (0, 0)}\", \"assert process_integers([-1, -2]) == {-1: (1, -1), -2: (4, -8)}\", \"a...
{ "split": "train", "index": 70786, "acecode_id": "oss_7841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of results, where each result is represented as a dictionary containing a name and its associated value. You need to create a function `create_results_dataframe(results_list: List[List[Dict[str, Any]]], abbreviate_name: bool = False, format_number: bool = F...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_results_dataframe([[{'name': 'Result1', 'value': 123.456}], [{'name': 'Result2', 'value': 78.1}]], False, False) == [{'name': 'Result1', 'value': 123.456}, {'name': 'Result2', 'value': 78.1}]\", \"assert create_results_dataframe([[{'name': 'ResultA', ...
{ "split": "train", "index": 70787, "acecode_id": "bigcode_python_fns_18983", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function `check_length_equality` that takes two string inputs and returns a boolean indicating whether the lengths of the two strings are equal. If the lengths are equal, return True; otherwise, return False.\nPlease reason step by step, then write a self-contained Pyth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_length_equality('hello', 'world') == True\", \"assert check_length_equality('python', 'java') == False\", \"assert check_length_equality('abc', 'def') == True\", \"assert check_length_equality('abcd', 'abcde') == False\", \"assert check_length_equality...
{ "split": "train", "index": 70788, "acecode_id": "evol_6453", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that constructs a URL for downloading files from different servers based on a given server name. The function takes a `server_name` as input and constructs a URL for downloading files from the specified server. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_url_for_servers('server1') == 'http://server1.com/download'\", \"assert build_url_for_servers('server2') == 'http://server2.net/download'\", \"assert build_url_for_servers('server3') == 'Invalid server name'\", \"assert build_url_for_servers('server4')...
{ "split": "train", "index": 70789, "acecode_id": "oss_35108", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string representing a section name and a list of tuples. Each tuple contains a key-value pair. The function should return a dictionary where the keys are the values from the tuples and the values are the keys. If the sect...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_section('nonexistent', [('key1', 'value1')]) == None\", \"assert transform_section('test', []) == None\", \"assert transform_section('random', [('foo', 'bar'), ('baz', 'qux')]) == None\", \"assert transform_section('missing', [('k1', 'v1'), ('k2', ...
{ "split": "train", "index": 70790, "acecode_id": "bigcode_python_fns_17520", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are a security analyst tasked with identifying and addressing potential security vulnerabilities in a codebase. You come across a code snippet that constructs a command to execute a Java program using user-provided input. Your task is to write a function named `secure_execu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert secure_execute('valid_input', 'output.json') == ['/usr/bin/java', '-cp', '.:javaparser/javaparser-core/target/classes:$HOME/.m2/repository/com/cedarsoftware/json-io/4.3.0/json-io-4.3.0.jar', 'jskparser.Jsonify', 'valid_input', 'output.json']\", \"assert secu...
{ "split": "train", "index": 70791, "acecode_id": "oss_21412", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a dictionary that represents a location data entry. The dictionary must contain the keys 'latitude', 'longitude', 'device', 'id', and 'trigger'. Implement a function `is_valid_location_data(data: dict) -> bool` that checks if all required keys are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_location_data({'latitude': 40.7128, 'longitude': -74.0060, 'device': 'sensor_1', 'id': 'loc_123', 'trigger': 'manual'}) == True\", \"assert is_valid_location_data({'latitude': 40.7128, 'longitude': -74.0060, 'device': 'sensor_1', 'id': 'loc_123'}) =...
{ "split": "train", "index": 70792, "acecode_id": "bigcode_python_fns_18813", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `even_product_pairs` that takes two lists of numbers as input. The function should return a list of tuples, where each tuple contains pairs of integers (one from each list) that, when multiplied together, produce an even product. Ensure that only positive integ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert even_product_pairs([1, 3, 5], [2, 4, 6]) == [(1, 2), (1, 4), (1, 6), (3, 2), (3, 4), (3, 6), (5, 2), (5, 4), (5, 6)]\", \"assert even_product_pairs([-1, 0, 2], [3, 4, 5]) == [(2, 3), (2, 4), (2, 5)]\", \"assert even_product_pairs([2], [2]) == [(2, 2)]\", \"a...
{ "split": "train", "index": 70793, "acecode_id": "evol_35220", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine if a given package specification is editable or not. An editable package can be directly edited in the current environment. The package specification can be in various forms, including a dictionary with a 'git' key, a str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_editable({'git': 'https://github.com/sarugaku/vistir.git', 'editable': True}) == True\", \"assert is_editable({'git': 'https://github.com/sarugaku/shellingham.git'}) == False\", \"assert is_editable('-e .') == True\", \"assert is_editable('.') == False\",...
{ "split": "train", "index": 70794, "acecode_id": "oss_1436", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `calc_lateral_surf_area(r1, r2, l, shape='cone')` that computes the lateral surface area of a frustum. The parameters `r1` and `r2` are the radii of the two circular ends, `l` is the height of the frustum, and `shape` indicates the type of frustum to calculate....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_lateral_surf_area(1, 1, 1, 'cone') == 6.283185307179586\", \"assert calc_lateral_surf_area(0, 0, 0, 'cone') == 0.0\", \"assert calc_lateral_surf_area(5, 10, 15, 'ellipse') == 'To be implemented.'\", \"assert calc_lateral_surf_area(3, 7, 10, 'hyperbola')...
{ "split": "train", "index": 70795, "acecode_id": "evol_15775", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of edges representing connections between nodes and a list of chains where each chain is a list of tuples. Each tuple indicates a start and end point of a section. Your task is to implement a function that returns a list of connections between the sections ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert chain_connectivity([], [[(1, 2)]]) == []\", \"assert chain_connectivity([(1, 2), (2, 3)], [[(1, 2)], [(3, 4)]]) == []\", \"assert chain_connectivity([(1, 2), (2, 3)], [[(1, 2)], [(2, 2)]]) == [(0, 1)]\", \"assert chain_connectivity([(1, 3), (3, 5)], [[(1, 2)...
{ "split": "train", "index": 70796, "acecode_id": "bigcode_python_fns_44427", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that filters a list of actor types based on certain conditions. Implement the function `filter_actor_types` that takes a list of actor types as input and returns a list of those types that satisfy the following criteria: 1. The typ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_actor_types([ActorBase, Player, Enemy, str, int]) == [Player, Enemy]\", \"assert filter_actor_types([ActorBase, str, int]) == []\", \"assert filter_actor_types([Player, Enemy]) == [Player, Enemy]\", \"assert filter_actor_types([ActorBase]) == []\", \"...
{ "split": "train", "index": 70797, "acecode_id": "oss_7673", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of user names represented as strings. Write a function that takes this list of user names and returns a list of unique user names. The unique user names should be returned in the order they first appeared in the input list. For example, if the input list co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_usernames(['nick', 'elonmusk', 'nick', 'jack']) == ['nick', 'elonmusk', 'jack']\", \"assert get_unique_usernames(['alice', 'bob', 'alice', 'charlie', 'bob']) == ['alice', 'bob', 'charlie']\", \"assert get_unique_usernames(['a', 'b', 'c', 'a', 'b',...
{ "split": "train", "index": 70798, "acecode_id": "bigcode_python_fns_48514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters a list of notifications based on their status and scheduled time. Each notification is represented as a dictionary with the following keys: 'status' (a string), 'scheduled_time' (a string representing time in 'YYYY-MM-DD ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_queued_notifications([{'status': 'queued', 'scheduled_time': '2023-10-01 10:00:00'}, {'status': 'queued', 'scheduled_time': '2023-10-02 11:00:00'}, {'status': 'sent', 'scheduled_time': '2023-10-01 09:00:00'}], '2023-10-02 12:00:00') == [{'status': 'queue...
{ "split": "train", "index": 70799, "acecode_id": "bigcode_python_fns_35801", "num_tests": 15 }