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": "Write a function that takes an array of integers and outputs the elements in reverse order without using the built-in reverse function or slicing. Implement the function using a recursive algorithm.\nPlease reason step by step, then write a self-contained Python solution. Give ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_reverse([0, 1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1, 0]\", \"assert print_reverse([1, 2, 3]) == [3, 2, 1]\", \"assert print_reverse([10, 20, 30, 40]) == [40, 30, 20, 10]\", \"assert print_reverse([]) == []\", \"assert print_reverse([5]) == [5]\", \"assert pr...
{ "split": "train", "index": 82700, "acecode_id": "evol_21878", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a custom Python exception to handle Nonetype errors in a function that processes a list of strings. Implement a function called `process_strings` that takes a list of strings as input and returns a new list with each string capitalized. If the function encounters a None ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_strings(['hello', 'world']) == ['Hello', 'World']\", \"assert process_strings(['python', 'programming']) == ['Python', 'Programming']\", \"assert process_strings(['data', 'science']) == ['Data', 'Science']\", \"assert process_strings([]) == []\", \"a...
{ "split": "train", "index": 82701, "acecode_id": "evol_29892", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function that calculates the average age of a group of people. The input will be a list of lists, where each inner list contains a person's name and age. The first inner list will be a header indicating the columns. Your function should return the average age as a float...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_age([['Person', 'Age'], ['Alice', 30], ['Bob', 25], ['Charlie', 35]]) == 30.0\", \"assert average_age([['Person', 'Age'], ['Eve', 22], ['Mallory', 27]]) == 24.5\", \"assert average_age([['Person', 'Age'], ['Oscar', 50], ['Peggy', 40], ['Trent', 30]])...
{ "split": "train", "index": 82702, "acecode_id": "evol_32551", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `preorder_traversal(root)` that takes the root node of a binary tree and returns a list of values representing the pre-order traversal of the tree. The pre-order traversal follows the order: Root -> Left -> Right. If the tree is empty, return an empty list....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert preorder_traversal(None) == []\", \"assert preorder_traversal(Node(1)) == [1]\", \"assert preorder_traversal(Node(1, Node(2))) == [1, 2]\", \"assert preorder_traversal(Node(1, None, Node(3))) == [1, 3]\", \"assert preorder_traversal(Node(1, Node(2, Node(4), ...
{ "split": "train", "index": 82703, "acecode_id": "evol_2606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two vectors represented as lists of floating-point numbers, write a function `is_vector_equal(vec1: List[float], vec2: List[float], tolerance: float = 1e-10) -> bool` that checks if the two vectors are equal. Two vectors are considered equal if the absolute difference bet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_vector_equal([1.0, 2.0, 3.0], [1.0, 2.0, 3.0]) == True\", \"assert is_vector_equal([1.0, 2.0, 3.0], [1.0, 2.0, 4.0]) == False\", \"assert is_vector_equal([1.0, 2.0], [1.0, 2.0, 3.0]) == False\", \"assert is_vector_equal([1.0], [1.0]) == True\", \"assert i...
{ "split": "train", "index": 82704, "acecode_id": "bigcode_python_fns_20267", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes and manipulates a list of geospatial coordinates represented as tuples. Each tuple contains two elements: latitude and longitude. Write a Python function called `process_coordinates` that takes a list of coordinate t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_coordinates([(10, 20)]) == [(10, 20)]\", \"assert process_coordinates([(95, 200)]) == [(None, None)]\", \"assert process_coordinates([(-100, 150)]) == [(None, 150)]\", \"assert process_coordinates([(45, -190)]) == [(45, None)]\", \"assert process_coo...
{ "split": "train", "index": 82705, "acecode_id": "oss_20613", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a configuration dictionary for a natural language processing tool. The function should handle two specific parameters: `max_length` and `pos_num`. The `max_length` parameter should represent the maximum number of words allo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_config({'fixlen': 100, 'maxlen': 50}) == {'max_length': 100, 'pos_num': 201}\", \"assert process_config({'fixlen': 10, 'maxlen': 5}) == {'max_length': 10, 'pos_num': 21}\", \"assert process_config({'fixlen': 0, 'maxlen': 0}) == {'max_length': 0, 'pos...
{ "split": "train", "index": 82706, "acecode_id": "oss_9530", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function called `remove_negative` that takes a list of integers as input and returns a new list containing only the non-negative integers (i.e., integers greater than or equal to zero).\nPlease reason step by step, then write a self-contained Python solution. Give your ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_negative([-1, 2, -3, 4]) == [2, 4]\", \"assert remove_negative([0, -1, 3, -4, 5]) == [0, 3, 5]\", \"assert remove_negative([-5, -10, -15]) == []\", \"assert remove_negative([1, 2, 3]) == [1, 2, 3]\", \"assert remove_negative([]) == []\", \"assert remo...
{ "split": "train", "index": 82707, "acecode_id": "evol_29310", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, write a function `fibonacci(n)` that returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. Your implementation should be optimized to handle larger values of n e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2...
{ "split": "train", "index": 82708, "acecode_id": "evol_22330", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a JSON string based on a given list of materials and object types. The function should take in two parameters: a list of tuples containing material names and object types, and a boolean flag indicating whether the ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_json_string([('Iron', 'Ore'), ('Gold', 'Ingot'), ('Copper', 'Block')], True) == '{\\\\n \\\"block.libvulpes.oreIron\\\": \\\"Iron Ore\\\",\\\\n \\\"block.libvulpes.ingotGold\\\": \\\"Gold Ingot\\\",\\\\n \\\"block.libvulpes.blockCopper\\\":...
{ "split": "train", "index": 82709, "acecode_id": "oss_7651", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a file path represented as a string, implement a function that splits the path into its components. The first component should be the root (which is either '/' or an empty string if there's no root), followed by the subsequent directories and the file name (if present). T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_path_components('/a/b/c') == ['/', 'a', 'b', 'c']\", \"assert split_path_components('/a/b/c.txt') == ['/', 'a', 'b', 'c.txt']\", \"assert split_path_components('/home/user/docs') == ['/', 'home', 'user', 'docs']\", \"assert split_path_components('/var/...
{ "split": "train", "index": 82710, "acecode_id": "bigcode_python_fns_32794", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates running a function across multiple hosts. Your goal is to implement a function `parallel_execution` that takes a list of host names and a function as input. The function should execute the given function for each hos...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parallel_execution(['host1'], lambda host: f'Hello from {host}') == {'host1': 'Hello from host1'}\", \"assert parallel_execution(['host1', 'host2'], lambda host: f'Host {host} is active') == {'host1': 'Host host1 is active', 'host2': 'Host host2 is active'}\...
{ "split": "train", "index": 82711, "acecode_id": "oss_21538", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a basic banking system operation. The function will take a list of transactions and an initial balance, then process the transactions sequentially. Each transaction can either be a deposit (indicated by a positive amount) o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_transactions(1000.0, [200.0, -100.0, -50.0]) == 1050.0\", \"assert process_transactions(800.0, [-50.0, -200.0, 100.0]) == 650.0\", \"assert process_transactions(100.0, [0.0, 0.0]) == 100.0\", \"assert process_transactions(100.0, [50.0, -70.0]) == 80....
{ "split": "train", "index": 82712, "acecode_id": "oss_15863", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of motivational pitches and returns a list of pitches that belong to a specified category. Each pitch is represented as a dictionary with keys 'title', 'category', and 'description'. Your function should filter the pitch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_pitches_by_category([], 'Inspiration') == []\", \"assert filter_pitches_by_category([{'title': 'Pitch 1', 'category': 'Inspiration', 'description': 'Stay positive!'}], 'Inspiration') == [{'title': 'Pitch 1', 'category': 'Inspiration', 'description': '...
{ "split": "train", "index": 82713, "acecode_id": "oss_2974", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `register_user(user_id: str, user_data: dict) -> str` that simulates the registration of a user in a serverless architecture. The function should take a user ID as a string and a dictionary containing user data. If the registration is successful, return the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_user('user1', {'name': 'Alice'}) == 'User registered successfully'\", \"assert register_user('user2', {'name': 'Charlie'}) == 'User registered successfully'\", \"assert register_user('user3', {'name': 'David'}) == 'User registered successfully'\", \...
{ "split": "train", "index": 82714, "acecode_id": "evol_6489", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines the correct Juju command based on the provided inputs for JUJU_BINARY and JUJU_VERSION. The function should accept two parameters: `juj_binary` (a string representing the full path location to a Juju binary) and `juj_v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_juju_command('/home/ubuntu/Downloads/juju/usr/lib/juju-2.1-rc1/bin/juju', '') == '/home/ubuntu/Downloads/juju/usr/lib/juju-2.1-rc1/bin/juju'\", \"assert get_juju_command('', 'juju-2.1-rc1') == 'juju-2.1'\", \"assert get_juju_command('', '') == 'juju'\", ...
{ "split": "train", "index": 82715, "acecode_id": "bigcode_python_fns_35627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom validation function for an integer field that allows null values and has a range of 0 to 100. Your task is to implement a function that checks if the given value is a multiple of 5. If the value is not a multiple of 5 and is not null, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_multiple_of_5(0) == True\", \"assert is_multiple_of_5(5) == True\", \"assert is_multiple_of_5(10) == True\", \"assert is_multiple_of_5(15) == True\", \"assert is_multiple_of_5(20) == True\", \"assert is_multiple_of_5(25) == True\", \"assert is_multiple_of...
{ "split": "train", "index": 82716, "acecode_id": "oss_2876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of n-dimensional vectors (represented as a list of lists), write a function that normalizes each vector in the list. Normalizing a vector means scaling it to have a length (or magnitude) of 1. If a vector is the zero vector (all components are zero), it should be r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_vectors([[1, 0, 0], [0, 1, 0], [0, 0, 0]]) == [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0, 0, 0]], 'Test Case 2 Failed'\", \"assert normalize_vectors([[2, 2], [2, 0], [0, 2]]) == [[0.7071067811865475, 0.7071067811865475], [1.0, 0.0], [0.0, 1.0]], 'Test C...
{ "split": "train", "index": 82717, "acecode_id": "bigcode_python_fns_40688", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `merge_sort(arr)` that takes an array of integers as input and sorts the array in ascending order using the merge sort algorithm. The function should return the sorted array.\nPlease reason step by step, then write a self-contained Python solution. Give you...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sort([34, 19, 42, -9, 2018, 0, 105]) == [-9, 0, 19, 34, 42, 105, 2018]\", \"assert merge_sort([3, 5, 1, 4, 2]) == [1, 2, 3, 4, 5]\", \"assert merge_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert merge_sort([]) == []\", \"assert merge_sort...
{ "split": "train", "index": 82718, "acecode_id": "evol_12771", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function that evaluates and computes the outcome of a mathematical expression encapsulated within a string format, processing operations in a sequential manner. The function should handle all basic arithmetic operations including addition, subtraction, multiplicatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('1+2*3') == 7\", \"assert evaluate_expression('4-2+6') == 8\", \"assert evaluate_expression('10/2*3') == 15\", \"assert evaluate_expression('5*6-10') == 20\", \"assert evaluate_expression('2+3*4-5') == 9\", \"assert evaluate_expression('7...
{ "split": "train", "index": 82719, "acecode_id": "evol_17376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that filters out strings from a given list that have a length of less than three characters. The function should return a new list containing only the strings that meet this criteria.\nPlease reason step by step, then write a self-contained Python solution....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_short_strings(['a', 'ab', 'abc', 'abcd']) == ['abc', 'abcd']\", \"assert filter_short_strings(['cat', 'dog', 'a', 'b', 'c']) == ['cat', 'dog']\", \"assert filter_short_strings(['', 'no', 'yes', 'maybe', 'ok']) == ['yes', 'maybe']\", \"assert filter_sh...
{ "split": "train", "index": 82720, "acecode_id": "evol_30315", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that takes three parameters: the list of integers, a slice range (start and end indices), and an index for the column to extract. The function should return a string representation of the integers in the specified slice range, joined b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert join_integers([1, 2, 3, 4, 5], (1, 4), 0) == '2-3-4'\", \"assert join_integers([10, 20, 30, 40], (0, 2), 0) == '10-20'\", \"assert join_integers([5, 15, 25, 35], (2, 4), 0) == '25-35'\", \"assert join_integers([-1, -2, -3, -4], (0, 3), 0) == '-1--2--3'\", \"...
{ "split": "train", "index": 82721, "acecode_id": "bigcode_python_fns_20063", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a configuration dictionary for a mobile application build system. The dictionary contains settings for building the mobile application, including resource and distribution URLs, and the build type. Your function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_mobile_config({'mobile': {'resourceUrlBase': 'https://example.com/resources', 'distUrlBase': 'https://example.com/distribution', 'buildMobile': 'debug'}}) == 'Mobile Build Configuration:\\\\nResource URL: https://example.com/resources\\\\nDistributio...
{ "split": "train", "index": 82722, "acecode_id": "oss_23583", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to track and recognize people. Your function should manage the recognition and tracking of individuals based on their names and corresponding recognition times. Implement a function `track_people(people: List[Tuple[str, str]]) -> Dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert track_people([('Alice', '2023-10-01 10:00:00'), ('Bob', '2023-10-01 10:05:00'), ('Alice', '2023-10-01 10:10:00')]) == {'Alice': '2023-10-01 10:10:00', 'Bob': '2023-10-01 10:05:00'}\", \"assert track_people([('Charlie', '2023-10-01 09:00:00'), ('Charlie', '20...
{ "split": "train", "index": 82723, "acecode_id": "oss_33404", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates user tasks based on specific criteria. The function should take a list of dictionaries, where each dictionary represents a user task with the following keys: `task_id`, `task_name`, `task_description`, and `task_status`. Yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_user_tasks([{'task_id': '1', 'task_name': 'Task A', 'task_description': 'Description A', 'task_status': 'pending'}, {'task_id': '2', 'task_name': 'Task B', 'task_description': None, 'task_status': 'completed'}]) == True\", \"assert validate_user_tas...
{ "split": "train", "index": 82724, "acecode_id": "oss_7743", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a character's name and a list of traits, write a function that generates a sequence of haikus, each haiku revealing one of the character's traits in a specific format. The haiku should follow the structure: '{name}, {trait},\\nPaths of life he does tread,\\nA soul story s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_haikus('John Doe', ['brave as a lion', 'loves to explore', 'devoid of any fear', 'has a heart of gold', 'kind to everyone', 'a lover of books', 'wise beyond his years', 'has an agile mind', 'mysterious in ways', 'carries hidden pain']) == ['John Doe...
{ "split": "train", "index": 82725, "acecode_id": "evol_30073", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a procedure that, given the head of a singly linked list, returns the value of a random node from the list. Each node should have an equal chance of being chosen. You need to implement the function `getRandom` which returns a random node's value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solution.getRandom() in {1, 2, 3}\", \"assert solution.getRandom() in {1, 2, 3}\", \"assert solution.getRandom() in {1, 2, 3}\", \"assert solution.getRandom() in {1, 2, 3}\", \"assert solution.getRandom() in {1, 2, 3}\", \"assert solution.getRandom() in {1, ...
{ "split": "train", "index": 82726, "acecode_id": "evol_31907", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple pagination system for displaying data in a table. Your goal is to implement a function `paginate_data(show_amount: int, page: int, table: List[str]) -> List[str]` that returns the subset of the given `table` data for the specified `page...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert paginate_data(3, 1, ['a', 'b', 'c', 'd', 'e']) == ['a', 'b', 'c']\", \"assert paginate_data(3, 2, ['a', 'b', 'c', 'd', 'e']) == ['d', 'e']\", \"assert paginate_data(3, 3, ['a', 'b', 'c', 'd', 'e']) == []\", \"assert paginate_data(2, 1, ['apple', 'banana', 'c...
{ "split": "train", "index": 82727, "acecode_id": "oss_30386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings `stra` and `strb`, return the longest common prefix shared by both strings. A common prefix is defined as the substring that appears at the beginning of both strings and consists of consecutive matching characters. If there is no common prefix, return an empty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_start('flower', 'flow') == 'flow'\", \"assert common_start('dog', 'racecar') == ''\", \"assert common_start('interspecies', 'interstellar') == 'inters'\", \"assert common_start('throne', 'throne') == 'throne'\", \"assert common_start('abcdefg', 'abcxy...
{ "split": "train", "index": 82728, "acecode_id": "bigcode_python_fns_46109", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_item(matrix, row, column)` that retrieves an item from a given two-dimensional array (list of lists) at a specific row and column. If the row or column index is out of bounds, the function should return 'Row or Column index out of range.' You can assum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_item([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 1, 2) == 6\", \"assert get_item([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 0, 0) == 1\", \"assert get_item([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2, 2) == 9\", \"assert get_item([[1, 2, 3]], 0, 1) == 2\", \"assert get_item([[1...
{ "split": "train", "index": 82729, "acecode_id": "evol_26645", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `sum_of_elements(array)` that calculates the sum of all the integers in the list. If the input is not a list, the function should raise a TypeError with the message 'Input should be of list data type'.\nPlease reason step by step, then...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_elements([1, 2, 3]) == 6\", \"assert sum_of_elements([-1, -2, -3]) == -6\", \"assert sum_of_elements([0, 0, 0]) == 0\", \"assert sum_of_elements([5]) == 5\", \"assert sum_of_elements([1, 2, 3, 4, 5]) == 15\", \"assert sum_of_elements([]) == 0\", \"ass...
{ "split": "train", "index": 82730, "acecode_id": "evol_15962", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of triangles defined by their vertex coordinates in a 2D space, implement a function `calculate_triangle_properties(vertices: List[Tuple[int, int]]) -> Dict[str, List[float]]` that calculates the centroid and area of each triangle. Each triangle is represented by a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_triangle_properties([((0, 0), (0, 1), (1, 0))]) == {'centroids': [(0.3333333333333333, 0.3333333333333333)], 'areas': [0.5]}\", \"assert calculate_triangle_properties([((1, 1), (4, 1), (1, 5))]) == {'centroids': [(2.0, 2.3333333333333335)], 'areas'...
{ "split": "train", "index": 82731, "acecode_id": "bigcode_python_fns_836", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `analyze_text(text: str) -> Dict[str, int]` that takes a string input and returns a dictionary containing the counts of uppercase letters, lowercase letters, digits, symbols, as well as the counts of vowels and consonants for both uppercase and lowercase le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_text('123456') == {'Uppercase': 0, 'Uppercase_Vowels': 0, 'Uppercase_Consonants': 0, 'Lowercase': 0, 'Lowercase_Vowels': 0, 'Lowercase_Consonants': 0, 'Digits': 6, 'Symbols': 0}\", \"assert analyze_text('!@#$%^&*()') == {'Uppercase': 0, 'Uppercase_Vo...
{ "split": "train", "index": 82732, "acecode_id": "evol_34823", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given two lists of elements, `line1` and `line2`, each containing integers, floats, or strings. Your task is to implement a function that checks if the two lists are equal under the following conditions: 1) Both lists must have the same length. 2) If an element is a str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_lists([1, 2, 3], [1, 2, 3]) == True\", \"assert compare_lists([1.0, 'test', 3], [1.0, 'test', 3]) == True\", \"assert compare_lists([1.00000000000001, 2, 3], [1.00000000000002, 2, 3]) == True\", \"assert compare_lists(['a', 'b', 'c'], ['a', 'b', 'c']...
{ "split": "train", "index": 82733, "acecode_id": "bigcode_python_fns_34671", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sequence of characters, write a function that arranges these characters in ascending order without using any built-in sorting methods. The characters can be uppercase and lowercase letters, and special characters or numbers represented as strings should be placed at the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_sort(['b', 'a', 'c', 'B', 'A']) == ['A', 'B', 'a', 'b', 'c']\", \"assert custom_sort(['A', 'a', '1', '@', 'B', 'b', 'C', 'c']) == ['A', 'B', 'C', 'a', 'b', 'c', '1', '@']\", \"assert custom_sort(['1', '2', '3', 'a', 'A']) == ['A', 'a', '1', '2', '3']\...
{ "split": "train", "index": 82734, "acecode_id": "evol_11659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates a 2D array of size m x n, filling it with numbers from 1 to m*n in a zig-zag pattern. The zig-zag pattern starts from the top-left corner, moving right on even indexed rows and left on odd indexed rows. The function should take two parameters: m ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert zigzag_pattern(1, 1) == [[1]]\", \"assert zigzag_pattern(1, 2) == [[1, 2]]\", \"assert zigzag_pattern(2, 1) == [[1], [2]]\", \"assert zigzag_pattern(2, 2) == [[1, 2], [4, 3]]\", \"assert zigzag_pattern(3, 1) == [[1], [2], [3]]\", \"assert zigzag_pattern(3, 2...
{ "split": "train", "index": 82735, "acecode_id": "evol_17666", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the coefficients of a second-degree polynomial equation ax^2 + bx + c = 0, implement a function `calculate_roots(a, b, c)` that returns the two roots of the equation. The function should handle both real and complex roots. You can assume that the inputs will be numerical ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_roots(1, 2, 1) == [(-1.0+0j), (-1.0+0j)]\", \"assert calculate_roots(1, 0, -1) == [(1.0+0j), (-1.0+0j)]\", \"assert calculate_roots(1, 4, 4) == [(-2.0+0j), (-2.0+0j)]\", \"assert calculate_roots(1, -2, 5) == [(1.0+2.0j), (1.0-2.0j)]\", \"assert cal...
{ "split": "train", "index": 82736, "acecode_id": "evol_7544", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an integer `node_id`, write a function that returns a string representation of `node_id` padded with leading zeros to ensure that the total length of the string is exactly 20 characters. If the integer is already 20 characters or longer, return it as-is. The input will be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pad_node_id(0) == '00000000000000000000'\", \"assert pad_node_id(123) == '00000000000000000123'\", \"assert pad_node_id(12345678901234567890) == '12345678901234567890'\", \"assert pad_node_id(99999999999999999999) == '99999999999999999999'\", \"assert pad_no...
{ "split": "train", "index": 82737, "acecode_id": "bigcode_python_fns_34129", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that checks if a given string is a valid file path format. A valid file path must start with a letter followed by a colon, and can contain letters, digits, underscores, and slashes. The function should return a boolean value in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_file_path('C:/invalid|path.txt') == False\", \"assert is_valid_file_path('C:\\\\invalid*path.txt') == False\", \"assert is_valid_file_path('C:/path?file.txt') == False\", \"assert is_valid_file_path('C:/path<file.txt') == False\", \"assert is_valid_...
{ "split": "train", "index": 82738, "acecode_id": "oss_4075", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing replacement codes used in computer graphics. Your task is to implement a function `calculate_sum_of_replacement_codes(replacement_codes: List[int]) -> int` that calculates and returns the sum of all the replacement code values in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_of_replacement_codes([1]) == 1\", \"assert calculate_sum_of_replacement_codes([5, 5, 5]) == 15\", \"assert calculate_sum_of_replacement_codes([-1, 1]) == 0\", \"assert calculate_sum_of_replacement_codes([100, 200, 300]) == 600\", \"assert calcu...
{ "split": "train", "index": 82739, "acecode_id": "oss_28171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing signal values from a sensor. Your task is to implement a function `denoise_signal(signal: List[int]) -> List[int]` that applies a simple denoising algorithm to the signal by removing any integer that is less than the average of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert denoise_signal([10, 20, 30, 40, 50]) == [30, 40, 50]\", \"assert denoise_signal([]) == []\", \"assert denoise_signal([5, 6, 7, 8, 9]) == [7, 8, 9]\", \"assert denoise_signal([10, 10, 10, 10]) == [10, 10, 10, 10]\", \"assert denoise_signal([1, 1, 1, 1, 10]) =...
{ "split": "train", "index": 82740, "acecode_id": "bigcode_python_fns_18180", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts a list of agents from a given configuration dictionary. The function should accept a dictionary that may or may not contain a key 'agents'. If the key exists, the function should return its associated value, which is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_agents_config({'agents': ['agent1', 'agent2']}) == ['agent1', 'agent2']\", \"assert parse_agents_config({'agents': []}) == []\", \"assert parse_agents_config({}) == ['default_agent']\", \"assert parse_agents_config({'agents': ['agent3']}) == ['agent3']...
{ "split": "train", "index": 82741, "acecode_id": "oss_34650", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the distance between two geographical locations given their latitude and longitude using the Haversine formula. Write a function `calculate_distance(lat1: float, lon1: float, lat2: float, lon2: float) -> float` that takes in the latitude and long...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_distance(0, 0, 0, 0) - 0) < 1e-9\", \"assert abs(calculate_distance(1, 1, 1, 1) - 0) < 1e-9\", \"assert abs(calculate_distance(-90, 0, 90, 0) - 20015.086) < 1e-3\", \"assert abs(calculate_distance(0, 0, 0, 180) - 20015.086) < 1e-3\", \"assert a...
{ "split": "train", "index": 82742, "acecode_id": "oss_3953", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given two collections, `a` and `b`, which can be lists, sets, or any iterable. Your task is to determine if the two collections are equivalent. Two collections are considered equivalent if they contain the same elements with the same frequencies. You have to implement a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_collections_equivalent([1, 2, 3], [3, 2, 1]) == ('Collections equivalent', [])\", \"assert check_collections_equivalent([1, 2, 3, 3], [3, 2, 1]) == ('Duplicate elements ', ['a, 3, 2'])\", \"assert check_collections_equivalent([1, 2, 2, 3], [3, 2, 1]) =...
{ "split": "train", "index": 82743, "acecode_id": "bigcode_python_fns_27432", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the setup of a single device entity in a home automation system. The function `setup_device` should take in a list of `devices` and a `name` as parameters. The function should return a dictionary representing the device's s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_device([], 'Temp Name') is None\", \"assert setup_device(['Device1'], 'Temp Name') == {'entity_id': 'device_Temp Name', 'name': 'Temp Name', 'status': 'active'}\", \"assert setup_device(['Device1', 'Device2'], 'Cooler') == {'entity_id': 'device_Cooler'...
{ "split": "train", "index": 82744, "acecode_id": "bigcode_python_fns_1520", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a summary report for a given exercise based on provided input parameters. The summary report should include the exercise name, goal type, goal value, founder username, and a list of movements associated with the exercise. E...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_exercise_summary('Running', 'TIME', 30, 'john_doe', [{'movement_name': 'Warm-up', 'movement_number': 1, 'settings': [{'setting_name': 'Duration', 'setting_value': 5}]}]) == {'exercise_name': 'Running', 'goal_type': 'TIME', 'goal_value': 30, 'founder...
{ "split": "train", "index": 82745, "acecode_id": "oss_22238", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a 2D array of probabilities, where each sub-array contains two probabilities (float values) that sum to 1. Your task is to implement a function that calculates the uncertainty values for each sub-array. The uncertainty value for each pair of probabilities is defin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_uncertainty([[0.1, 0.9], [0.5, 0.5], [0.0, 1.0]]) == [0.8, 0.0, 1.0]\", \"assert calculate_uncertainty([[0.0, 1.0], [1.0, 0.0]]) == [1.0, 1.0]\", \"assert calculate_uncertainty([[0.33, 0.67], [0.75, 0.25], [0.5, 0.5]]) == [0.34, 0.5, 0.0]\", \"asse...
{ "split": "train", "index": 82746, "acecode_id": "oss_33850", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of phrases as input, sorts the phrases based on the number of words in each phrase, and in the case of ties, sorts them by the alphabetical order of the first word. If the first words are the same, sort them based on the ASCII value of the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_distinct_combinations(['Hello world', 'Hello there', 'Hello again']) == 3\", \"assert count_distinct_combinations(['Single word']) == 1\", \"assert count_distinct_combinations(['A quick brown fox', 'A lazy dog', 'A clever rabbit']) == 3\", \"assert cou...
{ "split": "train", "index": 82747, "acecode_id": "evol_35531", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Construct a function that retrieves designated data from a given string, adapting to various separators and character variations. The function should be defined as follows: \n\n```python\ndef extract_data(s: str) -> Union[List[str], int, Dict[str, int]]:\n``` \n\n1. If the stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_data('HELLO;WORLD') == ['HELLO', 'WORLD']\", \"assert extract_data('GOOD,MORNING') == ['GOOD', 'MORNING']\", \"assert extract_data('ABCDE') == 3\", \"assert extract_data('A;B;C') == ['A', 'B', 'C']\", \"assert extract_data('EXAMPLE,TEST') == ['EXAMPL...
{ "split": "train", "index": 82748, "acecode_id": "evol_9487", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes input strings according to specific conditions. Write a function `process_input(inp: str) -> str` that takes a string `inp` as input and returns a string based on the following rules: 1. If the input string `inp` ends w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_input('xyzMean') == 'mean'\", \"assert process_input('pqrstddev') == 'stddev'\", \"assert process_input('testq456') == '45.6'\", \"assert process_input('helloWorldMean') == 'mean'\", \"assert process_input('dataq789') == '78.9'\", \"assert process_in...
{ "split": "train", "index": 82749, "acecode_id": "oss_24588", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of equal length: `xdata` and `ydata`, where `xdata` represents the x-coordinates and `ydata` represents the corresponding y-coordinates of a set of points. Your task is to implement a function `slice_data(xdata: List[int], ydata: List[int], x_range: Tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert slice_data([1, 3, 5, 7], [10, 20, 30, 40], (2, 6)) == ([3, 5], [20, 30])\", \"assert slice_data([1, 2, 3], [10, 20, 30], (1, 3)) == ([1, 2, 3], [10, 20, 30])\", \"assert slice_data([1, 2, 3], [10, 20, 30], (2, 2)) == ([2], [20])\", \"assert slice_data([1, 1,...
{ "split": "train", "index": 82750, "acecode_id": "bigcode_python_fns_7883", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages the allocation of hidden states to different CUDA devices based on a device map. The function, named `allocate_to_device`, takes a list of hidden states, an index `i`, a device map (a dictionary where the keys are integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert allocate_to_device([1, 2, 3], 2, {0: [0, 1], 1: [2]}, 'cuda:0') == [1, 2, 3]\", \"assert allocate_to_device([4, 5, 6], 1, {0: [0, 1], 1: [2]}, 'cuda:0') == [4, 5, 6]\", \"assert allocate_to_device([7, 8, 9], 2, {0: [0, 1], 1: [2]}, 'cuda:1') == [7, 8, 9]\", ...
{ "split": "train", "index": 82751, "acecode_id": "oss_24207", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the downloading of a dataset. The function, `download_dataset`, should take a single argument, `dataset_folder`, which is a string representing the path where the dataset files should be stored. The function should return a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert download_dataset('datasets/eval') == 'Dataset downloaded successfully.'\", \"assert download_dataset('') == 'Error: Dataset folder cannot be empty.'\", \"assert download_dataset('data/public') == 'Dataset downloaded successfully.'\", \"assert download_datase...
{ "split": "train", "index": 82752, "acecode_id": "bigcode_python_fns_8912", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of tasks that need to be processed. Each integer indicates the number of tasks in a specific batch. Implement a function `process_batches(batches: List[int], max_concurrent: int) -> List[int]` that returns a list of integ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_batches([3, 2, 5, 1], 2) == [2, 2]\", \"assert process_batches([1, 1, 1, 1], 1) == [1, 1, 1, 1]\", \"assert process_batches([10], 10) == [1]\", \"assert process_batches([], 2) == []\", \"assert process_batches([4, 3, 2, 1], 1) == [1, 1, 1, 1]\", \"as...
{ "split": "train", "index": 82753, "acecode_id": "bigcode_python_fns_3559", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a traffic light system. The traffic light should follow a specific sequence of states: green for 10 seconds, yellow for 3 seconds, and red for 8 seconds. Write a function `simulate_traffic_light()` that returns a list of strings representing the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_traffic_light() == ['green', 'green', 'green', 'green', 'green', 'green', 'green', 'green', 'green', 'green', 'yellow', 'yellow', 'yellow', 'red', 'red', 'red', 'red', 'red', 'red', 'red', 'red']\", \"assert simulate_traffic_light()[:10] == ['green'...
{ "split": "train", "index": 82754, "acecode_id": "oss_19269", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that constructs a dictionary from two lists of keys and values. The function should take in two lists, `keys` and `values`, and return a dictionary constructed from the input lists. If the lengths of the `keys` and `values` lists do n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_dictionary(['a', 'b', 'c'], [1, 2, 3]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert construct_dictionary(['name', 'age'], ['Alice', 30]) == {'name': 'Alice', 'age': 30}\", \"assert construct_dictionary([], []) == {}\", \"assert construct_dictionary(['x'...
{ "split": "train", "index": 82755, "acecode_id": "oss_30622", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that returns a list of all prime numbers up to a given integer n. The function should handle the following cases: If n is not a positive integer, raise a ValueError. If n is less than 2, also raise a ValueError. Optimize the implementation for large values ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert primes(10) == [2, 3, 5, 7]\", \"assert primes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert primes(25) == [2, 3, 5, 7, 11, 13, 17, 19, 23]\", \"assert primes(50) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]\", \"assert primes(100) == [2, 3, ...
{ "split": "train", "index": 82756, "acecode_id": "evol_23884", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple robot controller for a mobile robot. Your goal is to implement a function named `publish_velocity` that takes two parameters: `linear` and `angular`, which represent the linear and angular velocities of the robot. The function should crea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert publish_velocity(0, 0) == {'linear': 0, 'angular': 0}\", \"assert publish_velocity(1, 0) == {'linear': 1, 'angular': 0}\", \"assert publish_velocity(0, 1) == {'linear': 0, 'angular': 1}\", \"assert publish_velocity(-1, -1) == {'linear': -1, 'angular': -1}\",...
{ "split": "train", "index": 82757, "acecode_id": "oss_29594", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts the 'INSTALL_REQUIRES' list of packages from a given string representing the content of a 'setup.py' file. Your function should return a list of packages that are required for the project. The input will be a string f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_install_requires(\\\"from setuptools import setup\\\\nINSTALL_REQUIRES = ['requests', 'reportlab']\\\\nsetup(\\\\nname='example',\\\\nversion='0.1'\\\\n)\\\\n\\\") == ['requests', 'reportlab']\", \"assert extract_install_requires(\\\"INSTALL_REQUIRES...
{ "split": "train", "index": 82758, "acecode_id": "oss_16684", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `print_numbers` that uses recursion to print numbers from the `current_number` up to a specified `limit`. The function should take two parameters: `current_number` (the starting number) and `limit` (the upper limit, defaulting to 10). The function should pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_numbers(0) == None\", \"assert print_numbers(5) == None\", \"assert print_numbers(10) == None\", \"assert print_numbers(8) == None\", \"assert print_numbers(3) == None\", \"assert print_numbers(-2) == None\", \"assert print_numbers(1) == None\", \"asse...
{ "split": "train", "index": 82759, "acecode_id": "evol_17978", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary that represents a biological database with two keys: 'taxonomy' and 'markers'. The 'taxonomy' key maps to another dictionary where the keys are taxonomic classifications and the values are lists of tax ids. The 'markers' key also maps to a dictionary where th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_taxa_and_markers({'taxonomy': {'k__Bacteria': [1, 2], 'k__Viruses': [3]}, 'markers': {'mkr1': {'taxon': 'k__Bacteria'}, 'mkr2': {'taxon': 'k__Viruses'}, 'mkr3': {'taxon': 'k__Bacteria'}}}, 1) == (1, 1)\", \"assert count_taxa_and_markers({'taxonomy': {'...
{ "split": "train", "index": 82760, "acecode_id": "bigcode_python_fns_3139", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists, `geography` and `chloropleth`, where `geography` contains unique keys and `chloropleth` contains values associated with those keys. Your task is to merge these two lists into a dictionary where the keys come from the `geography` list and the values corr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_data('attribute', ['key1', 'key2', 'key3'], [10, 20, 30]) == {'key1': 10, 'key2': 20, 'key3': 30}\", \"assert merge_data('attribute', ['a', 'b', 'c'], [1]) == {'a': 1, 'b': None, 'c': None}\", \"assert merge_data('attribute', ['k1', 'k2'], [5, 15, 25])...
{ "split": "train", "index": 82761, "acecode_id": "bigcode_python_fns_31191", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fahrenheit_to_temperature(f)` that converts a given temperature in Fahrenheit to both Celsius and Kelvin. The function should return a tuple containing the Celsius and Kelvin values, rounded to two decimal places. If the input temperature is below -459.67 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fahrenheit_to_temperature(32) == (0.0, 273.15)\", \"assert fahrenheit_to_temperature(212) == (100.0, 373.15)\", \"assert fahrenheit_to_temperature(0) == (-17.78, 255.37)\", \"assert fahrenheit_to_temperature(-40) == (-40.0, 233.15)\", \"assert fahrenheit_to_...
{ "split": "train", "index": 82762, "acecode_id": "evol_7379", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a given value into a readable string representation. Your function should handle different data types, including integers, floats, strings, lists, and dictionaries. If the input value cannot be formatted for any reason, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_value(123) == '123'\", \"assert format_value(3.14) == '3.14'\", \"assert format_value('Hello, World!') == 'Hello, World!'\", \"assert format_value({}) == '{}'\", \"assert format_value([]) == '[]'\", \"assert format_value('') == ''\"]}" }
{ "split": "train", "index": 82763, "acecode_id": "bigcode_python_fns_2659", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `randomize_list(input_list)` that takes a list of integers as input and returns a new list containing the same integers in a random order. The original list should not be modified. You may assume that the input list will always contain at least one integer....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted(randomize_list([1, 2, 3, 4, 5])) == [1, 2, 3, 4, 5]\", \"assert len(randomize_list([1, 2, 3, 4, 5])) == 5\", \"assert randomize_list([10, 20, 30]) != [10, 20, 30]\", \"assert randomize_list([5, 5, 5]) == [5, 5, 5]\", \"assert randomize_list([-1, -2, -...
{ "split": "train", "index": 82764, "acecode_id": "evol_10981", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the sum of all even numbers in the list. The function should take in a single parameter, 'nums', which is a list of integers. The output should be a single integer representing the sum of all even numbers in the list. If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -4, 1, 3]) == -6\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([0, 1, 2, 3]) == 2\", \"ass...
{ "split": "train", "index": 82765, "acecode_id": "bigcode_python_fns_23650", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages additional options for a hypothetical package management system. The function should be named `manage_options`. It accepts a list of strings representing additional options and returns a single string containing all the o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_options([]) == ''\", \"assert manage_options(['--update']) == '--update'\", \"assert manage_options(['--upgrade', '--force']) == '--upgrade --force'\", \"assert manage_options(['--no-install-recommends', '--allow-downgrades']) == '--no-install-recomme...
{ "split": "train", "index": 82766, "acecode_id": "oss_10555", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of distances and a list of revenues corresponding to different nodes. Your task is to find the optimal alpha value between 0.0 and 1.0 (inclusive) that maximizes the overall savings calculated using the formula: saving = distance_saving * (1 - alpha) + reve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_best_alpha([0, 0, 0], [1, 2, 3]) == 1.0\", \"assert find_best_alpha([1, 2, 3], [0, 0, 0]) == 0.0\", \"assert find_best_alpha([5, 10, 15], [0, 0, 0]) == 0.0\", \"assert find_best_alpha([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert find_best_alpha([10, 20, 30,...
{ "split": "train", "index": 82767, "acecode_id": "bigcode_python_fns_43836", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that calculates the total number of frames to be captured from a video, given the duration in minutes and the frames per second (fps) rate. The function should return the total number of frames based on the formula: total_frames = duration...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_frames(1.0, 24) == 1440\", \"assert calculate_total_frames(0.5, 60) == 1800\", \"assert calculate_total_frames(3.0, 25) == 4500\", \"assert calculate_total_frames(0.0, 24) == 0\", \"assert calculate_total_frames(5.0, 15) == 4500\", \"assert c...
{ "split": "train", "index": 82768, "acecode_id": "bigcode_python_fns_12873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing lines from a FASTA file. Each line either starts with a '>' indicating a new sequence entry or contains a nucleotide sequence. Your task is to implement a function that counts the number of start codons (sequences starting with 'ATG'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_codons_and_sd(['>sequence1', 'ATGAAA', 'CCTAGG', '>sequence2', 'AAGTAA', 'TTTTTT']) == (1, 2)\", \"assert count_codons_and_sd(['>seq1', 'ATG', 'AGG', 'CCT']) == (1, 1)\", \"assert count_codons_and_sd(['>first', 'TTTT', 'CCCAAG']) == (0, 1)\", \"assert ...
{ "split": "train", "index": 82769, "acecode_id": "bigcode_python_fns_25753", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates parsing command line arguments for a configuration file. The function should accept two parameters: a string representing the path to the configuration file (with a default value of 'settings/pipeline/example.cfg') and an i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments() == {'pipeline': 'settings/pipeline/example.cfg', 'verbosity': 2}\", \"assert parse_arguments('custom/path/config.cfg') == {'pipeline': 'custom/path/config.cfg', 'verbosity': 2}\", \"assert parse_arguments('another/path/config.cfg', 1) == {'...
{ "split": "train", "index": 82770, "acecode_id": "bigcode_python_fns_46344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with building a function `predict_attack` that takes several parameters related to patient health data and predicts the likelihood of a cardiac event. The function accepts the following parameters: \n- `h1` (int): age of the patient. \n- `h2` (str): gender of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_attack(63, 'male', 'angina', 145, 233, 'greater than 120', 'normal', 0, 1, 150, 250, 110, 'yes') == 1\", \"assert predict_attack(45, 'female', 'atypical angina', 130, 200, '120 or less', 'ST-t normal', 2, 0, 140, 200, 120, 'no') == 0\", \"assert pred...
{ "split": "train", "index": 82771, "acecode_id": "bigcode_python_fns_6088", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of database entries and removes all entries related to a specific trading platform, 'Bittrex'. Each entry is represented as a string in the format 'platform_name: data'. Your function should take a list of entries an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_bittrex_entries(['Bittrex: data1', 'Coinbase: data2', 'Bittrex: data3']) == ['Coinbase: data2']\", \"assert remove_bittrex_entries(['Bittrex: data', 'Bittrex: more_data']) == []\", \"assert remove_bittrex_entries(['Coinbase: data', 'Kraken: data2', 'G...
{ "split": "train", "index": 82772, "acecode_id": "bigcode_python_fns_37348", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the length of that string. The function should count all characters, including spaces and special characters. The function signature should be: def string_length(input_string: str) -> int.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_length('hello') == 5\", \"assert string_length('') == 0\", \"assert string_length(' ') == 1\", \"assert string_length('hello world') == 11\", \"assert string_length('1234567890') == 10\", \"assert string_length('!@#$%^&*()') == 10\", \"assert string_l...
{ "split": "train", "index": 82773, "acecode_id": "evol_24152", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers representing a vector, write a function that returns the unit vector corresponding to that input vector. The unit vector is defined as the vector divided by its magnitude. The magnitude of a vector is calculated as the square root of the sum of the squa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unitVector([3, 4]) == [0.6, 0.8]\", \"assert unitVector([0, 0]) == [0.0, 0.0]\", \"assert unitVector([1, 2, 2]) == [0.3333333333333333, 0.6666666666666666, 0.6666666666666666]\", \"assert unitVector([-1, -1]) == [-0.7071067811865475, -0.7071067811865475]\", ...
{ "split": "train", "index": 82774, "acecode_id": "bigcode_python_fns_18472", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_string(s: str) -> str` that reverses the input string `s` without using any built-in functions or additional variables. The function should return the reversed string.\nPlease reason step by step, then write a self-contained Python solution. Give y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('Hello World!') == '!dlroW olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('') == ''\", \"assert reverse_string('A') == 'A'\", \"assert reverse_string('ab') == 'ba'\", \"assert reverse_string('racecar') == 'r...
{ "split": "train", "index": 82775, "acecode_id": "evol_20288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `extract_values` that takes a nested dictionary as input and returns a tuple containing all the values found in the dictionary, including values from dictionaries that are nested within lists. The function should handle any level of nesting.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_values({'Country': 'USA', 'Details': {'Capital': 'Washington D.C.', 'Currency': 'USD'}, 'States': [{'Name': 'Texas', 'Capital': 'Austin'}, {'Name': 'California', 'Capital': 'Sacramento'}]}) == ('USA', 'Washington D.C.', 'USD', 'Texas', 'Austin', 'Cal...
{ "split": "train", "index": 82776, "acecode_id": "evol_16245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `standardize_supplemental(content: str) -> dict` that takes a string `content` as input and returns a dictionary with a single key `'c'`, where the value is the input string. Your function should simply wrap the input string inside a dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert standardize_supplemental('Example content') == {'c': 'Example content'}\", \"assert standardize_supplemental('Test case') == {'c': 'Test case'}\", \"assert standardize_supplemental('') == {'c': ''}\", \"assert standardize_supplemental('Hello, World!') == {'c...
{ "split": "train", "index": 82777, "acecode_id": "bigcode_python_fns_10893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an alphanumeric string `s`, an integer `k`, and another integer `m`, your task is to return the length of the longest subsequence within `s` where each alphabet's occurrence is not less than `k` and the total count of distinct alphabets in the subsequence is exactly `m`. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_subseq('a', 1, 1) == 1\", \"assert longest_subseq('aabb', 3, 1) == 0\", \"assert longest_subseq('aaa', 1, 1) == 3\", \"assert longest_subseq('abcdefgh', 2, 1) == 0\", \"assert longest_subseq('aabbcc', 3, 2) == 0\"]}" }
{ "split": "train", "index": 82778, "acecode_id": "evol_30703", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `deserialize_primitive(data: str, klass: type) -> Union[int, float, str, bool]` that takes a string `data` and a class type `klass`. The function should attempt to convert the `data` into the specified primitive type defined by `klass`. If the conversion fa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deserialize_primitive('123', int) == 123\", \"assert deserialize_primitive('123.45', float) == 123.45\", \"assert deserialize_primitive('Hello', str) == 'Hello'\", \"assert deserialize_primitive('True', bool) == True\", \"assert deserialize_primitive('3.14',...
{ "split": "train", "index": 82779, "acecode_id": "bigcode_python_fns_41761", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the discounted price of an item given its original cost. The discount rate is fixed at 15%. Your function should take a single parameter, 'cost', which represents the original price of the item. The function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_discount(100) == 85.0\", \"assert compute_discount(200) == 170.0\", \"assert compute_discount(50) == 42.5\", \"assert compute_discount(0) == 0.0\", \"assert compute_discount(15.99) == 13.5915\", \"assert compute_discount(123.45) == 104.9325\", \"asse...
{ "split": "train", "index": 82780, "acecode_id": "evol_29059", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer array `nums` and an integer `k`, implement a function `containsNearbyDuplicate(nums: List[int], k: int) -> bool` that returns `true` if there are two distinct indices `i` and `j` in the array such that `nums[i] = nums[j]` and the absolute difference of `i` and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert containsNearbyDuplicate([1,2,3,1], 3) == True\", \"assert containsNearbyDuplicate([1,0,1,1], 1) == True\", \"assert containsNearbyDuplicate([1,2,3,1,2,3], 2) == False\", \"assert containsNearbyDuplicate([1,1,1,1], 1) == True\", \"assert containsNearbyDuplica...
{ "split": "train", "index": 82781, "acecode_id": "evol_12658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of rectangles defined by their bottom-left and top-right corners in a 2D space. Each rectangle is represented by a tuple of four integers (x1, y1, x2, y2) where (x1, y1) are the coordinates of the bottom-left corner and (x2, y2) are the coordinates of the t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_union_area([(1, 1, 3, 3), (2, 2, 4, 4)]) == 7\", \"assert calculate_union_area([(0, 0, 1, 1), (1, 1, 2, 2), (0, 0, 2, 2)]) == 4\", \"assert calculate_union_area([(1, 1, 2, 2), (2, 2, 3, 3), (3, 3, 4, 4)]) == 3\", \"assert calculate_union_area([(1, ...
{ "split": "train", "index": 82782, "acecode_id": "bigcode_python_fns_34128", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the use of a contact based on its rank and period. The function takes two parameters: 'rank' (which can be either 'primary' or 'secondary') and 'period' (which can be either 'current' or 'expired'). The function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_use('primary', 'current') == 'primary current'\", \"assert get_use('primary', 'expired') == 'primary expired'\", \"assert get_use('secondary', 'current') == 'secondary current'\", \"assert get_use('secondary', 'expired') == 'secondary expired'\", \"asser...
{ "split": "train", "index": 82783, "acecode_id": "oss_31157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the standard deviation of horizontal distances between consecutive points in a list. Each point is represented as a tuple of (x, y) coordinates. Implement a function `distance_deviation(points: List[Tuple[int, int]]) -> float` that takes a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert distance_deviation([(1, 1)]) == 0.0\", \"assert distance_deviation([]) == 0.0\", \"assert distance_deviation([(1, 1), (1, 2), (1, 3)]) == 0.0\", \"assert distance_deviation([(1, 1), (1, 1)]) == 0.0\", \"assert distance_deviation([(1, 2), (1, 3), (1, 4), (1, ...
{ "split": "train", "index": 82784, "acecode_id": "oss_10073", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a 12-bit grayscale image represented as a 2D list of integers, convert the pixel values to a desired data type (like uint8) by scaling the values from the range [0, 4095] to the range of the desired data type. The function should take the 2D image and the desired data typ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_12bit_to_type([[0, 2048], [4095, 0]], 'uint8') == [[0, 127], [255, 0]]\", \"assert convert_12bit_to_type([[1024]], 'uint8') == [[63]]\", \"assert convert_12bit_to_type([[4095]], 'uint8') == [[255]]\", \"assert convert_12bit_to_type([[0, 4095], [2048,...
{ "split": "train", "index": 82785, "acecode_id": "bigcode_python_fns_20684", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function `check_jaccard_similarity(sentence1: str, sentence2: str) -> float` that calculates the Jaccard similarity coefficient between two provided sentences. The function should be case-insensitive and ignore punctuation. The Jaccard similarity is defined as the size ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_jaccard_similarity('Hello World!', 'Hello') == 0.5\", \"assert check_jaccard_similarity('Data Science', 'Data Science') == 1.0\", \"assert check_jaccard_similarity('A B C D E F', 'G H I J K') == 0.0\", \"assert check_jaccard_similarity('', 'Empty strin...
{ "split": "train", "index": 82786, "acecode_id": "evol_13792", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a two-dimensional array of integers, write a function `find_sum` that returns any two integers from nested arrays with an odd index such that their sum equals a given target value. If no such integers exist, return None. The function should only consider integers from arr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_sum([[1], [2], [3], [4]], 5) == None\", \"assert find_sum([[1, 2], [3, 4], [5]], 8) == None\", \"assert find_sum([[1, 2, 3], [3, 4], [7], [8, 2]], 10) == (8, 2)\", \"assert find_sum([[1, 1], [2, 2], [3, 3], [4, 4]], 5) == None\", \"assert find_sum([[0, ...
{ "split": "train", "index": 82787, "acecode_id": "evol_32703", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simulation for different types of antennas based on their beamwidth. Each antenna has a beamwidth and a description property. You need to implement a function that takes in the beamwidth of an antenna and returns the appropriate description based ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_antenna_description(0.5) == 'Narrow beam antenna'\", \"assert get_antenna_description(1.0) == 'Medium beam antenna'\", \"assert get_antenna_description(1.2) == 'Medium beam antenna'\", \"assert get_antenna_description(1.5) == 'Medium beam antenna'\", \"a...
{ "split": "train", "index": 82788, "acecode_id": "oss_32810", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of text styles, where each style is represented by a dictionary containing the keys 'name', 'font_size', and 'font_color'. Your task is to implement a function `has_style(styles: List[Dict[str, Union[str, int]]], style_name: str) -> bool` that checks whethe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_style([{ 'name': 'Header', 'font_size': 24, 'font_color': 'blue' }, { 'name': 'Body', 'font_size': 12, 'font_color': 'black' }], 'Header') == True\", \"assert has_style([{ 'name': 'Header', 'font_size': 24, 'font_color': 'blue' }, { 'name': 'Body', 'font...
{ "split": "train", "index": 82789, "acecode_id": "oss_31403", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a time string in the format '%Y-%m-%d %H:%M:%S', write a function that converts the time into a different time zone specified by the user. The function should take two parameters: a time string and a target time zone identifier in the format 'Region/City' (e.g., 'Europe/M...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_time_zone('2021-08-16 16:03:34', 'Europe/Moscow') == '2021-08-16 19:03:34'\", \"assert convert_time_zone('2022-12-01 05:30:00', 'America/New_York') == '2022-12-01 00:30:00'\", \"assert convert_time_zone('2021-06-15 12:00:00', 'Asia/Tokyo') == '2021-0...
{ "split": "train", "index": 82790, "acecode_id": "bigcode_python_fns_33474", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer num, write a function that returns 'Square' if num is a perfect square, 'Cube' if num is a perfect cube, 'Both' if num is both a perfect square and a perfect cube, and 'None' if num is neither. Do not use any built-in library function such as sqrt or cb...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perfect(1) == 'Both'\", \"assert perfect(4) == 'Square'\", \"assert perfect(8) == 'Cube'\", \"assert perfect(9) == 'Square'\", \"assert perfect(16) == 'Square'\", \"assert perfect(27) == 'Cube'\", \"assert perfect(64) == 'Both'\", \"assert perfect(15) == 'No...
{ "split": "train", "index": 82791, "acecode_id": "evol_4554", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers that may contain some duplicates. Write a function `remove_duplicates` that takes this list as input and returns a new list with all duplicate integers removed, while preserving the original order of the first occurrences of the integers. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([4, 5, 4, 6]) == [4,...
{ "split": "train", "index": 82792, "acecode_id": "bigcode_python_fns_23724", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function that simulates a button click event in a GUI application. The function should accept a string parameter representing the current label text. If the current text is 'Hello, World!', the function should return 'Button Clicked!'. If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_label('Hello, World!') == 'Button Clicked!'\", \"assert update_label('Button Clicked!') == 'Button Clicked!'\", \"assert update_label('') == ''\", \"assert update_label('Test') == 'Test'\", \"assert update_label('Hello') == 'Hello'\", \"assert update_...
{ "split": "train", "index": 82793, "acecode_id": "oss_19798", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers as input. For each integer in the list, you need to calculate a new value using the formula (integer // 2) + 1, and then return the results as a list of integers. Write a function `calculate_new_values(integers: List[int]) -> List[int]` that tak...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_new_values([10, 20, 30, 40, 50]) == [6, 11, 16, 21, 26]\", \"assert calculate_new_values([1, 3, 5, 7]) == [1, 2, 3, 4]\", \"assert calculate_new_values([-2, 0, 2, 4]) == [0, 1, 2, 3]\", \"assert calculate_new_values([100, 200, 300]) == [51, 101, 15...
{ "split": "train", "index": 82794, "acecode_id": "oss_23195", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a molecular simulation project that involves handling the energy minimization of water molecules. Your task is to implement a Python function called `perform_energy_minimization` that simulates the energy minimization of a given water molecule structure. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_energy_minimization('H2O', 'Water_res_name', 'FF_file', 10) == 'Minimized Water_res_name with 10 steps using FF_file.'\", \"assert perform_energy_minimization('H2O', 'Ice', 'Ice_FF', 100) == 'Minimized Ice with 100 steps using Ice_FF.'\", \"assert pe...
{ "split": "train", "index": 82795, "acecode_id": "oss_37241", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers called `edges` that represent the boundaries of grid cells, and an integer `pix` which is a pixel coordinate. Your task is to write a function that converts the pixel coordinate to a grid coordinate using linear interpolation. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pix_to_coord([0, 1, 2, 3], 4) == None\", \"assert pix_to_coord([10, 20, 30], 5) == None\", \"assert pix_to_coord([10, 20, 30], 35) == None\", \"assert pix_to_coord([1, 3, 5, 7], 8) == None\", \"assert pix_to_coord([100, 200, 300], 50) == None\", \"assert pix...
{ "split": "train", "index": 82796, "acecode_id": "bigcode_python_fns_19943", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that logs messages with different severity levels. The function should take two parameters: 'level' (a string representing the severity level - either 'DEBUG', 'INFO', 'WARNING', 'ERROR', or 'CRITICAL') and 'message' (a string containing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('DEBUG', 'This is a debug message') is None\", \"assert log_message('INFO', 'This is an info message') is None\", \"assert log_message('WARNING', 'This is a warning message') is None\", \"assert log_message('ERROR', 'This is an error message') is...
{ "split": "train", "index": 82797, "acecode_id": "bigcode_python_fns_23414", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a network switch within a pfSense firewall system. The function should take a configuration entry as an input and allow the addition and removal of ports. Your function should include the following funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_switch('Switch1', [('add', 'Port1'), ('add', 'Port2'), ('remove', 'Port1')]) == ['Port2']\", \"assert manage_switch('Switch1', [('add', 'Port1'), ('add', 'Port2'), ('add', 'Port3'), ('remove', 'Port2')]) == ['Port1', 'Port3']\", \"assert manage_switch...
{ "split": "train", "index": 82798, "acecode_id": "oss_31963", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the loading of a machine learning model based on a given `model_file`. The function should return a string indicating the type of model being loaded: either 'RandomForestClassifier' or 'RandomForestRegressor'. The model typ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_model('my_model_classifier.pkl') == 'RandomForestClassifier'\", \"assert load_model('my_model_regressor.pkl') == 'RandomForestRegressor'\", \"assert load_model('my_model_random_forest.pkl') == 'Unknown Model'\", \"assert load_model('random_forest_classi...
{ "split": "train", "index": 82799, "acecode_id": "oss_27302", "num_tests": 16 }