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 given an array of strings called `words`. Your task is to return a list of words that can be typed using only the letters found on a single row of the American keyboard. The top row consists of the characters 'qwertyuiop', the middle row consists of 'asdfghjkl', and the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findWords(['Hello', 'Alaska', 'Dad', 'Peace']) == ['Alaska', 'Dad']\", \"assert findWords(['omk']) == []\", \"assert findWords(['adsdf', 'sfd']) == ['adsdf', 'sfd']\", \"assert findWords(['qwerty', 'asdf', 'zxcvbn']) == ['qwerty', 'asdf', 'zxcvbn']\", \"asse...
{ "split": "train", "index": 1400, "acecode_id": "evol_28941", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string `sequence`, write a function `digit_between_primes(sequence)` that returns a list of indices of all digits in the string that are located between two prime numbers. A digit is considered to be between two prime numbers if the characters immediately before and aft...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert digit_between_primes('4a5b6') == [-1]\", \"assert digit_between_primes('pqr') == [-1]\", \"assert digit_between_primes('8hello9') == [-1]\", \"assert digit_between_primes('17**19') == [-1]\", \"assert digit_between_primes('4digits9') == [-1]\", \"assert digi...
{ "split": "train", "index": 1401, "acecode_id": "evol_27028", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `insert_doubly_linked_list(data: int, head: Optional[Node]) -> Node` that inserts a new node with the given `data` at the beginning of a doubly linked list. The function should return the new head of the list. If the list is empty, the new node becomes the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_doubly_linked_list(10, None).data == 10\", \"assert insert_doubly_linked_list(5, insert_doubly_linked_list(10, None)).data == 5\", \"assert insert_doubly_linked_list(15, insert_doubly_linked_list(10, None)).next.data == 10\", \"assert insert_doubly_li...
{ "split": "train", "index": 1402, "acecode_id": "evol_304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes an input value and determines if it evaluates to True or False. The function should handle various types of inputs, including booleans, strings, integers, and floats. It should differentiate between boolean values and strings that represent 'true' o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_true_or_false_1(True) == True\", \"assert is_true_or_false_1(False) == False\", \"assert is_true_or_false_1('true') == True\", \"assert is_true_or_false_1('false') == False\", \"assert is_true_or_false_1('True') == True\", \"assert is_true_or_false_1('Fal...
{ "split": "train", "index": 1403, "acecode_id": "evol_2046", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers representing stock prices on consecutive days. Your task is to write a function `max_profit` to find the maximum profit that can be obtained by buying and selling the stock at most once. You can only buy the stock on a day and then sell it on ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([1]) == 0\", \"assert max_profit([]) == 0\", \"assert max_profit...
{ "split": "train", "index": 1404, "acecode_id": "oss_582", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes quarantine actions for files based on a given quarantine profile. The function takes in three arguments: `quarantine_profile_id`, `file_id`, and `action`. The `quarantine_profile_id` represents the ID of the quar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_quarantine_action('', 'file_123', 'delete') == 'Invalid quarantine profile ID'\", \"assert process_quarantine_action('profile_1', '', 'delete') == 'Invalid file ID'\", \"assert process_quarantine_action('profile_1', 'file_123', '') == 'Invalid action...
{ "split": "train", "index": 1405, "acecode_id": "oss_5337", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a genetic algorithm to optimize the parameters of a group of agents. The genetic algorithm will run for a specified number of generations, and each generation will consist of a certain number of agents. The goal is to find the best combination o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimize_parameters(10, 5, {'param1': [1, 2], 'param2': [3, 4]}) in [{'param1': 1, 'param2': 3}, {'param1': 2, 'param2': 4}]\", \"assert optimize_parameters(25, 10, {'paramA': [1, 2, 3], 'paramB': [4, 5]}) in [{'paramA': 3, 'paramB': 5}]\", \"assert optimize...
{ "split": "train", "index": 1406, "acecode_id": "oss_165", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that selects a vaccination center based on the provided state and postal code. The function should take two string inputs: the name of the state (bundesland) and the postal code (plz). The function will then return a string indicating...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_vaccination_center('Bavaria', '80331') == 'Vaccination Center for Bavaria with postal code 80331 selected'\", \"assert select_vaccination_center('Berlin', '10115') == 'Vaccination Center for Berlin with postal code 10115 selected'\", \"assert select_v...
{ "split": "train", "index": 1407, "acecode_id": "bigcode_python_fns_37766", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of a terrain, implement a function that detects the extent of the peak in the terrain. A peak is defined as the highest point in the list, and the extent is determined by the slope of the terrain. The function should return a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_peak([1, 2, 1, 2, 1], 0.3) == [0, 1, 0, 1, 0]\", \"assert detect_peak([0, 0, 0, 1, 0, 0], 0.3) == [0, 0, 0, 1, 0, 0]\", \"assert detect_peak([5, 5, 5, 5], 0.3) == [0, 0, 0, 0]\", \"assert detect_peak([1, 3, 2, 4, 1], 0.3) == [0, 1, 0, 1, 0]\", \"asser...
{ "split": "train", "index": 1408, "acecode_id": "bigcode_python_fns_22844", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a utility function that simulates building and uploading a design for an FPGA device based on a set of command line arguments. Write a function `simulate_fpga_process` that takes the following arguments: `output: Optional[str]`, `erase: bool`, `uplo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_fpga_process(None, False, False, False, False, False) == 'No action taken.'\", \"assert simulate_fpga_process('output.txt', True, False, False, False, False) == 'Erasing flash... Erase complete. Outputting to filename.'\", \"assert simulate_fpga_pro...
{ "split": "train", "index": 1409, "acecode_id": "bigcode_python_fns_38788", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with initializing a hypothetical application module by importing necessary resources. Write a function `init_app()` that takes a string parameter `app_name` representing the name of the application and a variable number of keyword arguments. The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert init_app('TestApp') == 'Initialized TestApp with 0 configurations'\", \"assert init_app('MyApp', debug=True) == 'Initialized MyApp with 1 configurations'\", \"assert init_app('DemoApp', version=1, env='production') == 'Initialized DemoApp with 2 configuratio...
{ "split": "train", "index": 1410, "acecode_id": "bigcode_python_fns_46690", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `remove_duplicates(arr)` that takes an array of integers `arr` as input and returns a new array containing all distinct elements from `arr` in the order they first appeared. The output array should not contain any duplicates. For example, given the input ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([1, 1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1]) == [1]\", \"assert remove_duplicates([2, 3, 2, 1, 3]) == [2, 3, 1]\",...
{ "split": "train", "index": 1411, "acecode_id": "evol_15254", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that measures the execution time of a given function. Write a function `measure_execution_time(func: Callable, *args: Any, **kwargs: Any) -> float` that takes another function `func` and its arguments `*args` and `**kwargs`, executes the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(measure_execution_time(lambda: sum(range(1000000))) - 0.0) < 1.0\", \"assert abs(measure_execution_time(lambda: [i for i in range(1000)]) - 0.0) < 1.0\", \"assert abs(measure_execution_time(lambda: [i**2 for i in range(500)]) - 0.0) < 1.0\", \"assert abs...
{ "split": "train", "index": 1412, "acecode_id": "bigcode_python_fns_18657", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a positive integer 'n', write a function that returns a list of all primitive roots modulo 'n'. A primitive root modulo 'n' is an integer 'g' such that the powers of 'g' modulo 'n' generate all integers from 1 to 'n-1'. The function should return the primitive roots in as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prim_roots(2) == [1]\", \"assert prim_roots(3) == [2]\", \"assert prim_roots(4) == []\", \"assert prim_roots(5) == [2, 3]\", \"assert prim_roots(6) == []\", \"assert prim_roots(7) == [3, 5]\", \"assert prim_roots(8) == []\", \"assert prim_roots(12) == []\", ...
{ "split": "train", "index": 1413, "acecode_id": "bigcode_python_fns_32955", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a numeric value, a precision level, a unit of measurement, and a boolean flag indicating whether to display the unit. The function should return a formatted string that represents the converted value, including the unit if spec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_conversion(123.45678, 2, 'm', True) == '123.46 m'\", \"assert apply_conversion(123.45678, 2, 'm', False) == '123.46'\", \"assert apply_conversion(0, 2, 'kg', True) == '0.00 kg'\", \"assert apply_conversion(0, 0, 'g', True) == '0 g'\", \"assert apply_co...
{ "split": "train", "index": 1414, "acecode_id": "bigcode_python_fns_27070", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that generates the nth Fibonacci number using memoization. The function should handle erroneous input gracefully by returning an appropriate error message for negative numbers and non-integer types. The Fibonacci sequence is defined as follows: F(0) ...
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": 1415, "acecode_id": "evol_20185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a cluster of OSD nodes in a cloud environment. Each OSD node has a unique name and resides in a specific availability zone. Your goal is to simulate the process of deleting an OSD node and creating a new one in its place. Given the name of the OSD n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_and_create_osd_node('osd-node-1') == 'osd-node-1-new'\", \"assert delete_and_create_osd_node('osd-node-2') == 'osd-node-2-new'\", \"assert delete_and_create_osd_node('osd-node-3') == 'osd-node-3-new'\", \"assert delete_and_create_osd_node('osd-node-4'...
{ "split": "train", "index": 1416, "acecode_id": "bigcode_python_fns_21386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple asynchronous task manager in Python. The task manager should be able to manage a service that can run and stop operations. You are given a base class `Service` that contains two asynchronous methods, `run` and `stop`, which you will not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert TaskManager(Service()).service is not None\", \"assert TaskManager(Service()).service.run is not None\", \"assert TaskManager(Service()).service.stop is not None\", \"assert TaskManager(Service()).service != None\", \"assert TaskManager(Service()).service.ru...
{ "split": "train", "index": 1417, "acecode_id": "oss_24927", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that returns the index of the first occurrence of a specified target integer. If the target integer is not found in the array, return -1. The function signature is: def find_first_occurrence(array: List[int], target: int) -> int:\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_occurrence([1, 2, 3, 4, 5], 3) == 2\", \"assert find_first_occurrence([1, 2, 3, 4, 5], 1) == 0\", \"assert find_first_occurrence([1, 2, 3, 4, 5], 5) == 4\", \"assert find_first_occurrence([1, 2, 3, 4, 5], 6) == -1\", \"assert find_first_occurrence...
{ "split": "train", "index": 1418, "acecode_id": "evol_32123", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a custom data sampler for a machine learning framework. Your function should take a list of data points and a boolean indicating whether to shuffle the dataset. If shuffling is required, return the data ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert data_sampler([1, 2, 3, 4, 5], False) == [1, 2, 3, 4, 5]\", \"assert data_sampler([], False) == []\", \"assert sorted(data_sampler([1, 2, 3, 4, 5], True)) == sorted([1, 2, 3, 4, 5])\", \"assert data_sampler(['a', 'b', 'c'], False) == ['a', 'b', 'c']\", \"asse...
{ "split": "train", "index": 1419, "acecode_id": "oss_13052", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines if all elements in a given list are the same. If they are, return that element; otherwise, return None. The input will be a list of integers. Implement the function `find_unique_element(elements: List[int]) -> Optional...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_element([1, 1, 1]) == 1\", \"assert find_unique_element([2, 2, 2]) == 2\", \"assert find_unique_element([3, 3, 3, 3]) == 3\", \"assert find_unique_element([4]) == 4\", \"assert find_unique_element([5, 5, 5, 5, 5]) == 5\", \"assert find_unique_ele...
{ "split": "train", "index": 1420, "acecode_id": "bigcode_python_fns_48207", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of user roles represented as strings, write a function `delete_role(roles: List[str], role_to_delete: str) -> List[str]` that deletes a specified role from the list of roles. If the role does not exist in the list, the function should return the list unchanged. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_role(['admin', 'editor', 'viewer'], 'editor') == ['admin', 'viewer']\", \"assert delete_role(['admin', 'editor', 'viewer'], 'admin') == ['editor', 'viewer']\", \"assert delete_role(['admin', 'editor', 'viewer'], 'viewer') == ['admin', 'editor']\", \"a...
{ "split": "train", "index": 1421, "acecode_id": "bigcode_python_fns_38213", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function to extract values between quotation marks from a string. The function should be able to handle nested quotations and return the values in the order they appear. The function should also be able to handle different types of quotation marks (single, double, and b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_quotes('No quotes here!') == []\", \"assert extract_quotes('Mixed \\\\\\\"quotes\\\\\\\" and \\\\'single quotes\\\\'') == ['quotes', 'single quotes']\", \"assert extract_quotes('Just a \\\\'single quote here') == []\", \"assert extract_quotes('This h...
{ "split": "train", "index": 1422, "acecode_id": "evol_33398", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing the imports from various modules in a game development framework. Your goal is to create a function named `analyze_imports` that takes no parameters and returns a dictionary containing the counts of classes and functions imported from specified mod...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_imports() == {'group': 0, 'props': 0, 'balls': 0, 'object': 0, 'buttons': 0, 'entities': 0}\", \"assert analyze_imports() != {'group': 1, 'props': 0, 'balls': 0, 'object': 0, 'buttons': 0, 'entities': 0}\", \"assert analyze_imports().keys() == {'grou...
{ "split": "train", "index": 1423, "acecode_id": "oss_12245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given four integer inputs, which can include negative numbers and zero, write a function that returns the second smallest value among them. Your function should minimize the number of comparisons made when determining this value.\nPlease reason step by step, then write a self-c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_smallest(1, 2, 3, 4) == 2\", \"assert second_smallest(-5, -10, -3, -1) == -5\", \"assert second_smallest(-1, 0, 1, 2) == 0\", \"assert second_smallest(-100, 0, 100, 50) == 0\", \"assert second_smallest(9, 7, 8, 6) == 7\", \"assert second_smallest(10, ...
{ "split": "train", "index": 1424, "acecode_id": "evol_33177", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `generate_unique_color()` that generates a unique random hex color code in the format #RRGGBB. The function should not repeat any previously generated color codes during its execution. You may use any data structure to track previously generated color codes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_color() != generate_unique_color()\", \"assert generate_unique_color() != generate_unique_color()\", \"assert generate_unique_color() != generate_unique_color()\", \"assert generate_unique_color() != generate_unique_color()\", \"assert genera...
{ "split": "train", "index": 1425, "acecode_id": "evol_35750", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_item(id: str, name: str, position: str) -> bool` that simulates the creation of an item in a database. The function should return True if the item is successfully created. If the item already exists (i.e., if the id is '1' for the sake of this probl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_item('2', 'Bob', 'Manager') == True\", \"assert create_item('3', 'Charlie', 'Designer') == True\", \"assert create_item('4', 'Eve', 'Analyst') == True\", \"assert create_item('5', 'Frank', 'Architect') == True\", \"assert create_item('6', 'Grace', 'De...
{ "split": "train", "index": 1426, "acecode_id": "evol_3568", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple logging system. The function should take a list of messages as input and return a list containing all the logged messages. Each message in the input list should be appended to the output list, maintaining the order...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_messages(['First message', 'Second message']) == ['First message', 'Second message']\", \"assert log_messages(['Error occurred', 'User logged in']) == ['Error occurred', 'User logged in']\", \"assert log_messages([]) == []\", \"assert log_messages(['Log ...
{ "split": "train", "index": 1427, "acecode_id": "oss_2645", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks whether a given integer is an even number. The function should return True if the number is even and False otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code bl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_even(2) == True\", \"assert is_even(0) == True\", \"assert is_even(-2) == True\", \"assert is_even(3) == False\", \"assert is_even(-3) == False\", \"assert is_even(4) == True\", \"assert is_even(5) == False\", \"assert is_even(10) == True\", \"assert is_e...
{ "split": "train", "index": 1428, "acecode_id": "evol_20151", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a dictionary containing data about an observation from a fictional wildlife database. The function should take an input dictionary with the following structure: `{'observed_on_string': str, 'observed_time_zone': str, 'obser...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_observation({'observed_on_string': '2022-03-15T12:00:00', 'observed_time_zone': 'UTC', 'observed_on_details': {}, 'taxon': {'id': 1}, 'geojson': {'coordinates': [1.0, 2.0]}, 'photos': [{'url': 'http://example.com/photo1.jpg'}, {'url': 'http://example...
{ "split": "train", "index": 1429, "acecode_id": "bigcode_python_fns_7732", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a dictionary representing a tracklist for multiple artists and their albums. The function should take in the tracklist dictionary and return a new dictionary containing the albums as keys and the number of unique tra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert album_unique_track_count({'Artist1': {'Album1': 'Track1', 'Album2': 'Track2'}}) == {'Album1': 1, 'Album2': 1}\", \"assert album_unique_track_count({'Artist1': {'Album1': 'Track1', 'Album1': 'Track1', 'Album2': 'Track2'}}) == {'Album1': 1, 'Album2': 1}\", \"a...
{ "split": "train", "index": 1430, "acecode_id": "oss_12694", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that takes four parameters representing the components of a quaternion (a, b, c, d) and returns the string representation of the quaternion in the format 'a + bi + cj + dk'. The components a, b, c, and d are floating-point numbers. Ensure that the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quaternion_representation(1, 2, 3, 4) == '1 + 2i + 3j + 4k'\", \"assert quaternion_representation(0, 2, 3, 4) == '2i + 3j + 4k'\", \"assert quaternion_representation(1, 0, 3, 4) == '1 + 3j + 4k'\", \"assert quaternion_representation(1, 2, 0, 4) == '1 + 2i + ...
{ "split": "train", "index": 1431, "acecode_id": "evol_34195", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple username and user ID re-authentication flow. Implement a function `reauthenticate_user` that takes two parameters: `current_user` (a dictionary containing the current user's details, including 'username' and 'user_id') and `new_credentials`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reauthenticate_user({'username': 'user1', 'user_id': '123'}, {'username': 'user1', 'user_id': '123'}) == 'Reauthentication successful'\", \"assert reauthenticate_user({'username': 'user1', 'user_id': '123'}, {'username': 'user1', 'user_id': '456'}) == 'Reaut...
{ "split": "train", "index": 1432, "acecode_id": "bigcode_python_fns_7893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of exactly 7 integers, write a function that returns the third smallest integer in the list. The function should handle the case where all integers are distinct. You can assume the input list will always contain 7 elements.\nPlease reason step by step, then write a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert third_smallest([34, 76, 12, 43, 87, 25, 58]) == 34\", \"assert third_smallest([1, 2, 3, 4, 5, 6, 7]) == 3\", \"assert third_smallest([20, 30, 10, 40, 50, 60, 70]) == 30\", \"assert third_smallest([-1, -2, -3, -4, -5, -6, -7]) == -5\", \"assert third_smallest...
{ "split": "train", "index": 1433, "acecode_id": "evol_25290", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that takes two binary strings `a` and `b` as inputs. First, verify that the input strings are of equal length. If they are not, return an error message. If they are of equal length, perform a binary XOR operation on the strings and identify the longest alte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_xor_alternating_subseq('010', '110') == '10'\", \"assert validate_and_xor_alternating_subseq('101', '010') == '1'\", \"assert validate_and_xor_alternating_subseq('111', '000') == '1'\", \"assert validate_and_xor_alternating_subseq('10', '01') ==...
{ "split": "train", "index": 1434, "acecode_id": "evol_8333", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an unsorted list of integers, write a function that finds the frequency of each unique element and returns a list of elements sorted in descending order based on their frequency. If multiple elements have the same frequency, they should be sorted in ascending order based ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_elements_by_frequency([7, 8, 9, 7, 10, 11, 9, 8, 10, 10]) == [10, 7, 8, 9, 11]\", \"assert sort_elements_by_frequency([1, 1, 2, 2, 3]) == [1, 2, 3]\", \"assert sort_elements_by_frequency([3, 3, 3, 1, 1, 2]) == [3, 1, 2]\", \"assert sort_elements_by_freq...
{ "split": "train", "index": 1435, "acecode_id": "evol_14190", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers or floats, write a function `min_spacing(mylist)` that calculates the minimum distance between any two distinct elements in the list. The distance is defined as the absolute difference between the two elements. If the list contains fewer than two elemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_spacing([1, 2, 3, 4, 5]) == 1\", \"assert min_spacing([10, 20, 30]) == 10\", \"assert min_spacing([-1, -5, -3]) == 2\", \"assert min_spacing([0]) == 0\", \"assert min_spacing([5]) == 0\", \"assert min_spacing([100, 200, 300, 400]) == 100\", \"assert min_...
{ "split": "train", "index": 1436, "acecode_id": "bigcode_python_fns_24729", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves an organization schema based on a specific type and an expansion flag. The function should take in two parameters: a string `t` representing the type of organization schema to retrieve, and a boolean `expanded` indicati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scheming_get_organization_schema('type1', True) == 'Schema for type1 (expanded)'\", \"assert scheming_get_organization_schema('type1', False) == 'Schema for type1'\", \"assert scheming_get_organization_schema('type2', True) == 'Schema for type2 (expanded)'\"...
{ "split": "train", "index": 1437, "acecode_id": "oss_35192", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a list of schedules, allowing for various operations such as adding, updating, retrieving, and deleting schedules. Each schedule is represented as a dictionary with keys 'id', 'title', and 'time'. Your function should support...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_schedules([{'action': 'add', 'data': {'id': 1, 'title': 'Meeting', 'time': '10:00 AM'}}]) == [{'id': 1, 'title': 'Meeting', 'time': '10:00 AM'}]\", \"assert manage_schedules([{'action': 'add', 'data': {'id': 1, 'title': 'Meeting', 'time': '10:00 AM'}}...
{ "split": "train", "index": 1438, "acecode_id": "oss_13146", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a mock client for an AWS service. Implement a function `create_mock_client(service_name: str, region: str) -> dict` that simulates creating a mock AWS service client. The function should return a dictionary containing the service name and region use...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_mock_client('s3', 'us-east-1') == {'service_name': 's3', 'region': 'us-east-1'}\", \"assert create_mock_client('ec2', 'us-west-2') == {'service_name': 'ec2', 'region': 'us-west-2'}\", \"assert create_mock_client('lambda', 'us-east-1') == {'service_nam...
{ "split": "train", "index": 1439, "acecode_id": "bigcode_python_fns_35664", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that determines if a list of integers contains any duplicates. Your function should take a list of integers as input and return True if there are any duplicates in the list, and False otherwise. The function should handle empty lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_duplicates([1, 2, 3, 1]) == True\", \"assert contains_duplicates([1, 2, 3, 4]) == False\", \"assert contains_duplicates([5, 6, 7, 5, 8]) == True\", \"assert contains_duplicates([]) == False\", \"assert contains_duplicates([1]) == False\", \"assert c...
{ "split": "train", "index": 1440, "acecode_id": "oss_21192", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `quicksort(arr: List[int]) -> List[int]` that takes an array of integers and returns a new array with the elements sorted in ascending order using the Quick Sort algorithm. The input array may contain duplicate values.\nPlease reason step by step, then writ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quicksort([2, 3, 5, 6, 1, 4]) == [1, 2, 3, 4, 5, 6]\", \"assert quicksort([5, 3, 8, 6, 2]) == [2, 3, 5, 6, 8]\", \"assert quicksort([1]) == [1]\", \"assert quicksort([]) == []\", \"assert quicksort([3, 3, 3]) == [3, 3, 3]\", \"assert quicksort([4, 2, 2, 1, 3...
{ "split": "train", "index": 1441, "acecode_id": "evol_8576", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_logger` that returns a string representing the name of a logger for a project. The logger name is defined as a constant `LOGGER_NAME`. Your function should not take any input parameters and should return the string value of `LOGGER_N...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_logger() == 'my_project_logger'\", \"assert get_logger() == 'my_project_logger'\", \"assert get_logger() == 'my_project_logger'\", \"assert get_logger() == 'my_project_logger'\", \"assert get_logger() == 'my_project_logger'\", \"assert get_logger() == 'm...
{ "split": "train", "index": 1442, "acecode_id": "bigcode_python_fns_23997", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a deque data structure that allows appending elements to both ends. Implement a function `append_left_child(deque: Deque, value: str) -> None` that appends a string `value` to the left end of the deque. The function should modify the deque in-place. The deque can ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_left_child(test_deque, 's') == None\", \"assert append_left_child(test_deque, 'tring') == None\", \"assert append_left_child(test_deque, 'hello') == None\", \"assert append_left_child(test_deque, 'world') == None\", \"assert append_left_child(test_deq...
{ "split": "train", "index": 1443, "acecode_id": "bigcode_python_fns_39082", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `is_palindrome(s: str) -> bool` that determines if the input string `s` is a palindrome, considering only alphanumeric characters and ignoring cases. Special characters, spaces, and punctuation should not be taken into account when determining if `s` is a p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama!') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('12321')...
{ "split": "train", "index": 1444, "acecode_id": "evol_18745", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples representing positions (x, y) and a corresponding list of tuples representing velocity vectors (Ux, Uy), write a function that determines for each position whether it contributes to inflow or outflow. The inflow is indicated by a negative scalar product o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fluid_contribution([(1, 2), (3, 4)], [(1, 1), (0, 0)]) == [1, 0]\", \"assert fluid_contribution([(1, 1), (2, 2)], [(2, 2), (1, 1)]) == [1, 1]\", \"assert fluid_contribution([(0, 0), (1, 1)], [(1, -1), (-1, 1)]) == [0, 0]\", \"assert fluid_contribution([(1, 0...
{ "split": "train", "index": 1445, "acecode_id": "bigcode_python_fns_49485", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a unique identifier for a data object if one is not provided. The function should accept a dictionary containing a 'body' key, which in turn contains a 'data_object' key. If a unique identifier is present in 'data_object', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_data_object({'body': {'data_object': {}}}) == {'data_object_id': 1}\", \"assert create_data_object({'body': {'data_object': {'id': 1}}}) == {'data_object_id': 1}\", \"assert create_data_object({'body': {'data_object': {'id': 2}}}) == {'data_object_id'...
{ "split": "train", "index": 1446, "acecode_id": "bigcode_python_fns_10350", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a string representation of a bar chart based on given data. The function should take in two lists: `x_data` and `y_data`, which represent the categories and their corresponding values, respectively. The function should also...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_bar_chart_string(['A', 'B', 'C'], [1, 2, 3], 'Sample Chart', 'Categories', 'Values', 'blue') == 'Title: Sample Chart\\\\nX-axis: Categories\\\\nY-axis: Values\\\\nData: A: 1, B: 2, C: 3, Color: blue'\", \"assert generate_bar_chart_string([], [1, 2])...
{ "split": "train", "index": 1447, "acecode_id": "bigcode_python_fns_3305", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2-dimensional array with 5 rows, each containing 10 integers, write a function that sorts each row in ascending order and returns the sorted 2D array.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_rows([[5, 3, 8, 6, 2, 9, 1, 7, 10, 4], [12, 15, 11, 14, 13, 19, 18, 17, 16, 20], [25, 23, 28, 26, 21, 29, 22, 24, 30, 27], [35, 33, 38, 36, 31, 39, 32, 34, 40, 37], [45, 43, 48, 46, 41, 49, 42, 44, 50, 47]]) == [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [11, 12,...
{ "split": "train", "index": 1448, "acecode_id": "evol_14576", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of commands and corresponding financial deals. The function should take a list of strings as input, where each string represents a command-deal pair in the format `<command> <deal>`. The command can be one of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_commands(['buy deal1', 'sell deal2', 'hold deal3']) == ['deal1', 'DEAL2']\", \"assert process_commands(['hold deal1', 'buy deal2', 'sell deal3']) == ['deal2', 'DEAL3']\", \"assert process_commands(['buy dealA', 'hold dealB', 'sell dealC', 'buy dealD'...
{ "split": "train", "index": 1449, "acecode_id": "oss_5339", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function named 'will_it_fly' to assess the likelihood of an object referred to as 'q' taking flight, providing 'True' if plausible, and 'False' otherwise. To achieve flight, 'q' must satisfy two prerequisites: it must be a palindrome (a symmetric array) and the sum of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert will_it_fly([1, 2], 5) == False\", \"assert will_it_fly([3, 2, 3], 1) == False\", \"assert will_it_fly([3, 2, 3], 9) == True\", \"assert will_it_fly([3], 5) == True\", \"assert will_it_fly([4, 4, 4], 12) == True\", \"assert will_it_fly([1, 2, 1], 4) == True\...
{ "split": "train", "index": 1450, "acecode_id": "evol_5675", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a user registration system for a college ecosystem. The system should register new users and prepare a welcome email message to be sent to their recovery email address. Your task is to implement a function `getFormattedText` that takes in an ema...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getFormattedText('Welcome {username} to {college}!', {'username': 'Alice', 'college': 'XYZ University'}) == 'Welcome Alice to XYZ University!'\", \"assert getFormattedText('Hello {username}, welcome to {college}.', {'username': 'Bob', 'college': 'LMN College...
{ "split": "train", "index": 1451, "acecode_id": "oss_16399", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that resets the internal states of a reinforcement learning agent. Implement a function called `reset_internal_states` that takes an integer `model_size` as an input and returns a list of internal states, where each internal state is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_internal_states(1) == [[None]]\", \"assert reset_internal_states(2) == [[None], [None]]\", \"assert reset_internal_states(3) == [[None], [None], [None]]\", \"assert reset_internal_states(4) == [[None], [None], [None], [None]]\", \"assert reset_internal...
{ "split": "train", "index": 1452, "acecode_id": "oss_33886", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, your task is to clean up the string by removing leading and trailing whitespace characters, as well as any occurrences of dashes ('-') at the beginning and end of the string. You need to implement a function `clean_string(s: str) -> str`, which takes the input s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_string(' -example string- ') == 'example string'\", \"assert clean_string(' hello world ') == 'hello world'\", \"assert clean_string('---python---') == 'python'\", \"assert clean_string('--leading and trailing dashes--') == 'leading and trailin...
{ "split": "train", "index": 1453, "acecode_id": "bigcode_python_fns_26304", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that calculates a weighted average of elements in a list that can contain strings, nested lists, and tuples. It should use a given list of weights for the calculation and apply a custom comparison function to handle string entities. The function must not us...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert weighted_average(['a', 'b'], [1, 2], lambda x: x) == 'b'\", \"assert weighted_average(['x', ('y',)], [1, 1], lambda x: x) == 'y'\", \"assert weighted_average(['string1', 'string2'], [2, 3], lambda x: x) == 'string2'\", \"assert weighted_average(['test', 'dat...
{ "split": "train", "index": 1454, "acecode_id": "evol_17612", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers representing packet sizes, write a function that determines the maximum packet size that can be captured from the list without exceeding a given limit. The function should return the maximum packet size if it exists, otherwise return 0. You are given tw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_packet_size([100, 200, 300, 400], 350) == 300\", \"assert max_packet_size([1500, 1600, 1700], 1500) == 1500\", \"assert max_packet_size([850, 900, 1000, 1100], 950) == 900\", \"assert max_packet_size([10, 20, 30, 40, 50], 25) == 20\", \"assert max_packet...
{ "split": "train", "index": 1455, "acecode_id": "bigcode_python_fns_19790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a library installation process in a build system. Write a function that takes in a list of library names and a target directory, and returns the list of libraries that were 'successfully installed'. For this simulation, assume that libraries at ev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert install_libraries(['lib1.so', 'lib2.so', 'lib3.so'], '/usr/local/lib') == ['lib1.so', 'lib3.so']\", \"assert install_libraries(['libA.so', 'libB.so', 'libC.so', 'libD.so'], '/usr/lib') == ['libA.so', 'libC.so']\", \"assert install_libraries(['lib1', 'lib2', ...
{ "split": "train", "index": 1456, "acecode_id": "oss_34744", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `trilinear_interpolation(c: List[List[List[float]]], x: float, y: float, z: float) -> float` that performs trilinear interpolation for a given 3D grid of points. The input `c` is a 3D list representing the values at the corners of a cube defined by points (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trilinear_interpolation([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], 0, 0, 0) == 1.0\", \"assert trilinear_interpolation([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], 0, 0, 1) == 2.0\", \"assert trilinear_interpolation([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], 0, 1, 0) == 3.0\...
{ "split": "train", "index": 1457, "acecode_id": "evol_33322", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs image denoising. The function should take two input parameters: a noisy image represented as a 2D list of integers (where each integer represents a pixel value) and a clean image, also represented as a 2D list of integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert denoise_image([[10]], [[15]]) == [[12]]\", \"assert denoise_image([[0]], [[0]]) == [[0]]\", \"assert denoise_image([[100, 150]], [[200, 250]]) == [[150, 200]]\", \"assert denoise_image([[10, 20], [30, 40]], [[15, 25], [35, 45]]) == [[12, 22], [32, 42]]\", \"...
{ "split": "train", "index": 1458, "acecode_id": "oss_14229", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a number guessing game. The function takes two parameters: a target number (between 1 and 100, inclusive) and an entered number (also between 1 and 100, inclusive). The function should return a string that gives feedback ba...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert number_guessing_game(50, 30) == 'Too low!'\", \"assert number_guessing_game(50, 70) == 'Too high!'\", \"assert number_guessing_game(50, 50) == 'Congratulations! You guessed it!'\", \"assert number_guessing_game(50, 1) == 'Too low!'\", \"assert number_guessin...
{ "split": "train", "index": 1459, "acecode_id": "oss_37323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining whether color output is enabled based on a specific configuration setting and an environment variable. Implement a function `color_enabled(ui_color: str, no_color: Optional[str]) -> bool` that takes in two parameters: `ui_color` (a string that ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert color_enabled('on', None) == True\", \"assert color_enabled('off', None) == False\", \"assert color_enabled('auto', None) == True\", \"assert color_enabled('auto', 'TRUE') == False\", \"assert color_enabled('off', 'TRUE') == False\", \"assert color_enabled('...
{ "split": "train", "index": 1460, "acecode_id": "bigcode_python_fns_19091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of bars in a histogram where the width of each bar is 1. Write a function `max_area(heights: List[int]) -> int` that returns the area of the largest rectangle that can be formed within the bounds of the histogram. The ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area([1, 1, 1, 1]) == 4\", \"assert max_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_area([1]) == 1\", \"assert max_area([]) == 0\", \"assert max_area([5, 4, 1, 2]) == 8\", \"assert max_area([1, 3, 2, 5, 25...
{ "split": "train", "index": 1461, "acecode_id": "bigcode_python_fns_9882", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function `merge_with_fixes` that simulates the merging of a pull request with specific details. The function takes four parameters: `commit_title` (a string representing the title of the commit), `commit_message` (a string representing the message for the commit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_with_fixes('Initial Commit', 'This is the first commit', 'merge', 'abc123') == {'title': 'Initial Commit', 'message': 'This is the first commit', 'method': 'merge', 'sha': 'abc123'}\", \"assert merge_with_fixes('Feature Update', 'Added new features', '...
{ "split": "train", "index": 1462, "acecode_id": "bigcode_python_fns_37827", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that converts a hexadecimal string representation into its binary string representation. The function should take a single parameter, 'hex_number', which is a string containing valid hexadecimal digits (0-9, A-F, a-f) and return a string representing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_bin('0') == '0'\", \"assert hex_to_bin('F') == '1111'\", \"assert hex_to_bin('10') == '10000'\", \"assert hex_to_bin('1') == '1'\", \"assert hex_to_bin('2A') == '101010'\", \"assert hex_to_bin('FF') == '11111111'\", \"assert hex_to_bin('A0') == '10100...
{ "split": "train", "index": 1463, "acecode_id": "evol_26360", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of sentences and returns the frequency of each unique word in the sentences. The function `word_frequency(sentences)` takes a list of strings as input, where each string represents a sentence. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency(['Hello world', 'Hello']) == {'hello': 2, 'world': 1}\", \"assert word_frequency(['Python is great', 'Python is fun']) == {'python': 2, 'is': 2, 'great': 1, 'fun': 1}\", \"assert word_frequency(['a b c', 'A B C']) == {'a': 2, 'b': 2, 'c': 2}\"...
{ "split": "train", "index": 1464, "acecode_id": "oss_35245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of observations where each observation is represented as a tuple containing the plot_id, taxa, and sex of an individual. Your task is to group these observations by plot_id, taxa, and sex, count the number of observations in each group, and return a diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_observations([(1, 'A', 'M'), (1, 'A', 'F'), (1, 'B', 'M'), (1, 'A', 'M')]) == {(1, 'A', 'M'): 2, (1, 'A', 'F'): 1, (1, 'B', 'M'): 1}\", \"assert count_observations([(2, 'A', 'M'), (2, 'A', 'M'), (2, 'A', 'F'), (2, 'B', 'F')]) == {(2, 'A', 'M'): 2, (2, ...
{ "split": "train", "index": 1465, "acecode_id": "oss_11513", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and an integer target as input and returns a list of unique pairs (as tuples) from the list that sum up to the target. A pair is considered unique if it consists of two different numbers (not the same index)....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_pairs([0, 0, 0, 0], 0) == [(0, 0)]\", \"assert find_unique_pairs([], 5) == []\", \"assert find_unique_pairs([5, 5, 5, 5], 10) == [(5, 5)]\", \"assert find_unique_pairs([1, 2, 3, 4, 5], 10) == []\", \"assert find_unique_pairs([1, 2, 2, 3, 3], 4) =...
{ "split": "train", "index": 1466, "acecode_id": "bigcode_python_fns_20388", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with constructing a message header for a 'HostNameRequest' command based on the provided size of the hostname string. Implement a function that takes an integer parameter `payload_size`, which represents the length of the hostname string. If the `payload_size` ex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert HostNameRequestHeader(0) == (21, 0, 0, 0, 0, 0)\", \"assert HostNameRequestHeader(1) == (21, 1, 0, 0, 0, 0)\", \"assert HostNameRequestHeader(65535) == (21, 65535, 0, 0, 0, 0)\", \"assert HostNameRequestHeader(100) == (21, 100, 0, 0, 0, 0)\", \"assert HostNa...
{ "split": "train", "index": 1467, "acecode_id": "bigcode_python_fns_36556", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a dataset containing information about quasars (QSOs). Write a function that calculates the mean wavelength and corresponding values of eta for specified restframe wavelength ranges. The function should take in two parameters: a dataset `qso` which...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_restframe_ranges({'zq': [0.5, 1.2, 0.8], 'sn': [6, 7, 8], 'wl': [1355, 1365, 1370]}, [[1350, 1360]]) == [(1355.0, 1)]\", \"assert analyze_restframe_ranges({'zq': [0.5, 1.2, 0.8], 'sn': [4, 7, 8], 'wl': [1355, 1365, 1370]}, [[1350, 1360]]) == [(1355.0...
{ "split": "train", "index": 1468, "acecode_id": "oss_9963", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that serializes a blog post into a dictionary format. The function should take three parameters: a string `title`, a datetime object `publish`, and a string `body`. The function should return a dictionary containing the serialized blo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_blog_post('First Post', datetime.datetime(2022, 5, 1, 10, 30), 'This is the first post.') == {'title': 'First Post', 'publish': datetime.datetime(2022, 5, 1, 10, 30), 'body': 'This is the first post.'}\", \"assert serialize_blog_post('Second Post',...
{ "split": "train", "index": 1469, "acecode_id": "oss_12953", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested dictionary representing complex data, implement a Python function that converts this dictionary into a YAML string format. The dictionary may contain various levels of nested dictionaries and lists. Your function should ensure that all data types are correctly re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_dict_to_yaml({'employees': [{'name': 'John', 'role': 'developer'}, {'name': 'Doe', 'role': 'designer'}]}) == 'employees:\\\\n- name: John\\\\n role: developer\\\\n- name: Doe\\\\n role: designer\\\\n'\", \"assert convert_dict_to_yaml({'nested': {'l...
{ "split": "train", "index": 1470, "acecode_id": "evol_36144", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to set the recurrence of a calendar event. The function should take in the event details as a string and the days of the week on which the event should occur as variable arguments. The days of the week are represented by their full na...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_event_recurrence('Weekly Review', 'Sunday', 'Wednesday') == \\\"Recurrence set for 'Weekly Review' on Sun and Wed\\\"\", \"assert set_event_recurrence('Birthday Party', 'Monday', 'Tuesday', 'Funday') == \\\"Recurrence set for 'Birthday Party' on Mon and ...
{ "split": "train", "index": 1471, "acecode_id": "oss_5741", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of vehicles, where each vehicle is represented as a dictionary containing the keys 'make', 'model', 'year', 'color', and 'mileage'. The function should return a list of strings, where each string describes a vehicle in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert describe_vehicles([]) == []\", \"assert describe_vehicles([{'make': 'Toyota', 'model': 'Camry', 'year': 2020, 'color': 'Blue', 'mileage': 30000.5}]) == ['2020 Toyota Camry (Blue) - Mileage: 30000.5 miles']\", \"assert describe_vehicles([{'make': 'Honda', 'mo...
{ "split": "train", "index": 1472, "acecode_id": "oss_33804", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages college information. The function should take a list of college objects and return a list of college names that are located in a specific location. Each college object is represented as a dictionary with keys 'name', 'locatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_colleges_by_location([{'name': 'College A', 'location': 'New York', 'description': 'Description A'},{ 'name': 'College B', 'location': 'Los Angeles', 'description': 'Description B'}], 'New York') == ['College A']\", \"assert filter_colleges_by_locatio...
{ "split": "train", "index": 1473, "acecode_id": "oss_36104", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the sum of the inverses (1/i) for all integers i in the range from 1 to n (inclusive). If an exception occurs while calculating the inverse for any i, you should log the exception message and the value of i. The function should terminate and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_inverse_sum(1) == 1.0\", \"assert calculate_inverse_sum(2) == 1.5\", \"assert calculate_inverse_sum(3) == 1.8333333333333333\", \"assert calculate_inverse_sum(4) == 2.083333333333333\", \"assert calculate_inverse_sum(5) == 2.283333333333333\", \"as...
{ "split": "train", "index": 1474, "acecode_id": "evol_32258", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a binary string representing a binary image. Your task is to replace a specific section of this binary image with new bytes starting from a given address. Write a function `replace_bytes_in_binary_image` that takes the following parameters: \n\n- `binary_image` (s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_bytes_in_binary_image('hello world', 6, 'Python') == 'hello Python'\", \"assert replace_bytes_in_binary_image('11111', 0, '000') == '00011'\", \"assert replace_bytes_in_binary_image('data1234', 4, '5678') == 'data5678'\", \"assert replace_bytes_in_bi...
{ "split": "train", "index": 1475, "acecode_id": "bigcode_python_fns_5766", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the number of words in different sentences, write a function that returns the maximum number of words in a single sentence and the total number of sentences provided. The function should take a list of integers as input and return a tuple c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_words_and_count([10, 20, 30, 40]) == (40, 4)\", \"assert max_words_and_count([1, 2, 3, 4, 5]) == (5, 5)\", \"assert max_words_and_count([]) == (0, 0)\", \"assert max_words_and_count([0, 0, 0]) == (0, 3)\", \"assert max_words_and_count([100]) == (100, 1)\...
{ "split": "train", "index": 1476, "acecode_id": "bigcode_python_fns_43658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the sum of all the even numbers in the list. If there are no even numbers, return 0. The function should be defined as follows: `def sum_of_evens(nums: List[int]) -> int:` where `nums` is a list of integers. The input list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, -2, -4, 1, 3]) == -6\", \"assert sum_of_evens([7, 9, 11]) == 0\", \"assert sum_of_evens([-1, -2, -3, -4, -5]) == -6\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20...
{ "split": "train", "index": 1477, "acecode_id": "bigcode_python_fns_27022", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_user_activities(user_id: int, timestamp_start: int, timestamp_end: int) -> List[int]` that retrieves a list of activity IDs for a user within a specified time range. The function should return a list of activity IDs that fall between...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_activities(1, 1000, 2000) == [1, 2, 3]\", \"assert get_user_activities(2, 1500, 2500) == [4, 5]\", \"assert get_user_activities(1, 0, 500) == []\", \"assert get_user_activities(4, 1000, 1000) == []\", \"assert get_user_activities(2, 400, 800) == []\...
{ "split": "train", "index": 1478, "acecode_id": "bigcode_python_fns_10008", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that processes a given string to extract specific information. Your program should take a string as input and return the number of vowels and consonants in the string. For the purpose of this problem, consider the English alphabet and the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_vowels_consonants('Python 3.8') == {'Number of vowels': 1, 'Number of consonants': 5}\", \"assert count_vowels_consonants('') == {'Number of vowels': 0, 'Number of consonants': 0}\", \"assert count_vowels_consonants('1234567890') == {'Number of vowels'...
{ "split": "train", "index": 1479, "acecode_id": "oss_26486", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to generate an inverted index for a collection of documents. The inverted index should map each unique word in the documents to the list of document IDs in which it appears. The preprocessing involves tokenizing the text, converting i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compile_inverted_index(['Hello world', 'Hello there', 'World of Python']) == {'hello': [0, 1], 'world': [0, 2], 'there': [1], 'of': [2], 'python': [2]}\", \"assert compile_inverted_index(['Sample document', 'Sample document']) == {'sample': [0, 1], 'document...
{ "split": "train", "index": 1480, "acecode_id": "oss_7442", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a decorator function called `since` that appends a version number to the docstring of a given function. The decorator should take a single parameter, `version`, which can be a string, float, or int. When applied to a function, it should modify that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert (since('1.0.0')(lambda: None).__doc__ == '\\\\n\\\\n.. versionadded:: 1.0.0')\", \"assert (since(2.0)(lambda: None).__doc__ == '\\\\n\\\\n.. versionadded:: 2.0')\", \"assert (since('3.1.4')(lambda: None).__doc__ == '\\\\n\\\\n.. versionadded:: 3.1.4')\", \"a...
{ "split": "train", "index": 1481, "acecode_id": "bigcode_python_fns_29787", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total dimensionality of a neural network layer based on the dimensions of the individual neurons within that layer. The dimensionality of a layer is defined as the sum of the dimensions of all the individual neurons. Implement a function `tot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_dimensionality([3, 5, 2]) == 10\", \"assert total_dimensionality([1, 1, 1, 1]) == 4\", \"assert total_dimensionality([10]) == 10\", \"assert total_dimensionality([100, 200, 300]) == 600\", \"assert total_dimensionality([5, 5, 5, 5, 5]) == 25\", \"asser...
{ "split": "train", "index": 1482, "acecode_id": "oss_30293", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two lists as input: `operation_elements` and `number_elements`. The `operation_elements` list contains arithmetic operations as strings, and the `number_elements` list contains numerical values. Your function should perform the operations in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_complex_arithmetic_functions(['+'], [1, 2]) == 3\", \"assert execute_complex_arithmetic_functions(['-', '+'], [5, 2, 3]) == 6\", \"assert execute_complex_arithmetic_functions(['//'], [10, 2]) == 5\", \"assert execute_complex_arithmetic_functions(['%'...
{ "split": "train", "index": 1483, "acecode_id": "evol_3819", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of subjobs for a job management system. Each subjob is represented as a dictionary containing the following keys: 'key' (subjob key), 'status' (current status), and 'parent_batch_key' (parent batch key). Your goal is to implement a function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_batch([{'key': 'subjob1', 'status': 'COMPLETED', 'parent_batch_key': 'batch1'}, {'key': 'subjob2', 'status': 'FAILED', 'parent_batch_key': 'batch1'}]) == {'batch_key': 'new_batch_key', 'subjob_keys': ['subjob1', 'subjob2'], 'is_batch': 1}\", \"assert...
{ "split": "train", "index": 1484, "acecode_id": "oss_36469", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a list of unique integers that are less than 50, ensuring that the order of their first occurrence is preserved. The function should only return each integer once, even if it appears multiple times in the input list.\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert FunctionB([10, 20, 30, 40, 10, 20]) == [10, 20, 30, 40]\", \"assert FunctionB([60, 70, 80]) == []\", \"assert FunctionB([5, 5, 5, 5, 5]) == [5]\", \"assert FunctionB([0, 1, 2, 3, 4, 5]) == [0, 1, 2, 3, 4, 5]\", \"assert FunctionB([-1, -2, -50, 49, 49]) == [-...
{ "split": "train", "index": 1485, "acecode_id": "evol_25478", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a task, which can either be a function or a string, implement a function `get_task_name(task)` that returns the name of the task as a string. If the task is a function, the function should return its name. If the task is a string, it should return the string itself. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_task_name(str) == 'str'\", \"assert get_task_name('Task A') == 'Task A'\", \"assert get_task_name(sum) == 'sum'\", \"assert get_task_name(list) == 'list'\", \"assert get_task_name(object) == 'object'\", \"assert get_task_name(type) == 'type'\", \"assert ...
{ "split": "train", "index": 1486, "acecode_id": "bigcode_python_fns_23152", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `get_default_value(var: str, default: Union[str, None]) -> Union[str, None]`. This function should return the `default` value if it is not None; otherwise, it should raise a `ValueError` with the message 'Missing secret for {va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_default_value('API_KEY', '12345') == '12345'\", \"assert get_default_value('USERNAME', 'user01') == 'user01'\", \"assert get_default_value('SESSION_ID', 'abcde') == 'abcde'\", \"assert get_default_value('DB_CONNECTION', 'localhost') == 'localhost'\", \"a...
{ "split": "train", "index": 1487, "acecode_id": "bigcode_python_fns_45387", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `graph` and `subgraph`, determine if `subgraph` is a spanning subgraph of `graph`. A subgraph is considered spanning if it contains all unique elements from `graph`. Implement a function `is_spanning(graph: List[int], subgraph: List[int]) -> bool` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_spanning([1, 2, 3, 4], [1, 2, 3, 4]) == True\", \"assert is_spanning([1, 2, 2, 3], [1, 2, 3]) == True\", \"assert is_spanning([1, 2], [2, 2]) == False\", \"assert is_spanning([5, 6, 7], [6, 7, 5]) == True\", \"assert is_spanning([1, 1, 1, 1], [1]) == True...
{ "split": "train", "index": 1488, "acecode_id": "bigcode_python_fns_36411", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function to find the second highest value within a specified range in a given list of integers. The function should take a list of integers and two integers denoting the start and end of the range. If there are fewer than two distinct values in the range, the function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_highest_in_range([15, 25, 35, 45, 55, 20, 30, 40], 25, 45) == 40\", \"assert second_highest_in_range([1, 2, 3, 4, 5], 2, 4) == 3\", \"assert second_highest_in_range([10, 10, 10, 10], 5, 15) == None\", \"assert second_highest_in_range([5, 6, 7, 8, 9], ...
{ "split": "train", "index": 1489, "acecode_id": "evol_15093", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the daily stock prices of a company. Your task is to write a function that calculates the maximum profit that can be obtained by buying and selling the stock on different days. The function should take the list of stock prices as in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([2, 4, 1, 3]) == 2\", \"assert max_profit([1]) == 0\", \"assert ...
{ "split": "train", "index": 1490, "acecode_id": "oss_3353", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named 'create_skateboard' that takes two parameters: 'material' (a string representing the type of material the skateboard is made of) and 'trucks' (an integer representing the number of trucks the skateboard incorporates). The function should return a dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_skateboard('wood', 2) == {'material': 'wood', 'trucks': 2}\", \"assert create_skateboard('plastic', 4) == {'material': 'plastic', 'trucks': 4}\", \"assert create_skateboard('metal', 1) == {'material': 'metal', 'trucks': 1}\", \"assert create_skateboar...
{ "split": "train", "index": 1491, "acecode_id": "evol_29190", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing genetic variant information. Each variant is represented as a dictionary that contains an 'INFO' key, which itself is a dictionary. Your task is to implement a function that retrieves the minor allele frequency (MAF) from the 'INFO' dicti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_maf({'INFO': {'MAF': 0.25}}) == 0.25\", \"assert get_maf({'INFO': {'MAF': 0.3}}) == 0.3\", \"assert get_maf({'INFO': {'MAF': 0.1}}) == 0.1\", \"assert get_maf({'INFO': {'MAF': 0.5}}) == 0.5\", \"assert get_maf({'INFO': {'MAF': 0.0}}) == 0.0\", \"assert g...
{ "split": "train", "index": 1492, "acecode_id": "bigcode_python_fns_43196", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a sign-out process for users in a timesheet system. The function should accept the user ID, date, a sign-out time in the format 'HH:MM' (24-hour format), and a boolean flag indicating whether the user forgot to sign out...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sign_out('user123', '2023-10-01', '17:30', False) == {'user_id': 'user123', 'date': '2023-10-01', 'time_out': '17:30', 'forgot': False}\", \"assert sign_out('user456', '2023-10-01', '18:00', True) == {'user_id': 'user456', 'date': '2023-10-01', 'time_out': '...
{ "split": "train", "index": 1493, "acecode_id": "bigcode_python_fns_43970", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that determines the type of environment in which a Python script is being executed. The function should take no arguments and return a string indicating the type of environment. The possible environment types are 'Jupyter noteb...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_environment_type() == 'Other'\", \"assert determine_environment_type() == 'Other'\", \"assert determine_environment_type() == 'Other'\", \"assert determine_environment_type() == 'Other'\", \"assert determine_environment_type() == 'Other'\", \"asser...
{ "split": "train", "index": 1494, "acecode_id": "oss_2859", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an achievement ID (aid), return the corresponding processor module name based on a predefined mapping. If the achievement ID does not exist in the mapping, return the string 'Achievement not found.'. Implement a single function `get_processor(aid: str) -> str` that fulfil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_processor('1') == 'ProcessorA'\", \"assert get_processor('2') == 'ProcessorB'\", \"assert get_processor('3') == 'ProcessorC'\", \"assert get_processor('4') == 'Achievement not found.'\", \"assert get_processor('5') == 'Achievement not found.'\", \"assert...
{ "split": "train", "index": 1495, "acecode_id": "bigcode_python_fns_21992", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a predefined tuple representing a clinical cup description. The tuple should consist of the following elements: a string representing the volume in ounces, a string representing the number of cups, a string representing the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_clinical_cup() == ('8', '2', 'M', '01', 25)\", \"assert type(get_clinical_cup()) == tuple\", \"assert len(get_clinical_cup()) == 5\", \"assert get_clinical_cup()[0] == '8'\", \"assert get_clinical_cup()[1] == '2'\", \"assert get_clinical_cup()[2] == 'M'\...
{ "split": "train", "index": 1496, "acecode_id": "bigcode_python_fns_37458", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a multidimensional array (list of lists) and a target element, implement a function that performs a sequential search to find all the occurrences of the target element within the array. The function should return a list of tuples, where each tuple contains the row and col...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_element([[1,1,1], [1,1,1], [1,1,1]], 1) == [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)]\", \"assert search_element([[1,2,3], [4,5,6]], 7) == []\", \"assert search_element([[10,20,30], [40,50,60], [70,80,90]], 50) == [(1, 1)...
{ "split": "train", "index": 1497, "acecode_id": "evol_12492", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the lengths of rods, write a function that determines the maximum possible length of a single rod that can be formed by combining any two distinct rods from the list. The function should return this maximum length. If no two rods can be com...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_combined_length([1, 2, 3, 4, 5]) == 9\", \"assert max_combined_length([10, 20, 30]) == 50\", \"assert max_combined_length([5, 1]) == 6\", \"assert max_combined_length([7]) == 0\", \"assert max_combined_length([]) == 0\", \"assert max_combined_length([1, ...
{ "split": "train", "index": 1498, "acecode_id": "bigcode_python_fns_8275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage user registrations in a gaming guild. You need to create a function `add_user` that takes two parameters: `user` (user's ID) and `guild` (guild's ID). The function should check if the user already exists in the guild. If the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_user(1, 101) == False\", \"assert add_user(3, 102) == True\", \"assert add_user(8, 101) == True\", \"assert add_user(9, 101) == True\", \"assert add_user(10, 101) == True\", \"assert add_user(11, 101) == True\", \"assert add_user(13, 101) == True\", \"as...
{ "split": "train", "index": 1499, "acecode_id": "oss_35375", "num_tests": 9 }