data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given two arrays of integers, create an array of all possible pairs where each pair consists of one element from the first array and one element from the second array. The output should be a 2D list containing these pairs. For example, if the input arrays are a = [1, 2] and b =... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gridarray([1, 2], [2, 4, 5]) == [[1, 2], [1, 4], [1, 5], [2, 2], [2, 4], [2, 5]]\", \"assert gridarray([1], [1, 2]) == [[1, 1], [1, 2]]\", \"assert gridarray([3, 4], None) == [[3, 3], [4, 4]]\", \"assert gridarray(None, [1, 2, 3]) == [[1, 1], [2, 2], [3, 3]]... | {
"split": "train",
"index": 68800,
"acecode_id": "bigcode_python_fns_4080",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the orthographic projection of a 3D point onto a 2D plane. The function `orthographic_projection` takes a 3D point represented by its coordinates (x, y, z) and outputs its corresponding 2D coordinates on the plane. The or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert orthographic_projection(1.0, 2.0, 3.0) == (1.0, 3.0)\", \"assert orthographic_projection(0.0, 0.0, 0.0) == (0.0, 0.0)\", \"assert orthographic_projection(-1.0, 2.0, 5.0) == (-1.0, 5.0)\", \"assert orthographic_projection(10.5, -3.5, 2.1) == (10.5, 2.1)\", \"... | {
"split": "train",
"index": 68801,
"acecode_id": "oss_19199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates a library call which returns an integer value indicating the status of a parameter error. You need to implement a function `status_parameter_error()` that calls this simulated library function and returns the value it provides. For this e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert status_parameter_error() == -1\", \"assert status_parameter_error() == -1\", \"assert status_parameter_error() == -1\", \"assert status_parameter_error() == -1\", \"assert status_parameter_error() == -1\", \"assert status_parameter_error() == -1\", \"assert ... | {
"split": "train",
"index": 68802,
"acecode_id": "bigcode_python_fns_43299",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a database migration process. In a database migration, a series of operations are performed to modify the structure of the database schema. Your task is to implement a function `apply_migration` that takes a database schema (represented as a dicti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_migration({'users': {'name': 'string', 'age': 'integer'}}, [lambda s: {**s, 'users': {**s['users'], 'email': 'string'}}]) == {'users': {'name': 'string', 'age': 'integer', 'email': 'string'}}\", \"assert apply_migration({}, [lambda s: {'products': {'ti... | {
"split": "train",
"index": 68803,
"acecode_id": "oss_16633",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers. The function should take in a list of integers and return a new list containing only the even integers from the input list, sorted in ascending order. Write a function `filter_and_sort_evens(nums:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort_evens([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_and_sort_evens([10, 9, 8, 7, 6]) == [6, 8, 10]\", \"assert filter_and_sort_evens([-1, -2, -3, -4]) == [-4, -2]\", \"assert filter_and_sort_evens([0, 2, 4, 6]) == [0, 2, 4, 6]\", \"assert fil... | {
"split": "train",
"index": 68804,
"acecode_id": "oss_1949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that can parse a JSON string representing a configuration and extract the value of a specified parameter. The function should take two arguments: a string `config_string` which contains the JSON data, and a string `parameter_name` which s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config('{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": 42}', 'key1') == 'value1'\", \"assert parse_config('{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": 42}', 'key2') == 42\", \"assert parse_config('{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": 42}', 'key3... | {
"split": "train",
"index": 68805,
"acecode_id": "oss_4200",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that simulates the updating of an investor's profile. The function, `update_investor_profile`, takes an integer input representing the investable capital of a large investor and returns a string that indicates whether the update was suc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_investor_profile(12345) == 'Profile updated successfully.'\", \"assert update_investor_profile(100) == 'Profile updated successfully.'\", \"assert update_investor_profile(1) == 'Profile updated successfully.'\", \"assert update_investor_profile(50000)... | {
"split": "train",
"index": 68806,
"acecode_id": "bigcode_python_fns_3437",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a binary tree with integer values. Your task is to implement a function that determines the maximum absolute difference between the values of a node and its ancestor. A node A is considered an ancestor of node B if B is a direct child of A or a descendant of A's c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxAncestorDiff(TreeNode(7, TreeNode(3, TreeNode(1), TreeNode(4)), TreeNode(9))) == 6\", \"assert maxAncestorDiff(TreeNode(10, TreeNode(10, TreeNode(10)), TreeNode(10))) == 0\", \"assert maxAncestorDiff(TreeNode(0, TreeNode(0), TreeNode(0))) == 0\", \"assert... | {
"split": "train",
"index": 68807,
"acecode_id": "evol_16987",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a task note from a predefined list of notes based on an index input. The function should take an integer index as input and return the corresponding note from the list. If the index is out of bounds, the function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_task_note(0) == 'Buy groceries'\", \"assert get_task_note(1) == 'Call the bank'\", \"assert get_task_note(2) == 'Finish project report'\", \"assert get_task_note(3) == 'Schedule a meeting'\", \"assert get_task_note(4) == 'Read a book'\", \"assert get_tas... | {
"split": "train",
"index": 68808,
"acecode_id": "bigcode_python_fns_42422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `count_nodes_with_degree` that takes an integer `degree` and the list of integers representing the degrees of nodes in a tree structure. Your task is to return the count of nodes that have the specified degree. The function should have... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_nodes_with_degree(2, [1, 2, 2, 3, 2]) == 3\", \"assert count_nodes_with_degree(1, [1, 1, 1, 1]) == 4\", \"assert count_nodes_with_degree(0, [0, 0, 0, 1, 2]) == 3\", \"assert count_nodes_with_degree(3, [3, 3, 3, 4, 5]) == 3\", \"assert count_nodes_with_... | {
"split": "train",
"index": 68809,
"acecode_id": "bigcode_python_fns_3639",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that calculates the quantity of reversed string pairs within a provided list of strings. The function must handle strings that include special characters, numerals, and letters in mixed case. Special characters and numerals should be disregarded when tallying... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_reverse_pairs(['', '']) == 0\", \"assert count_reverse_pairs(['!@#$', '%^&*', '123abc', 'cba321']) == 1\", \"assert count_reverse_pairs(['a', 'b', 'c', 'd']) == 0\", \"assert count_reverse_pairs(['abc!', 'def@', 'fed', 'cba']) == 1\", \"assert count_re... | {
"split": "train",
"index": 68810,
"acecode_id": "evol_22995",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers representing two datasets. Your task is to write a Python function that takes these two lists as input and performs the following operations: 1. Remove any duplicate elements from both lists. 2. Return a tuple containing the two modified list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_and_sort([1, 2, 3, 3, 4], [4, 5, 5, 6]) == ([1, 2, 3, 4], [4, 5, 6])\", \"assert process_and_sort([1, 1, 1], [2, 2, 2]) == ([1], [2])\", \"assert process_and_sort([], []) == ([], [])\", \"assert process_and_sort([9, 8, 7], [6, 5, 4]) == ([7, 8, 9], [... | {
"split": "train",
"index": 68811,
"acecode_id": "oss_1233",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the two numbers that add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. The function signatu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert two_sum([2, 7, 11, 15], 9) == [2, 7]\", \"assert two_sum([3, 2, 4], 6) == [2, 4]\", \"assert two_sum([3, 3], 6) == [3, 3]\", \"assert two_sum([1, 1, 2, 3], 4) == [1, 3]\", \"assert two_sum([0, -1, 2, -3, 1], -2) == [-3, 1]\", \"assert two_sum([10, 15, 3, 7],... | {
"split": "train",
"index": 68812,
"acecode_id": "evol_1211",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked to implement a function `reverse_engineer(numlist, an)` that takes two lists of integers, `numlist` and `an`. The function should perform the following operations: First, create a copy of the `an` list and sort it in ascending order. Then, compute the sum of all ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_engineer([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 15]\", \"assert reverse_engineer([], [10, 20, 30]) == [60]\", \"assert reverse_engineer([-1, -2], [5]) == [-1, -2, 5]\", \"assert reverse_engineer([1, 1, 1], [1, 1]) == [1, 1, 1, 2]\", \"assert reverse_engi... | {
"split": "train",
"index": 68813,
"acecode_id": "oss_6990",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the gravitational effect between two celestial bodies based on their positions. Implement a function `gravity_effect(position: int, other_position: int) -> int` that returns: \n- `0` if the two bodies are at the same position (indicating no gravi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gravity_effect(0, 0) == 0\", \"assert gravity_effect(10, 5) == -1\", \"assert gravity_effect(3, 3) == 0\", \"assert gravity_effect(-3, -3) == 0\", \"assert gravity_effect(5, 10) == 1\", \"assert gravity_effect(1, 0) == -1\", \"assert gravity_effect(-1, 1) ==... | {
"split": "train",
"index": 68814,
"acecode_id": "bigcode_python_fns_39349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the IDs of posts. Implement a function `get_posts_by_user(user_id: int, post_ids: List[int]) -> List[int]` that returns a list of post IDs that belong to the specified user ID. A post ID belongs to the user if it is present in the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_posts_by_user(1, [1, 2, 3, 1, 5]) == [1, 1]\", \"assert get_posts_by_user(2, [1, 2, 3, 1, 5]) == [2]\", \"assert get_posts_by_user(3, [1, 2, 3, 1, 5]) == [3]\", \"assert get_posts_by_user(1, [4, 5, 6]) == []\", \"assert get_posts_by_user(2, []) == []\", ... | {
"split": "train",
"index": 68815,
"acecode_id": "bigcode_python_fns_13614",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a given model output satisfies a specific condition. The function should return `True` if the target class matches the model's highest probability prediction or if the ground truth output matches the target cla... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_goal_complete([0.1, 0.2, 0.7], 2, 1) == True\", \"assert is_goal_complete([0.5, 0.3, 0.2], 0, 1) == True\", \"assert is_goal_complete([0.1, 0.3, 0.6], 1, 1) == True\", \"assert is_goal_complete([0.0, 0.0, 1.0], 2, 2) == True\", \"assert is_goal_complete([... | {
"split": "train",
"index": 68816,
"acecode_id": "oss_9743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `inverseBubbleSort(arr: List[str]) -> List[str]` that sorts a list of strings in descending order using the Bubble Sort algorithm. The function should return the sorted list. For example, given the input ['lime', 'strawberry', 'apple', 'cherry', 'banana'], ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inverseBubbleSort(['lime', 'strawberry', 'apple', 'cherry', 'banana']) == ['strawberry', 'lime', 'cherry', 'banana', 'apple']\", \"assert inverseBubbleSort(['dog', 'cat', 'elephant', 'bear']) == ['elephant', 'dog', 'cat', 'bear']\", \"assert inverseBubbleSor... | {
"split": "train",
"index": 68817,
"acecode_id": "evol_6970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, `current` and `termination`. Your task is to implement a function that checks if the value of `current` meets or exceeds the termination value of `termination`. If it does, the function should return `True`, otherwise, it should return `False`. Write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkTermination(10, 15) == False\", \"assert checkTermination(20, 15) == True\", \"assert checkTermination(15, 15) == True\", \"assert checkTermination(0, 1) == False\", \"assert checkTermination(5, 5) == True\", \"assert checkTermination(-1, 0) == False\",... | {
"split": "train",
"index": 68818,
"acecode_id": "oss_7194",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Snake Game on a grid of size `height x width`. The snake starts at position `(0, 0)` with a length of `1`. The snake can move in four directions: up ('U'), down ('D'), left ('L'), and right ('R'). An array `food` is provided, where each elemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert SnakeGame(3, 2, [[1, 2], [0, 1]]).move('R') == 0\", \"assert SnakeGame(3, 2, [[1, 2], [0, 1]]).move('D') == 0\", \"assert SnakeGame(3, 2, [[1, 2], [0, 1]]).move('U') == -1\", \"assert SnakeGame(5, 5, [[1, 4], [3, 2], [0, 0]]).move('R') == 0\", \"assert Snake... | {
"split": "train",
"index": 68819,
"acecode_id": "evol_3598",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `calculate_sum_and_product(nums)` that returns a tuple containing the sum and product of all the integers in the list. If the list is empty, return (0, 1). The function should handle both positive and negative integers. \n\nFunction si... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum_and_product([1, 2, 3]) == (6, 6)\", \"assert calculate_sum_and_product([-1, -2, -3]) == (-6, -6)\", \"assert calculate_sum_and_product([0, 1, 2]) == (3, 0)\", \"assert calculate_sum_and_product([-1, 0, 1]) == (0, 0)\", \"assert calculate_sum_an... | {
"split": "train",
"index": 68820,
"acecode_id": "bigcode_python_fns_1957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a Look Up Table (LUT) for Absolute Humidity (AH) at 100% Relative Humidity (RH) based on a list of temperature values. The Absolute Humidity is calculated using a formula that incorporates constants. Your task is to implement a function `gen_ah_lu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gen_ah_lut([0]) == [0.622 * 100 * math.exp(17.62 * 0)]\", \"assert gen_ah_lut([-10]) == [0.622 * 100 * math.exp(17.62 * -10)]\", \"assert gen_ah_lut([20, 25]) == [0.622 * 100 * math.exp(17.62 * 20), 0.622 * 100 * math.exp(17.62 * 25)]\", \"assert gen_ah_lut(... | {
"split": "train",
"index": 68821,
"acecode_id": "oss_16349",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_perfect_square(n: int) -> bool` that checks if a given non-negative integer `n` is a perfect square. A perfect square is an integer that is the square of an integer. For example, 0, 1, 4, 9, 16 are perfect squares, while 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_perfect_square(0) == True\", \"assert is_perfect_square(1) == True\", \"assert is_perfect_square(4) == True\", \"assert is_perfect_square(9) == True\", \"assert is_perfect_square(16) == True\", \"assert is_perfect_square(25) == True\", \"assert is_perfect... | {
"split": "train",
"index": 68822,
"acecode_id": "evol_28279",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the execution of a command-line tool with given arguments. Your function should accept a list of strings representing command-line arguments and return a list that represents the complete command to execute. The command sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_command(['a', 'b', 'c']) == ['ffmpeg', '-y', 'a', 'b', 'c']\", \"assert build_command(['input.mp4', 'output.mp4']) == ['ffmpeg', '-y', 'input.mp4', 'output.mp4']\", \"assert build_command(['-i', 'video.mp4']) == ['ffmpeg', '-y', '-i', 'video.mp4']\", \... | {
"split": "train",
"index": 68823,
"acecode_id": "bigcode_python_fns_9497",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple service container in Python. A service container allows you to register services and retrieve them later. Your task is to implement a function `service_container` that takes a list of operations and returns the results of those operatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert service_container([('register', 'service_a', 42), ('retrieve', 'service_a', 'not found')]) == [42]\", \"assert service_container([('register', 'service_b', 'Hello'), ('retrieve', 'service_b', 'not found')]) == ['Hello']\", \"assert service_container([('retri... | {
"split": "train",
"index": 68824,
"acecode_id": "oss_37470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of integers and performs a specific calculation based on the data. Your function should extract certain elements from the list and calculate the sum of those elements. Write a function called `calculate_sum()` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum([1, 2, 3, 4, 5]) == 6\", \"assert calculate_sum([10, 15, 20, 25]) == 30\", \"assert calculate_sum([0, 1, 2, 3, 4]) == 6\", \"assert calculate_sum([-2, -4, -6, 1, 3]) == -12\", \"assert calculate_sum([-1, -3, -5]) == 0\", \"assert calculate_sum(... | {
"split": "train",
"index": 68825,
"acecode_id": "oss_15956",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted XML string from a given dictionary representing data. The dictionary will contain key-value pairs, where the keys are the tag names and the values are the text content of the tags. Your function should convert t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_xml({'name': 'Alice', 'age': '30'}) == '<name>Alice</name><age>30</age>'\", \"assert generate_xml({'country': 'USA', 'city': 'New York'}) == '<country>USA</country><city>New York</city>'\", \"assert generate_xml({'product': 'Laptop', 'price': '1000'... | {
"split": "train",
"index": 68826,
"acecode_id": "bigcode_python_fns_32379",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a serialization function that converts a given dictionary into a string representation. Implement the function `serialize_dict(data: dict, separator: str) -> str`, where `data` is a dictionary containing key-value pairs, and `separator` is a string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_dict({'a': '1', 'b': '2'}, ';') == 'a=1;b=2'\", \"assert serialize_dict({'name': 'Alice', 'age': '30'}, ';') == 'name=Alice;age=30'\", \"assert serialize_dict({'key;1': 'value=1', 'key;2': 'value=2'}, ';') == 'key\\\\;1=value\\\\=1;key\\\\;2=value\... | {
"split": "train",
"index": 68827,
"acecode_id": "bigcode_python_fns_6291",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates updating a shopping cart. The function should take a dictionary representing the shopping cart and a discount code. The cart has items with their prices and quantities, and the discount code may provide a percentage discoun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recalculate_cart({'apple': (1.0, 2)}, 'SAVE50') == 1.0\", \"assert recalculate_cart({'grapes': (2.0, 1)}, 'INVALIDCODE') == 2.0\", \"assert recalculate_cart({'watermelon': (3.0, 2)}, 'SAVE0') == 6.0\", \"assert recalculate_cart({'peach': (2.5, 2)}, 'SAVE51')... | {
"split": "train",
"index": 68828,
"acecode_id": "bigcode_python_fns_19225",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating resource types for an analytics application. A valid resource type is defined as any string that is exactly one of the following values: 'user', 'event', 'location', 'session', or 'transaction'. Write a function `is_valid_resource_type(resource_ty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_resource_type('user') == True\", \"assert is_valid_resource_type('event') == True\", \"assert is_valid_resource_type('location') == True\", \"assert is_valid_resource_type('session') == True\", \"assert is_valid_resource_type('transaction') == True\... | {
"split": "train",
"index": 68829,
"acecode_id": "bigcode_python_fns_301",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `text` consisting of lowercase and uppercase alphabetic characters, write a function `count_exponential_characters(text: str) -> int` that returns the count of characters in the string that are considered 'exponential'. A character is considered 'exponential' if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_exponential_characters('abcXYZ') == 6\", \"assert count_exponential_characters('hello') == 0\", \"assert count_exponential_characters('xXyYzZ') == 6\", \"assert count_exponential_characters('ABCDE') == 3\", \"assert count_exponential_characters('expone... | {
"split": "train",
"index": 68830,
"acecode_id": "bigcode_python_fns_45107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of help articles and generates a formatted help page for a web application. Each help article is represented as a dictionary with keys 'title' and 'content'. The function should take a list of such dictionarie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_help_page([]) == '<!DOCTYPE html><html><head><title>Help Page</title></head><body><h1>Help Articles</h1></body></html>'\", \"assert format_help_page([{'title': 'Article 1', 'content': 'Content 1'}]) == '<!DOCTYPE html><html><head><title>Help Page</tit... | {
"split": "train",
"index": 68831,
"acecode_id": "oss_32111",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a linear search on a list of integers and returns the index of a given target integer. If the target is not found in the list, return -1. The function signature is: `def linear_search(lst: List[int], target: int) -> int:`. For example, given t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linear_search([7, -3, 10, 13, -6], -3) == 1\", \"assert linear_search([1, 2, 3, 4, 5], 3) == 2\", \"assert linear_search([10, 20, 30, 40, 50], 60) == -1\", \"assert linear_search([-1, -2, -3, -4], -4) == 3\", \"assert linear_search([0, 1, 2, 3], 0) == 0\", \... | {
"split": "train",
"index": 68832,
"acecode_id": "evol_19792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given rotor position is within an acceptable tolerance of a reference signal for an Electrically Excited Synchronous Permanent Magnet Motor (EEC PMSM). The function `check_motor_sync(rotor_position: float, reference_s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_motor_sync(1.0, 1.0, 0.1) == True\", \"assert check_motor_sync(1.0, 1.05, 0.1) == True\", \"assert check_motor_sync(1.0, 1.1, 0.1) == False\", \"assert check_motor_sync(0.5, 0.5, 0.01) == True\", \"assert check_motor_sync(0.5, 0.52, 0.01) == False\", \... | {
"split": "train",
"index": 68833,
"acecode_id": "oss_26062",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates sending a message to a server. The function should take in a message string, a recipient string, and a sender string as parameters. It should return a confirmation string indicating that the message has been sent suc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message('Hello, World!', 'Alice', 'Bob') == 'Message from Bob to Alice: Hello, World! has been sent.'\", \"assert send_message('Goodbye!', 'Charlie', 'Dave') == 'Message from Dave to Charlie: Goodbye! has been sent.'\", \"assert send_message('How are yo... | {
"split": "train",
"index": 68834,
"acecode_id": "oss_4473",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list 'frame' representing an image, where each element in the list is a list of integers representing pixel values. Your task is to remove the last 15 rows from the image. Implement a function 'remove_bottom(frame)' that takes in the 2D list and returns a new... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_bottom([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]) == []\", \"assert remove_bottom([[1, 2]]) == []\", \"assert remove_bottom([[1]*100]*20) == [[1]*100]*5\", \"assert remove_bottom([[1]*100]*15) == []\", \"assert remove_bottom([[1]*50]*30) == [[1]*50]*1... | {
"split": "train",
"index": 68835,
"acecode_id": "bigcode_python_fns_16460",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that creates a collection of items based on an owner's name. The function should take two parameters: an 'owned' string representing the owner of the collection, and an optional 'collection' list representing the items in the collecti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_item_manager('book', ['item1', 'item2']) == {'collection': ['item1', 'item2'], 'audience': 'urn:auth0-authz-api'}\", \"assert create_item_manager('car') == {'collection': 'cars', 'audience': 'urn:auth0-authz-api'}\", \"assert create_item_manager('pen'... | {
"split": "train",
"index": 68836,
"acecode_id": "oss_28616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a logging level, write a function `convert_loglevstr_to_loglevint(loglevstr)` that converts this string to its corresponding integer value based on the following mapping: 'critical' to 50, 'error' to 40, 'warning' to 30, 'info' to 20, 'debug' to 10. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_loglevstr_to_loglevint('critical') == 50\", \"assert convert_loglevstr_to_loglevint('error') == 40\", \"assert convert_loglevstr_to_loglevint('warning') == 30\", \"assert convert_loglevstr_to_loglevint('info') == 20\", \"assert convert_loglevstr_to_l... | {
"split": "train",
"index": 68837,
"acecode_id": "bigcode_python_fns_29048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary `zep_inp` that represents components of a system, where each key is a string representing a component name, and each value is a dictionary containing a list of interfaces that the component provides under the key 'provides', write a function that returns two ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_maps_interface_class({'components': {'comp1': {'provides': [{'ports': ['interfaceA', 'interfaceB']}]}, 'comp2': {'provides': [{'ports': ['interfaceB', 'interfaceC']}]}, 'comp3': {'provides': [{'ports': ['interfaceA']}]}}}) == ({'interfaceA': ['comp1', 'c... | {
"split": "train",
"index": 68838,
"acecode_id": "bigcode_python_fns_11663",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are file types (strings) and the values are lists of dictionaries representing file metadata. Each file metadata dictionary contains the following keys: 'path', 'filetype', 'fullname', 'filename', and 'compression'. Write a function `pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_files({'txt': [{'path': '/path/to/file1.txt', 'filetype': 'txt', 'fullname': 'file1.txt', 'filename': 'file1', 'compression': False}], 'jpg': [{'path': '/path/to/file2.jpg', 'filetype': 'jpg', 'fullname': 'file2.jpg', 'filename': 'file2', 'compressio... | {
"split": "train",
"index": 68839,
"acecode_id": "bigcode_python_fns_41715",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing files in a codebase. Each dictionary contains the following keys: 'is_file' (a boolean indicating if the resource is a file), 'is_key_file' (a boolean indicating if the file is a key file), and 'licenses' (a list of dictionaries... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_licenses([{'is_file': True, 'is_key_file': True, 'licenses': [{'key': 'MIT'}]}, {'is_file': True, 'is_key_file': False, 'licenses': [{'key': 'GPL'}]}]) == ({'MIT'}, {'GPL'})\", \"assert get_unique_licenses([{'is_file': True, 'is_key_file': True, '... | {
"split": "train",
"index": 68840,
"acecode_id": "bigcode_python_fns_43394",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the execution of a command-line process. The function should take a command represented as a list of strings, and return a string that represents the output of the command after executing it. Your function should handle the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_command(['ls']) == 'file1.txt\\\\nfile2.txt\\\\nfile3.txt'\", \"assert simulate_command(['pwd']) == '/home/user'\", \"assert simulate_command(['echo', 'Hello, World!']) == 'Hello, World!'\", \"assert simulate_command(['unknown_command']) == 'Command... | {
"split": "train",
"index": 68841,
"acecode_id": "bigcode_python_fns_25283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a series of banking operations. The function should accept a list of tuples where each tuple contains an operation type (either 'deposit' or 'withdrawal') and an operation value (a non-negative integer). Additionally, a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([('deposit', 100), ('withdrawal', 100)]) == True\", \"assert below_zero([('deposit', 100), ('withdrawal', 50)]) == False\", \"assert below_zero([('withdrawal', 100), ('deposit', 50)]) == True\", \"assert below_zero([('Deposit', 200), ('Withdrawal'... | {
"split": "train",
"index": 68842,
"acecode_id": "evol_1426",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves user information from a given user object. The user object contains details like 'name', 'age', and 'email'. If the user object is None or does not exist, the function should return a default message indicating that the use... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_info({'name': 'Alice', 'age': 30, 'email': 'alice@example.com'}) == {'name': 'Alice', 'age': 30, 'email': 'alice@example.com'}\", \"assert get_user_info({'name': 'Bob', 'age': 25, 'email': 'bob@example.com'}) == {'name': 'Bob', 'age': 25, 'email': '... | {
"split": "train",
"index": 68843,
"acecode_id": "bigcode_python_fns_45166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a year and a week number, write a function that combines them into a single integer representation called an epiweek. The epiweek is calculated by multiplying the year by 100 and adding the week number to it. You need to implement a function `join_epiweek(year: int, week:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert join_epiweek(2023, 1) == 202301\", \"assert join_epiweek(2020, 52) == 202052\", \"assert join_epiweek(1999, 25) == 199925\", \"assert join_epiweek(2021, 10) == 202110\", \"assert join_epiweek(2022, 5) == 202205\", \"assert join_epiweek(2000, 1) == 200001\", ... | {
"split": "train",
"index": 68844,
"acecode_id": "bigcode_python_fns_35458",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that verifies if a given email address is valid. A valid email address must contain an '@' symbol and a domain name that includes a '.' followed by at least two characters (e.g., '.com', '.org'). If the email is valid, return 'Valid e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_email('user@domain.com') == 'Valid email'\", \"assert verify_email('user@domain..com') == 'Valid email'\", \"assert verify_email('user@domain.c') == 'Invalid email'\", \"assert verify_email('user@domain') == 'Invalid email'\", \"assert verify_email('u... | {
"split": "train",
"index": 68845,
"acecode_id": "evol_10556",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer 'image_number' (1-based index) and an optional integer 'passno' (0-based index), calculate the total number of X-ray bursts needed to send to a sample based on the following rules: If 'passno' is provided, return the result of a helper function 'npulses_of_pass... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_npulses(1, 0) == 5\", \"assert calculate_npulses(3) == 15\", \"assert calculate_npulses(4, None) == 15\", \"assert calculate_npulses(6) == 15\", \"assert calculate_npulses(9) == 15\", \"assert calculate_npulses(10, None) == 15\", \"assert calculate... | {
"split": "train",
"index": 68846,
"acecode_id": "bigcode_python_fns_48004",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 2D points represented as tuples of integers (x, y). Your task is to implement a function that takes this list of points and modifies the second point in the list to be a new point (50, 60). If the list contains fewer than two points, the function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_second_point([(10, 20), (30, 40)]) == [(10, 20), (50, 60)]\", \"assert modify_second_point([(10, 20)]) == [(10, 20)]\", \"assert modify_second_point([]) == []\", \"assert modify_second_point([(5, 5), (15, 15), (25, 25)]) == [(5, 5), (50, 60), (25, 25)... | {
"split": "train",
"index": 68847,
"acecode_id": "bigcode_python_fns_9783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a command-line interface (CLI) argument parser. The function `parse_arguments` should accept a list of command-line arguments (strings) and return a dictionary representing the parsed arguments. The function should supp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['--tenantname', 'user1']) == {'tenantname': 'user1', 'interface': 'publicURL', 'username': 'admin', 'password': 'admin', 'cacert': '/etc/ssl/certs/ca-certificates.crt', 'auth_url': 'http://standard-ccp-vip-KEY-API-mgmt:35357/v3', 'api_versio... | {
"split": "train",
"index": 68848,
"acecode_id": "bigcode_python_fns_23069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a message containing a photo. The message is represented as a string, and your function should return a modified version of that string, indicating that the photo has been processed. Implement a function called `process_pho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_photo_message('Picture of a sunset') == 'Processed photo: Picture of a sunset'\", \"assert process_photo_message('Family photo') == 'Processed photo: Family photo'\", \"assert process_photo_message('Vacation memories') == 'Processed photo: Vacation m... | {
"split": "train",
"index": 68849,
"acecode_id": "bigcode_python_fns_35709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of field descriptor strings representing a protocol buffer message definition. Each field descriptor string contains various attributes such as name, full name, index, number, type, and default value. Your task is to write a function that parses these field... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_field_descriptors([\\\"_descriptor.FieldDescriptor(name='latitude', full_name='v3.asset.ip.v4.geolocation.Message.latitude', index=11, number=13, type=2, default_value=0.0)\\\"]) == [{'name': 'latitude', 'full_name': 'v3.asset.ip.v4.geolocation.Message... | {
"split": "train",
"index": 68850,
"acecode_id": "oss_21904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a two-dimensional list (matrix) of integers, representing an image. Each integer represents a pixel value. Your task is to implement a function that flips this image vertically. This means that the first row of the image will be swapped with the last row, the seco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flip_vertical([[1, 2], [3, 4]]) == [[3, 4], [1, 2]]\", \"assert flip_vertical([[1], [2], [3]]) == [[3], [2], [1]]\", \"assert flip_vertical([[1, 2, 3], [4, 5, 6]]) == [[4, 5, 6], [1, 2, 3]]\", \"assert flip_vertical([[1, 2]]) == [[1, 2]]\", \"assert flip_ver... | {
"split": "train",
"index": 68851,
"acecode_id": "bigcode_python_fns_35128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add(x: int, y: int) -> int` that takes two integers, x and y, as input and returns their sum. The function should be concise and follow the principles of clean and readable code.\nPlease reason step by step, then write a self-contained Python solution. Giv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add(1, 2) == 3\", \"assert add(-1, 1) == 0\", \"assert add(0, 0) == 0\", \"assert add(100, 200) == 300\", \"assert add(-5, -3) == -8\", \"assert add(7, 3) == 10\", \"assert add(50, 50) == 100\", \"assert add(-10, 10) == 0\", \"assert add(1, -1) == 0\", \"ass... | {
"split": "train",
"index": 68852,
"acecode_id": "evol_6247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to determine if a given classifier is the winning model based on its performance after running a specific algorithm. The function should take in the following parameters: a list of classifiers (estimator objects), a list of performance sc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_winning_classifier(['clf1', 'clf2', 'clf3'], [0.8, 0.9, 0.85], 'LR') == 'clf2'\", \"assert find_winning_classifier(['clf1', 'clf2', 'clf3'], [0.75, 0.75, 0.7], 'SVM') == 'clf1'\", \"assert find_winning_classifier(['clf1'], [0.6], 'RF') == 'clf1'\", \"as... | {
"split": "train",
"index": 68853,
"acecode_id": "bigcode_python_fns_23347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that constructs a specific library path based on the provided base directory, subdirectory, and library name. The function should take in three parameters: `base_dir` (string): the base directory where the subdirectory and library are lo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_library_path('/home/user', 'Java/runtime', 'spark') == '/home/user/Java/runtime/spark/python/lib/pyspark.zip'\", \"assert construct_library_path('/usr/local', 'lib', 'mylib') == '/usr/local/lib/mylib/python/lib/pyspark.zip'\", \"assert construct_li... | {
"split": "train",
"index": 68854,
"acecode_id": "oss_34404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of setting and retrieving environment variables. The function should mimic the behavior of the `setdefault` method found in the `os.environ` module. Your task is to implement a function `set_environment_variabl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_environment_variable('PATH', '/usr/bin') == '/usr/bin'\", \"assert set_environment_variable('HOME', '/home/user') == '/home/user'\", \"assert set_environment_variable('USER', 'guest') == 'guest'\", \"assert set_environment_variable('SHELL', '/bin/bash') ... | {
"split": "train",
"index": 68855,
"acecode_id": "oss_4715",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dataset of housing attributes represented as a list of lists. Each inner list contains the following attributes in the specified order: 'CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', 'RM', 'AGE', 'DIS', 'RAD', 'TAX', 'PTRAT... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_housing_attributes([[1, 0, 6, 0, 0.5, 6, 65, 4, 1, 300, 15, 396, 4, 24]]) == [1.0, 0.0, 6.0, 0.0, 0.5, 6.0, 65.0, 4.0, 1.0, 300.0, 15.0, 396.0, 4.0, 24.0]\", \"assert average_housing_attributes([[1, 0, 6, 0, 0.5, 6, 65, 4, 1, 300, 15, 396, 4, 24], [2... | {
"split": "train",
"index": 68856,
"acecode_id": "oss_19550",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with selecting a subset of stars from a large dataset for analysis. Given the total number of stars and the number of stars you want to select, your goal is to generate a list of unique random indices that represent the selected stars. The function should ensure ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_random_stars(14000, 1400) != select_random_stars(14000, 1400)\", \"assert len(select_random_stars(14000, 1400)) == 1400\", \"assert all(i in range(14000) for i in select_random_stars(14000, 1400))\", \"assert len(set(select_random_stars(14000, 1400)))... | {
"split": "train",
"index": 68857,
"acecode_id": "oss_36132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of problem instances. Each problem instance has a boolean attribute `is_open` indicating whether the problem is currently open for submissions, and a string attribute `problem` containing the problem description. You need to implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_open_problems([(True, 'Problem 1'), (False, 'Problem 2'), (True, 'Problem 3')]) == ['Problem 1', 'Problem 3']\", \"assert get_open_problems([(False, 'Problem A'), (False, 'Problem B')]) == []\", \"assert get_open_problems([(True, 'Single Open Problem')])... | {
"split": "train",
"index": 68858,
"acecode_id": "oss_33002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to determine if any two distinct integers in the list sum up to the target integer. Implement a function `has_pair_with_sum` that takes the following parameters: \n- `nums`: A list of integers, where 1 <= len(n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 9) == True\", \"assert has_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert has_pair_with_sum([10, 15, 3, 7], 17) == True\", \"assert has_pair_with_sum([1, 2, 3, 4], 8) == False\", \"assert has_pair_with_sum([-1, -2,... | {
"split": "train",
"index": 68859,
"acecode_id": "oss_19044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_string()` that generates a random alphanumeric string of 15 characters. The string should consist of both uppercase and lowercase letters, digits, and at least one special character. The special character can be any from the set of punctuation cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_string()) == 15\", \"assert any(c.islower() for c in generate_string())\", \"assert any(c.isupper() for c in generate_string())\", \"assert any(c in string.punctuation for c in generate_string())\", \"assert all(c.isalnum() or c in string.punctu... | {
"split": "train",
"index": 68860,
"acecode_id": "evol_13883",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that modifies an input dictionary based on a predefined set of parameters associated with a given action reference. The function should take in an action reference (a string) and an input dictionary. Based on the action referen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_action_parameters('action1', {}) == {'key1': 10, 'key2': 20}\", \"assert process_action_parameters('action2', {'key1': 1}) == {'key1': 1, 'key3': 30, 'key4': 40}\", \"assert process_action_parameters('action3', {'key1': 1}) == {'key1': 1}\", \"assert... | {
"split": "train",
"index": 68861,
"acecode_id": "oss_30947",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_map_lower(lst)` that takes a list of strings `lst` as input and returns a new list containing the lowercase versions of all the strings in the input list. You should iterate through the input list and apply the `str.lower` method to each element wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_map_lower(['Hello', 'WORLD', 'Python']) == ['hello', 'world', 'python']\", \"assert custom_map_lower(['TEST', '123', 'aBc']) == ['test', '123', 'abc']\", \"assert custom_map_lower(['UPPER', 'lower', 'MIXED']) == ['upper', 'lower', 'mixed']\", \"assert... | {
"split": "train",
"index": 68862,
"acecode_id": "oss_6427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the root of a binary tree. Your task is to implement a function that checks whether the binary tree is a binary search tree (BST). A binary search tree is defined as a binary tree in which for each node, all elements in its left subtree are less than the node's va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_binary_search_tree(BinaryTreeNode(2)) == True\", \"assert is_binary_search_tree(BinaryTreeNode(2, BinaryTreeNode(1), BinaryTreeNode(3))) == True\", \"assert is_binary_search_tree(BinaryTreeNode(5, BinaryTreeNode(3), BinaryTreeNode(7))) == True\", \"assert... | {
"split": "train",
"index": 68863,
"acecode_id": "oss_1892",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if a given integer is a prime number. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. The function should return True if the number is prime, and False otherwise.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser... | {
"split": "train",
"index": 68864,
"acecode_id": "evol_13261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a dictionary with a specific key-value pair and returns the value associated with that key. The dictionary should contain one entry where the key is 'Antnoder64' and the value is a list containing the integer 1. Your func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_value() == [1]\", \"assert get_value() == [1]\", \"assert get_value() == [1]\", \"assert get_value() == [1]\", \"assert get_value() == [1]\", \"assert get_value() == [1]\", \"assert get_value() == [1]\", \"assert get_value() == [1]\", \"assert get_value(... | {
"split": "train",
"index": 68865,
"acecode_id": "oss_20664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two fractions represented by their numerator and denominator, implement a function that performs addition, subtraction, multiplication, and division of these fractions. The function should return the result of all four operations as a list of strings in simplified form, w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fraction_operations(3, 4, 1, 2) == ['5/4', '1/4', '3/8', '3/2']\", \"assert fraction_operations(1, 2, 1, 2) == ['1/1', '0/1', '1/4', '1/1']\", \"assert fraction_operations(-1, 2, 1, 2) == ['0/1', '-1/1', '-1/4', '-1/1']\", \"assert fraction_operations(5, 8, ... | {
"split": "train",
"index": 68866,
"acecode_id": "oss_14709",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes XML data to extract location information. The function should take an XML string as input and return a dictionary containing the latitude and longitude of the location if available. The XML data is structured as foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_location_info('<place><name>City A</name><coordinates latitude=\\\"30.1234\\\" longitude=\\\"-90.5678\\\"/></place>') == {'latitude': '30.1234', 'longitude': '-90.5678'}\", \"assert extract_location_info('<place><name>City B</name><coordinates latitu... | {
"split": "train",
"index": 68867,
"acecode_id": "oss_25799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `set_attribute(namespace, attribute_name, value)` that behaves as follows: The function should take three parameters: a dictionary `namespace`, a string `attribute_name`, and a value `value`. The function should set the key `attribute... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_attribute({}, 'a', 1) == {'a': 1}\", \"assert set_attribute({'a': 1}, 'a', 2) == {'a': 2}\", \"assert set_attribute({'b': 3}, 'a', 1) == {'b': 3, 'a': 1}\", \"assert set_attribute({'c': 5, 'd': 6}, 'c', 7) == {'c': 7, 'd': 6}\", \"assert set_attribute({'... | {
"split": "train",
"index": 68868,
"acecode_id": "bigcode_python_fns_48998",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of boxes, each represented by a tuple of four integers (x1, y1, x2, y2) representing the bottom-left and top-right corners of the box respectively, and a single box represented in the same format, implement a function `boxes_intersect(boxes: List[Tuple[int, int, in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert boxes_intersect([(1, 1, 3, 3)], (2, 2, 4, 4)) == True\", \"assert boxes_intersect([(0, 0, 2, 2)], (2, 2, 3, 3)) == False\", \"assert boxes_intersect([(0, 0, 1, 1), (1, 1, 2, 2)], (0.5, 0.5, 1.5, 1.5)) == True\", \"assert boxes_intersect([(0, 0, 1, 1)], (1, 1... | {
"split": "train",
"index": 68869,
"acecode_id": "bigcode_python_fns_35761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of movement commands. Each command consists of a direction and a magnitude. The possible directions are 'forward', 'backward', 'left', and 'right'. The magnitude is a positive integer representing the distance to move in the specified direction. The initial... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_position(['forward 10', 'left 5', 'backward 3', 'right 2']) == (7, -3)\", \"assert calculate_final_position(['backward 5', 'backward 5', 'forward 10']) == (0, 0)\", \"assert calculate_final_position(['left 10', 'right 10', 'forward 10', 'back... | {
"split": "train",
"index": 68870,
"acecode_id": "oss_24143",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers as input and returns a new list containing only the positive integers from the input list, sorted in ascending order. If there are no positive integers, return an empty list. Please implement the function `get_positive_and_sort... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [1, 2, 3, 3, 5, 9, 123]\", \"assert get_positive_and_sort([-1, -2, -3]) == []\", \"assert get_positive_and_sort([0, 0, 0]) == ... | {
"split": "train",
"index": 68871,
"acecode_id": "evol_6373",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user information based on certain criteria. Your function should take a dictionary as input, which contains user details. Your task is to implement a function called `validate_user_info(user_info)` that returns a boolean in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_info({'username': 'user1', 'email': 'test@example.com', 'password': 'securePassword123', 'is_active': True, 'is_superuser': False, 'nickname': 'User', 'ldap_name': 'ldap_user'}) == True\", \"assert validate_user_info({'username': 'user2', 'emai... | {
"split": "train",
"index": 68872,
"acecode_id": "oss_14615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps representing the times at which certain events occurred. Your task is to identify the indices of significant changepoints in the list, defined as the points where the time difference between subsequent events exceeds a given threshold. You sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_changepoints([1.0, 2.0, 3.0, 10.0, 15.0], 5.0) == [0, 3, 4]\", \"assert detect_changepoints([1.0, 1.1, 1.2, 1.3, 1.4, 2.5], 0.5) == [0, 5]\", \"assert detect_changepoints([10.0, 10.1, 10.2, 10.3, 10.4], 0.5) == [0, 4]\", \"assert detect_changepoints([... | {
"split": "train",
"index": 68873,
"acecode_id": "bigcode_python_fns_9869",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing component names. Each string can either be a built-in component or a custom component. A built-in component is defined as any string that starts with 'homeassistant.components.'. A custom component is defined as any string that start... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_custom_components(['homeassistant.components.light', 'custom_components.switch', 'homeassistant.components.sensor', 'custom_components.binary_sensor']) == ['custom_components.switch', 'custom_components.binary_sensor']\", \"assert filter_custom_compon... | {
"split": "train",
"index": 68874,
"acecode_id": "bigcode_python_fns_25828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of strings, `source_paths` and `target_paths`, where each string represents a relative file path, implement a function `path_move(source_paths: List[str], target_paths: List[str]) -> List[str]` that simulates moving files from the source paths to the target path... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert path_move(['file1.txt', 'file2.txt'], ['target1.txt', 'target2.txt']) == ['file1.txt', 'file2.txt']\", \"assert path_move(['file1.txt'], ['target1.txt']) == ['file1.txt']\", \"assert path_move(['file1.txt', 'file2.txt'], ['target1.txt']) == ['file1.txt']\", ... | {
"split": "train",
"index": 68875,
"acecode_id": "bigcode_python_fns_48925",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple filtering system for processing frequency data. The function should take in three parameters: a list of frequency values, a low frequency threshold, and a high frequency threshold. Your job is to return a new l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_frequency_values([3.0, 8.0, 12.0, 18.0, 20.0], 5.0, 15.0) == [8.0, 12.0]\", \"assert filter_frequency_values([10.0, 15.0, 20.0], 15.0, 15.0) == [15.0]\", \"assert filter_frequency_values([], 0.0, 10.0) == []\", \"assert filter_frequency_values([5.5, 6... | {
"split": "train",
"index": 68876,
"acecode_id": "oss_8060",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates loading a machine learning model's state from a dictionary instead of a file. The function takes a dictionary, which contains the keys 'epoch', 'model', 'likelihood', 'mll', 'optimizer', and 'loss'. Your function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_model_state({'epoch': 5, 'model': 'model_data', 'likelihood': 'likelihood_data', 'mll': 'mll_data', 'optimizer': 'optimizer_data', 'loss': [0.1, 0.05]}) == (5, 'model_data', 'likelihood_data', 'mll_data', 'optimizer_data', [0.1, 0.05])\", \"assert load_... | {
"split": "train",
"index": 68877,
"acecode_id": "bigcode_python_fns_16468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the daily temperatures in Celsius for a week. Your task is to implement a function that transforms this list into a new list where each element at index i is the number of days until a warmer temperature. If there is no future day f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73]) == [1, 1, 4, 2, 1, 1, 0, 0]\", \"assert dailyTemperatures([30, 40, 50, 60]) == [1, 1, 1, 0]\", \"assert dailyTemperatures([30, 60, 90]) == [1, 1, 0]\", \"assert dailyTemperatures([70, 60, 50, 40, 30]) == [0... | {
"split": "train",
"index": 68878,
"acecode_id": "bigcode_python_fns_17109",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates retrieving game configuration details from a given file name. The function should take a string input representing the name of the configuration file (e.g., 'game.ini') and return a dictionary with the file name and a fixed... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_game_configuration('game.ini') == {'file_name': 'game.ini', 'status': 'loaded'}\", \"assert get_game_configuration('config.json') == {'file_name': 'config.json', 'status': 'loaded'}\", \"assert get_game_configuration('settings.txt') == {'file_name': 'set... | {
"split": "train",
"index": 68879,
"acecode_id": "bigcode_python_fns_44337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the default language code for a web application from a predefined settings dictionary. The settings dictionary contains a key 'LANGUAGE_CODE' which holds a string value representing the default language code. Your function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_language_code({'LANGUAGE_CODE': 'en-GB'}) == 'en-GB'\", \"assert get_language_code({'LANGUAGE_CODE': 'fr-FR'}) == 'fr-FR'\", \"assert get_language_code({'LANGUAGE_CODE': 'es-ES'}) == 'es-ES'\", \"assert get_language_code({'LANGUAGE_CODE': 'de-DE'}) == 'd... | {
"split": "train",
"index": 68880,
"acecode_id": "oss_1952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing contacts, where each contact has a 'telecom' field that contains additional details. Your task is to create a function that processes this list of contacts, retaining only specific fields within the 'telecom' field while removin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_contacts([{'name': 'Alice', 'telecom': [{'id': 1, 'use': 'home', 'extension': '123', 'other_field': 'value'}]}]) == [{'name': 'Alice', 'telecom': [{'id': 1, 'use': 'home', 'extension': '123'}]}]\", \"assert format_contacts([{'name': 'Bob', 'telecom': ... | {
"split": "train",
"index": 68881,
"acecode_id": "bigcode_python_fns_24468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a basic secret management system. The function should be able to encrypt and decrypt secrets using a simple substitution cipher. The encryption will involve shifting each character in the secret string by a specified number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_secret('hello', 2, 'encrypt') == 'jgnnq'\", \"assert manage_secret('jgnnq', 2, 'decrypt') == 'hello'\", \"assert manage_secret('abc', 1, 'encrypt') == 'bcd'\", \"assert manage_secret('bcd', 1, 'decrypt') == 'abc'\", \"assert manage_secret('A', 1, 'enc... | {
"split": "train",
"index": 68882,
"acecode_id": "oss_11382",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates either the sum or the factorial of a given positive integer based on the user's choice. Write a function `calculate(num: int, opc: int) -> int` where `num` is a positive integer and `opc` is either 1 or 2. If `opc` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate(5, 1) == 15\", \"assert calculate(5, 2) == 120\", \"assert calculate(0, 1) == 0\", \"assert calculate(0, 2) == 1\", \"assert calculate(1, 1) == 1\", \"assert calculate(1, 2) == 1\", \"assert calculate(10, 1) == 55\", \"assert calculate(10, 2) == 36... | {
"split": "train",
"index": 68883,
"acecode_id": "oss_26275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a dictionary representing a file item and adds an 'image' key to it. The value of the 'image' key should be a string that represents the contents of the file specified by the 'path' key in the dictionary. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_file({'path': 'file1.txt'}) == {'path': 'file1.txt', 'image': 'Contents of file1.txt'}\", \"assert read_file({'path': 'image.png'}) == {'path': 'image.png', 'image': 'Contents of image.png'}\", \"assert read_file({'path': '/documents/report.pdf'}) == {'... | {
"split": "train",
"index": 68884,
"acecode_id": "bigcode_python_fns_20861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a list of aggregation operations, implement a function that computes the results of the specified aggregations on the given list. The supported operations are 'min', 'max', 'sum', 'prod', 'mean', and 'std'. Your function should return a dictionary w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_operations([10, 20, 30, 40], ['min', 'max', 'mean']) == {'min': 10, 'max': 40, 'mean': 25.0}\", \"assert aggregate_operations([5], ['min', 'max', 'std']) == {'min': 5, 'max': 5, 'std': None}\", \"assert aggregate_operations([2, 4, 6], ['mean', 'pro... | {
"split": "train",
"index": 68885,
"acecode_id": "bigcode_python_fns_3465",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that selects a random line from a given list of strings. The function should take a list of strings as input and return one of the strings randomly. If the input list is empty, the function should return the string 'No lines available'. Y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_random_line(['line 1', 'line 2', 'line 3']) in ['line 1', 'line 2', 'line 3']\", \"assert get_random_line(['apple', 'banana', 'cherry']) in ['apple', 'banana', 'cherry']\", \"assert get_random_line(['hello', 'world']) in ['hello', 'world']\", \"assert ge... | {
"split": "train",
"index": 68886,
"acecode_id": "bigcode_python_fns_21818",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists where each sublist represents the videos watched by a person, and a list of friendships represented as pairs of indices of friends. Your task is to implement a function `watchedVideosByFriends(watchedVideos: List[List[str]], friends: List[List[int]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert watchedVideosByFriends([['A','B'],['C'],['B','C'],['D']], [[1,2],[0,3],[0,3],[1,2]], 0, 1) == ['C','B']\", \"assert watchedVideosByFriends([[],[],[],[]], [[1,2],[0,3],[0],[1]], 0, 1) == []\", \"assert watchedVideosByFriends([['A'],['B'],['C'],['D']], [[1],[2... | {
"split": "train",
"index": 68887,
"acecode_id": "evol_35588",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing Python import statements from a module. Your task is to modify these import statements to redirect them to a new module root. Specifically, you must replace any instance of the string 'more_itertools' with a new root prefix followed ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rewrite_imports(['from more_itertools import something', 'import more_itertools'], 'my_vendored') == ['from my_vendored.more_itertools import something', 'import my_vendored.more_itertools']\", \"assert rewrite_imports(['from more_itertools import another_th... | {
"split": "train",
"index": 68888,
"acecode_id": "bigcode_python_fns_44734",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of exception classes and a dictionary that maps each exception class to a specific error code. Write a function `get_error_code(exception_chain: List[Type[Exception]], error_codes: Dict[Type[Exception], int]) -> Optional[int]` that takes a list of exception... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_error_code([ValueError, Exception], {ValueError: 404, Exception: 500}) == 404\", \"assert get_error_code([KeyError, ValueError], {ValueError: 404, KeyError: 401}) == 401\", \"assert get_error_code([Exception, ValueError], {ValueError: 404, Exception: 500... | {
"split": "train",
"index": 68889,
"acecode_id": "bigcode_python_fns_16555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts old-style class definitions to new-style class definitions in a given source code string. Specifically, your function should identify class definitions that use the old-style syntax `class Blah:` and convert them to the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_old_style_classes('class MyClass:\\\\n pass') == 'class MyClass(object):\\\\n pass'\", \"assert convert_old_style_classes('class AnotherClass:\\\\n pass\\\\nclass MyClass:\\\\n pass') == 'class AnotherClass(object):\\\\n pass\\\\nclass... | {
"split": "train",
"index": 68890,
"acecode_id": "oss_19162",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple sensor management system for a robot. The system should allow sensors to register an observer and update the observer with distance measurements. Your task is to implement a single function called `update_sensor_distance` that takes the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_sensor_distance({}, 'Sensor1', 10) == {'Sensor1': 10}\", \"assert update_sensor_distance({'Sensor1': 10}, 'Sensor1', 15) == {'Sensor1': 15}\", \"assert update_sensor_distance({'Sensor1': 10}, 'Sensor2', 20) == {'Sensor1': 10, 'Sensor2': 20}\", \"asser... | {
"split": "train",
"index": 68891,
"acecode_id": "oss_30113",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that translates a given text from a source language to a target language using predefined translations. The function should take the following parameters: a string `text` representing the text to be translated, a string `source_langua... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_text('hello', 'en', 'es') == 'hola'\", \"assert translate_text('hello', 'en', 'fr') == 'bonjour'\", \"assert translate_text('hola', 'es', 'en') == 'hello'\", \"assert translate_text('hello', 'en', 'en') == 'hello'\", \"assert translate_text('hola',... | {
"split": "train",
"index": 68892,
"acecode_id": "bigcode_python_fns_38241",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing operations on 3D vectors represented by their coordinates. Write a function `vector_operations` that takes in two 3D vectors represented as tuples (x1, y1, z1) and (x2, y2, z2), and a scalar value `k`. The function should return a tuple containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vector_operations((1, 2, 3), (4, 5, 6), 2) == ((5, 7, 9), (-3, -3, -3), (2, 4, 6), (0.5, 1.0, 1.5))\", \"assert vector_operations((0, 0, 0), (0, 0, 0), 1) == ((0, 0, 0), (0, 0, 0), (0, 0, 0), (0.0, 0.0, 0.0))\", \"assert vector_operations((1, 1, 1), (1, 1, 1... | {
"split": "train",
"index": 68893,
"acecode_id": "oss_11552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and encodes it using base64 encoding. The function should then return the base64 encoded string, appended with a specified number of stars. The function signature should be: `def encode_string_with_stars(input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_string_with_stars('Hello, World!', 3) == 'SGVsbG8sIFdvcmxkIQ==***'\", \"assert encode_string_with_stars('Python', 0) == 'UHl0aG9u'\", \"assert encode_string_with_stars('Base64 Encoding', 5) == 'QmFzZTY0IEVuY29kaW5n*****'\", \"assert encode_string_with... | {
"split": "train",
"index": 68894,
"acecode_id": "oss_11638",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that validates a given credit card number. The function should check for the following conditions: 1. It must consist of exactly 16 digits. 2. It must start with 4, 5 or 6. 3. It should not consist of any alphabets or special characters. 4. No digit is r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate('5123-4567-8912-3456') == 'Invalid'\", \"assert validate('5133 3367 8912 3456') == 'Invalid'\", \"assert validate('41234567891234567') == 'Invalid'\", \"assert validate('412345678912345') == 'Invalid'\", \"assert validate('5133-3367-8912-345') == 'I... | {
"split": "train",
"index": 68895,
"acecode_id": "evol_18543",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_max(matrix)` that takes a 2D list (matrix) of integers as input and returns the maximum integer in that matrix. The matrix is guaranteed to have at least one element.\nPlease reason step by step, then write a self-contained Python solution. Give your fina... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 9\", \"assert find_max([[0, -1, -2], [-3, -4, -5]]) == 0\", \"assert find_max([[10]]) == 10\", \"assert find_max([[1, 2], [3, 4]]) == 4\", \"assert find_max([[1, 1], [1, 1]]) == 1\", \"assert find_max([[5, 10, 1... | {
"split": "train",
"index": 68896,
"acecode_id": "evol_25841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that checks whether a given string contains any numeric values. The function should take a single string input and return True if the string contains at least one numeric character (0-9), and False otherwise. Implement the function `contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_numeric('Hello World!') == False\", \"assert contains_numeric('Python 3.9') == True\", \"assert contains_numeric('No numbers here!') == False\", \"assert contains_numeric('12345') == True\", \"assert contains_numeric('abcdefg') == False\", \"assert ... | {
"split": "train",
"index": 68897,
"acecode_id": "bigcode_python_fns_13727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists, where each inner list represents a covering array for a set of parameters, implement a function `compare_covering_arrays(arr1: List[List[int]], arr2: List[List[int]]) -> bool` that checks if two covering arrays are equivalent. Two covering arrays are cons... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_covering_arrays([[1, 1, 1], [1, 2, 0]], [[1, 1, 1], [1, 2, 2]]) == True\", \"assert compare_covering_arrays([[1, 1, 1], [1, 2, 0]], [[1, 1, 0], [1, 2, 2]]) == True\", \"assert compare_covering_arrays([[1, 2], [3, 4]], [[1, 2], [3, 4]]) == True\", \"a... | {
"split": "train",
"index": 68898,
"acecode_id": "bigcode_python_fns_21652",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple class hierarchy for different types of animals. Implement a base class called 'Animal' that has a constructor to initialize the animal's name and an abstract method 'talk' that should be overridden by subclasses. Create three subclasses: 'D... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Dog('Rover').talk() == 'Woof Woof'\", \"assert Cat('Fluffy').talk() == 'Meow Meow'\", \"assert Dog('Buddy').talk() == 'Woof Woof'\", \"assert Cat('Whiskers').talk() == 'Meow Meow'\", \"assert Dog('Charlie').talk() == 'Woof Woof'\", \"assert Cat('Shadow').tal... | {
"split": "train",
"index": 68899,
"acecode_id": "evol_15469",
"num_tests": 8
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.