data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given a list of segments that represent billing provider data, implement a function that checks if the billing provider's pay-to address loop (2010AB) exists in the data. If it does not exist, the function should create a new pay-to address loop and return the updated data. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_billing_provider({'loop_name': 'loop_2010a', 'billing_provider': {} }) == {'loop_name': 'loop_2010a', 'billing_provider': {'pay_to_address_loop': {'ref_segment': [], 'per_segment': []}}}\", \"assert update_billing_provider({'loop_name': 'loop_2010a', ... | {
"split": "train",
"index": 64300,
"acecode_id": "bigcode_python_fns_24139",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of floating point numbers called `distance_array` and a floating point number called `scale`. Your task is to implement a function that transforms the `distance_array` into a new array where each element is 1.0 if the corresponding element in `distance_ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uniform_decay([0.0, 0.25, 0.5, 0.75, 1.0], 1.0) == [1.0, 1.0, 1.0, 1.0, 1.0]\", \"assert uniform_decay([0.0, 1.0, 1.5, 2.0], 1.0) == [1.0, 1.0, 0.0, 0.0]\", \"assert uniform_decay([0.5, 0.2, 1.1, 3.0], 0.5) == [1.0, 1.0, 0.0, 0.0]\", \"assert uniform_decay([... | {
"split": "train",
"index": 64301,
"acecode_id": "bigcode_python_fns_2546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that adds an element to the beginning of a given tuple while preserving the original tuple. The function should only add the element if it is of the same data type as the elements in the tuple. If the new element is of a different data type, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_element_to_tuple((1, 2, 3), 0) == (0, 1, 2, 3)\", \"assert add_element_to_tuple(('a', 'b'), 'c') == ('c', 'a', 'b')\", \"assert add_element_to_tuple((1.1, 2.2), 3.3) == (3.3, 1.1, 2.2)\", \"assert add_element_to_tuple((True, False), True) == (True, True,... | {
"split": "train",
"index": 64302,
"acecode_id": "evol_9154",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `classify_number(num: int) -> str` that classifies a given integer `num` as 'prime', 'composite', or 'neither'. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. A composite number is a natur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_number(-1) == 'neither'\", \"assert classify_number(0) == 'neither'\", \"assert classify_number(1) == 'neither'\", \"assert classify_number(2) == 'prime'\", \"assert classify_number(3) == 'prime'\", \"assert classify_number(4) == 'composite'\", \"as... | {
"split": "train",
"index": 64303,
"acecode_id": "evol_19403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_cache_template(sources: List[str], grids: List[str], geopackage: str, table_name: str = 'tiles') -> Dict[str, Any]` that generates a cache template dictionary for an application configuration. The function should take the following p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cache_template(['None'], ['default', 'custom'], 'path/to/geopackage') == {'sources': [], 'cache': {'type': 'geopackage', 'filename': 'path/to/geopackage', 'table_name': 'tiles'}, 'grids': ['default'], 'format': 'mixed', 'request_format': 'image/png'}\", ... | {
"split": "train",
"index": 64304,
"acecode_id": "bigcode_python_fns_7661",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that writes a message to an output if a certain condition is met. The function, named `write_info`, should take a string input `text` and a boolean input `verbose`. If `verbose` is `True`, the function should return the string `text`, simulating... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_info('Hello, World!', True) == 'Hello, World!'\", \"assert write_info('Error occurred', True) == 'Error occurred'\", \"assert write_info('Status: OK', False) == ''\", \"assert write_info('Debugging mode', False) == ''\", \"assert write_info('This is a ... | {
"split": "train",
"index": 64305,
"acecode_id": "bigcode_python_fns_38914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_server_active(server: str, args_array: List[str], class_cfg: bool) -> bool` that checks if a server is active based on the following criteria: The server is considered active if the `server` string is not empty, the `args_array` list contains at least o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_server_active('server1', ['arg1', 'arg2'], True) == True\", \"assert is_server_active('server2', [], True) == False\", \"assert is_server_active('', ['arg1'], True) == False\", \"assert is_server_active('server3', ['arg1'], False) == False\", \"assert is_... | {
"split": "train",
"index": 64306,
"acecode_id": "bigcode_python_fns_46430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sales records, where each record is represented as a dictionary containing 'customer_id', 'product_category', and 'sales_amount'. Your task is to write a function `calculate_total_sales(sales_records, product_category)` that filters the sales records to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_sales([{'customer_id': 1, 'product_category': 'Electronics', 'sales_amount': 500}, {'customer_id': 2, 'product_category': 'Clothing', 'sales_amount': 300}], 'Electronics') == {1: 500}\", \"assert calculate_total_sales([{'customer_id': 1, 'pro... | {
"split": "train",
"index": 64307,
"acecode_id": "oss_18908",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a security key based on provided parameters. The function `generate_key(account_switch_key: str, key_type: str) -> str` should take two strings as input: `account_switch_key` and `key_type`. If the `account_switch_key` is p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_key('12345', 'typeA') == 'Key: 12345-typeA'\", \"assert generate_key('abcde', 'typeB') == 'Key: abcde-typeB'\", \"assert generate_key(None, 'typeC') == 'Key: typeC'\", \"assert generate_key('key123', 'typeX') == 'Key: key123-typeX'\", \"assert gener... | {
"split": "train",
"index": 64308,
"acecode_id": "bigcode_python_fns_19151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `process_numbers` that takes no parameters. The function should iterate from -10 to 10 (inclusive). For each negative number, multiply it by -2 and print the result. For each positive number, compute and print its factorial. Handle any exceptions tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers() == None\", \"assert process_numbers() == None\", \"assert process_numbers() == None\", \"assert process_numbers() == None\", \"assert process_numbers() == None\", \"assert process_numbers() == None\", \"assert process_numbers() == None\", \... | {
"split": "train",
"index": 64309,
"acecode_id": "evol_8389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the magnitudes of stars, write a function that returns a histogram of the frequencies of each unique magnitude. The histogram should be represented as a dictionary where the keys are the unique magnitudes and the values are their respective... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert histogram([1, 2, 2, 3, 3, 3]) == {1: 1, 2: 2, 3: 3}\", \"assert histogram([4, 5, 6, 4, 5]) == {4: 2, 5: 2, 6: 1}\", \"assert histogram([]) == {}\", \"assert histogram([7]) == {7: 1}\", \"assert histogram([10, 10, 10, 10]) == {10: 4}\", \"assert histogram([1,... | {
"split": "train",
"index": 64310,
"acecode_id": "bigcode_python_fns_10873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates moving files within a workspace. Given a list of file paths represented as strings and a target directory, your function should return a new list of file paths where all files have been moved to the target directory. A file... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_files(['file1.txt', 'file2.txt', 'invalid/file3.txt'], '/new_directory') == ['/new_directory/file1.txt', '/new_directory/file2.txt']\", \"assert move_files(['file1.txt', 'file2.doc', 'file3.pdf'], '/archive') == ['/archive/file1.txt', '/archive/file2.do... | {
"split": "train",
"index": 64311,
"acecode_id": "bigcode_python_fns_10231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `S` consisting of lowercase letters, implement a function `distinct_subseq_count(S: str) -> int` that calculates the total number of unique, non-empty subsequences that can be formed from `S`. The result should be returned modulo `10^9 + 7`. Note that the length ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distinct_subseq_count('abc') == 7\", \"assert distinct_subseq_count('aba') == 6\", \"assert distinct_subseq_count('aaa') == 3\", \"assert distinct_subseq_count('abcd') == 15\", \"assert distinct_subseq_count('a') == 1\", \"assert distinct_subseq_count('ab') ... | {
"split": "train",
"index": 64312,
"acecode_id": "evol_25393",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of job durations, write a function `is_starvation_free_policy(policy: str) -> bool` that determines if the specified job-scheduling policy is starvation-free. The function should accept a string representing the scheduling policy which could be one of the following... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_starvation_free_policy('round-robin') == True\", \"assert is_starvation_free_policy('priority queuing') == True\", \"assert is_starvation_free_policy('shortest job first') == False\", \"assert is_starvation_free_policy('youngest job first') == False\", \"... | {
"split": "train",
"index": 64313,
"acecode_id": "evol_10079",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that sorts the array in ascending order using the bubble sort algorithm. The function should take a list of integers as input and return the sorted list.\nPlease reason step by step, then write a self-contained Python solution. G... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([7, 4, 5, 10, 1]) == [1, 4, 5, 7, 10]\", \"assert bubble_sort([3, 2, 1]) == [1, 2, 3]\", \"assert bubble_sort([5, 3, 8, 4, 2]) == [2, 3, 4, 5, 8]\", \"assert bubble_sort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\", \"assert bubble_sort([1, 2, 3, 4, 5... | {
"split": "train",
"index": 64314,
"acecode_id": "evol_12058",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add_list_and_tuple(lst: List[int], tpl: Tuple[int]) -> List[int]` that takes a list of integers and a tuple of integers as input parameters. The function should return a new list containing the sum of elements at the same index from both the input list and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_list_and_tuple([1, 2, 3], (4, 5, 6)) == [5, 7, 9]\", \"assert add_list_and_tuple([0, 0, 0], (1, 1, 1)) == [1, 1, 1]\", \"assert add_list_and_tuple([10, 20, 30], (1, 2, 3)) == [11, 22, 33]\", \"assert add_list_and_tuple([-1, -2, -3], (1, 2, 3)) == [0, 0, ... | {
"split": "train",
"index": 64315,
"acecode_id": "evol_10762",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the dimensions of a rectangular image in the format [height, width]. Your task is to implement a function that resizes the image based on a target size for the shorter side and a maximum size for the longer side. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resize_image([500, 800], 200, 600) == ([200, 320], 0.4)\", \"assert resize_image([400, 400], 250, 500) == ([250, 250], 0.625)\", \"assert resize_image([300, 400], 150, 500) == ([150, 200], 0.5)\", \"assert resize_image([150, 300], 60, 600, 10) == ([60, 120],... | {
"split": "train",
"index": 64316,
"acecode_id": "bigcode_python_fns_14084",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function `check_and_reset_wifi()` that monitors a simulated network connectivity status and resets the Wi-Fi connection if the network becomes unreachable. The function should take a list of integers representing network statuses, where a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_and_reset_wifi([0, 0, 0]) == 'No action needed'\", \"assert check_and_reset_wifi([1, 0, 0]) == 'Wi-Fi reset'\", \"assert check_and_reset_wifi([0, 2, 0]) == 'Wi-Fi reset'\", \"assert check_and_reset_wifi([0, 0, 3]) == 'Wi-Fi reset'\", \"assert check_and... | {
"split": "train",
"index": 64317,
"acecode_id": "oss_20887",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of variants where each variant is represented as a dictionary containing its details (dbSNPid, chromosome, position, reference, alternate), and an additional dictionary representing the zygosities of three individuals (Proband, Mother, Father) for each variant, imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_variant_tsv([{'dbSNPid': 'rs123', 'chromosome': '1', 'position': 100, 'reference': 'A', 'alternate': 'G'}, {'dbSNPid': 'rs456', 'chromosome': '1', 'position': 200, 'reference': 'C', 'alternate': 'T'}], {'Proband': 'Heterozygous', 'Mother': 'Homozygo... | {
"split": "train",
"index": 64318,
"acecode_id": "bigcode_python_fns_36856",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_password` that generates a random password of a specified length. The password should be exactly 8 characters long and must include at least one uppercase letter, one lowercase letter, and one digit. The function should return the generated passwo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_password(8)) == 8\", \"assert any(c.islower() for c in generate_password(8))\", \"assert any(c.isupper() for c in generate_password(8))\", \"assert any(c.isdigit() for c in generate_password(8))\", \"assert all(c in 'abcdefghijklmnopqrstuvwxyzAB... | {
"split": "train",
"index": 64319,
"acecode_id": "evol_654",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that finds and returns any two distinct elements in the array whose sum equals a specified target number. If no such pair exists, return an empty list. The function should be defined as follows: def find_pair(arr: List[int], target: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pair([2, 3, 5, 6], 7) == [2, 5]\", \"assert find_pair([1, 2, 3, 4, 5], 9) == [4, 5]\", \"assert find_pair([10, 15, 3, 7], 17) == [10, 7]\", \"assert find_pair([1, 1, 1, 1], 2) == [1, 1]\", \"assert find_pair([-1, -2, -3, -4], -3) == [-1, -2]\", \"assert... | {
"split": "train",
"index": 64320,
"acecode_id": "evol_7204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function that generates a URL filter based on the provided parameters for filtering a list of entries. The function should accept a dictionary with the following keys: 'list_type', 'view_by', and 'order_by'. The expected output is a formatted URL ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_url_filter({'list_type': 'safelist', 'view_by': 'type1', 'order_by': 'name'}) == '?action=view&limit=20&offset=0&quarantineType=spam&orderDir=desc&viewBy=type1&orderBy=name'\", \"assert build_url_filter({'list_type': 'safelist', 'view_by': 'typeA', 'or... | {
"split": "train",
"index": 64321,
"acecode_id": "bigcode_python_fns_11159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the initial number 1504170715041707 and a modulus 4503599627370517, implement a function that computes the cumulative sum of all Eulercoins in the sequence defined by the recurrence relation N(n) = (N(n-1) + 1504170715041707) mod 4503599627370517. An element is considered... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert eulercoin_cumulative_sum() > 0\", \"assert eulercoin_cumulative_sum() < 4503599627370517\", \"assert eulercoin_cumulative_sum() != 8912517754604\", \"assert eulercoin_cumulative_sum() >= 1504170715041707\", \"assert eulercoin_cumulative_sum() % 2 == 1\", \"a... | {
"split": "train",
"index": 64322,
"acecode_id": "evol_29898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the motion of an object in a 3D space over a specified duration. Your function should take in the initial position coordinates (init_x, init_y, init_z), initial velocity components (velx, vely, velz), initial acceleration components (accx, accy, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_motion(0, 0, 0, 1, 1, 1, 0, 0, 0, 5) == [(0, 0.0, 0.0, 0.0), (1, 1.0, 1.0, 1.0), (2, 2.0, 2.0, 2.0), (3, 3.0, 3.0, 3.0), (4, 4.0, 4.0, 4.0), (5, 5.0, 5.0, 5.0)]\", \"assert simulate_motion(0, 0, 0, 0, 0, 0, 0, 0, 0, 3) == [(0, 0.0, 0.0, 0.0), (1, 0.... | {
"split": "train",
"index": 64323,
"acecode_id": "bigcode_python_fns_23867",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to verify if a grid of dots can fit within a specified screen size. The grid consists of dots arranged in rows and columns, and its size is determined by the number of dots. Each dot has a specific width and height, and there is a spe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_grid(5, 5, 2, 50, 50) == True\", \"assert is_valid_grid(3, 3, 1, 20, 20) == True\", \"assert is_valid_grid(10, 10, 5, 100, 100) == True\", \"assert is_valid_grid(4, 4, 2, 30, 30) == True\", \"assert is_valid_grid(2, 2, 1, 15, 15) == True\", \"assert... | {
"split": "train",
"index": 64324,
"acecode_id": "oss_8280",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to validate energy price data for a specific hourly period. The function should take the following inputs: \n- `data_first_hour`: A dictionary containing the energy price data for the first hour, with keys representing different ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_energy_prices({'tag1': 2.5, 'tag2': 3.0, 'tag3': 4.5, 'tag4': 5.1, 'tag5': 6.2, 'tag6': 7.0, 'tag7': 8.3, 'tag8': 9.4, 'tag9': 10.5, 'tag10': 11.6, 'tag11': 12.7, 'tag12': 13.8, 'tag13': 14.9, 'tag14': 15.0, 'tag15': 16.1, 'tag16': 17.2, 'tag17': 18... | {
"split": "train",
"index": 64325,
"acecode_id": "oss_24302",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a network packet filtering system. You need to create a function called `filter_packets` that processes a list of packets. Each packet is represented as a dictionary with keys 'src' and 'dst' for the source and destination IP addresses respectiv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_packets([{'src': '192.168.1.1', 'dst': '192.168.1.1'}]) == [{'src': '192.168.1.1', 'dst': '192.168.1.1'}]\", \"assert filter_packets([{'src': '10.0.0.1', 'dst': '10.0.0.1'}, {'src': '10.0.0.2', 'dst': '10.0.0.3'}]) == [{'src': '10.0.0.1', 'dst': '10.0... | {
"split": "train",
"index": 64326,
"acecode_id": "oss_15990",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a linked list with the following functionalities: Initialize the linked list, get the value of a node at a specific index, add a node at the head, add a node at the tail, add a node at a specific index, delete a node at a specific index, reverse the linked list, and sort... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert myLinkedList.get(0) == -1\", \"assert myLinkedList.get(3) == -1\", \"assert myLinkedList.get(4) == -1\"]}"
} | {
"split": "train",
"index": 64327,
"acecode_id": "evol_12307",
"num_tests": 3
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes an object as input and returns a dictionary containing the object's attributes as keys and their corresponding values. If the attribute is a method, the dictionary should contain the string 'method' as the value for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert object_attributes(Example('Alice', 25)) == {'name': 'Alice', 'age': 25, 'greet': 'method'}\", \"assert object_attributes(Example('Bob', 30)) == {'name': 'Bob', 'age': 30, 'greet': 'method'}\", \"assert object_attributes(Example('Charlie', 22)) == {'name': 'C... | {
"split": "train",
"index": 64328,
"acecode_id": "oss_27247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_sort(arr: List[Union[int, str]]) -> List[Union[int, str]]` that rearranges a given mixed list of alphanumeric data in lexicographic order. The list contains integers, uppercase letters, and lowercase letters. The sorting order should be as follows: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_sort(['Z', 'y', 2, 0, 'B', 1]) == [0, 1, 2, 'B', 'Z', 'y']\", \"assert custom_sort(['D', 4, 3, 'f', 2, 'E']) == [2, 3, 4, 'D', 'E', 'f']\", \"assert custom_sort(['a', 'B', 'c', 5, 4]) == [4, 5, 'B', 'a', 'c']\", \"assert custom_sort(['Z', 0, 'a', 'C',... | {
"split": "train",
"index": 64329,
"acecode_id": "evol_1149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionary entries where each entry contains two numeric fields: 'init_rot_error' and 'rot_error'. Your task is to implement a function `calculate_difference(entries)` that processes this list and computes the difference between 'init_rot_error' and 'rot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_difference([{'init_rot_error': 10, 'rot_error': 5}]) == [{'init_rot_error': 10, 'rot_error': 5, 'rot_error_diff': 5}]\", \"assert calculate_difference([{'init_rot_error': 15, 'rot_error': 8}]) == [{'init_rot_error': 15, 'rot_error': 8, 'rot_error_d... | {
"split": "train",
"index": 64330,
"acecode_id": "oss_24557",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the durations of various recordings in seconds. Your task is to implement a function `filter_recordings_within_duration_range(recordings: List[int], min_duration: int, max_duration: int) -> List[int]` that filters the given list to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_recordings_within_duration_range([30, 45, 60, 90], 30, 60) == [30, 45, 60]\", \"assert filter_recordings_within_duration_range([10, 20, 30], 25, 35) == [30]\", \"assert filter_recordings_within_duration_range([5, 15, 25, 35], 20, 30) == [25]\", \"asse... | {
"split": "train",
"index": 64331,
"acecode_id": "oss_15762",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_squares` that returns the sum of the squares of all the integers in the list. If the list is empty, return 0. The function should have the following signature: `def sum_of_squares(numbers: List[int]) -> int:`. The input list ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3]) == 14\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([0, 0, 0]) == 0\", \"assert sum_of_squares([]) == 0\", \"assert sum_of_squares([1, -1, 2, -2]) == 10\", \"assert sum_of_squares([4, 5, 6]) == 77\", \"as... | {
"split": "train",
"index": 64332,
"acecode_id": "bigcode_python_fns_18115",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of daily stock prices and a transaction fee, write a function that calculates the maximum profit you can achieve from buying and selling shares. You must buy a share before you can sell it, and you cannot sell on the same day you buy. The function should take in tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([10, 20, 30, 40, 50], 5) == 35\", \"assert max_profit([5, 1, 2, 3, 0, 6], 1) == 6\", \"assert max_profit([5, 4, 3, 2, 1], 1) == 0\", \"assert max_profit([10, 5, 20, 15, 25], 5) == 15\", \"assert max_profit([100, 90, 80, 70], 10) == 0\", \"assert m... | {
"split": "train",
"index": 64333,
"acecode_id": "evol_18963",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a greeting message for a team. Implement a function named `generate_greeting` that takes no parameters and returns a string. The returned string should be \"hello mates!\".\nPlease reason step by step, then write a self-con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_greeting() == 'hello mates!'\", \"assert generate_greeting() == 'hello mates!'\", \"assert generate_greeting() == 'hello mates!'\", \"assert generate_greeting() == 'hello mates!'\", \"assert generate_greeting() == 'hello mates!'\", \"assert generate... | {
"split": "train",
"index": 64334,
"acecode_id": "oss_8706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a given year is a leap year. A year is considered a leap year if it is divisible by 4, but not divisible by 100, unless it is also divisible by 400. Your function should take an integer year as input and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_leap_year(2020) == True\", \"assert is_leap_year(2021) == False\", \"assert is_leap_year(1900) == False\", \"assert is_leap_year(2000) == True\", \"assert is_leap_year(2016) == True\", \"assert is_leap_year(2024) == True\", \"assert is_leap_year(2100) == ... | {
"split": "train",
"index": 64335,
"acecode_id": "oss_19853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical quantities, implement a function that calculates the maximum, minimum, and arithmetic mean of the list. The function should handle the case where the list is empty by returning 'Error: Empty List'. You need to implement one function called `max_min_avg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_min_avg([]) == 'Error: Empty List'\", \"assert max_min_avg([10]) == (10, 10, 10.0)\", \"assert max_min_avg([-10, -20, -30]) == (-10, -30, -20.0)\", \"assert max_min_avg([0, 0, 0]) == (0, 0, 0.0)\", \"assert max_min_avg([1, 2, 3, 4, 5]) == (5, 1, 3.0)\", ... | {
"split": "train",
"index": 64336,
"acecode_id": "evol_21847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the results of a network service test. Your task is to implement a function `countPassingTests(tests: List[int]) -> int` that returns the number of tests that passed. A test is considered passing if its result is greater than or equ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countPassingTests([-1, 0, 1, 2, -3]) == 3\", \"assert countPassingTests([-5, -2, 0, 3, 4]) == 3\", \"assert countPassingTests([1, 2, 3, 4, 5]) == 5\", \"assert countPassingTests([-10, -20, -30]) == 0\", \"assert countPassingTests([0]) == 1\", \"assert countP... | {
"split": "train",
"index": 64337,
"acecode_id": "bigcode_python_fns_35219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of email addresses, write a function `filter_valid_emails(email_list: List[str]) -> List[str]` that filters out invalid email addresses and returns a list of valid email addresses. An email address is considered valid if it follows the standard format: it contains ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_valid_emails(['test@example.com', 'invalid-email', 'user@domain.com']) == ['test@example.com', 'user@domain.com']\", \"assert filter_valid_emails(['example@domain.com', 'hello@world.com', 'foo@bar.baz']) == ['example@domain.com', 'hello@world.com', 'f... | {
"split": "train",
"index": 64338,
"acecode_id": "bigcode_python_fns_28682",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a string `enc_mes` consisting of digits, where each digit represents a letter (1-26 corresponds to 'A'-'Z'). Your task is to determine the total number of ways to decode the given string into letters. A valid encoding must not start with '0', and the characters '1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert num_decodings('226') == 3\", \"assert num_decodings('12') == 2\", \"assert num_decodings('1') == 1\", \"assert num_decodings('0') == 0\", \"assert num_decodings('10') == 1\", \"assert num_decodings('20') == 1\", \"assert num_decodings('27') == 1\", \"assert ... | {
"split": "train",
"index": 64339,
"acecode_id": "bigcode_python_fns_13368",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that summarizes a collection of items. The function should take two parameters: an integer 'count' representing the number of items and a string 'value' representing the value of the collection. The function should return a string that su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_summary(5, 'apples') == 'Summary: Count - 5, Value - apples'\", \"assert get_summary(0, 'none') == 'Summary: Count - 0, Value - none'\", \"assert get_summary(10, 'oranges') == 'Summary: Count - 10, Value - oranges'\", \"assert get_summary(1, 'banana') ==... | {
"split": "train",
"index": 64340,
"acecode_id": "oss_8780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates sending messages to an event hub. The function is called `send_message_to_event_hub`. It takes two parameters: `message` (a string) and `event_hub_name` (a string). Your goal is to implement the function such that it return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message_to_event_hub('Hello, World!', 'my_event_hub') == 'Message sent to my_event_hub: Hello, World!'\", \"assert send_message_to_event_hub('Test message', 'event_hub_1') == 'Message sent to event_hub_1: Test message'\", \"assert send_message_to_event_... | {
"split": "train",
"index": 64341,
"acecode_id": "oss_27875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the mean salary and the number of office assistants in two different locations. Write a function that calculates the overall mean salary for all office assistants across both locations. The function should take four parameters: mean_salary_loc1 (the mean salary in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert overall_mean_salary(70000, 0, 80000, 10) == 80000.0\", \"assert overall_mean_salary(0, 5, 40000, 5) == 20000.0\", \"assert overall_mean_salary(30000, 4, 30000, 6) == 30000.0\", \"assert overall_mean_salary(45000, 8, 55000, 2) == 47000.0\", \"assert overall_m... | {
"split": "train",
"index": 64342,
"acecode_id": "evol_28209",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs the NOR operation on two binary digits. The function should take two binary integers, x and y, where each can either be 0 or 1, and return the result of the NOR operation. The NOR operation is defined as the negation of the logical OR of the t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nor_op(0, 0) == 1\", \"assert nor_op(0, 1) == 0\", \"assert nor_op(1, 0) == 0\", \"assert nor_op(1, 1) == 0\", \"assert nor_op(0, 0) == 1\", \"assert nor_op(1, 1) == 0\", \"assert nor_op(0, 1) == 0\", \"assert nor_op(1, 0) == 0\", \"assert nor_op(0, 0) == 1\... | {
"split": "train",
"index": 64343,
"acecode_id": "evol_26296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that returns a dictionary containing the characters that appear most frequently in the string, along with their respective counts. The function should ignore spaces and be case insensitive. If the input is not a string, the function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert(robust_histogram('A B C 1 @') == {'a': 1, 'b': 1, 'c': 1, '1': 1, '@': 1})\", \"assert(robust_histogram('1 3 B B b A ! ! i !') == {'b': 3, '!': 3})\", \"assert(robust_histogram('') == {})\", \"assert(robust_histogram(123) == None)\", \"assert(robust_histogra... | {
"split": "train",
"index": 64344,
"acecode_id": "evol_26093",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> int` that calculates the Fibonacci number at the Nth term, where N is a non-negative integer. The Fibonacci sequence is defined as follows: Fibonacci(0) = 0, Fibonacci(1) = 1, and Fibonacci(n) = Fibonacci(n-1) + Fibonacci(n-2) for n >=... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 64345,
"acecode_id": "evol_5521",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of cards that a player has in their hand and the state of the game including previously played cards, the trump suit (atout), and the opening color. Your task is to implement a function that determines which cards can be played based on the game's rules. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canPlay({'cards_played': [], 'remaining_cards': [{'card_name': 'As', 'value_non_atout': 0, 'value_atout': 0, 'id': 'A'}], 'opening_color': 's', 'atout': 'c'}) == [{'card_name': 'As', 'value_non_atout': 0, 'value_atout': 0, 'id': 'A'}]\", \"assert canPlay({'c... | {
"split": "train",
"index": 64346,
"acecode_id": "bigcode_python_fns_11951",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of fluid moduli and their corresponding volume fractions for a porous rock material. Your task is to calculate the effective bulk modulus (ksat) of the saturated rock based on the given fluid properties. The effective bulk modulus can be computed using the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_effective_bulk_modulus([10, 20], [0.3]) == 10 * 0.3 + 20 * 0.7\", \"assert calculate_effective_bulk_modulus([5, 15, 25], [0.2, 0.3]) == 5 * 0.2 + 15 * 0.3 + 25 * 0.5\", \"assert calculate_effective_bulk_modulus([100, 200, 300], [0.1, 0.4]) == 100 *... | {
"split": "train",
"index": 64347,
"acecode_id": "bigcode_python_fns_47957",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python to simulate two rounds of shuffling on an array. In the first round, divide the array into two equal halves (or nearly equal if the array's length is odd), then interleave elements from each half back into the array such that the first element is from... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shuffle_array([1, 2, 3, 4, 5, 6]) != [1, 2, 3, 4, 5, 6]\", \"assert shuffle_array([]) == []\", \"assert shuffle_array([1, 2, 3, 4]) != [1, 2, 3, 4]\", \"assert shuffle_array([1, 2, 3, 4, 5, 6]) != [1, 2, 3, 4, 5, 6]\", \"assert shuffle_array([1, 2, 3, 4, 5, ... | {
"split": "train",
"index": 64348,
"acecode_id": "evol_24957",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a class named `Ticket` which will represent a support ticket in a helpdesk system. The `Ticket` class should have the following attributes: `name`, `email`, `category`, `content`, `status`, `ip_address`, and `user_agent`. The `status` attribute shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Ticket('John Doe', 'john.doe@example.com', 'Technical', 'Need help with my account.', 'Open', '192.168.1.1', 'Mozilla/5.0').is_valid_email() == True\", \"assert Ticket('Jane Doe', 'jane.doe@invalid', 'Billing', 'Question about my bill.', 'In Progress', '192.... | {
"split": "train",
"index": 64349,
"acecode_id": "oss_32200",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a monetary value and calculates a summary based on specified percentage increases and decreases. The function should accept three parameters: a monetary value `valor`, an increase percentage `aumento`, and a decrease percentage... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_summary(1000, 10, 5) == {'valor_original': 'R$1.000,00', 'aumento': 'R$100,00', 'reducao': 'R$50,00', 'dobro': 'R$2.000,00'}\", \"assert calculate_summary(1500, 20, 10) == {'valor_original': 'R$1.500,00', 'aumento': 'R$300,00', 'reducao': 'R$150,00... | {
"split": "train",
"index": 64350,
"acecode_id": "oss_2376",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a GitHub repository's star rating and logging level. The function should accept two parameters: `stars` (an integer) representing the number of stars for the repository and `log_level` (a string) represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repository_status(100, 'DEBUG') == 'Repository has 100 stars and log level is DEBUG.'\", \"assert repository_status(0, 'INFO') == 'Repository has 0 stars and log level is INFO.'\", \"assert repository_status(50, 'WARNING') == 'Repository has 50 stars and log... | {
"split": "train",
"index": 64351,
"acecode_id": "oss_4498",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Define the sequence a(n) as the number of adjacent pairs of zeros in the binary expansion of n (possibly overlapping). For instance, a(2) = a(10_2) = 0, a(3) = a(11_2) = 0, and a(4) = a(100_2) = 1. Implement a function `count_adjacent_zero_pairs(n: int) -> int` that returns the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_adjacent_zero_pairs(0) == 0\", \"assert count_adjacent_zero_pairs(1) == 0\", \"assert count_adjacent_zero_pairs(2) == 0\", \"assert count_adjacent_zero_pairs(3) == 0\", \"assert count_adjacent_zero_pairs(4) == 1\", \"assert count_adjacent_zero_pairs(5)... | {
"split": "train",
"index": 64352,
"acecode_id": "evol_4156",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple celestial being manager. Implement a function `create_angel_info(name: str, power: str) -> str` that takes in the `name` and `power` of an angel and returns a formatted string containing the angel's information. The format of the returned s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_angel_info('Gabriel', 'Wisdom') == 'Angel Name: Gabriel, Power: Wisdom'\", \"assert create_angel_info('Michael', 'Protection') == 'Angel Name: Michael, Power: Protection'\", \"assert create_angel_info('Raphael', 'Healing') == 'Angel Name: Raphael, Pow... | {
"split": "train",
"index": 64353,
"acecode_id": "oss_35864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, a and b. Your task is to implement a function that returns their sum. The function should take two parameters, both of which are integers. The output should be a single integer that represents the sum of the two input integers. Please implement the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_two_numbers(1, 2) == 3\", \"assert add_two_numbers(0, 0) == 0\", \"assert add_two_numbers(-1, 1) == 0\", \"assert add_two_numbers(-5, -5) == -10\", \"assert add_two_numbers(100, 200) == 300\", \"assert add_two_numbers(50, 50) == 100\", \"assert add_two_n... | {
"split": "train",
"index": 64354,
"acecode_id": "oss_26924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and returns a new string where all instances of the word 'error' are replaced with 'success'. The function should be case-insensitive, meaning it should replace 'Error', 'ERROR', 'eRrOr', etc., with 'success'.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_error_with_success('There was an error in the system.') == 'There was an success in the system.'\", \"assert replace_error_with_success('This is an ERROR message.') == 'This is an success message.'\", \"assert replace_error_with_success('No issues fo... | {
"split": "train",
"index": 64355,
"acecode_id": "bigcode_python_fns_961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary contains information about a person's details, including their name, age, and occupation. Your task is to implement a function that takes this list of dictionaries and returns a list of lists, where each inner list cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_person_data([{'name': 'Alice', 'age': 30, 'occupation': 'Engineer'}, {'name': 'Bob', 'age': 25, 'occupation': 'Designer'}, {'name': 'Alice', 'age': 30, 'occupation': 'Engineer'}]) == [['Alice', 30, 'Engineer'], ['Bob', 25, 'Designer']]\", \"assert ... | {
"split": "train",
"index": 64356,
"acecode_id": "bigcode_python_fns_16538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of tuples representing medical specialties and their corresponding abbreviations. Each tuple contains two elements: the full name of the medical specialty and its abbreviation. Your function should return a dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_specialty_dictionary([('Emergency Medicine Specialists', 'EMS'), ('Allergists/Immunologists', 'AI'), ('Cardiologists', 'C'), ('Dermatologists', 'D'), ('Endocrinologists', 'E'), ('Gastroenterologists', 'G'), ('Hematologists', 'H'), ('Nephrologists', 'N... | {
"split": "train",
"index": 64357,
"acecode_id": "oss_19700",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the interactions between users on a social media platform. The function should take a list of interactions in the format of tuples, where each tuple contains two usernames and a type of interaction (e.g., 'retweet', 'quote'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_interactions([('user1', 'user2', 'retweet'), ('user2', 'user1', 'reply')]) == {('user1', 'user2'): 1, ('user2', 'user1'): 1}\", \"assert user_interactions([('user1', 'user2', 'quote'), ('user1', 'user2', 'reply'), ('user1', 'user3', 'retweet')]) == {('u... | {
"split": "train",
"index": 64358,
"acecode_id": "oss_11760",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the factorial of a given non-negative integer using recursion. The function should raise a ValueError if the input is a negative number. The factorial of a number n is defined as the product of all positive integers less than or equal to n, ... | 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": 64359,
"acecode_id": "evol_10781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a class representing a Kangaroo that inherits from a Mammal class. The Mammal class should encapsulate properties such as species, weight, and lifespan. The Kangaroo class should have additional properties for pocket strength (the weight it can ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Kangaroo('Kangaroo', 200, 8, 10, 15)._species == 'Kangaroo'\", \"assert Kangaroo('Kangaroo', 200, 8, 10, 15)._weight == 200\", \"assert Kangaroo('Kangaroo', 200, 8, 10, 15)._lifespan == 8\", \"assert Kangaroo('Kangaroo', 200, 8, 10, 15)._pocket_strength == 1... | {
"split": "train",
"index": 64360,
"acecode_id": "evol_10062",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a configuration dictionary for data extraction. The function should take in a configuration dictionary and return a list of formatted strings that summarize the variables to be processed. Each entry in the list should i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_configuration({'cmor_table': {}, 'attributes': {'tier': '1', 'dataset_id': 'dataset_x'}, 'variables': {'var1': {'file': 'file1.txt', 'mip': 'A1', 'raw': 'raw_var1', 'iTr': 0}, 'var2': {'file': 'file2.txt', 'mip': 'A2', 'raw': 'raw_var2', 'iTr': 1}}})... | {
"split": "train",
"index": 64361,
"acecode_id": "bigcode_python_fns_22693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function to find the sum of the largest contiguous sublist. The list may contain both positive and negative integers. The function should return the sum of this sublist as a single integer.\nPlease reason step by step, then write a self-contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_sublist_sum([-2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert max_sublist_sum([1]) == 1\", \"assert max_sublist_sum([5,4,-1,7,8]) == 23\", \"assert max_sublist_sum([-1,-2,-3,-4]) == -1\", \"assert max_sublist_sum([2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert max_subl... | {
"split": "train",
"index": 64362,
"acecode_id": "evol_11824",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that swaps the first and second characters of the string. If the string has fewer than two characters, return it unchanged. The function should return the modified string.\nPlease reason step by step, then write a self-contained Python solution.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_chars('A') == 'A'\", \"assert swap_chars('AB') == 'BA'\", \"assert swap_chars('') == ''\", \"assert swap_chars('Hello') == 'eHllo'\", \"assert swap_chars('cat') == 'act'\", \"assert swap_chars('') == ''\", \"assert swap_chars('xy') == 'yx'\", \"assert s... | {
"split": "train",
"index": 64363,
"acecode_id": "evol_15266",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing commands for a list of devices based on their command responses. Each device is represented as a dictionary containing a unique device UUID and a nested dictionary of command responses. Your goal is to implement a function `process_commands(token:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands('token1', 'task1', ['command1', 'command2']) == [('device1', 'command1')]\", \"assert process_commands('token1', 'task1', ['command3']) == [('device2', 'command3')]\", \"assert process_commands('token1', 'task1', []) == []\", \"assert proces... | {
"split": "train",
"index": 64364,
"acecode_id": "oss_34093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that renders a template with a given context. The function should take in a string `template` representing the template name and a dictionary `context` that contains variables to be used within the template. The function should return a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_to_string('Hello, {{ name }}!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert render_to_string('Goodbye, {{ friend }}!', {'friend': 'Bob'}) == 'Goodbye, Bob!'\", \"assert render_to_string('The sky is {{ color }}.', {'color': 'blue'}) == 'The sky i... | {
"split": "train",
"index": 64365,
"acecode_id": "bigcode_python_fns_3857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of figure titles from a matplotlib figure, where each figure can contain multiple subplots. Your task is to write a function that returns the main title (or the first title) of the figure. The main title is defined as the first element of the list of titles... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_main_title(['My Figure Title', 'Subplot 1 Title']) == 'My Figure Title'\", \"assert get_main_title(['First Title', 'Second Title', 'Third Title']) == 'First Title'\", \"assert get_main_title(['Only Title']) == 'Only Title'\", \"assert get_main_title([]) ... | {
"split": "train",
"index": 64366,
"acecode_id": "bigcode_python_fns_37528",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves identifiers from a given API endpoint. The function, named `get_identifiers`, takes a single parameter: `base_url`, which is a string representing the base URL of the API. The function should handle potential errors and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_identifiers('https://api.example.com') == None\", \"assert get_identifiers('https://api.example.com') == None\", \"assert get_identifiers('https://api.example.com') == None\", \"assert get_identifiers('https://api.example.com') == None\", \"assert get_id... | {
"split": "train",
"index": 64367,
"acecode_id": "oss_24993",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing an event handling logic for a multiplayer online game involving a traitor player. You need to create a function `handle_turn_event(traitor: str, did_something: bool, phase: str, game_phases: List[str]) -> Tuple[bool, bool]` that simulates the tr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_turn_event('traitor1', True, 'phase1', ['phase1', 'phase2']) == (True, True)\", \"assert handle_turn_event('traitor1', True, 'phase3', ['phase1', 'phase2']) == (False, True)\", \"assert handle_turn_event('traitor2', False, 'phase1', ['phase1', 'phase2... | {
"split": "train",
"index": 64368,
"acecode_id": "oss_17396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers that represent the ages of a group of people. Your task is to implement a function that determines if any two people in the group have the same age. If there are any duplicates, return True; otherwise, return False. Please write a function named... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_duplicate_ages([1, 2, 3, 4, 5]) == False\", \"assert has_duplicate_ages([1, 2, 3, 4, 5, 2]) == True\", \"assert has_duplicate_ages([10, 20, 30, 40, 50]) == False\", \"assert has_duplicate_ages([10, 20, 30, 20, 50]) == True\", \"assert has_duplicate_ages(... | {
"split": "train",
"index": 64369,
"acecode_id": "bigcode_python_fns_40851",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `sanitize_email` that takes an email address as a string input and returns a sanitized version of that email address. The sanitized version should be in lower-case and should have leading and trailing whitespaces removed. For example, if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sanitize_email(' MyEmailAddress@example.com ') == 'myemailaddress@example.com'\", \"assert sanitize_email(' USER@EXAMPLE.COM ') == 'user@example.com'\", \"assert sanitize_email(' example@domain.com ') == 'example@domain.com'\", \"assert sanitize_email(... | {
"split": "train",
"index": 64370,
"acecode_id": "bigcode_python_fns_36774",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `is_chat_enabled(chat_id: int) -> bool` that checks whether a conversation with the given `chat_id` is enabled. The function will simulate the behavior of retrieving the enabled status of a conversation. For the purpose of this challe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_chat_enabled(1) == True\", \"assert is_chat_enabled(2) == False\", \"assert is_chat_enabled(3) == True\", \"assert is_chat_enabled(4) == False\", \"assert is_chat_enabled(7) == False\", \"assert is_chat_enabled(8) == False\", \"assert is_chat_enabled(11) ... | {
"split": "train",
"index": 64371,
"acecode_id": "bigcode_python_fns_12642",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a basic in-memory database operation. The function `get_records` should retrieve all entries from a list of records and return them as a list. Each record is represented as a dictionary containing the keys 'id', 'name',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_records([]) == []\", \"assert get_records([{'id': 1, 'name': 'Record1', 'value': 100}]) == [{'id': 1, 'name': 'Record1', 'value': 100}]\", \"assert get_records([{'id': 1, 'name': 'Record1', 'value': 100}, {'id': 2, 'name': 'Record2', 'value': 200}]) == [... | {
"split": "train",
"index": 64372,
"acecode_id": "bigcode_python_fns_7054",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers and an integer n, which represents the number of elements in the array. Implement a function `minHeap(arr: List[int], n: int) -> Tuple[List[int], int]` that constructs a Min Heap from the given array if it is not already a Min Heap. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minHeap([3, 1, 5, 7, 2], 5) == ([1, 2, 5, 7, 3], 1)\", \"assert minHeap([1, 2, 3, 4, 5], 5) == ([1, 2, 3, 4, 5], 1)\", \"assert minHeap([10, 9, 8, 7, 6, 5], 6) == ([5, 6, 8, 7, 9, 10], 5)\", \"assert minHeap([4, 6, 5, 10, 15, 20], 6) == ([4, 6, 5, 10, 15, 20... | {
"split": "train",
"index": 64373,
"acecode_id": "evol_11891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of risk tolerance profiles represented as strings. Your task is to write a function that takes this list as input and returns a string representing the highest risk tolerance profile. If the list is empty, return 'No Risk Profile'. The risk tolerance profil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_risk_tolerance(['Low', 'Medium', 'High']) == 'High'\", \"assert highest_risk_tolerance(['Medium', 'Low']) == 'Medium'\", \"assert highest_risk_tolerance(['Low', 'Low']) == 'Low'\", \"assert highest_risk_tolerance(['High', 'High', 'Medium']) == 'High'... | {
"split": "train",
"index": 64374,
"acecode_id": "bigcode_python_fns_17",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that checks the state of a dictionary and all its nested dictionaries, including counts of void dictionaries, total keys, and complex data types. The function should return a tuple containing a boolean indicating if the main dictionary and all nested ones are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_void_state_of_dict({}) == (True, 1, 0, 0)\", \"assert authenticate_void_state_of_dict({'a': 1}) == (False, 0, 1, 0)\", \"assert authenticate_void_state_of_dict({'a': {'b': 2, 'c': {}}}) == (False, 1, 3, 0)\", \"assert authenticate_void_state_of_... | {
"split": "train",
"index": 64375,
"acecode_id": "evol_25188",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a floating-point number representing the radius of a circle, write a function that calculates and returns the area of the circle using the formula A = π * r^2, where A is the area and r is the radius. The function should utilize the math module to access the constant valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_circle_area(1.0) == 3.141592653589793\", \"assert calculate_circle_area(2.0) == 12.566370614359172\", \"assert calculate_circle_area(0.0) == 0.0\", \"assert calculate_circle_area(3.5) == 38.48451000647496\", \"assert calculate_circle_area(5.0) == 7... | {
"split": "train",
"index": 64376,
"acecode_id": "oss_17058",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a command-line parser for a tool that extracts dependencies from a Pipfile.lock file and outputs them to a text file. The function should accept two optional string parameters: `path` (defaulting to 'Pipfile.lock') and `out... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_parser() == {'command': 'extractpipenv', 'help': 'Run notebook and check if it reproduces the same results', 'parameters': {'path': 'Pipfile.lock', 'output': '_julynter_requirements.txt'}}\", \"assert create_parser('custom_path.txt') == {'command': 'e... | {
"split": "train",
"index": 64377,
"acecode_id": "bigcode_python_fns_4973",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that selects a neighbor list class based on the type of device used in a molecular dynamics simulation. If the device is a CPU, the function should return 'NeighborListTree'. If the device is a GPU, the function should return 'Neighbo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_neighbor_list_class('CPU') == 'NeighborListTree'\", \"assert select_neighbor_list_class('GPU') == 'NeighborListGPUTree'\", \"assert select_neighbor_list_class('CPU') != 'NeighborListGPUTree'\", \"assert select_neighbor_list_class('GPU') != 'NeighborLi... | {
"split": "train",
"index": 64378,
"acecode_id": "oss_29979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Your task is to write a function `is_majority_of_age(ages: List[int], legal_age: int) -> bool` that determines if the majority of people in the group are of legal age. A person is considered of legal a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_majority_of_age([18, 20, 15, 22], 18) == True\", \"assert is_majority_of_age([17, 16, 15, 14], 18) == False\", \"assert is_majority_of_age([21, 22, 19, 20, 18], 18) == True\", \"assert is_majority_of_age([18, 17, 17, 16, 15, 14], 18) == False\", \"assert ... | {
"split": "train",
"index": 64379,
"acecode_id": "oss_17804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the retrieval of tweets for a specified topic from a list of unique users. The function should take in a topic string and a list of unique user strings, and return a dictionary where each key is a user and the value is a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_tweets_for_topic('python', ['user1', 'user2']) == {'user1': ['Tweet 1 by user1', 'Tweet 2 by user1', 'Tweet 3 by user1'], 'user2': ['Tweet 1 by user2', 'Tweet 2 by user2', 'Tweet 3 by user2']}\", \"assert retrieve_tweets_for_topic('java', ['user3'])... | {
"split": "train",
"index": 64380,
"acecode_id": "oss_3328",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate(s: str) -> int` that evaluates a basic mathematical expression represented as a string. The expression can contain non-negative integers, the operators `+`, `-`, `*`, `/`, and parentheses `(` and `)`. The division should truncate towards zero. It... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate('1 + 1') == 2\", \"assert calculate('6 - 4 / 2') == 4\", \"assert calculate('2 * (5 + 5 * 2) / 3 + (6 / 2 + 8)') == 21\", \"assert calculate('(2 + 6 * 3 + 5 - (3 * 14 / 7 + 2) * 5) + 3') == -12\", \"assert calculate('0') == 0\", \"assert calculate(... | {
"split": "train",
"index": 64381,
"acecode_id": "evol_29744",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a weather forecast includes an icon for the weather condition and retrieves the temperature in Celsius given a dictionary containing weather information. The dictionary has two keys: 'icon' and 'temperature'. The 'icon'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weather_info({'icon': 'sunny', 'temperature': 68}) == (True, 20)\", \"assert weather_info({'icon': '', 'temperature': 50}) == (False, 10)\", \"assert weather_info({'icon': 'rainy', 'temperature': 32}) == (True, 0)\", \"assert weather_info({'temperature': 100... | {
"split": "train",
"index": 64382,
"acecode_id": "oss_18188",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a medical concept represented by a URI and a generic type code into a FHIR-compliant format. The function should take two parameters: a string 'uri' representing the FHIR type and a string 'generic_type' representing the gen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_fhir_format('http://example.com/medical_concept', '12345') == {'uri': 'http://example.com/medical_concept', 'generic_type': '12345'}\", \"assert convert_to_fhir_format('http://example.com/another_concept', '67890') == {'uri': 'http://example.com/a... | {
"split": "train",
"index": 64383,
"acecode_id": "oss_8698",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the Catalan number for a given ordinal number or a range of ordinal numbers. The function should handle negative ordinal numbers by returning 0, and should also manage edge cases for incorrect inputs by returning an empty list. Use memoization... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert catalan_numbers(0) == 1\", \"assert catalan_numbers(1) == 1\", \"assert catalan_numbers(2) == 2\", \"assert catalan_numbers(3) == 5\", \"assert catalan_numbers(4) == 14\", \"assert catalan_numbers(5) == 42\", \"assert catalan_numbers(-1) == 0\", \"assert cat... | {
"split": "train",
"index": 64384,
"acecode_id": "evol_24893",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple note-taking application. The application should allow users to add new notes and modify existing notes. Implement a function `manage_notes` that takes a list of operations to perform on the notebook. Each operation can either be to add ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_notes([('add', 'First note'), ('add', 'Second note'), ('modify', (0, 'Updated first note'))]) == ['Updated first note', 'Second note']\", \"assert manage_notes([('add', 'Note 1'), ('modify', (2, 'Invalid modify'))]) == ['Note 1']\", \"assert manage_no... | {
"split": "train",
"index": 64385,
"acecode_id": "oss_12879",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `y_true` and `y_pred`, where both lists represent the true values and the predicted values respectively. Your task is to implement a function `mean_square_error(y_true: List[int], y_pred: List[int]) -> float` that calculates the Mean Squared... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mean_square_error([1, 2, 3], [1, 2, 3]) == 0.0\", \"assert mean_square_error([1, 2, 3], [4, 5, 6]) == 9.0\", \"assert mean_square_error([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert mean_square_error([1, 2, 3, 4], [1, 2, 3, 4]) == 0.0\", \"assert mean_square_erro... | {
"split": "train",
"index": 64386,
"acecode_id": "bigcode_python_fns_5239",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a series of tuples, each representing a mapping between an integer key and a tuple value. The tuple value consists of a sequence of integers, a boolean value, an integer (count), and another integer (multiplier). Your task is to write a function `process_mapping` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_mapping({-5: ((1, 2, 3), True, 0, 1)}) == {-5: 6}\", \"assert process_mapping({-6: ((1, -1, 1), True, 0, 1)}) == {-6: 1}\", \"assert process_mapping({-10: ((0, 0, 0), False, 100, 10)}) == {-10: 1000}\", \"assert process_mapping({1: ((1, 2, 3, 4), Tru... | {
"split": "train",
"index": 64387,
"acecode_id": "oss_6295",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `email2img()` that generates an image based on a provided email address and specified parameters. The function should accept the following arguments: `email` (a string representing the email address), `color_mode` (a string indicating the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert email2img('test@example.com', 'RGBA', (0, 0, 0, 0)) == {'email': 'test@example.com', 'color_mode': 'RGBA', 'background_color': (0, 0, 0, 0)}\", \"assert email2img('user@domain.com', 'RGB', (255, 255, 255)) == {'email': 'user@domain.com', 'color_mode': 'RGB',... | {
"split": "train",
"index": 64388,
"acecode_id": "oss_33178",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a unit of measurement represented as either a string or a numeric value, implement a function that returns the corresponding scale factor in points. If the input is a numeric value (integer or float), return it as a float. If the input is a string that represents a valid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_scale_factor(10) == 10.0\", \"assert get_scale_factor(5.5) == 5.5\", \"assert get_scale_factor('pt') == 1\", \"assert get_scale_factor('mm') == 2.83465\", \"assert get_scale_factor('cm') == 28.3465\", \"assert get_scale_factor('in') == 72\", \"assert get... | {
"split": "train",
"index": 64389,
"acecode_id": "bigcode_python_fns_46757",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a numeric location ID, write a function that returns a valid forecast URL string for the NOAA weather service. The valid URL format should be 'https://api.weather.noaa.gov/forecast/{location_id}', where {location_id} is the provided numeric location ID. If the location ID... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_noaa_forecast_url(44099) == 'https://api.weather.noaa.gov/forecast/44099'\", \"assert get_noaa_forecast_url(12345) == 'https://api.weather.noaa.gov/forecast/12345'\", \"assert get_noaa_forecast_url(0) == 'https://api.weather.noaa.gov/forecast/0'\", \"ass... | {
"split": "train",
"index": 64390,
"acecode_id": "bigcode_python_fns_18772",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that identifies the unique elements in the array and returns a dictionary where the keys are the unique integers and the values are their respective positions in the array. If there are no unique elements, return an empty diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 4, 5]) == {1: [0], 2: [1], 3: [2], 4: [3], 5: [4]}\", \"assert unique_elements([1, 1, 2, 3, 3, 4]) == {2: [2], 4: [5]}\", \"assert unique_elements([5, 5, 5, 5]) == {}\", \"assert unique_elements([]) == {}\", \"assert unique_elements... | {
"split": "train",
"index": 64391,
"acecode_id": "evol_35731",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `merge_keepalive_config(existing: dict, updates: dict) -> dict` that merges configuration updates for a peer-keepalive system. The function should take two dictionaries: `existing`, which contains the current configuration with option... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_keepalive_config({'pkl_dest': '10.1.1.1', 'pkl_source': '10.1.1.2', 'pkl_vrf': 'orange'}, {'pkl_dest': '10.1.1.1', 'pkl_vrf': 'blue'}) == {'pkl_dest': '10.1.1.1', 'pkl_source': '10.1.1.2', 'pkl_vrf': 'blue'}\", \"assert merge_keepalive_config({'pkl_des... | {
"split": "train",
"index": 64392,
"acecode_id": "bigcode_python_fns_4379",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer `n`. Write a function `generate_sequence(n)` that generates a sequence of integers starting from `0` up to `n-1` (inclusive). The function should return a list containing all the integers in this sequence. For example, if `n = 5`, the output sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sequence(5) == [0, 1, 2, 3, 4]\", \"assert generate_sequence(0) == []\", \"assert generate_sequence(1) == [0]\", \"assert generate_sequence(10) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert generate_sequence(3) == [0, 1, 2]\", \"assert generate_sequ... | {
"split": "train",
"index": 64393,
"acecode_id": "bigcode_python_fns_38424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer 'size' that represents the width of a paragraph and an integer 'lsize' that represents the left repositioning offset, write a function `set_paragraph_style(size: int, lsize: int) -> str` that returns a string representing the HTML paragraph tag with the specifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_paragraph_style(300, 50) == '<p style=\\\"text-align:left !important;text-indent:0 !important;position:relative;width:300px;left:50px;\\\"></p>'\", \"assert set_paragraph_style(100, 0) == '<p style=\\\"text-align:left !important;text-indent:0 !important;... | {
"split": "train",
"index": 64394,
"acecode_id": "bigcode_python_fns_20982",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `bucket_sort` that takes a list of numbers (which can include positive numbers, negative numbers, and decimals) as input and sorts the list using the Bucket Sort algorithm. You are not allowed to use Python's built-in sort function. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bucket_sort([]) == []\", \"assert bucket_sort([3, 2, 1]) == [1, 2, 3]\", \"assert bucket_sort([1, 2, 3]) == [1, 2, 3]\", \"assert bucket_sort([1.5, 2.5, 0.5]) == [0.5, 1.5, 2.5]\", \"assert bucket_sort([-1, -2, -3]) == [-3, -2, -1]\", \"assert bucket_sort([-... | {
"split": "train",
"index": 64395,
"acecode_id": "evol_12222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `reverse_n(s: str, n: int) -> str` that takes a string `s` and an integer `n` as input and performs the following tasks: \n1. If the integer `n` is negative, return an error message \"Invalid value for n.\" \n2. If the integer `n` is zero, return an empty s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_n('hello', -1) == 'Invalid value for n.'\", \"assert reverse_n('hello', 0) == ''\", \"assert reverse_n('hello', 5) == 'olleh'\", \"assert reverse_n('hello', 6) == 'hello'\", \"assert reverse_n('', 0) == ''\", \"assert reverse_n('', 1) == ''\", \"asse... | {
"split": "train",
"index": 64396,
"acecode_id": "evol_32406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the process of converting an SVG image to a PNG image. Your function, `convert_svg_to_png`, will take the following parameters: \n- `svg_path` (string): The file path of the SVG image to be converted to PNG. \n- `fil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_svg_to_png('icon.svg') == 'http://example.com/images/icon.svg.png'\", \"assert convert_svg_to_png('icon.svg', 'red') == 'http://example.com/images/icon.svg.png?fill=red'\", \"assert convert_svg_to_png('icon.svg', 'red', 'blue') == 'http://example.com... | {
"split": "train",
"index": 64397,
"acecode_id": "oss_3905",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a celestial object which has right ascension (ra) and declination (dec) coordinates. The function should accept a list of commands that either query or update the coordinates. The commands are as follows... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_coordinates([('query', 10, 20)]) == (10, 20)\", \"assert simulate_coordinates([('query', 10, 20), ('query', 30, 40)]) == (10, 20)\", \"assert simulate_coordinates([('query', 10, 20), ('update', 30, 40)]) == (30, 40)\", \"assert simulate_coordinates(... | {
"split": "train",
"index": 64398,
"acecode_id": "oss_8878",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer array `nums`. Your task is to determine if there exists a quadruplet of indices `(i, j, k, l)` such that `i < j < k < l` and `nums[i] < nums[j] < nums[k] < nums[l]`. If such a quadruplet exists, return `true`; otherwise, return `false`. Write a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increasingQuadruplet([1, 2, 3, 4, 5]) == True\", \"assert increasingQuadruplet([5, 4, 3, 2, 1]) == False\", \"assert increasingQuadruplet([2, 1, 5, 0, 4, 6, 7]) == True\", \"assert increasingQuadruplet([1, 3, 2, 4, 5]) == True\", \"assert increasingQuadruple... | {
"split": "train",
"index": 64399,
"acecode_id": "evol_27423",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.