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": "You are tasked with creating a custom exception class in Python for handling errors related to OpenShift operations. Your task is to implement the `OpenShiftException` class, which should be a subclass of the built-in `Exception` class. The `OpenShiftException` class should acc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert OpenShiftException('Custom error message').args[0] == 'Custom error message'\", \"assert OpenShiftException().args[0] == 'OpenShift operation failed'\", \"assert isinstance(OpenShiftException('Another custom message'), OpenShiftException)\", \"assert isinsta... | {
"split": "train",
"index": 65600,
"acecode_id": "oss_29724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that removes all elements that are divisible by 4, then rearranges the remaining elements according to their binary representation. The output should be sorted first by the count of 1s in their binary representation, then by their ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_list([4, 8, 12, 15, 20]) == [15]\", \"assert rearrange_list([0, 1, 2, 3]) == [1, 2, 3]\", \"assert rearrange_list([16, 32, 64]) == []\", \"assert rearrange_list([1, 2, 4, 8, 16]) == [1, 2]\", \"assert rearrange_list([4, 5, 6, 7, 8]) == [5, 6, 7]\",... | {
"split": "train",
"index": 65601,
"acecode_id": "evol_9682",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the optimal operational speed for a network port based on the supported speeds of the connected devices. You are given a list of supported speeds from two devices: a Device Under Test (DUT) and a Fanout device. Write a function `get_optimal_speed... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_optimal_speed([100, 1000, 10000], [100, 1000, 10000]) == 10000\", \"assert get_optimal_speed([10, 100, 1000], [100, 1000, 10000]) == 1000\", \"assert get_optimal_speed([10, 100], [100, 200]) == 100\", \"assert get_optimal_speed([1, 10, 100], [200, 300]) ... | {
"split": "train",
"index": 65602,
"acecode_id": "bigcode_python_fns_49097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that calculates the Manhattan distance between two distinct points in a 2D Cartesian coordinate system. Each point is represented as a tuple containing two integers, which correspond to the x and y coordinates. The function should take two such tuples ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manhattan_distance((1, 2), (3, 4)) == 4\", \"assert manhattan_distance((0, 0), (0, 0)) == 0\", \"assert manhattan_distance((-1, -1), (1, 1)) == 4\", \"assert manhattan_distance((5, 5), (5, 10)) == 5\", \"assert manhattan_distance((1, 2), (1, 5)) == 3\", \"as... | {
"split": "train",
"index": 65603,
"acecode_id": "evol_31588",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a list of symbols based on specified parameters. The function should accept the following parameters: `symbol` (a list of strings), `exchange` (a string), `asset_class` (a string), `contract_type` (a string), and `currency`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_symbols(['AAPL'], 'NASDAQ', 'STOCK', 'COMMON', 'USD') == [{'ticker': 'AAPL', 'exchange': 'NASDAQ', 'asset_class': 'STOCK', 'contract_type': 'COMMON', 'currency': 'USD'}]\", \"assert get_symbols(['GOOGL'], 'NASDAQ', 'STOCK', 'COMMON', 'USD') == [{'ticker'... | {
"split": "train",
"index": 65604,
"acecode_id": "bigcode_python_fns_21943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a non-negative integer as input and returns a list of its individual digits in the same order. For example, if the input is 1234, the output should be [1, 2, 3, 4]. The function should handle integers from 0 to 2,147,483,647.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decompose_integer(0) == [0]\", \"assert decompose_integer(1) == [1]\", \"assert decompose_integer(9) == [9]\", \"assert decompose_integer(10) == [1, 0]\", \"assert decompose_integer(123) == [1, 2, 3]\", \"assert decompose_integer(4567) == [4, 5, 6, 7]\", \"a... | {
"split": "train",
"index": 65605,
"acecode_id": "evol_22329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of device entries, where each entry is represented as a dictionary containing the following fields: 'device_index', 'software_version', 'manufacturer', and 'serial_number'. Your task is to write a Python function called `extract_device_details(device_entrie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_device_details([]) == []\", \"assert extract_device_details([{'device_index': 1, 'software_version': '1.0', 'manufacturer': 'ABC Corp', 'serial_number': 'SN001'}]) == [{'device_index': 1, 'software_version': '1.0', 'manufacturer': 'ABC Corp', 'serial... | {
"split": "train",
"index": 65606,
"acecode_id": "oss_8067",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given that the function g(x) is defined as g(x) = f(-x), and you know the point (3, 2) lies on the graph of g, implement a function that determines the corresponding point on the graph of f based on the reflection property in the y-axis. Your function should return the point (x... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_reflected_point(3, 2) == (-3, 2)\", \"assert find_reflected_point(4, 5) == (-4, 5)\", \"assert find_reflected_point(0, 0) == (0, 0)\", \"assert find_reflected_point(5, -3) == (-5, -3)\", \"assert find_reflected_point(-1, 1) == (1, 1)\", \"assert find_re... | {
"split": "train",
"index": 65607,
"acecode_id": "evol_647",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of email objects and retrieves the subject lines of all emails in the list. Each email object is represented as a dictionary with the following keys: 'id' (string), 'subject' (string), and 'sender' (string). Your functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_email_subjects([{'id': '1', 'subject': 'Hello World', 'sender': 'example@example.com'}, {'id': '2', 'subject': 'Test Email', 'sender': 'test@test.com'}]) == ['Hello World', 'Test Email']\", \"assert get_email_subjects([{'id': '3', 'subject': 'Meeting Rem... | {
"split": "train",
"index": 65608,
"acecode_id": "bigcode_python_fns_389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the coordinates of four distinct points in a two-dimensional plane, represented as `p1`, `p2`, `p3`, and `p4`, write a function `is_square(p1, p2, p3, p4)` that returns `true` if these four points can form a square. Each point `pi` is defined by its coordinates `[xi, yi]`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_square([0,0], [1,1], [1,0], [0,1]) == True\", \"assert is_square([0,0], [1,1], [1,0], [0,12]) == False\", \"assert is_square([1,0], [-1,0], [0,1], [0,-1]) == True\", \"assert is_square([0,0], [0,1], [1,1], [1,0]) == True\", \"assert is_square([2,3], [3,2]... | {
"split": "train",
"index": 65609,
"acecode_id": "evol_19365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a list of colors for a series of nested polygons. Each polygon's color is determined by its number of sides, which ranges from 3 to 7. The function takes a list of colors and returns a list of colors corresponding to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_polygon_colors(['red', 'green', 'blue', 'yellow', 'purple']) == ['red', 'green', 'blue', 'yellow', 'purple']\", \"assert generate_polygon_colors(['red', 'green']) == ['red', 'green', 'red', 'green', 'red']\", \"assert generate_polygon_colors(['black... | {
"split": "train",
"index": 65610,
"acecode_id": "oss_19583",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a given text string based on specified color and bold attributes. Your function should take three parameters: a string `text`, a string `color`, and a boolean `bold`. The function should return a formatted string that represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_text('Hello, World!', 'green', True) == 'Bold Green: Hello, World!'\", \"assert format_text('Hello, World!', 'cyan', False) == 'Normal Cyan: Hello, World!'\", \"assert format_text('Error!', 'red', True) == 'Bold Red: Error!'\", \"assert format_text('S... | {
"split": "train",
"index": 65611,
"acecode_id": "bigcode_python_fns_27312",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sine_of_angles(angles: List[float]) -> List[float]` that takes a list of angles in degrees and returns a list of their corresponding sine values. The sine of an angle can be calculated using the formula: sine(angle) = sin(angle in radians), where angle in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sine_of_angles([0]) == [0.0]\", \"assert sine_of_angles([30]) == [0.49999999999999994]\", \"assert sine_of_angles([45]) == [0.7071067811865475]\", \"assert sine_of_angles([90]) == [1.0]\", \"assert sine_of_angles([-30]) == [-0.49999999999999994]\", \"assert ... | {
"split": "train",
"index": 65612,
"acecode_id": "bigcode_python_fns_41863",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing a game board with obstacles. The grid contains 0s for empty spaces and 2s for obstacles. Your task is to write a function that determines the shortest path from the top-left corner to the bottom-right corner of the grid, avoiding the obstacl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortestPath([[0, 2, 0], [0, 0, 0], [0, 2, 0]]) == 4\", \"assert shortestPath([[0, 0, 0], [2, 2, 0], [0, 0, 0]]) == 4\", \"assert shortestPath([[0]]) == 0\", \"assert shortestPath([[2, 2], [2, 0]]) == -1\", \"assert shortestPath([[0, 0, 0], [0, 0, 0], [0, 0,... | {
"split": "train",
"index": 65613,
"acecode_id": "oss_31556",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string `text` containing a sequence of words. Write a function `classifyContent(text: str) -> List[Dict[str, Union[str, float]]]` that classifies the content of the string into various categories based on predefined keywords. The classification should be based o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classifyContent('New advancements in AI technology are impressive.') == [{'category': 'Technology', 'confidence': 0.85}]\", \"assert classifyContent('The doctor gave me advice about my health.') == [{'category': 'Health', 'confidence': 0.80}]\", \"assert cla... | {
"split": "train",
"index": 65614,
"acecode_id": "bigcode_python_fns_19285",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given input string by removing any digits and returning a modified version of it. The function should ensure that the returned result is in lowercase and stripped of any leading or trailing whitespace. Implement the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_input(' Hello123 World! ') == 'hello world!'\", \"assert process_input('1234567890') == ''\", \"assert process_input('Leading Spaces ') == 'leading spaces'\", \"assert process_input('NoDigitsHere') == 'nodigitshere'\", \"assert process_input(' 45... | {
"split": "train",
"index": 65615,
"acecode_id": "oss_10104",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given three lists of integers: `image`, `target`, and `output`. Each list contains the pixel values of an image represented in a flattened format. Your task is to return a dictionary with three keys: 'Input image', 'Prediction', and 'Target'. Each key should map to a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tensorboard_image([255, 128, 64], [255, 128, 64], [128, 64, 32]) == {'Input image': [255, 128], 'Prediction': [128, 64], 'Target': [255, 128]}\", \"assert tensorboard_image([255], [255, 128], [128, 64, 32]) == {'Input image': [], 'Prediction': [128, 64], 'Ta... | {
"split": "train",
"index": 65616,
"acecode_id": "bigcode_python_fns_29838",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that manipulates a given URL to generate a new URL based on certain criteria. Your function should take a string representing a URL and return a modified URL based on the following rules: - If the input URL contains 'github.com', t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_url('https://github.com/user/repo') == 'https://github.com/user/repo/api'\", \"assert modify_url('github.com/user/repo') == 'github.com/user/repo/api'\", \"assert modify_url('http://example.com/page') == 'https://http://example.com/page'\", \"assert m... | {
"split": "train",
"index": 65617,
"acecode_id": "oss_27944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_playlist(name: str, owner: User) -> Playlist` that creates a new playlist for a user. The function should take the playlist name and the owner (a User object) as parameters. It should return the newly created Playlist object. Ensure that the playlis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_playlist('My Favorite Songs', User('user1', 'pass123', 'user1@example.com')).name == 'My Favorite Songs'\", \"assert create_playlist('Chill Vibes', User('user2', 'pass456', 'user2@example.com')).name == 'Chill Vibes'\", \"assert create_playlist('Worko... | {
"split": "train",
"index": 65618,
"acecode_id": "evol_14933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of importances and a max_features parameter, implement a function that returns the maximum number of features to be considered based on the following rules: If max_features is None, return the total number of features in the importances list. If max_features is an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_max_features([0.1, 0.2, 0.3], None) == 3\", \"assert check_max_features([0.5, 0.5, 0.5, 0.5], 2) == 2\", \"assert check_max_features([0.1, 0.4, 0.2, 0.3], 10) == 4\", \"assert check_max_features([0.5, 0.5], 0.5) == 1\", \"assert check_max_features([0.0... | {
"split": "train",
"index": 65619,
"acecode_id": "bigcode_python_fns_13734",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a simplified representation of a user table based on input lists. Implement a function `generate_user_table` that takes four parameters: a list of boolean values `is_open`, a list of unique user identifiers `signup`, a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_user_table([True], ['user1'], [], []) == [{'Active': '\\u2714\\ufe0f', 'UID': 'user1', 'Edit': None, 'Remove': None}]\", \"assert generate_user_table([False, True], ['user1', 'user2'], ['user1'], ['user1']) == [{'Active': None, 'UID': 'user1', 'Edit... | {
"split": "train",
"index": 65620,
"acecode_id": "bigcode_python_fns_47166",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fib(n)` that outputs the Fibonacci series up to the nth term. The Fibonacci sequence starts with 0, 1, and each subsequent number is the sum of the two preceding ones. The function should print the Fibonacci numbers in a single line, separated by spaces.\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(1) == '0 '\", \"assert fib(2) == '0 1 '\", \"assert fib(3) == '0 1 1 '\", \"assert fib(4) == '0 1 1 2 '\", \"assert fib(5) == '0 1 1 2 3 '\", \"assert fib(6) == '0 1 1 2 3 5 '\", \"assert fib(7) == '0 1 1 2 3 5 8 '\", \"assert fib(8) == '0 1 1 2 3 5 8 13... | {
"split": "train",
"index": 65621,
"acecode_id": "evol_20052",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration represented as a nested dictionary. Implement a function `get_config_value(config: dict, key_path: str) -> Union[dict, Any]` that takes in a configuration dictionary and a `key_path` in the form of a '/'-separated string. The function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config_value({'a': {'b': {'c': 1}}}, 'a/b/c') == 1\", \"assert get_config_value({'a': {'b': {'c': 1}}}, 'a/b') == {'c': 1}\", \"assert get_config_value({'a': {'b': {'c': 1}}}, 'a/x') == None\", \"assert get_config_value({'a': {'b': {'c': 1}}}, '') == {'a... | {
"split": "train",
"index": 65622,
"acecode_id": "bigcode_python_fns_35732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that sorts the array in ascending order using the quicksort algorithm. The function should take the array as input and return the sorted array as output.\nPlease reason step by step, then write a self-contained Python solution. G... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quicksort([3, 2, 1]) == [1, 2, 3]\", \"assert quicksort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert quicksort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert quicksort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert quicksort([3, 3, 2, 1, 1, 4]) ... | {
"split": "train",
"index": 65623,
"acecode_id": "bigcode_python_fns_43298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to handle message deletion in a chat application. The function should take in the following parameters: a message ID (id), a user ID (user_id) of the person attempting to delete the message, a target ID (target_id) of the message auth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_message_deletion('msg1', 'user1', 'user1', 72) == 'Message deleted successfully'\", \"assert handle_message_deletion('msg2', 'user1', 'user2', 72) == 'Unauthorized deletion attempt'\", \"assert handle_message_deletion('msg3', 'user2', 'user2', 72) == ... | {
"split": "train",
"index": 65624,
"acecode_id": "oss_19617",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dataset represented as a dictionary, construct a new setting based on the type of the dataset. The dataset will contain a single key which could either be 'color' or 'scalar'. If the key is 'color', return a string indicating that a ColorType setting has been created. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_daysetting_from_data({'color': 'red'}) == 'ColorType setting created.'\", \"assert make_daysetting_from_data({'scalar': 10}) == 'ScalarType setting created.'\", \"assert make_daysetting_from_data({'color': 'blue'}) == 'ColorType setting created.'\", \"a... | {
"split": "train",
"index": 65625,
"acecode_id": "bigcode_python_fns_4871",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple of integers, write a function in Python that reverses the order of elements in the tuple without using any built-in functions. Additionally, the function should raise an exception if any of the elements in the tuple are not integers. Implement the function with th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_tuple((1, 2, 3)) == (3, 2, 1)\", \"assert reverse_tuple((5, 4, 3, 2, 1)) == (1, 2, 3, 4, 5)\", \"assert reverse_tuple((10, 20, 30)) == (30, 20, 10)\", \"assert reverse_tuple((-1, -2, -3)) == (-3, -2, -1)\", \"assert reverse_tuple((0, 1, 2, 3)) == (3,... | {
"split": "train",
"index": 65626,
"acecode_id": "evol_19507",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a keyword suggestion system for a search application. The system takes a dictionary called `datum` and a `session_id` as input to retrieve a list of suggested keywords associated with that session. Each entry in the `datum` dictionary is structu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_suggested_keywords({'session_id_1': {'session_id': 'session_id_1', 'result': {'1': {'answer': 'keyword1\\\\nkeyword2\\\\nkeyword3'}}}}, 'session_id_1') == ['keyword1', 'keyword2', 'keyword3']\", \"assert get_suggested_keywords({'session_id_2': {'session_... | {
"split": "train",
"index": 65627,
"acecode_id": "oss_35729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes two arguments: start and end, which default to 3 and 25 respectively. The function should return a list of alternate numbers between the start and end range. Additionally, handle edge cases like negative numbers and non-integer input by ensuring tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_alternate_numbers(3, 25) == [3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25]\", \"assert print_alternate_numbers(2, 10) == [2, 4, 6, 8, 10]\", \"assert print_alternate_numbers(3.5, 25) == [3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25]\", \"assert print_alter... | {
"split": "train",
"index": 65628,
"acecode_id": "evol_12982",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a scoring system for a chat application. Write a function `set_score(channel: str, target_user: str, new_score: int) -> str` that updates the score of a user in a specified chat channel. The function should return a message indicating the outcom... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_score('general', 'Alice', 10) == \\\"Alice's score in general is now set to 10\\\"\", \"assert set_score('random', 'Alice', 5) == \\\"Alice doesn't exist in random\\\"\", \"assert set_score('general', 'Alice', 30) == \\\"Alice's score in general is now s... | {
"split": "train",
"index": 65629,
"acecode_id": "oss_32065",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a python function to calculate the factorial of a non-negative integer 'n'. The function should return an error message if the provided input is a negative number or a non-integer. Implement this in a single function called 'factorial'.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 65630,
"acecode_id": "evol_19998",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement the FibFib sequence function that computes the nth value in the FibFib sequence, which is defined as follows: fibfib(0) == 0, fibfib(1) == 0, fibfib(2) == 1. For n > 2, fibfib(n) = fibfib(n-1) + fibfib(n-2) + fibfib(n-3). For n < 0, fibfib(n) = fibfib(n+3) - fibfib(n+... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibfib(0) == 0\", \"assert fibfib(1) == 0\", \"assert fibfib(2) == 1\", \"assert fibfib(3) == 1\", \"assert fibfib(4) == 2\", \"assert fibfib(5) == 4\", \"assert fibfib(6) == 7\", \"assert fibfib(7) == 13\", \"assert fibfib(8) == 24\", \"assert fibfib(9) == ... | {
"split": "train",
"index": 65631,
"acecode_id": "evol_27291",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a series of parentheses, brackets, and curly braces. Your task is to write a function `isValidParenthesesOrder` that takes this string `s` as input and returns `true` if the order of parentheses is valid, and `false` otherwise. A valid order me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isValidParenthesesOrder('(())') == True\", \"assert isValidParenthesesOrder('(){}[]') == True\", \"assert isValidParenthesesOrder('{[}]') == False\", \"assert isValidParenthesesOrder('((()))') == True\", \"assert isValidParenthesesOrder('((())') == False\", ... | {
"split": "train",
"index": 65632,
"acecode_id": "oss_37252",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a transformation function that can apply a series of transformations to a 2D point (x, y). The transformations include translation, rotation, scaling, and skewing. Implement a function `transform_point` that takes the following parameters: `shiftX` (float), `shift... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_point(0.0, 0.0, 0.0, 0.0, 1.0) == (0.0, 0.0)\", \"assert transform_point(1.0, 1.0, 0.0, 0.0, 1.0) == (1.0, 1.0)\", \"assert transform_point(1.0, 1.0, 0.0, 0.0, 2.0) == (2.0, 2.0)\", \"assert transform_point(1.0, 1.0, 0.0, 0.0, 0.5) == (0.5, 0.5)\",... | {
"split": "train",
"index": 65633,
"acecode_id": "bigcode_python_fns_15115",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the behavior of a command-line tool for validating YANG data models. The function should take two parameters: `lint` (a boolean indicating whether to perform linting) and `debug_level` (an integer indicating the leve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_yang_model(True, 0) == 'pyang --lint 2>&1'\", \"assert validate_yang_model(True, 1) == 'pyang --lint 2>&1'\", \"assert validate_yang_model(True, 2) == 'pyang --lint 2>&1'\", \"assert validate_yang_model(False, 0) == 'pyang --ietf 2>&1'\", \"assert v... | {
"split": "train",
"index": 65634,
"acecode_id": "oss_21984",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a DNA sequence represented as a string and a list of adapter sequences. Each adapter sequence has a corresponding score. Your task is to implement a function that checks how many of the adapter sequences can be found at the left and right ends of the DNA sequence.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_adapters('CGCGCGC', [('CGC', 3)]) == {'left': ('CGC', 3, 0), 'right': ('CGC', 3, 4)}\", \"assert find_adapters('CGTACGTA', [('GTA', 6), ('TAC', 4)]) == {'left': 'no adapter', 'right': ('GTA', 6, 5)}\", \"assert find_adapters('ACGT', [('AC', 2), ('TG', 1... | {
"split": "train",
"index": 65635,
"acecode_id": "bigcode_python_fns_46946",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns a new list containing only the numbers that are odd from the original list. You should only include numbers that have a remainder of 1 when divided by 2. The function should filter out all even numbers from the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_odd_numbers([1, 2, 3, 4, 5, 6]) == [1, 3, 5]\", \"assert filter_odd_numbers([0, 2, 4, 6]) == []\", \"assert filter_odd_numbers([7, 8, 9, 10]) == [7, 9]\", \"assert filter_odd_numbers([-1, -2, -3, -4]) == [-1, -3]\", \"assert filter_odd_numbers([]) == ... | {
"split": "train",
"index": 65636,
"acecode_id": "evol_20314",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with estimating the average density of particles in a plasma system. Write a function `average_density(N_particles: float, N_grid: int, dx: float) -> float` that calculates the average density of particles per grid cell based on the following parameters: \n\n- `N... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_density(100.0, 10, 0.5) == 5.0\", \"assert average_density(200.0, 20, 1.0) == 10.0\", \"assert average_density(50.5, 5, 2.0) == 20.2\", \"assert average_density(0.0, 1, 1.0) == 0.0\", \"assert average_density(1.0, 1, 1.0) == 1.0\", \"assert average_d... | {
"split": "train",
"index": 65637,
"acecode_id": "bigcode_python_fns_1608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree, where each node has a value and may have a left and/or right child, write a function `diameterOfBinaryTree` that computes the diameter of the binary tree. The diameter is defined as the number of nodes on the longest path between any two nodes in the tree. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert diameterOfBinaryTree(TreeNode(1, TreeNode(2), TreeNode(3))) == 3\", \"assert diameterOfBinaryTree(TreeNode(1)) == 1\", \"assert diameterOfBinaryTree(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)), TreeNode(3, None, TreeNode(8)))) == 5\", \"assert diameter... | {
"split": "train",
"index": 65638,
"acecode_id": "oss_20861",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an integer array `nums`, where every element appears three times except for one element which appears exactly once, implement a function `singleNumber(nums)` that returns the single element. If the array does not meet the conditions (i.e., if its length is not `3n + 1` fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert singleNumber([2,2,3,2]) == 3\", \"assert singleNumber([0,1,0,1,0,1,99]) == 99\", \"assert singleNumber([1,1,1,2]) == 2\", \"assert singleNumber([1,2,2,2]) == 1\", \"assert singleNumber([3,3,3,4]) == 4\", \"assert singleNumber([5,5,5,6,6,6,7]) == 7\", \"asser... | {
"split": "train",
"index": 65639,
"acecode_id": "evol_14823",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that integrates multiple numerical datasets. The function should take a list of numerical values and an optional starting value as input. It should compute the sum of all the values in the list and add the starting value to it (if provide... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert integrate_values([1, 2, 3]) == 6\", \"assert integrate_values([10, 20, 30, 40]) == 100\", \"assert integrate_values([-1, -2, -3]) == -6\", \"assert integrate_values([]) == 0\", \"assert integrate_values([5.5, 4.5]) == 10.0\", \"assert integrate_values([1, 2,... | {
"split": "train",
"index": 65640,
"acecode_id": "bigcode_python_fns_47381",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `text`, determine if it contains any spam words. A spam word is defined as a word that can be altered using certain character substitutions: '@' can replace 'a', '!' can replace 'i', '0' can replace 'o', '3' can replace 'e', '€' can replace 'e', and '1' can repla... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_spam('This message is winning!') == True\", \"assert is_spam('Congratulations! You have won a prize.') == True\", \"assert is_spam('Get your free gift now!') == True\", \"assert is_spam('Free samples available for all.') == True\", \"assert is_spam('You a... | {
"split": "train",
"index": 65641,
"acecode_id": "evol_21897",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers `a` of length `n`. Your task is to write a function that calculates the median of the list. The median of a list of numbers is defined as follows: if the list has an odd number of elements, the median is the middle element. If the list has an ev... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_median([1, 3, 3, 6, 7, 8, 9]) == 6\", \"assert calculate_median([1, 2, 3, 4]) == 2.5\", \"assert calculate_median([5]) == 5.0\", \"assert calculate_median([1, 2]) == 1.5\", \"assert calculate_median([1, 2, 3]) == 2.0\", \"assert calculate_median([1... | {
"split": "train",
"index": 65642,
"acecode_id": "oss_9858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image file names (as strings) and their corresponding labels (as integers). Write a function `convert_to_tfrecord(split_name: str, files: List[str], labels: List[int]) -> List[str]` that simulates the conversion of these images into TFRecord format. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_tfrecord('train', ['image1.jpg', 'image2.png'], [0, 1]) == ['dataset_dir/train_image_0.tfrecord', 'dataset_dir/train_image_1.tfrecord']\", \"assert convert_to_tfrecord('test', ['image3.jpg', 'image4.png'], [0, 1]) == ['dataset_dir/test_image_0.tfr... | {
"split": "train",
"index": 65643,
"acecode_id": "bigcode_python_fns_9867",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of products, where each product is represented by a dictionary containing its name and a list of suppliers. Your task is to write a Python function that takes this list of products and performs the following operations: 1. Flatten the list of suppliers for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_suppliers([{'name': 'Product A', 'suppliers': ['Supplier 1', 'Supplier 2']}, {'name': 'Product B', 'suppliers': ['Supplier 2', 'Supplier 3']}]) == ['Supplier 1', 'Supplier 2', 'Supplier 3']\", \"assert get_unique_suppliers([{'name': 'Product C', '... | {
"split": "train",
"index": 65644,
"acecode_id": "oss_23441",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a log directory path and a log level (which can be an integer or a string), implement a function that validates the log directory path and checks if the log level is valid. A valid log directory path must not be empty and should not contain any illeg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_log_setup('/var/logs/myapp', 20) == (True, 'Log directory and log level are valid.')\", \"assert validate_log_setup('/var/logs/myapp', 'INFO') == (True, 'Log directory and log level are valid.')\", \"assert validate_log_setup('/var/logs/myapp', 15) ... | {
"split": "train",
"index": 65645,
"acecode_id": "bigcode_python_fns_42694",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with merging two URL rule parts represented as tuples. Each rule part can either be a tuple of tuples, where each inner tuple contains an integer and a string, or it can be `None`. Your function should merge these two rules based on the following conditions: If e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_url_rule(None, None) == None\", \"assert merge_url_rule(((1, 'a'),), None) == ((1, 'a'),)\", \"assert merge_url_rule(None, ((2, 'b'),)) == ((2, 'b'),)\", \"assert merge_url_rule(((1, 'a'),), ((0, 'dummy'), (2, 'b'))) == ((1, 'a'), (2, 'b'))\", \"assert... | {
"split": "train",
"index": 65646,
"acecode_id": "bigcode_python_fns_12842",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple represents a page with the following properties: (image_dpi, border_1, border_2, border_3, border_4, rotation_angle, crop_x1, crop_y1, crop_x2, crop_y2). Your task is to create a function `validate_pages(pages: List[Tuple[int, int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_pages([(300, 2918, 310, 224, 224, 0.0, 410, 2926, 2420, 3172), (300, 1752, 1753, 1239, 1239, 0.0, 1185, 1740, 1185, 1750)]) == True\", \"assert validate_pages([(300, 2916, 310, 224, 224, 0.0, 410, 2926, 2420, 3172), (300, 1752, 1753, 1239, 1239, 0.0... | {
"split": "train",
"index": 65647,
"acecode_id": "bigcode_python_fns_34435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples containing pairs of integers, write a function `remove_duplicates` that removes all duplicate tuples from the list while preserving the original order of the first occurrences. The function should return a new list containing only the unique tuples. For e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([(3,4), (1,2), (7,8), (5,6), (3,4), (8,9), (7,8)]) == [(3,4), (1,2), (7,8), (5,6), (8,9)]\", \"assert remove_duplicates([(1,1), (2,2), (1,1), (3,3), (2,2)]) == [(1,1), (2,2), (3,3)]\", \"assert remove_duplicates([(5,5), (5,5), (5,5)]) == [(... | {
"split": "train",
"index": 65648,
"acecode_id": "evol_29676",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, determine if it is a valid email address. A valid email address must contain exactly one '@' symbol, at least one '.' after the '@', and cannot start or end with the '@' symbol. Implement a function `is_valid_email(email: str) -> bool` that returns True if the e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('test@example.com') == True\", \"assert is_valid_email('invalid-email') == False\", \"assert is_valid_email('user@domain.co') == True\", \"assert is_valid_email('@missingusername.com') == False\", \"assert is_valid_email('username@.com') == Fa... | {
"split": "train",
"index": 65649,
"acecode_id": "bigcode_python_fns_28614",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of function names as strings. Your task is to determine if a specific function is visible based on its name. A function is considered visible if its name does not start with 'hidden_' and is not an empty string. Implement the function `is_function_visible(f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_function_visible(['func1', 'hidden_func', 'func2'], 'func1') == True\", \"assert is_function_visible(['hidden_func', 'func2'], 'hidden_func') == False\", \"assert is_function_visible(['func1', 'func2', 'func3'], 'func4') == False\", \"assert is_function_v... | {
"split": "train",
"index": 65650,
"acecode_id": "bigcode_python_fns_6329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function called `bubble_sort` that sorts the list in increasing order without using any built-in sorting functions. The function should take a single parameter, `list_1`, which is a list of integers, and return the sorted list.\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([5, 3, 8, 1, 2]) == [1, 2, 3, 5, 8]\", \"assert bubble_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert bubble_sort([4, 2, 7, 1]) == [1, 2, 4, 7]\", \"assert bubble_sort([2, 4, 1, 5, 7]) == [1, 2, 4, 5, 7]\", \"assert bubble_sort([1])... | {
"split": "train",
"index": 65651,
"acecode_id": "evol_6216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of channel names and a list of commands. Implement a function `toggle_auth` that takes in two parameters: `channels` (a list of strings representing channel names) and `commands` (a list of strings where each command is either 'enable' or 'disable'). The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toggle_auth(['channel1', 'channel2'], ['enable', 'disable']) == [True, False]\", \"assert toggle_auth(['channel1', 'channel2'], ['disable', 'enable']) == [False, True]\", \"assert toggle_auth(['channel1'], ['enable']) == [True]\", \"assert toggle_auth(['chan... | {
"split": "train",
"index": 65652,
"acecode_id": "bigcode_python_fns_28626",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given list of lowercase words into a list of encrypted strings using a Caesar cipher. Each letter in the word should be shifted three places down the alphabet. If the shift takes you past 'z', it should wrap around to the beginning of the al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert caesar_cipher(['apple']) == ['dssoh']\", \"assert caesar_cipher(['xyz']) == ['abc']\", \"assert caesar_cipher(['hello']) == ['khoor']\", \"assert caesar_cipher(['test']) == ['whvw']\", \"assert caesar_cipher(['python']) == ['sbwkrq']\", \"assert caesar_ciphe... | {
"split": "train",
"index": 65653,
"acecode_id": "evol_7737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are strings representing citations and the values are lists of strings. Your task is to create a function `format_resolution(resolution: Dict[str, List[str]]) -> Dict[str, List[str]]` that transforms this dictionary. Specifically, the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_resolution({'1 U.S. 1': ['1 U.S. 1', '1 U.S., at 2']}) == {'1 U.S. 1': ['1 U.S. 1', '1 U.S. 1', '1 U.S., at 2']}\", \"assert format_resolution({'2 U.S. 2': ['2 U.S. 2']}) == {'2 U.S. 2': ['2 U.S. 2', '2 U.S. 2']}\", \"assert format_resolution({'3 U.S.... | {
"split": "train",
"index": 65654,
"acecode_id": "bigcode_python_fns_45375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of actions available for different agents in an environment. Each agent can perform a certain number of actions, and you need to compute the total number of actions that can be performed by all agents combined. Implement ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_actions([1, 2, 3]) == 6\", \"assert total_actions([0, 0, 0]) == 0\", \"assert total_actions([5]) == 5\", \"assert total_actions([1, 1, 1, 1]) == 4\", \"assert total_actions([10, 20, 30]) == 60\", \"assert total_actions([100, 200, 300, 400]) == 1000\", ... | {
"split": "train",
"index": 65655,
"acecode_id": "bigcode_python_fns_18163",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of points in a 3D coordinate system, where each point is represented as a tuple (x, y, z), you need to determine which partition each point belongs to based on its distance from the origin. The points are partitioned into two categories: those that lie within a cer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert partition_points([(5, 5, 0), (5, -5, 0), (-5, 5, 0), (-5, -5, 0)]) == [0, 0, 0, 0]\", \"assert partition_points([(3, 3, 0), (4, 4, 0), (5, 5, 0)]) == [0, 0, 0]\", \"assert partition_points([(1, 1, 1), (2, 2, 2), (3, 3, 3)]) == [0, 0, 0]\", \"assert partition... | {
"split": "train",
"index": 65656,
"acecode_id": "bigcode_python_fns_31109",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple bank account. You need to implement a function `bank_account_operations(operations: List[Tuple[str, Union[str, int]]]) -> List[Union[str, int]]` that takes a list of operations on a bank account and returns a list of results. The operatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100), ('withdraw', 50), ('get_balance',)]) == [None, None, 50]\", \"assert bank_account_operations([('set_withdrawal_limit', 50), ('withdraw', 60), ('get_balance',)]) == [None, 'Withdrawal limit exceeded', 0]\", \"assert ... | {
"split": "train",
"index": 65657,
"acecode_id": "oss_24590",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `http_response_status(url: str) -> int` that takes in a URL as a string and returns the HTTP status code for that URL. The function should simulate the behavior of an HTTP request and return the following status codes based on the URL... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert http_response_status('http://example.com/404') == 404\", \"assert http_response_status('http://example.com/500') == 500\", \"assert http_response_status('http://example.com/200') == 200\", \"assert http_response_status('http://example.com/success') == 0\", \... | {
"split": "train",
"index": 65658,
"acecode_id": "bigcode_python_fns_347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a DNA sequence as a string `seq` and a substring `pattern`. Your task is to write a function that finds the starting positions of all the occurrences of the specified pattern within the DNA sequence. The function should return a list of starting positions (0-index... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pattern_positions('ACTGACTGACTG', 'ACT') == [0, 4, 8]\", \"assert find_pattern_positions('AAAAA', 'AA') == [0, 1, 2, 3]\", \"assert find_pattern_positions('TTTTTT', 'TT') == [0, 1, 2, 3, 4]\", \"assert find_pattern_positions('CGTACGT', 'CGT') == [0, 4]\... | {
"split": "train",
"index": 65659,
"acecode_id": "oss_22136",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `remove_shot_from_scene(scene: List[int], shot: List[int]) -> List[int]` that removes all integers in the `shot` list from the `scene` list. The function should return a new list that retains the original order of elements in the `scen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_shot_from_scene([1, 2, 3, 4, 5], [2, 4]) == [1, 3, 5]\", \"assert remove_shot_from_scene([1, 2, 2, 3], [2]) == [1, 3]\", \"assert remove_shot_from_scene([1, 1, 1, 1], [1]) == []\", \"assert remove_shot_from_scene([5, 6, 7, 8], [9]) == [5, 6, 7, 8]\", ... | {
"split": "train",
"index": 65660,
"acecode_id": "bigcode_python_fns_27869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `list1` and `list2`, write a function `to_dict(list1, list2)` that transforms the provided lists into a dictionary. In this dictionary, the elements from `list1` act as keys and the elements from `list2` act as values. If the lists are of unequal length, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_dict(['a', 'b', 'c'], [1, 2, 3]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert to_dict(['a', 'b', 'c', 'd'], [1, 2, 3]) == {'a': 1, 'b': 2, 'c': 3, 'd': None}\", \"assert to_dict(['a'], [1]) == {'a': 1}\", \"assert to_dict(['a', 'b'], [1]) == {'a': 1, 'b': None... | {
"split": "train",
"index": 65661,
"acecode_id": "evol_9937",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `karatsuba_poly_mult(poly1, poly2)` that multiplies two polynomials represented as lists of coefficients using the Karatsuba algorithm. The input polynomials `poly1` and `poly2` are lists of integers where the index represents the power of the variable, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert karatsuba_poly_mult([1], [1]) == [1]\", \"assert karatsuba_poly_mult([1, 2], [3, 4]) == [3, 10, 8]\", \"assert karatsuba_poly_mult([2, 1], [1, 2]) == [2, 5, 2]\", \"assert karatsuba_poly_mult([0, 1], [1, 0]) == [0, 1]\", \"assert karatsuba_poly_mult([1, 1], ... | {
"split": "train",
"index": 65662,
"acecode_id": "evol_10353",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `prime_log_dict()` that returns a dictionary. This dictionary should consist of keys that are prime numbers within the range of 1 to 50, and corresponding values that denote their associated logarithmic values (using natural logarithm).\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(prime_log_dict()) == 15\", \"assert 2 in prime_log_dict()\", \"assert 19 in prime_log_dict()\", \"assert 50 not in prime_log_dict()\", \"assert prime_log_dict()[5] == 1.6094379124341003\", \"assert prime_log_dict()[29] == 3.367295829986474\", \"assert pr... | {
"split": "train",
"index": 65663,
"acecode_id": "evol_25469",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a dice rolling game to achieve a target sum. The game involves rolling four six-sided dice multiple times to reach a specific target sum. Each roll of the dice produces a random number between 1 and 6, inclusive. Instead of simulating random rolls... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_game([5, 6, 7, 8, 4], 20) == 4\", \"assert simulate_game([3, 3, 3, 3, 3, 3], 15) == 5\", \"assert simulate_game([6, 5, 6, 5, 6], 25) == 5\", \"assert simulate_game([2, 3, 2, 5, 7], 15) == 5\", \"assert simulate_game([5, 5, 5, 5], 20) == 4\", \"asser... | {
"split": "train",
"index": 65664,
"acecode_id": "oss_1656",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that calculates the time required to cover a certain distance at a constant speed of 30 kilometers per hour. Your program should take an integer input representing the distance in kilometers (km) and then output the time required to cover ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_time(0) == '0 minutos'\", \"assert calculate_time(1) == '2 minutos'\", \"assert calculate_time(2) == '4 minutos'\", \"assert calculate_time(3) == '6 minutos'\", \"assert calculate_time(4) == '8 minutos'\", \"assert calculate_time(5) == '10 minutos'... | {
"split": "train",
"index": 65665,
"acecode_id": "oss_27613",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function named `trans_stop` that takes a single input parameter `value`. The function is expected to return a constant string 'RETURN' regardless of the input received. Implement this function. You do not need to consider the value of the input parameter, as it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trans_stop(1) == 'RETURN'\", \"assert trans_stop(0) == 'RETURN'\", \"assert trans_stop(-1) == 'RETURN'\", \"assert trans_stop('test') == 'RETURN'\", \"assert trans_stop([]) == 'RETURN'\", \"assert trans_stop([1, 2, 3]) == 'RETURN'\", \"assert trans_stop({}) ... | {
"split": "train",
"index": 65666,
"acecode_id": "bigcode_python_fns_9379",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `xvals` and `yvals`, and a boolean list `isGood`, write a function `filter_and_compute` that filters the `yvals` based on the corresponding values in `isGood` and computes the average of the filtered values. If no values are filtered, the function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_compute([1, 2, 3], [10, 20, 30], [True, False, True]) == 20.0\", \"assert filter_and_compute([5, 6, 7], [15, 25, 35], [False, True, False]) == 25.0\", \"assert filter_and_compute([0, 0, 0], [0, 0, 0], [True, True, True]) == 0.0\", \"assert filter_... | {
"split": "train",
"index": 65667,
"acecode_id": "bigcode_python_fns_41093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that returns all lucid numbers smaller than or equal to a given integer. A lucid number is defined as a number that is not a multiple of 3 or 5. The function should also handle erroneous inputs by returning an appropriate error message. The function signature i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lucid_numbers(10) == [1, 2, 4, 7, 8]\", \"assert lucid_numbers(0) == []\", \"assert lucid_numbers(3) == [1, 2]\", \"assert lucid_numbers(15) == [1, 2, 4, 7, 8, 11, 13, 14]\", \"assert lucid_numbers(5) == [1, 2, 4]\", \"assert lucid_numbers(20) == [1, 2, 4, 7... | {
"split": "train",
"index": 65668,
"acecode_id": "evol_7826",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing block device mappings for a virtual machine. Each dictionary contains the following keys: 'DeviceName', 'Ebs', where 'Ebs' itself is a dictionary that may contain the keys: 'Status', 'SnapshotId', 'VolumeSize', 'VolumeType', 'En... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_block_devices([]) == ''\", \"assert get_block_devices([{'DeviceName': 'dev/sda1', 'Ebs': {'Status': 'attached', 'SnapshotId': 'snap-12345678', 'VolumeSize': 8, 'VolumeType': 'gp2', 'Encrypted': True, 'DeleteOnTermination': True, 'AttachTime': '2022-01-01... | {
"split": "train",
"index": 65669,
"acecode_id": "bigcode_python_fns_6826",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_length_prime_or_composite(arr: List[int]) -> str` that takes an array of integers and returns 'prime' if the length of the array is a prime number, 'composite' if the length is a composite number, and 'neither' if the length is 0 or 1. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_length_prime_or_composite([]) == 'neither'\", \"assert is_length_prime_or_composite([1]) == 'neither'\", \"assert is_length_prime_or_composite([1, 2, 3]) == 'prime'\", \"assert is_length_prime_or_composite([1, 2, 3, 4]) == 'composite'\", \"assert is_lengt... | {
"split": "train",
"index": 65670,
"acecode_id": "evol_13145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building an encoder-decoder model for a machine translation system. Write a function `encdec_model` that takes in the following parameters: `input_shape` which is a tuple representing the shape of the input data, `output_sequence_length` which is an integer ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encdec_model((32, 32), 10, 1000, 1200) == 'Model with input shape (32, 32), output sequence length 10, English vocabulary size 1000, French vocabulary size 1200'\", \"assert encdec_model((64, 64), 20, 1500, 1800) == 'Model with input shape (64, 64), output s... | {
"split": "train",
"index": 65671,
"acecode_id": "bigcode_python_fns_19611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_secure_passphrase(length: int) -> str` that generates a random passphrase consisting of a mix of upper-case letters, lower-case letters, digits, and special symbols. The length of the passphrase should be specified by the `length` parameter. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_secure_passphrase(10) != ''\", \"assert len(generate_secure_passphrase(10)) == 10\", \"assert generate_secure_passphrase(15) != ''\", \"assert len(generate_secure_passphrase(15)) == 15\", \"assert generate_secure_passphrase(20) != ''\", \"assert len... | {
"split": "train",
"index": 65672,
"acecode_id": "evol_20540",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that compares two grayscale images represented as 2D arrays. Each array contains integer intensity values ranging from 0 to 255, and both images are guaranteed to have the same dimensions. Your function should return the percen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_images([[255, 0, 100], [50, 255, 200]], [[255, 0, 100], [50, 255, 200]]) == 100.0\", \"assert compare_images([[0, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 0, 0]]) == 100.0\", \"assert compare_images([[128, 128, 128], [128, 128, 128]], [[128, 128, 128], [12... | {
"split": "train",
"index": 65673,
"acecode_id": "oss_32945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a nested list representing a table where each inner list represents a row of data. Write a function that takes this nested list and a list of column indices as input, and returns a new nested list containing only the specified columns from each row of the original... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_columns([['ID', 'Name', 'Country', 'Salary'], ['001', 'Alice', 'USA', '60000'], ['002', 'Bob', 'UK', '55000'], ['003', 'Cathy', 'Australia', '70000']], [0, 2]) == [['ID', 'Country'], ['001', 'USA'], ['002', 'UK'], ['003', 'Australia']]\", \"assert ex... | {
"split": "train",
"index": 65674,
"acecode_id": "evol_10179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a mathematical expression represented as a string, implement a function `evaluate_expression(expr: str) -> float` that evaluates the expression and returns its numeric result. The expression can contain numbers, basic arithmetic operators (+, -, *, /), and parentheses for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('(1 + 2) * (3 + 4)') == 21.0\", \"assert evaluate_expression('2 * (3 + 4) / 2') == 7.0\", \"assert evaluate_expression('10 - 3 * (2 + 1)') == 1.0\", \"assert evaluate_expression('5 + (2 * 3) - 4') == 7.0\", \"assert evaluate_expression('8... | {
"split": "train",
"index": 65675,
"acecode_id": "bigcode_python_fns_18868",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an input list containing string representations of numbers, two range thresholds as low and high, and a digit limit. The function should filter the input list for valid numbers and numbers within the provided range. It should discard all invalid inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert improvised_filter(['24.5', '12', 'out_of_range'], 10, 30, 1) == 'Error: Invalid Input.'\", \"assert improvised_filter(['10.0', '20.0', '30.0'], 0, 30, 1) == [10.0, 20.0, 30.0]\", \"assert improvised_filter(['-10.0', '-5.0', '0.0'], -10, 0, 1) == [-10.0, -5.0... | {
"split": "train",
"index": 65676,
"acecode_id": "evol_26482",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified build system for a software project. Your function should determine whether a specified installation prefix is valid based on the presence of a '+python' flag in the build specifications. The function should take two parameters: 'sp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_installation(['+python'], '/usr/local') == True\", \"assert is_valid_installation(['+python', 'debug'], '/usr/local') == True\", \"assert is_valid_installation(['release'], '/opt/myapp') == False\", \"assert is_valid_installation([], '/opt/myapp') =... | {
"split": "train",
"index": 65677,
"acecode_id": "oss_17069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, implement a function that removes any duplicate words from the list and returns a new list containing only unique words in the order they first appeared. The function should ignore case when determining if words are duplicates. Write a function `remove_du... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert remove_duplicates(['Hello', 'world', 'hello', 'WORLD']) == ['Hello', 'world']\", \"assert remove_duplicates(['test', 'Test', 'TEST', 'test']) == ['test']\"... | {
"split": "train",
"index": 65678,
"acecode_id": "bigcode_python_fns_2021",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `stack_operations(operations: List[str]) -> List[int]` that simulates a stack using a series of operations. The input is a list of string commands representing operations on the stack. The operations can be: 'push x' to push an intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stack_operations(['push 1', 'push 2', 'top']) == [2]\", \"assert stack_operations(['push 5', 'push 10', 'pop', 'top']) == [5]\", \"assert stack_operations(['pop', 'top']) == [-1]\", \"assert stack_operations(['top']) == [-1]\", \"assert stack_operations(['pu... | {
"split": "train",
"index": 65679,
"acecode_id": "bigcode_python_fns_36437",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique integers from the input list, preserving their original order of first appearance. The input can contain negative numbers, zero, and positive numbers. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([4, 4, 4, 4]) == [4]\", \"assert unique_integers([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([]) == []\", \"assert unique_integers([-1, -2, -2, -3, -1, -4]) == [-1,... | {
"split": "train",
"index": 65680,
"acecode_id": "oss_15204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of students in a class. Your task is to implement a function that calculates the average score of the students. The average score should be rounded to two decimal places. If the list is empty, return 0.00. Write a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_score([100, 80, 90]) == 90.00\", \"assert calculate_average_score([50, 70, 80, 90]) == 72.50\", \"assert calculate_average_score([0, 0, 0]) == 0.00\", \"assert calculate_average_score([100]) == 100.00\", \"assert calculate_average_score([10... | {
"split": "train",
"index": 65681,
"acecode_id": "bigcode_python_fns_15264",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that returns the stringified version of a nested list. The stringified version should maintain the structure of the nested list, with each entry separated by a comma and enclosed in brackets []. The nested list can be of any depth and can contain mix... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stringify_list([1, [4, [6, [8]]]]) == '1, [4, [6, [8]]]'\", \"assert stringify_list(['car', 2.5, [1, 'bicycle']]) == \\\"'car', 2.5, [1, 'bicycle']\\\"\", \"assert stringify_list([1, 'hello', [3.14, 'world']]) == \\\"1, 'hello', [3.14, 'world']\\\"\", \"asse... | {
"split": "train",
"index": 65682,
"acecode_id": "evol_23556",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a user's permission to edit a coach's information. The function should take two parameters: a boolean `is_superuser` that indicates if the user has superuser privileges, and a string `action` that specifies the action t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_permission(True, 'edit') == 'You have permission to edit the coach.'\", \"assert validate_permission(False, 'edit') == 'Sorry, only the owners can do that.'\", \"assert validate_permission(True, 'delete') == 'You have permission to edit the coach.'\... | {
"split": "train",
"index": 65683,
"acecode_id": "bigcode_python_fns_25327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fetch_content(url: str) -> str` that mimics the behavior of an HTTP client by returning a predefined response based on the provided URL. The function should return the following responses for specific URLs: \n- For 'http://example.com', return 'Example Dom... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_content('http://example.com') == 'Example Domain'\", \"assert fetch_content('http://baidu.com') == 'Baidu Search'\", \"assert fetch_content('http://google.com') == 'Google Search'\", \"assert fetch_content('http://yahoo.com') == 'Not Found'\", \"assert... | {
"split": "train",
"index": 65684,
"acecode_id": "oss_1959",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_permutations(seq1: str, seq2: str) -> Tuple[bool, List[Union[Tuple[int, str], List[int]]]]` that determines if two given character sequences are permutations of one another. The function should return a tuple where the first element is a boolean value in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_permutations('listen', 'silent') == (True, [])\", \"assert check_permutations('abc', 'bca') == (True, [])\", \"assert check_permutations('a b c', 'c b a') == (True, [])\", \"assert check_permutations('123', '321') == (True, [])\", \"assert check_permut... | {
"split": "train",
"index": 65685,
"acecode_id": "evol_24790",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `cci_trend_analysis` that calculates the Commodity Channel Index (CCI) and identifies emerging trends based on a given list of financial data. The CCI is calculated using the formula: CCI = (Typical Price - N-period SMA of Typical Pri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cci_trend_analysis([{'High': 18, 'Low': 12, 'Close': 15}, {'High': 20, 'Low': 14, 'Close': 17}, {'High': 22, 'Low': 16, 'Close': 19}, {'High': 24, 'Low': 18, 'Close': 21}, {'High': 26, 'Low': 20, 'Close': 23}], 4) == ['None', 'None', 'None', 'None', 'None']\... | {
"split": "train",
"index": 65686,
"acecode_id": "oss_25550",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_sort(s: str) -> str` that sorts the substrings in the input string `s` based on the following criteria: (1) the ascending ASCII value of the characters in a case-insensitive manner, (2) the length of each substring, and (3) the character count in ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_sort('Hi') == 'Hi'\", \"assert custom_sort('A B C') == 'A B C'\", \"assert custom_sort('C B A') == 'A B C'\", \"assert custom_sort('Sorting is Fun') == 'Fun is Sorting'\", \"assert custom_sort('Python Java C++') == 'C++ Java Python'\", \"assert custom... | {
"split": "train",
"index": 65687,
"acecode_id": "evol_10913",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional grid composed of integer entities, implement a function that flattens the grid into a one-dimensional list. The function should take a list of lists as input and return a single list containing all the integers in the grid in the order they appear.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert flatten([[5, 6], [7, 8], [9]]) == [5, 6, 7, 8, 9]\", \"assert flatten([[0, 0], [0, 0]]) == [0, 0, 0, 0]\", \"assert flatten([[]]) == []\", \"assert flatten([[1]]) == [1]\", \"assert flatten([[1, 2], [3, 4... | {
"split": "train",
"index": 65688,
"acecode_id": "evol_25324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates logging a warning message when a specific signal is received. Your goal is to create a function called `log_warning` that takes two parameters: `signal_number` (an integer representing the signal number) and `message` (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_warning(15, 'got SIGTERM - exiting ...') == 'Warning: got SIGTERM - exiting ... (signal: 15)'\", \"assert log_warning(2, 'got SIGINT - interrupting ...') == 'Warning: got SIGINT - interrupting ... (signal: 2)'\", \"assert log_warning(9, 'got SIGKILL - te... | {
"split": "train",
"index": 65689,
"acecode_id": "oss_17482",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing metadata attributes of a package. Your task is to write a function `validate_metadata(metadata: Dict[str, Any]) -> bool` that checks whether all specified metadata attributes are present and are of type string. The required metadata attri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_metadata({'author': 'John Doe', 'contact': 'john@example.com', 'license': 'MIT', 'version': '1.0.0'}) == True\", \"assert validate_metadata({'author': 'Jane Doe', 'contact': 'jane@example.com', 'license': 'Apache', 'version': '2.0.0'}) == True\", \"... | {
"split": "train",
"index": 65690,
"acecode_id": "oss_32749",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing sample data. Your task is to implement a function `create_cartesian_product(data: List[int], colv: List[int]) -> List[Tuple[int, int]]` that returns the Cartesian product of the given list of sample data and a list of column values.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_cartesian_product([1, 2], [3, 4]) == [(1, 3), (1, 4), (2, 3), (2, 4)]\", \"assert create_cartesian_product([], [3, 4]) == []\", \"assert create_cartesian_product([1], [2]) == [(1, 2)]\", \"assert create_cartesian_product([0, 1], [0]) == [(0, 0), (1, 0... | {
"split": "train",
"index": 65691,
"acecode_id": "bigcode_python_fns_38308",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_final_price(price: float, cash_discount: float, percentage_discount: float) -> float` that calculates the final price after applying both cash and percentage discounts. The cash discount should be applied first, followed by the percentage discount on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_price(100, 5, 10) == 85.5\", \"assert calculate_final_price(200, 50, 20) == 120.0\", \"assert calculate_final_price(150, 0, 15) == 127.5\", \"assert calculate_final_price(250, 25, 30) == 157.5\", \"assert calculate_final_price(1000, 100, 10) ... | {
"split": "train",
"index": 65692,
"acecode_id": "evol_19481",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of distinct integers, implement a function that returns the median of the list. The median is defined as the middle value when the list is sorted. If the list has an even number of elements, the median is the average of the two middle numbers. If the list is empty,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([3, 7, 2, 1, 9]) == 3\", \"assert find_median([1, 2, 3, 4, 5]) == 3\", \"assert find_median([10, 20, 30, 40]) == 25\", \"assert find_median([5, 15, 25]) == 15\", \"assert find_median([100, 200, 300, 400, 500]) == 300\", \"assert find_median([]) =... | {
"split": "train",
"index": 65693,
"acecode_id": "evol_25562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `reverse_string` that takes a string as input and returns the reversed string. The function should handle all types of strings, including empty strings and strings with special characters. Your implementation should not use any external li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('world') == 'dlrow'\", \"assert reverse_string('') == ''\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$%') == '%$#@!'\", \"assert reverse_string('Python') == 'noht... | {
"split": "train",
"index": 65694,
"acecode_id": "oss_5733",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a data type string (such as 'FLOAT', 'INT16', etc.) into its corresponding integer representation based on a predefined mapping of data types. If the provided data type string does not exist in the mapping, the function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_data_type('FLOAT') == 1\", \"assert convert_data_type('INT16') == 2\", \"assert convert_data_type('INT32') == 3\", \"assert convert_data_type('DOUBLE') == 4\", \"assert convert_data_type('STRING') == 5\", \"assert convert_data_type('BOOL') == -1\", \... | {
"split": "train",
"index": 65695,
"acecode_id": "bigcode_python_fns_10938",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of integers and returns a new list containing only the even numbers from the input list. Implement the function `filter_even_numbers(nums: List[int]) -> List[int]` where `nums` is a list of integers. Your functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]... | {
"split": "train",
"index": 65696,
"acecode_id": "oss_11790",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path in a source directory. Your task is to convert this file path to a corresponding test directory path by replacing the prefix 'src/main/' with 'src/test/'. Additionally, the resulting path should retain the rest of the string uncha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_test_path('src/main/com/example/MyClass.java') == 'src/test/com/example/MyClass.java'\", \"assert convert_to_test_path('src/main/org/example/test/TestExample.java') == 'src/test/org/example/test/TestExample.java'\", \"assert convert_to_test_path('... | {
"split": "train",
"index": 65697,
"acecode_id": "bigcode_python_fns_25718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the pixel values of a grayscale image. Write a function `average_pixel_value(pixels: List[int]) -> float` that calculates and returns the average pixel value of the given list. The average should be calculated as the sum of all pixe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_pixel_value([255, 255, 255, 255]) == 255.0\", \"assert average_pixel_value([0, 0, 0, 0]) == 0.0\", \"assert average_pixel_value([100, 150, 200]) == 150.0\", \"assert average_pixel_value([10, 20, 30, 40, 50]) == 30.0\", \"assert average_pixel_value([1... | {
"split": "train",
"index": 65698,
"acecode_id": "bigcode_python_fns_28255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, denoted as `s` and `t`. Your objective is to determine if it is possible to transform `s` into `t` within `k` steps or fewer. During each step `ith` (1 <= i <= k), you can select any index `j` (1-indexed) from `s` to shift the character at that index ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_transform('input', 'ouput', 9) == True\", \"assert can_transform('aab', 'bbb', 27) == True\", \"assert can_transform('xyz', 'abc', 30) == True\", \"assert can_transform('aaa', 'bbb', 3) == True\", \"assert can_transform('a', 'b', 1) == True\", \"assert c... | {
"split": "train",
"index": 65699,
"acecode_id": "evol_25821",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.