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 that takes the coefficients of a quadratic equation (a, b, c) and returns the two solutions as a tuple. The function should handle cases where the solutions are complex numbers. If the solutions are real, return them as float values. If they are complex, re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_quadratic(1, -3, 2) == (2.0, 1.0)\", \"assert solve_quadratic(1, 2, 1) == (-1.0, -1.0)\", \"assert solve_quadratic(1, 0, -4) == (2.0, -2.0)\", \"assert solve_quadratic(1, -1, -6) == (3.0, -2.0)\", \"assert solve_quadratic(1, 4, 5) == ((-2+1j), (-2-1j))...
{ "split": "train", "index": 80900, "acecode_id": "evol_1258", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that takes a 2D list (matrix) and rotates it 90 degrees clockwise. The function should return the rotated matrix. Please note that the input matrix can have any number of rows and columns.\nPlease reason step by step, then write a self-contained Python solu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_matrix([[1, 2], [3, 4], [5, 6]]) == [[5, 3, 1], [6, 4, 2]]\", \"assert rotate_matrix([[1]]) == [[1]]\", \"assert rotate_matrix([[1, 2], [3, 4]]) == [[3, 1], [4, 2]]\", \"assert rotate_matrix([[1, 2, 3], [4, 5, 6]]) == [[4, 1], [5, 2], [6, 3]]\", \"ass...
{ "split": "train", "index": 80901, "acecode_id": "evol_28988", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two bounding boxes in a 2D space represented by their coordinates (x1, y1, x2, y2), where (x1, y1) is the bottom-left corner and (x2, y2) is the top-right corner, write a function `jaccard_index(box_a: List[int], box_b: List[int]) -> float` to compute the Jaccard Index (I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert jaccard_index([0, 0, 2, 2], [1, 1, 3, 3]) == 0.14285714285714285\", \"assert jaccard_index([0, 0, 1, 1], [0, 0, 1, 1]) == 1.0\", \"assert jaccard_index([1, 1, 3, 3], [2, 2, 4, 4]) == 0.14285714285714285\", \"assert jaccard_index([0, 0, 1, 1], [1, 1, 2, 2]) =...
{ "split": "train", "index": 80902, "acecode_id": "bigcode_python_fns_26793", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `filter_fibonacci_numbers(input_list)` that takes a list of integers as input and returns a new list containing only the elements that are Fibonacci numbers. A Fibonacci number is defined as a number that appears in the Fibonacci sequence, which starts with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_fibonacci_numbers([0, 1, 2, 3, 5, 8, 13, 21, 34, 55]) == [0, 1, 2, 3, 5, 8, 13, 21, 34, 55]\", \"assert filter_fibonacci_numbers([4, 6, 9, 10]) == []\", \"assert filter_fibonacci_numbers([0, 1, 4, 6]) == [0, 1]\", \"assert filter_fibonacci_numbers([7,...
{ "split": "train", "index": 80903, "acecode_id": "evol_30993", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of allowed external URLs (allowlist) and a list of test URLs. Your task is to implement a function `is_allowed_external_url(url: str, allowlist: List[str]) -> bool` that checks if the provided URL is considered valid based on the following rules: \n1. The U...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_allowed_external_url('http://x.com/1.jpg', ['http://x.com/', 'https://y.com/bla/', 'https://z.com/images/']) == True\", \"assert is_allowed_external_url('https://y.com/bla/', ['http://x.com/', 'https://y.com/bla/', 'https://z.com/images/']) == True\", \"a...
{ "split": "train", "index": 80904, "acecode_id": "bigcode_python_fns_35694", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting specific attributes from a user data dictionary representing a user on a social media platform. The user data dictionary contains several attributes, including 'lang', 'listed_count', 'location', and 'name'. Your goal is to implement a function th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_user_attributes({'lang': 'en', 'listed_count': 5, 'location': 'NY', 'name': 'John'}) == {'lang': 'en', 'listed_count': 5, 'location': 'NY', 'name': 'John'}\", \"assert extract_user_attributes({'listed_count': 10, 'location': 'LA'}) == {'lang': None, ...
{ "split": "train", "index": 80905, "acecode_id": "oss_10783", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of object names, implement a function `filter_objects` that takes a list of strings and a target string as inputs and returns a new list containing only the object names that contain the target string as a substring. The function should be case-sensitive. If no obj...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_objects(['apple', 'banana', 'cherry', 'date'], 'a') == ['apple', 'banana', 'date']\", \"assert filter_objects(['apple', 'banana', 'cherry', 'date'], 'c') == ['cherry']\", \"assert filter_objects(['apple', 'banana', 'cherry', 'date'], 'e') == ['apple',...
{ "split": "train", "index": 80906, "acecode_id": "bigcode_python_fns_13630", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that reads a YAML configuration from a string and returns the configuration as a dictionary. The input will be a string formatted in YAML, and your function should parse this string and return the corresponding dictionary. Your function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_yaml('key: value') == {'key': 'value'}\", \"assert parse_yaml('name: John\\\\nage: 30') == {'name': 'John', 'age': 30}\", \"assert parse_yaml('key1: value1\\\\nkey2: value2\\\\nkey3: value3') == {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}\",...
{ "split": "train", "index": 80907, "acecode_id": "bigcode_python_fns_2284", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `delay_slot_instruction(ea, bexec, fexec)` that determines if the instruction at a given address 'ea' is a delay slot instruction. The function takes three parameters: an integer 'ea' representing the instruction address, and two boolean flags 'bexec' and '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delay_slot_instruction(100, True, False) == True\", \"assert delay_slot_instruction(101, False, True) == False\", \"assert delay_slot_instruction(103, False, False) == False\", \"assert delay_slot_instruction(105, False, True) == False\", \"assert delay_slot...
{ "split": "train", "index": 80908, "acecode_id": "bigcode_python_fns_34532", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a greeting message based on the specified language code. The function should accept a string parameter `lang` which represents the language code and return the corresponding greeting. The supported language codes are: 'es' fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet('es') == 'Hola'\", \"assert greet('ge') == 'Hallo'\", \"assert greet('fr') == 'Hello'\", \"assert greet('it') == 'Hello'\", \"assert greet('jp') == 'Hello'\", \"assert greet('zh') == 'Hello'\", \"assert greet('pt') == 'Hello'\", \"assert greet('ru') ==...
{ "split": "train", "index": 80909, "acecode_id": "bigcode_python_fns_12422", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function that takes a list of integers and returns a tuple containing two lists: one for all the even numbers and one for all the odd numbers from the input list. The function should be able to handle lists with up to 10,000 integers, which may include negative ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert separate_even_odd([1, 2, 3, 4, 5, 0, -1, -2]) == ([2, 4, 0, -2], [1, 3, 5, -1])\", \"assert separate_even_odd([]) == ([], [])\", \"assert separate_even_odd([1, 3, 5, 7]) == ([], [1, 3, 5, 7])\", \"assert separate_even_odd([2, 4, 6, 8]) == ([2, 4, 6, 8], [])\...
{ "split": "train", "index": 80910, "acecode_id": "evol_25956", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a dictionary of command-line arguments and simulates the behavior of a command-line argument parser. The function should accept the following parameters: 'user', 'password', 'infile', and 'outdir'. The 'user' and 'password' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments(user='test_user', password='test_password', infile='data.json', outdir='output/') == {'user': 'test_user', 'password': 'test_password', 'infile': 'data.json', 'outdir': 'output/'}\", \"assert parse_arguments(infile='data.json') == {'user': 'd...
{ "split": "train", "index": 80911, "acecode_id": "oss_21465", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `reverse_and_running_average(arr)` that takes a list of integers `arr` and returns a tuple containing two lists: the reversed array and the running average of the reversed array. The running average for a given index is calculated as the sum of all the current ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_and_running_average([4, 3, 2, 1]) == ([1, 2, 3, 4], [1.0, 1.5, 2.0, 2.5])\", \"assert reverse_and_running_average([1, 2, 3]) == ([3, 2, 1], [3.0, 2.5, 2.0])\", \"assert reverse_and_running_average([10, 20, 30, 40]) == ([40, 30, 20, 10], [40.0, 35.0, ...
{ "split": "train", "index": 80912, "acecode_id": "evol_10681", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a JSON object as input and returns the number of unique keys present in that JSON object. The JSON object can be a nested structure containing dictionaries and lists. If the input is not a valid JSON object or is None, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_keys({'a': 1, 'b': 2, 'c': 3}) == 3\", \"assert count_unique_keys({'a': 1, 'b': {'c': 2, 'd': 3}}) == 4\", \"assert count_unique_keys({'a': {'b': {'c': 1}}, 'd': 2}) == 4\", \"assert count_unique_keys({'a': [1, 2, 3], 'b': 4}) == 2\", \"assert c...
{ "split": "train", "index": 80913, "acecode_id": "evol_4319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents the box score data for a basketball game. The dictionary contains various tables related to the game statistics, each represented as a list of dictionaries. Your task is to implement a function `validate_boxscore_structure(boxscore: Di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_boxscore_structure({'GameSummary': [{}], 'OtherStats': [{}], 'Officials': [{}], 'InactivePlayers': [{}], 'GameInfo': [{}], 'LineScore': [{}], 'LastMeeting': [{}], 'SeasonSeries': [{}]}) == False\", \"assert validate_boxscore_structure({'GameSummary'...
{ "split": "train", "index": 80914, "acecode_id": "bigcode_python_fns_47953", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to simulate a simple game where a player must press a button to increase their score. The program should take in a list of boolean values representing the state of the button over time. Your task is to implement a Python function that coun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_button_presses([True, True, True]) == 3\", \"assert count_button_presses([False, False, False]) == 0\", \"assert count_button_presses([True, False, True, False, True]) == 3\", \"assert count_button_presses([]) == 0\", \"assert count_button_presses([Tru...
{ "split": "train", "index": 80915, "acecode_id": "oss_4331", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are required to create a Python function that takes a list of integers and returns a new list containing only the even integers from the input list. The function should be named `filter_even_numbers`. Implement the function such that it loops through the input list and appe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([7, 9, 11]) == []\", \"assert filter_even_numbers([0, 1, 2]) == [0, 2]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([-2, -1,...
{ "split": "train", "index": 80916, "acecode_id": "oss_1316", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two numeric strings as input and returns their sum as an integer. If either of the inputs is not a valid numeric string, the function should return an error message 'ERROR: Both inputs should be numeric strings'.\nPlease reason step by step, then...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_two_numbers('10', '20') == 30\", \"assert sum_of_two_numbers('5', '15') == 20\", \"assert sum_of_two_numbers('100', '200') == 300\", \"assert sum_of_two_numbers('0', '0') == 0\", \"assert sum_of_two_numbers('123', '456') == 579\", \"assert sum_of_two_...
{ "split": "train", "index": 80917, "acecode_id": "evol_20329", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the deployment scenario from a given dictionary. The function should take a single parameter, `config`, which is a dictionary that may or may not contain the key 'DEPLOY_SCENARIO'. If the key exists, return its correspondin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_deployment_scenario({'DEPLOY_SCENARIO': 'production'}) == 'production'\", \"assert get_deployment_scenario({'DEPLOY_SCENARIO': 'staging'}) == 'staging'\", \"assert get_deployment_scenario({'DEPLOY_SCENARIO': 'development'}) == 'development'\", \"assert g...
{ "split": "train", "index": 80918, "acecode_id": "bigcode_python_fns_8689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a user logout process in a web application. The function should take a dictionary representing a user's session data and clear specific keys from it. The keys to remove from the session are: 'user_id', 'mobile', 'nick_n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert logout({'user_id': 1, 'mobile': '1234567890', 'nick_name': 'John', 'is_admin': True}) == {}\", \"assert logout({'user_id': 1}) == {}\", \"assert logout({'user_id': 1, 'mobile': '1234567890'}) == {}\", \"assert logout({'user_id': 1, 'mobile': '1234567890', 'n...
{ "split": "train", "index": 80919, "acecode_id": "bigcode_python_fns_19318", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a variable number of strings as input. Each string contains a series of commands separated by commas. Your function should parse these strings, concatenate all commands into a single string, and return the result. The commands ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_commands('command1,command2', 'command3') == 'command1 command2 command3'\", \"assert parse_commands('start,stop', 'pause,resume', 'play') == 'start stop pause resume play'\", \"assert parse_commands('jump', 'run,walk') == 'jump run walk'\", \"assert p...
{ "split": "train", "index": 80920, "acecode_id": "bigcode_python_fns_16531", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates executing a computation based on specified resource requirements. The function should take an integer `n` as input and a dictionary `resource_spec` specifying the resource requirements for the computation. If the spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_computation(10, {'cores': 2, 'memory': '1GiB'}) == 'Executor_1'\", \"assert execute_computation(5, {'cores': 1, 'memory': '2GiB'}) == 'Executor_1'\", \"assert execute_computation(8, {'cores': 4, 'memory': '1GiB'}) == 'Executor_1'\", \"assert execute_...
{ "split": "train", "index": 80921, "acecode_id": "oss_34874", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a model for a slot machine game in a simplified format. Each slot is represented by a single character that can be up to 2 characters long. Your task is to implement a function that takes a list of character strings and returns a list of valid slot ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert valid_slots(['A', 'B', 'C']) == ['A', 'B', 'C']\", \"assert valid_slots(['AB', 'CD', 'EF']) == ['AB', 'CD', 'EF']\", \"assert valid_slots(['A', 'AB', 'ABC', 'B']) == ['A', 'AB', 'B']\", \"assert valid_slots(['', 'A', 'AB', 'C']) == ['', 'A', 'AB', 'C']\", \"...
{ "split": "train", "index": 80922, "acecode_id": "oss_18383", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes the parameters of a given model. The model is represented as a dictionary where the keys are the names of the parameters and the values are lists of numerical values representing the parameters. Your function should accep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_model({'layer1_weight': [0.0, 0.0], 'layer1_bias': [0.0, 0.0]}, lambda x: [1.0 for _ in x]) == {'layer1_weight': [1.0, 1.0], 'layer1_bias': [0.0, 0.0]}\", \"assert initialize_model({'layer1_weight': [2.0, 3.0], 'layer1_bias': [1.0]}, lambda x: [0....
{ "split": "train", "index": 80923, "acecode_id": "bigcode_python_fns_46800", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains the x and y coordinates of a vertex of a polygon. Your task is to implement a function `calculate_polygon_area(vertices: List[Tuple[int, int]]) -> float` that calculates the area of the polygon using the Shoelace formula...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_polygon_area([(0, 0), (4, 0), (4, 3), (0, 4)]) == 14.0\", \"assert calculate_polygon_area([(1, 1), (1, 4), (5, 4), (5, 1)]) == 12.0\", \"assert calculate_polygon_area([(0, 0), (0, 1), (1, 1), (1, 0)]) == 1.0\", \"assert calculate_polygon_area([(0, ...
{ "split": "train", "index": 80924, "acecode_id": "oss_31118", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom iterable class in Python named `CustomIterable`. This class should allow iteration over its internal data, which is initialized with a provided list. When iterated over, it should return both the value and the index of each element. Add...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_custom_iterable([1, 2, 3]).data == [1, 2, 3]\", \"assert len(create_custom_iterable([4, 5, 6])) == 3\", \"assert create_custom_iterable([1]).data[0] == 1\", \"assert create_custom_iterable([]).data == []\", \"assert create_custom_iterable([1, 2]).data...
{ "split": "train", "index": 80925, "acecode_id": "oss_19880", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of publication objects and returns the count of active publications. Each publication object is represented as a dictionary with the following keys: 'title' (string), 'is_active' (boolean), and 'publication_da...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_active_publications([]) == 0\", \"assert count_active_publications([{'title': 'Publication A', 'is_active': True, 'publication_date': '2022-01-15'}]) == 1\", \"assert count_active_publications([{'title': 'Publication B', 'is_active': False, 'publicatio...
{ "split": "train", "index": 80926, "acecode_id": "oss_11530", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that calculates the sum of all prime numbers less than a given integer n. The function should be called `sum_of_primes` and take a single parameter `n` which is a positive integer. The function should return an integer representing the sum of all prime n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_primes(10) == 17\", \"assert sum_of_primes(20) == 77\", \"assert sum_of_primes(1) == 0\", \"assert sum_of_primes(2) == 0\", \"assert sum_of_primes(3) == 2\", \"assert sum_of_primes(30) == 129\", \"assert sum_of_primes(50) == 328\", \"assert sum_of_pri...
{ "split": "train", "index": 80927, "acecode_id": "evol_16682", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string `text`, write a function `isValid` that checks if the substring 'blackjack' (case insensitive) exists in the given string. The function should return True if 'blackjack' is found, and False otherwise. For example, if the input is 'I love playing blackjack!', the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isValid('I love playing blackjack!') == True\", \"assert isValid('BLACKJACK is my favorite game.') == True\", \"assert isValid('Nothing beats a classic card game.') == False\", \"assert isValid('What about a game of Blackjack?') == True\", \"assert isValid('...
{ "split": "train", "index": 80928, "acecode_id": "bigcode_python_fns_29431", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function `string_sort(lst)` that sorts the list in ascending order using a recursive sorting algorithm. The function should not modify the input list and should return a new sorted list. Ensure that your implementation adheres to functional ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_sort(['banana', 'apple', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert string_sort(['zebra', 'monkey', 'apple', 'lion']) == ['apple', 'lion', 'monkey', 'zebra']\", \"assert string_sort(['apple', 'apple', 'banana']) == ['apple', 'apple', 'ban...
{ "split": "train", "index": 80929, "acecode_id": "evol_2697", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of a button in a simplified environment. You need to implement a function that takes two parameters: a boolean value `input_value` representing the current state of the button and a string `polarity` which can either be 'low' or 'high...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_button_pressed(True, 'low') == True\", \"assert is_button_pressed(False, 'low') == False\", \"assert is_button_pressed(True, 'high') == False\", \"assert is_button_pressed(False, 'high') == True\", \"assert is_button_pressed(True, 'low') == True\", \"asse...
{ "split": "train", "index": 80930, "acecode_id": "oss_23960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with cleaning up a block of text that has various OCR errors and formatting issues. Your goal is to replace specific incorrect phrases with their correct counterparts according to a predefined mapping. Write a function called `clean_text_block(block: str) -> str`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_text_block('Cemus and Description of plot are important.') == 'Census and Description of Plot are important.'\", \"assert clean_text_block('We found Mallard ): American Black Duck hybrid.') == 'We found Mallard x American Black Duck hybrid.'\", \"asser...
{ "split": "train", "index": 80931, "acecode_id": "bigcode_python_fns_30577", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the delivery times of multiple payloads. Each payload has a unique identifier and a specified delivery time in seconds. Your function should take a list of payloads, where each payload is represented as a dictionary with ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_payloads_by_delivery_time([{'id': 1, 'delivery_time': 2}, {'id': 2, 'delivery_time': 3}, {'id': 3, 'delivery_time': 1}]) == [3, 1, 2]\", \"assert sort_payloads_by_delivery_time([{'id': 1, 'delivery_time': 5}, {'id': 2, 'delivery_time': 5}, {'id': 3, 'de...
{ "split": "train", "index": 80932, "acecode_id": "oss_24075", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that enables or disables a feature in a hypothetical application. The function, `set_feature_enabled`, takes a boolean input parameter `enable`. If `enable` is set to True, the feature should be activated; if set to False, the feature...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_feature_enabled(True) == True\", \"assert set_feature_enabled(False) == False\", \"assert set_feature_enabled(True) == True\", \"assert set_feature_enabled(False) == False\", \"assert set_feature_enabled(True) == True\", \"assert set_feature_enabled(Fals...
{ "split": "train", "index": 80933, "acecode_id": "bigcode_python_fns_39732", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a variable, determine if it is a dictionary where every key and value is a string. Implement a function `is_str_str_dict(x)` that returns `True` if the variable `x` is a dictionary and every key-value pair consists of strings; otherwise, return `False`. The input variable...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_str_str_dict({'key': 'value'}) == True\", \"assert is_str_str_dict({'name': 'Alice', 'age': '30'}) == True\", \"assert is_str_str_dict({'a': '1', 'b': '2'}) == True\", \"assert is_str_str_dict({'foo': 'bar', 'baz': 'qux'}) == True\", \"assert is_str_str_d...
{ "split": "train", "index": 80934, "acecode_id": "bigcode_python_fns_7416", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing pairs of words, where each pair represents an antonym relationship. Your task is to write a function `find_antonym(word, antonym_dict)` that takes a word as input and returns its antonym from the given dictionary. If the input word does not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_antonym('fond', {'fond':'averse', 'wrath':'delight', 'diligent':'idle', 'guide':'follow', 'flow':'jam'}) == 'averse'\", \"assert find_antonym('wrath', {'fond':'averse', 'wrath':'delight', 'diligent':'idle', 'guide':'follow', 'flow':'jam'}) == 'delight'\...
{ "split": "train", "index": 80935, "acecode_id": "oss_265", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates logging messages with different severity levels. Your function should accept two parameters: a message and a severity level. The severity levels are 'INFO' and 'WARNING'. The function should return a formatted string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('Test message with unknown level.', 'ERROR') == 'Invalid level'\", \"assert log_message('Message with invalid level.', 'DEBUG') == 'Invalid level'\", \"assert log_message('Testing invalid level.', 'CRITICAL') == 'Invalid level'\", \"assert log_me...
{ "split": "train", "index": 80936, "acecode_id": "oss_13605", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple database migration tool. Implement the function `execute_commands(commands: List[str]) -> Dict[str, List[str]]` that takes a list of database migration commands and executes them in the order they are provided. Each command can be one of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_commands([\\\"op.create_table('users', ['id'])\\\", \\\"op.add_column('users', 'email', 'varchar')\\\", \\\"op.drop_column('users', 'email')\\\", \\\"op.drop_table('users')\\\"]) == {}\", \"assert execute_commands([\\\"op.create_table('inventory', ['...
{ "split": "train", "index": 80937, "acecode_id": "oss_31534", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function `encode_json_dict(input_dict: dict) -> str` that takes a dictionary as input and returns a JSON string representation of the dictionary. The function should ensure that all values in the dictionary are converted to strings and handle keys that may contain poten...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_json_dict({'name': 'John Doe', 'age': 30, 'fav_char': '<div></div>'}) == '{\\\"name\\\": \\\"John Doe\\\", \\\"age\\\": \\\"30\\\", \\\"fav_char\\\": \\\"<div></div>\\\"}'\", \"assert encode_json_dict({'key_with_harmful_character_$': 'value'}) == '{\\...
{ "split": "train", "index": 80938, "acecode_id": "evol_32435", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with validating a dictionary of parameters. Write a function `validate_parameters(parameters: dict) -> None` that checks if the input is a dictionary and if all the values in the dictionary are of valid types. The valid types for the values are: string, integer, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_parameters({'name': 'Alice', 'age': 30, 'height': 5.5}) is None\", \"assert validate_parameters({'is_active': False, 'preferences': ['email', 'sms']}) is None\", \"assert validate_parameters({'user': {'id': 1, 'role': 'admin'}, 'is_verified': True})...
{ "split": "train", "index": 80939, "acecode_id": "bigcode_python_fns_5126", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers representing a dataset, write a function that checks whether the sum of the lengths of the even and odd indexed elements in the dataset equals the total length of the dataset. The function should return True if the condition is met, otherwise return Fal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert index_length_check([1, 2, 3, 4, 5]) == True\", \"assert index_length_check([1, 2, 3]) == True\", \"assert index_length_check([1, 3, 5, 7]) == True\", \"assert index_length_check([]) == True\", \"assert index_length_check([1, 2]) == True\", \"assert index_len...
{ "split": "train", "index": 80940, "acecode_id": "bigcode_python_fns_22268", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing the resolution of a global Earth relief grid (in minutes), return a tuple representing the shape of the grid in terms of latitude and longitude. The input string will be in the format 'Xm', where 'X' is a two-digit integer representing the number of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert _shape_from_resolution('01m') == (10801, 21601)\", \"assert _shape_from_resolution('02m') == (5401, 10801)\", \"assert _shape_from_resolution('03m') == (3601, 7201)\", \"assert _shape_from_resolution('04m') == (2701, 5401)\", \"assert _shape_from_resolution(...
{ "split": "train", "index": 80941, "acecode_id": "bigcode_python_fns_27042", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of registered rule types and a rule object. Each rule object has a type and a set of parameters. Your task is to implement a function that checks if the rule type is registered. If the rule type is not registered, raise a RuleSerializeError with the message...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_rule_type(RuleClass(rule_type='ExistingType', parameters={}), ['ExistingType', 'AnotherType']) is None\", \"assert check_rule_type(RuleClass(rule_type='AnotherType', parameters={}), ['ExistingType', 'AnotherType']) is None\", \"assert check_rule_type(R...
{ "split": "train", "index": 80942, "acecode_id": "bigcode_python_fns_6159", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a nested list of lists, implement a function that returns the list with the highest number of unique elements. If there are multiple lists with the same highest number of unique elements, return the first one encountered.\nPlease reason step by step, then write a self-con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_with_most_unique_elements([[1, 2, 2, 2, 3], [4, 4, 4, 4], [5, 5, 6, 6, 7, 8], [7, 7, 9]]) == [5, 5, 6, 6, 7, 8]\", \"assert list_with_most_unique_elements([[1, 1, 1], [2, 2, 2], [3, 3, 3]]) == [1, 1, 1]\", \"assert list_with_most_unique_elements([[1, 2]...
{ "split": "train", "index": 80943, "acecode_id": "evol_24940", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a User class in Python that has a single method `get_user_info`. The `get_user_info` method should return a dictionary representation of the User object, including the `user_id` and `username` attributes. The User class should have a constructor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert User(1, 'Alice').get_user_info() == {'user_id': 1, 'username': 'Alice'}\", \"assert User(2, 'Bob').get_user_info() == {'user_id': 2, 'username': 'Bob'}\", \"assert User(123, 'Charlie').get_user_info() == {'user_id': 123, 'username': 'Charlie'}\", \"assert Us...
{ "split": "train", "index": 80944, "acecode_id": "oss_11192", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function in Python that takes a paragraph as a string input and creates a dictionary that counts the occurrence of each word in the paragraph. The function should treat words with different capitalizations (e.g., 'the' and 'The') as the same word. Additionally, the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_count('Hello world! Hello again.') == {'hello': 2, 'world': 1, 'again': 1}\", \"assert word_count('The quick brown fox jumps over the lazy dog.') == {'the': 2, 'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1}\", \"assert wor...
{ "split": "train", "index": 80945, "acecode_id": "evol_2497", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending a notification to a user's device using a hypothetical notification service. Write a function `send_notification(user_key, api_token, message)` that takes in three parameters: \n- `user_key` (string): The user-speci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_notification('valid_user_key', 'valid_api_token', 'Hello World!') == True\", \"assert send_notification('valid_user_key', 'valid_api_token', '') == False\", \"assert send_notification('valid_user_key', 'valid_api_token', 'Another Test') == True\", \"ass...
{ "split": "train", "index": 80946, "acecode_id": "oss_7140", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 3D points representing a local coordinate system. Each point is represented as a tuple of three floats (x, y, z). Your task is to implement a function that calculates the origin of this local coordinate system, which is defined as the average of all the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_origin([(1.0, 2.0, 3.0), (4.0, 5.0, 6.0), (7.0, 8.0, 9.0)]) == (4.0, 5.0, 6.0)\", \"assert calculate_origin([(1.0, 1.0, 1.0)]) == (1.0, 1.0, 1.0)\", \"assert calculate_origin([]) == (0.0, 0.0, 0.0)\", \"assert calculate_origin([(0.0, 0.0, 0.0), (0....
{ "split": "train", "index": 80947, "acecode_id": "bigcode_python_fns_19963", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s`, write a function that determines if the characters in the string can be rearranged to form a palindrome. A palindrome is a sequence that reads the same backward as forward. Your function should return `true` if the string can be rearranged into a palindrome,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_rearrange_to_palindrome('aab') == True\", \"assert can_rearrange_to_palindrome('abc') == False\", \"assert can_rearrange_to_palindrome('civic') == True\", \"assert can_rearrange_to_palindrome('ivicc') == True\", \"assert can_rearrange_to_palindrome('hell...
{ "split": "train", "index": 80948, "acecode_id": "oss_33565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a project that involves importing functions from different modules. Your task is to write a function `correct_imports()` that returns a list of two corrected import statements for a Python file named `main.py`. The first import statement should import `functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_imports() == ['from gavin import function as fu', 'from formatted_name import get_formatted_name as name']\", \"assert correct_imports() == ['from gavin import function as fu', 'from formatted_name import get_formatted_name as name']\", \"assert corr...
{ "split": "train", "index": 80949, "acecode_id": "oss_23516", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a JSON sidecar template from an events file represented as a dictionary. The input will consist of a dictionary containing event data with column names as keys and their corresponding values. Additionally, you will receive a dictionary specifying ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sidecar({'event1': 1, 'event2': 2}, {'event1': True, 'event2': False}) == {'command': 'generate_sidecar', 'command_target': 'events', 'data': '{\\\"event1\\\": 1}', 'output_display_name': 'events_generated.json', 'msg_category': 'success', 'msg': 'J...
{ "split": "train", "index": 80950, "acecode_id": "bigcode_python_fns_8525", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a dictionary of user input data against a predefined set of rules. The function should check if the input data contains a 'username' key with a non-empty string value, an 'email' key containing a valid email format, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_user_input({'username': 'john_doe', 'email': 'john@example.com', 'age': 25}) == (True, 'User input is valid and processed successfully.')\", \"assert validate_user_input({'username': 'john_doe', 'email': 'invalid_email', 'age': 25}) == (False, 'Inva...
{ "split": "train", "index": 80951, "acecode_id": "oss_11977", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function to find the longest increasing subsequence where each number in the subsequence is exactly 1 greater than the previous number. Implement a function called longest_increasing_subsequence that takes a list of integers as input and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([5, 6, 7, 8]) == [5, 6, 7, 8]\", \"assert longest_increasing_subsequence([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert longest_increasing_subsequence([10, 11, 12]) == [10, 11, 12]\", \"assert longest_increasing_subsequence([1, 2, 1...
{ "split": "train", "index": 80952, "acecode_id": "evol_3466", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `pluck(arr, cond_fn)` that takes an array of non-negative integers and a condition function `cond_fn`. The function should extract and return the node with the smallest value that meets the condition defined by `cond_fn` in the format of `[minimum value, in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pluck([4, 2, 3], lambda x: x % 2 == 0) == [2, 1, 6]\", \"assert pluck([5, 0, 3, 0, 4, 2], lambda x: x % 2 == 0) == [0, 1, 6]\", \"assert pluck([1, 3, 5, 7], lambda x: x % 2 == 0) == []\", \"assert pluck([], lambda x: x > 0) == []\", \"assert pluck([2, 2, 2],...
{ "split": "train", "index": 80953, "acecode_id": "evol_26248", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that updates a doctor's first name based on their ID. The function will take in an integer representing the doctor's unique ID and a dictionary containing the updated information for the doctor. The dictionary will have a key 'doc_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_doctor_by_id(1, {'doc_first_name': 'Alice'}) == 'Doctor information updated successfully'\", \"assert update_doctor_by_id(2, {'doc_first_name': 'Bob'}) == 'Doctor information updated successfully'\", \"assert update_doctor_by_id(11, {'doc_first_name':...
{ "split": "train", "index": 80954, "acecode_id": "oss_8505", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that calculates both the first and third quartiles of a tuple consisting of both even and odd numbers without using sorting or built-in functions. The function should return the quartiles as a tuple. The first quartile (Q1) is the median of the first half o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quartiles((5, 10, 15, 20, 25, 30, 35)) == (10, 30)\", \"assert quartiles((7, 8, 9)) == (7, 9)\", \"assert quartiles((10, 20, 30, 40)) == (15.0, 35.0)\", \"assert quartiles((1, 5, 9, 7)) == (3.0, 8.0)\", \"assert quartiles((1, 1, 1, 1)) == (1.0, 1.0)\", \"ass...
{ "split": "train", "index": 80955, "acecode_id": "evol_21560", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of dictionaries representing different items. Each dictionary contains information about an item, including its name, price, and category. Your goal is to create a function that filters the list of items b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_and_sort_items([{'name': 'Laptop', 'price': 800, 'category': 'electronics'},{'name': 'Headphones', 'price': 150, 'category': 'electronics'},{'name': 'T-shirt', 'price': 20, 'category': 'clothing'},{'name': 'Sneakers', 'price': 100, 'category': 'clothi...
{ "split": "train", "index": 80956, "acecode_id": "oss_14642", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom Float function that supports various features such as pre-setting values, handling units, and mapping values to specific labels. Your task is to implement a function `custom_float_operations` that takes the following parameters: a boole...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_float_operations(True, [5], None, {}) == [5]\", \"assert custom_float_operations(False, [1.0], 'mV', {}) == []\", \"assert custom_float_operations(True, [0.0024], 'V', {}) == [0.0024]\", \"assert custom_float_operations(True, [], None, {}) == []\", \"...
{ "split": "train", "index": 80957, "acecode_id": "oss_28167", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a code snippet that follows a specific format: `<reponame>RepositoryName/UniqueID<filename>FilePath<gh_stars>StarCount`. Your task is to write a function `extract_code_info(code_snippet: str) -> dict` that extracts the repository name, unique identifier, file path...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_code_info('<reponame>DPNT-Sourcecode/CHK-hbjk01<filename>virtualenv/Lib/site-packages/tdl/queue/abstractions/response/fatal_error_response.py<gh_stars>0') == {'Repository Name': 'DPNT-Sourcecode/CHK-hbjk01', 'Unique Identifier': 'CHK-hbjk01', 'File P...
{ "split": "train", "index": 80958, "acecode_id": "oss_1122", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that may contain instances of the substring '\\line'. Your task is to write a function that replaces all occurrences of '\\line' with '\\par' in the given string and returns the modified string. The input string will not be empty and will only consist of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_line_with_par('Hello\\\\line World') == 'Hello\\\\par World'\", \"assert replace_line_with_par('This is a test\\\\line string\\\\line with multiple\\\\line lines.') == 'This is a test\\\\par string\\\\par with multiple\\\\par lines.'\", \"assert repl...
{ "split": "train", "index": 80959, "acecode_id": "bigcode_python_fns_36611", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `binary_search(arr: List[int], x: int) -> int` that performs a binary search on a predefined, ordered numeric array. The function should return the index of the element `x` in the array if it is present, or -1 if it is not. The predefined array is `[1, 4, 5...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 4, 5, 6, 7, 9], 1) == 0\", \"assert binary_search([1, 4, 5, 6, 7, 9], 4) == 1\", \"assert binary_search([1, 4, 5, 6, 7, 9], 5) == 2\", \"assert binary_search([1, 4, 5, 6, 7, 9], 6) == 3\", \"assert binary_search([1, 4, 5, 6, 7, 9], 7) == 4\...
{ "split": "train", "index": 80960, "acecode_id": "evol_27644", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `prime_lcm_upto(n: int) -> int` that calculates the least common multiple (LCM) of all prime numbers up to a given integer n. The function should return the LCM of these prime numbers. If there are no prime numbers up to n, the function should return 1.\nPlease...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_lcm_upto(1) == 1\", \"assert prime_lcm_upto(2) == 2\", \"assert prime_lcm_upto(3) == 6\", \"assert prime_lcm_upto(4) == 6\", \"assert prime_lcm_upto(5) == 30\", \"assert prime_lcm_upto(6) == 30\", \"assert prime_lcm_upto(10) == 210\", \"assert prime_lc...
{ "split": "train", "index": 80961, "acecode_id": "evol_9267", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function called `multiply_triplet` that takes three integers as input and returns their product. The function should accept three parameters: `a`, `b`, and `c`, which are all integers. Your task is to write this function without any additional functionality or class...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_triplet(1, 2, 3) == 6\", \"assert multiply_triplet(0, 5, 10) == 0\", \"assert multiply_triplet(-1, -2, -3) == -6\", \"assert multiply_triplet(-1, 2, 3) == -6\", \"assert multiply_triplet(5, 5, 5) == 125\", \"assert multiply_triplet(10, 0, 10) == 0\"...
{ "split": "train", "index": 80962, "acecode_id": "evol_30469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of positive integers. Implement a function that calculates the Least Common Multiple (LCM) of the numbers in the list. The function should return the LCM of the list. The LCM of two integers a and b is defined as the smallest positive integer that is divisi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert array_lcm([3, 4, 5]) == 60\", \"assert array_lcm([7, 12, 21]) == 84\", \"assert array_lcm([5, 3, 7]) == 105\", \"assert array_lcm([7, 11, 17]) == 1309\", \"assert array_lcm([1]) == 1\", \"assert array_lcm([2, 3]) == 6\", \"assert array_lcm([15, 25]) == 75\",...
{ "split": "train", "index": 80963, "acecode_id": "evol_26607", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to manage log files in a simple file management system. Your function should be able to store log files, retrieve a log file by its name, and list all stored log file names. You will implement a function `manage_log_files` that takes a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_log_files([('log1.txt', 1024, '2022-01-01 12:00:00'), ('log2.txt', 2048, '2022-01-02 09:30:00')], 'store') == None\", \"assert manage_log_files([('log1.txt', 1024, '2022-01-01 12:00:00'), ('log2.txt', 2048, '2022-01-02 09:30:00')], 'get', 'log1.txt') ...
{ "split": "train", "index": 80964, "acecode_id": "oss_3429", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of financial transactions. Each transaction is represented as a dictionary with two keys: 'amount' (a non-negative integer representing the transaction amount) and 'extra' (a string representing additional inform...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total([{'amount': 100, 'extra': 'Purchase at Store A'}, {'amount': 200, 'extra': 'Purchase at Store B'}]) == 300\", \"assert calculate_total([{'amount': 50, 'extra': 'Gift'}, {'amount': 150, 'extra': 'Donation'}]) == 200\", \"assert calculate_total...
{ "split": "train", "index": 80965, "acecode_id": "oss_17584", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a directory structure for exporting glTF files based on a list of Blender objects and their associated animations. The function should take a list of object names and their associated animation names as input and org...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_gltf_paths(['Cube', 'Sphere'], {'Cube': ['Idle', 'Walk'], 'Sphere': ['Roll', 'Bounce']}) == {'Cube': ['base_directory/Cube/Idle.gltf', 'base_directory/Cube/Walk.gltf'], 'Sphere': ['base_directory/Sphere/Roll.gltf', 'base_directory/Sphere/Bounce.gltf...
{ "split": "train", "index": 80966, "acecode_id": "oss_13906", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that filters and sorts a list of field names related to Azure tools and extensions. Specifically, you need to filter out the fields that do not start with the prefix 'az_tool_' and return a list of the remaining fields sorted i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_and_sort_fields(['az_tool_path', 'az_tool_target']) == ['az_tool_path', 'az_tool_target']\", \"assert filter_and_sort_fields(['az_tool_version', 'az_tool_path', 'non_az_tool']) == ['az_tool_path', 'az_tool_version']\", \"assert filter_and_sort_fields(...
{ "split": "train", "index": 80967, "acecode_id": "oss_8024", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `pluck(arr: List[int], cond_fn: Callable[[int], bool]) -> List[int]` that traverses an array of non-negative integers and returns the largest node that satisfies a condition defined by `cond_fn`. In case of a tie (where multiple nodes have the same value), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pluck([1, 3, 5, 7], lambda x: x % 2 == 0) == []\", \"assert pluck([10, 20, 10, 30], lambda x: x > 15) == [30, 3]\", \"assert pluck([5, 1, 5], lambda x: x == 5) == [5, 2]\", \"assert pluck([3, 5, 3, 5, 3], lambda x: x == 5) == [5, 3]\", \"assert pluck([0, 0, ...
{ "split": "train", "index": 80968, "acecode_id": "evol_13442", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the creation of security policies using a mock client. You need to implement a function `create_security_policy` that takes a policy name (a string) and a list of rules (a list of strings) as inputs. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_security_policy('TestPolicy', ['rule1', 'rule2']) == 'Policy TestPolicy created successfully with rules: rule1, rule2'\", \"assert create_security_policy('PolicyWithNoRules', ['']) == 'Policy PolicyWithNoRules created successfully with rules: '\", \"a...
{ "split": "train", "index": 80969, "acecode_id": "oss_34648", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list containing only the unique integers from the original list, in the order they first appeared. Implement the function `get_unique_numbers(nums: List[int]) -> List[i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_numbers([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_numbers([4, 5, 4, 6, 7, 5]) == [4, 5, 6, 7]\", \"assert get_unique_numbers([1, 1, 1, 1, 1]) == [1]\", \"assert get_unique_numbers([]) == []\", \"assert get_unique_numbers([10, 20, 10,...
{ "split": "train", "index": 80970, "acecode_id": "bigcode_python_fns_27321", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of database migration operations and returns a dictionary containing the count of each type of operation. Each operation is represented as a dictionary with a key 'operation' indicating the type of operation. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_migration_operations([{'operation': 'AddField'}, {'operation': 'DeleteModel'}, {'operation': 'RenameModel'}]) == {'AddField': 1, 'DeleteModel': 1, 'RenameModel': 1}\", \"assert count_migration_operations([{'operation': 'RenameField'}, {'operation': 'Re...
{ "split": "train", "index": 80971, "acecode_id": "oss_33164", "num_tests": 16 }
acecode
[ { "role": "user", "content": "A robot on an infinite XY-plane starts at point (0, 0) and faces north. The robot can receive one of three possible types of commands: -2 (turn left 90 degrees), -1 (turn right 90 degrees), or 1 <= k <= 9 (move forward k units). Some grid squares are obstacles, defined as obsta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert robotSim([4,-1,3], [], 10) == 25\", \"assert robotSim([9,-1,9], [], 20) == 162\", \"assert robotSim([1,1,1,1], [], 4) == 16\", \"assert robotSim([4,-1,4], [[2,4]], 10) == 17\", \"assert robotSim([1,1,1,1,1,1,1,1], [], 8) == 64\"]}" }
{ "split": "train", "index": 80972, "acecode_id": "evol_25794", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `check_zip_code(zip_code: str) -> bool` that validates a United States postal zip code. The function should return `True` if the zip code is valid and `False` otherwise. A valid zip code is either a 5-digit number (e.g., '12345') or a 5-digit number followe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_zip_code('12345') == True\", \"assert check_zip_code('12345-6789') == True\", \"assert check_zip_code('1234') == False\", \"assert check_zip_code('123456') == False\", \"assert check_zip_code('12345-678') == False\", \"assert check_zip_code('12345-6789...
{ "split": "train", "index": 80973, "acecode_id": "evol_25266", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that maps labels to their corresponding numerical values. Write a function `label_to_number(label_dict: dict, label: str) -> Optional[int]` that takes in a dictionary `label_dict` and a string `label`. The function should return the corresponding nume...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert label_to_number({'cat': 1, 'dog': 2, 'mouse': 3}, 'cat') == 1\", \"assert label_to_number({'cat': 1, 'dog': 2, 'mouse': 3}, 'dog') == 2\", \"assert label_to_number({'cat': 1, 'dog': 2, 'mouse': 3}, 'mouse') == 3\", \"assert label_to_number({'cat': 1, 'dog': ...
{ "split": "train", "index": 80974, "acecode_id": "bigcode_python_fns_49891", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of real-time courses represented as a 2D list of floating-point numbers, where each inner list represents the time courses of different signals. Your task is to implement a function that extracts the first time course from the list and returns it as a 1D li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_first_time_course([[1.0, 2.0], [3.0, 4.0]]) == [1.0, 2.0]\", \"assert extract_first_time_course([[5.5, 6.5], [7.5, 8.5], [9.5]]) == [5.5, 6.5]\", \"assert extract_first_time_course([[0.1], [0.2, 0.3]]) == [0.1]\", \"assert extract_first_time_course([...
{ "split": "train", "index": 80975, "acecode_id": "bigcode_python_fns_6042", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `sum_of_squares` that calculates the sum of squares of all the even numbers in the list. The function should return this sum. If there are no even numbers in the list, return 0. \n\nFunction Signature: `def sum_of_squares(nums: List[in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3, 4]) == 20\", \"assert sum_of_squares([0, 1, 2, 3]) == 4\", \"assert sum_of_squares([1, 3, 5]) == 0\", \"assert sum_of_squares([-2, -4, 6]) == 56\", \"assert sum_of_squares([10, 15, 20, 25]) == 500\", \"assert sum_of_squares([-1, -3, ...
{ "split": "train", "index": 80976, "acecode_id": "bigcode_python_fns_49178", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates two types of Fibonacci sequences based on a given integer 'n' (where n should be more than 10). The function should return a tuple containing: 1) the original Fibonacci sequence starting from 0 up to the n-th term, and 2) another Fibonacci se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(11) == ([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55], [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89])\", \"assert fibonacci(12) == ([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89], [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144])\", \"assert fibonacci(15) == ([0, 1, 1, 2, ...
{ "split": "train", "index": 80977, "acecode_id": "evol_9248", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of bounding boxes represented in a normalized format as (cx, cy, w, h), where (cx, cy) are the coordinates of the center of the bounding box relative to the dimensions of an image, and w and h are the width and height of the bounding box, also normalized. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_bounding_boxes([(0.5, 0.5, 0.2, 0.3)], 600, 800) == [(400.0, 300.0, 160.0, 180.0)]\", \"assert convert_bounding_boxes([(0.0, 0.0, 0.5, 0.5)], 400, 600) == [(0.0, 0.0, 300.0, 200.0)]\", \"assert convert_bounding_boxes([(0.25, 0.25, 0.1, 0.2)], 800, 80...
{ "split": "train", "index": 80978, "acecode_id": "bigcode_python_fns_41442", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with visualizing a quantum state represented by a density matrix or statevector. Implement a function `visualize_quantum_state(rho: List[List[float]], method: str) -> None` that takes in the following parameters: \n\n- `rho`: a 2D list of floats representing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert visualize_quantum_state([[1, 0], [0, 1]], 'city') is None\", \"assert visualize_quantum_state([[0.5, 0], [0, 0.5]], 'paulivec') is None\", \"assert visualize_quantum_state([[1, 0], [0, 0]], 'qsphere') is None\", \"assert visualize_quantum_state([[0, 1], [1, ...
{ "split": "train", "index": 80979, "acecode_id": "bigcode_python_fns_44365", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given username exists in a predefined list of users. Each user is represented by a dictionary that contains a 'username' key. Your function should take a string 'username' as input and return a boolean indicating whet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert username_exists('Alice') == True\", \"assert username_exists('alice') == True\", \"assert username_exists('BOB') == True\", \"assert username_exists('Charlie') == True\", \"assert username_exists('david') == True\", \"assert username_exists('Eve') == True\",...
{ "split": "train", "index": 80980, "acecode_id": "bigcode_python_fns_3449", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s`, write a function `longestPalindromicSubstring(s)` that returns the longest palindromic substring in `s`. If there are multiple longest palindromic substrings, return any one of them. If there are no palindromic substrings, return an empty string. The input s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestPalindromicSubstring('babad') in ['bab', 'aba']\", \"assert longestPalindromicSubstring('cbbd') == 'bb'\", \"assert longestPalindromicSubstring('a') == 'a'\", \"assert longestPalindromicSubstring('ac') == 'a'\", \"assert longestPalindromicSubstring('r...
{ "split": "train", "index": 80981, "acecode_id": "evol_19558", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that determines the simplest type from a given list of types based on specific rules. The function should take a list of types as input and return the simplest type according to the following rules: 1. Basic types (e.g., int, s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simplify_type([float, List[str], Tuple[int]]) == float\", \"assert simplify_type([List[int], List[str], int]) == int\", \"assert simplify_type([Union[int, float], str, List[float]]) == str\", \"assert simplify_type([Tuple[int, str], List[float], int]) == int...
{ "split": "train", "index": 80982, "acecode_id": "oss_10461", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and replaces all occurrences of the character 'a' with the character '@'. The function should return the modified string.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_a_with_at('@pple') == '@pple'\", \"assert replace_a_with_at('banana') == 'b@n@n@'\", \"assert replace_a_with_at('apple pie') == '@pple pie'\", \"assert replace_a_with_at('grape') == 'gr@pe'\", \"assert replace_a_with_at('avocado') == '@voc@do'\", \"a...
{ "split": "train", "index": 80983, "acecode_id": "evol_34105", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of vertical bars in a histogram. Your task is to implement a function that calculates the maximum area of a rectangle that can be formed within the histogram. The rectangle can span multiple bars and its area is determin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_histogram_area([1, 2, 3, 4, 5]) == 9\", \"assert max_histogram_area([5, 4, 3, 2, 1]) == 9\", \"assert max_histogram_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_histogram_area([2, 4]) == 4\", \"assert max_histogram_area([0, 1, 0, 1]) == 1\", \"assert m...
{ "split": "train", "index": 80984, "acecode_id": "oss_32894", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `gcd_of_list(num_list: List[int]) -> int` that computes the greatest common divisor (GCD) for a list of provided positive integers. Ensure that all inputs are positive integers and that the function handles large numbers efficiently. The function should rai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gcd_of_list([12, 15, 9]) == 3\", \"assert gcd_of_list([100, 75, 25]) == 25\", \"assert gcd_of_list([7, 14, 21]) == 7\", \"assert gcd_of_list([9, 27, 81]) == 9\", \"assert gcd_of_list([10, 20, 30, 40]) == 10\", \"assert gcd_of_list([17, 19, 23]) == 1\", \"ass...
{ "split": "train", "index": 80985, "acecode_id": "evol_3311", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes sample data from a scientific project. The function takes two parameters: `project` and `sample_data`. The `project` parameter represents the project number as a string, and `sample_data` is a list of dictionaries, e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_samples('A', [{'project': 'A', 'sample_id': '1', 'description': 'Sample 1 for project A'}, {'project': 'B', 'sample_id': '2', 'description': 'Sample 2 for project B'}, {'project': 'A', 'sample_id': '3', 'description': 'Sample 3 for project A'}, {'pro...
{ "split": "train", "index": 80986, "acecode_id": "oss_14311", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of integers and returns a new list containing only the even numbers from the original list. Your function should preserve the order of the elements as they appear in the input list. If there are no even number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 21, 32, 43, 54]) == [10, 32, 54]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_...
{ "split": "train", "index": 80987, "acecode_id": "oss_24814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of points of interest (POIs) represented as tuples of (id, label), write a function that encodes the labels into numerical values. The function should return a list of encoded labels and a dictionary mapping each unique label to its corresponding encoding. The inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_labels([(1, 'restaurant'), (2, 'cafe'), (3, 'restaurant')]) == ([0, 1, 0], {'restaurant': 0, 'cafe': 1})\", \"assert encode_labels([(1, 'gas station'), (2, 'supermarket'), (3, 'gas station')]) == ([0, 1, 0], {'gas station': 0, 'supermarket': 1})\", \"...
{ "split": "train", "index": 80988, "acecode_id": "bigcode_python_fns_15043", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a standardized log file name based on the provided base file name and log type. The log file name should be created by appending a specific suffix based on the log type to the base file name. The suffixes are as follows: fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_log_filename('example.yaml', 'catalog_seed') == 'example_catalog.log'\", \"assert generate_log_filename('data.xml', 'fits_seed') == 'data_fits.log'\", \"assert generate_log_filename('config.yml', 'yaml_generator') == 'config_yaml.log'\", \"assert ge...
{ "split": "train", "index": 80989, "acecode_id": "bigcode_python_fns_28137", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D grid of size NxN where each cell contains a unique integer from 1 to N*N, implement a function `maxSumPath(grid: List[List[int]], k: int) -> Tuple[int, List[Tuple[int, int]]]` that finds the maximum sum of exactly k non-repeating cells. You can start from any cell an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxSumPath([[9, 1, 2], [8, 7, 3], [6, 5, 4]], 1) == (9, [(0, 0)])\", \"assert maxSumPath([[1]], 1) == (1, [(0, 0)])\", \"assert maxSumPath([[1, 1, 1], [1, 1, 1], [1, 1, 1]], 3) == (3, [(0, 0), (0, 1), (0, 2)])\", \"assert maxSumPath([[10, 20, 30], [40, 50, 6...
{ "split": "train", "index": 80990, "acecode_id": "evol_609", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of strings representing recipe names, implement a function `get_jambalaya_recipes(recipes: List[str], query: Optional[str] = None) -> List[str]` that returns a list of recipe names that contain the word 'jambalaya' and optionally match a given query string. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_jambalaya_recipes(['Chicken Jambalaya', 'Seafood Jambalaya', 'Vegetable Stir Fry'], 'chicken') == ['Chicken Jambalaya']\", \"assert get_jambalaya_recipes(['Chicken Jambalaya', 'Seafood Jambalaya', 'Vegetable Stir Fry'], 'Jambalaya') == ['Chicken Jambalay...
{ "split": "train", "index": 80991, "acecode_id": "bigcode_python_fns_3424", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a single game of rock-paper-scissors. The function should take two inputs: the user's choice (a string which can be 'rock', 'paper', or 'scissors') and the computer's choice (a string which can also be 'rock', 'paper', or '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert play_rps('rock', 'scissors') == 'You win! Rock beats scissors.'\", \"assert play_rps('paper', 'rock') == 'You win! Paper beats rock.'\", \"assert play_rps('scissors', 'paper') == 'You win! Scissors beats paper.'\", \"assert play_rps('rock', 'paper') == 'Comp...
{ "split": "train", "index": 80992, "acecode_id": "oss_36609", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two binary vectors, `pr` (predicted) and `gt` (ground truth), representing the predicted and actual classifications of a set of items, write a function `f_score(pr: List[int], gt: List[int], beta: float = 1, threshold: float = 0.5) -> float` that calculates the F1-score (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert f_score([1, 1, 0], [0, 0, 0]) == 0.0\", \"assert f_score([0, 0, 1], [1, 1, 0]) == 0.0\", \"assert f_score([1, 0, 0], [0, 1, 0]) == 0.0\", \"assert f_score([0, 0, 0], [1, 1, 1]) == 0.0\", \"assert f_score([0, 1, 0], [0, 0, 0]) == 0.0\"]}" }
{ "split": "train", "index": 80993, "acecode_id": "bigcode_python_fns_38392", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of flavors in an ice cream shop. Implement a function `disable_flavor(flavor: str) -> None` that takes a string `flavor` as input and removes it from a global list of flavors called `all_flavors`. If the given flavor does not exist in the lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert disable_flavor('vanilla') is None\", \"assert disable_flavor('chocolate') is None\", \"assert disable_flavor('strawberry') is None\", \"assert disable_flavor('mint') is None\", \"assert disable_flavor('cookie dough') is None\", \"assert disable_flavor('vanil...
{ "split": "train", "index": 80994, "acecode_id": "bigcode_python_fns_23190", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that takes the number of hours worked in a week and returns a normalized score based on a standard work week of 40 hours. If the input hours are greater than 168 or less than 0, the function should return an appropriate error message. The normalized score i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_hours(50) == 1.25\", \"assert normalize_hours(0) == 0.0\", \"assert normalize_hours(40) == 1.0\", \"assert normalize_hours(80) == 2.0\", \"assert normalize_hours(168) == 4.2\", \"assert normalize_hours(100) == 2.5\", \"assert normalize_hours(39) ==...
{ "split": "train", "index": 80995, "acecode_id": "evol_25126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a transition matrix A representing state transitions and a starting state s. Your task is to implement a function `predict_chain(m: int, count: int, s: str, A: Dict[str, Dict[str, float]]) -> List[List[str]]` that predicts the next m-length chains from the startin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_chain(3, 2, 'A', {'A': {'B': 0.5, 'C': 0.5}, 'B': {'C': 1.0}, 'C': {'A': 1.0}}) == [['A', 'B', 'C'], ['A', 'C', 'A']]\", \"assert predict_chain(2, 1, 'B', {'A': {'B': 0.3, 'C': 0.7}, 'B': {'C': 1.0}, 'C': {'A': 0.5, 'B': 0.5}}) == [['B', 'C']]\", \"a...
{ "split": "train", "index": 80996, "acecode_id": "bigcode_python_fns_20224", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python decorator that logs the input arguments and return value of a function. Your decorator should be able to handle both positional and keyword arguments. The decorator should print the function name, input arguments, and the return value w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_function_call(cwincall)('x', 'y') == None\", \"assert log_function_call(cwincall)('foo', 'bar', 10) == None\", \"assert log_function_call(cwincall)('test1', 'test2', 5, 6, 7) == None\", \"assert log_function_call(cwincall)('red', 'blue') == None\", \"ass...
{ "split": "train", "index": 80997, "acecode_id": "oss_28805", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of time points in a 24-hour clock format represented as strings in 'HH:MM'. Your task is to implement a function that returns the minimum time difference in minutes between any two time points in the list. If any of the time points are invalid (not in the '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_time_difference(['23:59', '00:00']) == 1\", \"assert find_min_time_difference(['00:00', '23:59', '00:00']) == 0\", \"assert find_min_time_difference(['00:00', '23:59', '25:00']) == 'Error: Invalid time input'\", \"assert find_min_time_difference(['1...
{ "split": "train", "index": 80998, "acecode_id": "evol_11260", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `calculate_average(scores: List[int]) -> float` that takes a list of integers representing scores and returns the average of these scores. If the list is empty, the function should return 0.0. The function should handle cases where the scores can be negative or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([]) == 0.0\", \"assert calculate_average([0]) == 0.0\", \"assert calculate_average([1]) == 1.0\", \"assert calculate_average([1, 2, 3]) == 2.0\", \"assert calculate_average([10, 20, 30]) == 20.0\", \"assert calculate_average([-1, -2, -3]) =...
{ "split": "train", "index": 80999, "acecode_id": "evol_34372", "num_tests": 16 }