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": "Implement a function `calculate_bonus(experience: int, salary: float) -> float` that calculates the bonus for an employee based on their years of experience and salary. The bonus structure is as follows: If the experience is less than or equal to 2 years, the bonus is 5% of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_bonus(1, 50000) == 2500.0\", \"assert calculate_bonus(2, 60000) == 3000.0\", \"assert calculate_bonus(3, 70000) == 7000.0\", \"assert calculate_bonus(4, 80000) == 8000.0\", \"assert calculate_bonus(5, 90000) == 9000.0\", \"assert calculate_bonus(6,... | {
"split": "train",
"index": 79400,
"acecode_id": "evol_917",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function that takes a list of integers, including negative numbers and zero, and identifies all prime numbers within the list. The function should also calculate the product of all prime numbers, ensuring that the product can exceed the maximum limit for inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_prime_numbers([-10, -7, 0, 1, 2, 3, 4, 5]) == ([2, 3, 5], 30, 10)\", \"assert find_prime_numbers([11, 13, 17, 19]) == ([11, 13, 17, 19], 46189, 60)\", \"assert find_prime_numbers([4, 6, 8, 10]) == ([], 1, 0)\", \"assert find_prime_numbers([20, 21, 22, 2... | {
"split": "train",
"index": 79401,
"acecode_id": "evol_738",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that rearranges a list of integers based on a string of operation names. The operations can include division by a custom number ('divN'), squaring ('pow2'), adding a custom number ('addN'), and calculating the square root ('sqrt'). The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_on_operations('div0,sqrt', [1, 4, -1]) == {'div0': ['Error', 'Error', 'Error'], 'sqrt': [1.0, 2.0, 'Error']}\", \"assert rearrange_on_operations('pow2', [2, 3, 4]) == {'pow2': [4, 9, 16]}\", \"assert rearrange_on_operations('add10', [1, 2, 3]) == {... | {
"split": "train",
"index": 79402,
"acecode_id": "evol_34281",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that inserts multiple elements at specified indices in a singly linked list. The function should take a list of tuples, where each tuple contains an element to insert and its corresponding index. The function will create a singly linked list from an initial... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_multiple_elements([1, 2, 3, 4, 5, 6, 7, 8, 9], [('Hello', 1), (10, 3), ('World', 5)]) == ['1', 'Hello', '2', '10', '3', 'World', '4', '5', '6', '7', '8', '9']\", \"assert insert_multiple_elements([1, 2, 3], [(100, 0)]) == ['100', '1', '2', '3']\", \"a... | {
"split": "train",
"index": 79403,
"acecode_id": "evol_4790",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with filtering a list of airspace objects based on specific criteria. Each airspace object contains details such as its name, altitude, and type. Implement a function `filter_airspaces()` that takes in the following parameters: \n- `airspaces` (list): A list of a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_airspaces([{'name': 'Airspace A', 'altitude': 2000, 'type': 'Controlled Airspace'}, {'name': 'Airspace B', 'altitude': 6000, 'type': 'Restricted Airspace'}], 1000, 5000, ['Controlled Airspace', 'Restricted Airspace']) == [{'name': 'Airspace A', 'altit... | {
"split": "train",
"index": 79404,
"acecode_id": "oss_9087",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_lucas_fibonacci_ratios(n: int) -> List[Tuple[int, int, float]]` that returns a list of tuples containing the first `n` numbers of the Lucas number series and their corresponding Fibonacci numbers, along with the ratio of Lucas to Fibonacci number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_lucas_fibonacci_ratios(2) == [(2, 0, 'inf'), (1, 1, 1.0)]\", \"assert calculate_lucas_fibonacci_ratios(3) == [(2, 0, 'inf'), (1, 1, 1.0), (3, 1, 3.0)]\", \"assert calculate_lucas_fibonacci_ratios(4) == [(2, 0, 'inf'), (1, 1, 1.0), (3, 1, 3.0), (4, ... | {
"split": "train",
"index": 79405,
"acecode_id": "evol_27327",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a unique store key for a user based on their user ID and an optional section identifier. Write a function `gen_key` that takes two parameters: a string `uid` representing the user ID and an optional string `section` (defaulting to 's'). The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gen_key('12345') == b'cs:s:12345'\", \"assert gen_key('12345', 'a') == b'cs:a:12345'\", \"assert gen_key('user1') == b'cs:s:user1'\", \"assert gen_key('user1', 'b') == b'cs:b:user1'\", \"assert gen_key('45678') == b'cs:s:45678'\", \"assert gen_key('test_user... | {
"split": "train",
"index": 79406,
"acecode_id": "bigcode_python_fns_25234",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the area of a circle using numerical integration. The function should take the radius of the circle as an input and return the area. You can assume the value of π to be 3.14159. Implement a function `calculate_c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_circle_area(1) == 3.14159\", \"assert calculate_circle_area(2) == 12.56636\", \"assert calculate_circle_area(3) == 28.27431\", \"assert calculate_circle_area(4) == 50.26544\", \"assert calculate_circle_area(5) == 78.53975\", \"assert calculate_circ... | {
"split": "train",
"index": 79407,
"acecode_id": "oss_18378",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that determines the maximum sum of a non-empty subarray. A subarray is defined as a contiguous part of an array. You need to implement the function `max_subarray_sum(arr: List[int]) -> int`, where `arr` is a list of integers. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, 2, 3, 4]) == 10\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, 1, 2, 3]) ... | {
"split": "train",
"index": 79408,
"acecode_id": "bigcode_python_fns_24252",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple representing the scale of an object in a 3D coordinate system, implement a function that converts this scale from a specified coordinate system to another. The input will be a tuple of three float values representing the scale, and a boolean flag indicating whethe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_scale((1.0, 2.0, 3.0), True) == (1.0, 3.0, 2.0)\", \"assert convert_scale((1.0, 2.0, 3.0), False) == (1.0, 2.0, 3.0)\", \"assert convert_scale((0.0, 0.0, 0.0), True) == (0.0, 0.0, 0.0)\", \"assert convert_scale((-1.0, -2.0, -3.0), True) == (-1.0, -3.... | {
"split": "train",
"index": 79409,
"acecode_id": "bigcode_python_fns_33788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `dec_to_bin(n: int) -> str` that converts a given decimal integer `n` (0 <= n <= 1000) into its corresponding binary representation as a string, without using the built-in `bin()` function. The output should not include the '0b' prefix.\nPlease reason step by s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dec_to_bin(0) == '0'\", \"assert dec_to_bin(1) == '1'\", \"assert dec_to_bin(2) == '10'\", \"assert dec_to_bin(3) == '11'\", \"assert dec_to_bin(4) == '100'\", \"assert dec_to_bin(5) == '101'\", \"assert dec_to_bin(10) == '1010'\", \"assert dec_to_bin(15) ==... | {
"split": "train",
"index": 79410,
"acecode_id": "evol_1352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of mixed data types, implement a function `handle_array(arr)` that processes the array in the following way: 1. Create a copy of the original array. 2. Subtract 7 from each numeric element of the copied array. 3. If an element is not a number (including null or u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_array([15, 20, 36, 8, 13, 'six', None, 200]) == [8, 13, 29, 1, 6, 'six', None, 193]\", \"assert handle_array([1, 2, 3, 4, 5]) == [-6, -5, -4, -3, -2]\", \"assert handle_array(['a', 'b', 'c', 10, None]) == ['a', 'b', 'c', 3, None]\", \"assert handle_ar... | {
"split": "train",
"index": 79411,
"acecode_id": "evol_3163",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Trie data structure with the following functionalities: 1) Insert a word into the Trie. 2) Search for a word in the Trie (case-insensitive). 3) Check if any word from a provided list can be formed using the words stored in the Trie. 4) Count the frequency of a store... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Trie().insert('hello') == None\", \"assert Trie().search('Hello') == False\", \"assert trie.countWordFreq('hello') == 1\", \"assert trie.canForm(['helloo']) == False\"]}"
} | {
"split": "train",
"index": 79412,
"acecode_id": "evol_35749",
"num_tests": 4
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of passengers at different train stations along a route. Your task is to implement a function that calculates the maximum number of passengers at any train station. The function should take a list of integers as input and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_passengers([-5, -10, -3]) == 0\", \"assert max_passengers([0, 0, 0]) == 0\", \"assert max_passengers([]) == 0\", \"assert max_passengers([-10, -20, 0]) == 0\", \"assert max_passengers([1, -1, 1, -1, 1]) == 1\", \"assert max_passengers([10, -10, 10, -10, ... | {
"split": "train",
"index": 79413,
"acecode_id": "bigcode_python_fns_35572",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a nested list of integers, you need to construct a representation of a ragged tensor. A ragged tensor is a tensor where each row can have a different number of elements. Your task is to implement the function `create_ragged_tensor(pylist: List[List[int]]) -> Tuple[List[in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_ragged_tensor([[1, 2], [3], [4, 5, 6]]) == ([1, 2, 3, 4, 5, 6], [0, 2, 3, 6])\", \"assert create_ragged_tensor([[10], [20, 30], [], [40, 50, 60, 70]]) == ([10, 20, 30, 40, 50, 60, 70], [0, 1, 3, 3, 7])\", \"assert create_ragged_tensor([[1], [2], [3], ... | {
"split": "train",
"index": 79414,
"acecode_id": "bigcode_python_fns_26944",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two lists of strings, `predictions` and `true_labels`, where each string represents a sequence of characters, write a function `calculate_char_error_rate(predictions: List[str], true_labels: List[str]) -> List[float]` that computes the character error rate (CER) for each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_char_error_rate(['hello', 'world'], ['hello', 'world']) == [0.0, 0.0]\", \"assert calculate_char_error_rate(['hello', 'w0rld'], ['hello', 'world']) == [0.0, 0.2]\", \"assert calculate_char_error_rate(['abc', 'def'], ['abcd', 'de']) == [0.25, 0.5]\"... | {
"split": "train",
"index": 79415,
"acecode_id": "bigcode_python_fns_26715",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `subtract_two_numbers` that takes two complex numbers as input and returns their difference. The function should ensure that both inputs are complex numbers and return an error message if they are not. The function is expected to handle large inputs ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subtract_two_numbers(complex(3, 4), complex(1, 2)) == complex(2, 2)\", \"assert subtract_two_numbers(complex(5, 5), complex(5, 5)) == complex(0, 0)\", \"assert subtract_two_numbers(complex(1, 1), complex(0, 0)) == complex(1, 1)\", \"assert subtract_two_numbe... | {
"split": "train",
"index": 79416,
"acecode_id": "evol_13082",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer or a string representing a percentage, write a function `factor_size(value: Union[int, str], factor: int) -> str` that takes an input `value`, which can either be an integer representing an absolute size or a string representing a percentage (ending with '%'). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factor_size(50, 2) == '100'\", \"assert factor_size(0, 5) == ''\", \"assert factor_size(10, 3) == '30'\", \"assert factor_size(25, 4) == '100'\", \"assert factor_size(100, 1) == '100'\", \"assert factor_size(0, 0) == ''\", \"assert factor_size(75, 0) == ''\"... | {
"split": "train",
"index": 79417,
"acecode_id": "bigcode_python_fns_27511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a start datetime and an end datetime of an event. Your task is to convert this event into a list of time boxes that represent the time allocated to this event over one or more days. Each time box should be structured as a tuple where the first element is the day i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_event_to_boxes('2023-10-01 09:00:00', '2023-10-01 17:00:00') == [(0, 9.0, 17.0)]\", \"assert convert_event_to_boxes('2023-10-01 15:30:00', '2023-10-01 18:45:00') == [(0, 15.5, 18.75)]\", \"assert convert_event_to_boxes('2023-10-01 18:00:00', '2023-10... | {
"split": "train",
"index": 79418,
"acecode_id": "bigcode_python_fns_7758",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the extraction of login parameters from a given URL response. Your goal is to implement a function that takes a URL containing query parameters and extracts specific parameters required for authentication. The parameters to extract are `client_id`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_login_params('https://auth.tesla.com/login?client_id=ownerapi&code_challenge=abc123&code_challenge_method=S256&redirect_uri=https://auth.tesla.com/void/callback') == {'client_id': 'ownerapi', 'code_challenge': 'abc123', 'code_challenge_method': 'S256... | {
"split": "train",
"index": 79419,
"acecode_id": "oss_20844",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of lists representing an Excel-like table and extracts specific information from it. The function should take in a 2D list and return a dictionary containing the following information: 1. The number of rows in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_table([[\\\"Header1\\\", \\\"Header2\\\"], [1, 2], [3, 4]]) == {'num_rows': 2, 'num_cols': 2, 'column_names': ['Header1', 'Header2']}\", \"assert process_table([[\\\"Name\\\", \\\"Age\\\", \\\"City\\\"], [\\\"Alice\\\", 30, \\\"New York\\\"], [\\\"Bo... | {
"split": "train",
"index": 79420,
"acecode_id": "oss_32911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the sender's user profile data from a given object. The function should take an object as input and return the sender's data formatted as a dictionary. The input object has a `sender` attribute, which itself has a `user_pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sender_data({'sender': {'user_profile': {'name': 'Alice', 'email': 'alice@example.com', 'age': 30}}}) == {'name': 'Alice', 'email': 'alice@example.com', 'age': 30}\", \"assert get_sender_data({'sender': {'user_profile': {'name': 'Bob', 'email': 'bob@exam... | {
"split": "train",
"index": 79421,
"acecode_id": "oss_15796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `generate_entry_point` that takes a string `plugin_name` as input and returns the entry point string in the format `'testplan = plugin_name'`. The function should correctly format the entry point for the given plugin name, ensuring that it is returned as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_entry_point('pytest_testplan') == 'testplan = pytest_testplan'\", \"assert generate_entry_point('my_custom_plugin') == 'testplan = my_custom_plugin'\", \"assert generate_entry_point('test_plugin_123') == 'testplan = test_plugin_123'\", \"assert gene... | {
"split": "train",
"index": 79422,
"acecode_id": "oss_14717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers as input and returns a new list containing only the unique elements from the original list, preserving their original order. The output list should not contain any duplicate elements.\nPlease reason step by step, then write a self-... | 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]\", \"assert remove_duplicates([5, 4, 3, 2, 1]) == [5, 4, 3, 2, 1]\", \"assert remove_duplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert rem... | {
"split": "train",
"index": 79423,
"acecode_id": "evol_2397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_parameters(query_string: str) -> dict` that takes a query string in the format 'key1=value1&key2=value2&...' and returns a dictionary where the keys are the parameter names and the values are the corresponding parameter values. You can assume that the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_parameters('name=John&age=93&occupation=Retired') == {'name': 'John', 'age': '93', 'occupation': 'Retired'}\", \"assert extract_parameters('color=blue&size=medium') == {'color': 'blue', 'size': 'medium'}\", \"assert extract_parameters('fruit=apple&qu... | {
"split": "train",
"index": 79424,
"acecode_id": "evol_3137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns the sum of all even numbers in that list. If the list is empty, the function should return 0. Implement the function `sum_of_evens(nums: List[int]) -> int` where `nums` is a list of integers. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -4, -6, 1]) == -12\", \"assert sum_of_evens([0, 1, 2, 3]) == 2\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"a... | {
"split": "train",
"index": 79425,
"acecode_id": "bigcode_python_fns_25285",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of detection scores and a corresponding list of keypoints for multiple persons, implement a function that returns the keypoints of the person with the highest detection score. Each keypoint consists of three values (x, y, score). If there are no detection scores pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_highest_keypoints([0.9, 0.8, 0.75], [[1.0, 2.0, 0.9], [2.0, 3.0, 0.8], [3.0, 4.0, 0.75]]) == [1.0, 2.0, 0.9]\", \"assert select_highest_keypoints([0.0], [[1.0, 2.0, 0.0]]) == [1.0, 2.0, 0.0]\", \"assert select_highest_keypoints([0.5, 0.6], [[1.0, 2.0,... | {
"split": "train",
"index": 79426,
"acecode_id": "bigcode_python_fns_10214",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You have been given a list of integers representing the execution times of various functions in a Python application. Your task is to identify the function with the maximum execution time and return its execution time. If there are multiple functions with the same maximum execu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_execution_time([10, 20, 30, 40, 50]) == 50\", \"assert max_execution_time([5, 5, 5, 5]) == 5\", \"assert max_execution_time([100, 90, 80, 70]) == 100\", \"assert max_execution_time([1, 2, 3, 4, 5, 6]) == 6\", \"assert max_execution_time([50]) == 50\", \"... | {
"split": "train",
"index": 79427,
"acecode_id": "oss_29501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers and returns a new list containing the same integers in reverse order. The input list will have a length of n (1 <= n <= 1000).\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_array([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_array([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_array([7]) == [7]\", \"assert reverse_array([-1, -2, -3]) == [-3, -2, -1]\", \"assert reverse_array([1, 3, 2, 4]) == [4, 2, 3, 1]\",... | {
"split": "train",
"index": 79428,
"acecode_id": "evol_1764",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes multiple numerical lists as arguments and combines them into a single string, where individual numbers are separated by commas and different lists are separated by a hyphen '-'. For example: [1, 2, 3], [4, 5, 6, 7], [8, 9] would give '1,2,3-4,5,6,7-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_lists([1, 2, 3], [4, 5, 6, 7], [8, 9]) == '1,2,3-4,5,6,7-8,9'\", \"assert combine_lists([10], [20, 30]) == '10-20,30'\", \"assert combine_lists([1, 2, 3], [4]) == '1,2,3-4'\", \"assert combine_lists([5, 6], [7, 8, 9]) == '5,6-7,8,9'\", \"assert combi... | {
"split": "train",
"index": 79429,
"acecode_id": "evol_3369",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `notify_voice_chat_start(member_name: str, before_channel: str, after_channel: str) -> str` that simulates sending a notification when a user starts a voice chat. The function should return a notification string in the format '{member_name} has started a vo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert notify_voice_chat_start('Alice', '', 'General') == 'Alice has started a voice chat.'\", \"assert notify_voice_chat_start('Bob', 'General', 'General') == ''\", \"assert notify_voice_chat_start('Charlie', 'General', '') == ''\", \"assert notify_voice_chat_star... | {
"split": "train",
"index": 79430,
"acecode_id": "evol_25993",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a comment made by a user. Your task is to concatenate all the comments into a single string with a space separating each comment. Implement a function called `combine_comments` that takes in a list of comments and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_comments(['Hello', 'World']) == 'Hello World'\", \"assert combine_comments(['This', 'is', 'a', 'test.']) == 'This is a test.'\", \"assert combine_comments(['SingleComment']) == 'SingleComment'\", \"assert combine_comments([]) == ''\", \"assert combin... | {
"split": "train",
"index": 79431,
"acecode_id": "bigcode_python_fns_49868",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of instructions represented as dictionaries, each containing an 'inst_type' and an 'addr', write a function that returns the address of the first instruction of type 'jmp_T'. If there are no instructions of this type in the list, return None. Each instruction is re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_jmp_addr([{'inst_type': 'nop', 'addr': 1}, {'inst_type': 'jmp_T', 'addr': 5}, {'inst_type': 'add', 'addr': 2}]) == 5\", \"assert get_jmp_addr([{'inst_type': 'jmp_F', 'addr': 3}, {'inst_type': 'jmp_T', 'addr': 7}, {'inst_type': 'jmp_T', 'addr': 2}]) == 7\... | {
"split": "train",
"index": 79432,
"acecode_id": "bigcode_python_fns_36620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that calculates the mean (average) of the integers in the list. The mean is defined as the sum of all elements divided by the number of elements. If the list is empty, you should raise a ValueError. Write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mean([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_mean([-1, -2, -3]) == -2.0\", \"assert calculate_mean([10, 20, 30, 40]) == 25.0\", \"assert calculate_mean([5]) == 5.0\", \"assert calculate_mean([0, 0, 0]) == 0.0\", \"assert calculate_mean([-1, 1... | {
"split": "train",
"index": 79433,
"acecode_id": "bigcode_python_fns_15400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the ratio of a specific word's frequency to the total word count in a given text. The function should take two parameters: a string 'word' and a string 'text'. It should return the ratio as a floating-point number. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert comp_ratio('hello', 'hello world hello') == 0.6666666666666666\", \"assert comp_ratio('world', 'hello world hello') == 0.3333333333333333\", \"assert comp_ratio('hello', 'hello! hello? hello...') == 1.0\", \"assert comp_ratio('test', 'this is a test text') =... | {
"split": "train",
"index": 79434,
"acecode_id": "oss_32020",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a mutant solution based on two given genomes and a scaling factor. The function should take in a list of two Genome objects and a scaling factor `K`, and return a new Genome object that represents the trial solution. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_mutant([Genome([1, 2, 3]), Genome([4, 5, 6])], 0.5).getSolution() == [2.5, 3.5, 4.5]\", \"assert generate_mutant([Genome([0, 0, 0]), Genome([1, 1, 1])], 1.0).getSolution() == [1.0, 1.0, 1.0]\", \"assert generate_mutant([Genome([5, 5]), Genome([10, 1... | {
"split": "train",
"index": 79435,
"acecode_id": "oss_2961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_and_replace(string: str, keyword: str, replacement: str) -> Tuple[int, str]` that searches for a specific keyword in a given string. If the keyword exists, replace the first instance of that keyword with a different keyword and count the total occurre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_and_replace('hello world', 'world', 'there') == (1, 'hello there')\", \"assert find_and_replace('hello hello', 'hello', 'hi') == (2, 'hi hello')\", \"assert find_and_replace('test test test', 'test', 'exam') == (3, 'exam test test')\", \"assert find_and... | {
"split": "train",
"index": 79436,
"acecode_id": "evol_17316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a floating-point number K, implement a function that approximates the cumulative distribution function of the standard normal distribution using the Bryc approximation method. The function should return a floating-point number that represents the approximate cumulative di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(bryc(10) - 0.999999694097773) < 1e-5\", \"assert abs(bryc(-10) - 3.059022269256247e-07) < 1e-5\", \"assert abs(bryc(5) - 0.999999694097773) < 1e-5\", \"assert abs(bryc(-5) - 2.866515718791933e-07) < 1e-5\", \"assert abs(bryc(8) - 0.9999999996940977) < 1e... | {
"split": "train",
"index": 79437,
"acecode_id": "bigcode_python_fns_5311",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that updates remote support connection information. The function should be able to handle both synchronous and asynchronous requests based on a boolean flag. Implement the function `update_remote_support` that takes two paramet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_remote_support('ConnectionInfo2', False) == 'Update completed synchronously.'\", \"assert update_remote_support('ConnectionInfo4', False) == 'Update completed synchronously.'\", \"assert update_remote_support('ConnectionInfo6', False) == 'Update compl... | {
"split": "train",
"index": 79438,
"acecode_id": "oss_9107",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks two input values: `theta` (a float) and `num_iterations` (an integer). The function should normalize these values based on the following criteria: If `theta` is less than or equal to 0, it should be considered as `None`. Simil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_termination_criteria(0, 5) == (None, 5)\", \"assert check_termination_criteria(5, 0) == (5, None)\", \"assert check_termination_criteria(-1, 5) == (None, 5)\", \"assert check_termination_criteria(5, -1) == (5, None)\", \"assert check_termination_criter... | {
"split": "train",
"index": 79439,
"acecode_id": "bigcode_python_fns_10190",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of security codes and their corresponding security types, implement a function that retrieves the security type for a given code. If the code does not exist in the list, return None. The function should take a list of tuples, where each tuple consists of a security... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_security_type([('AAPL', 'Stock'), ('GOOGL', 'Stock'), ('TSLA', 'Stock')], 'AAPL') == 'Stock'\", \"assert get_security_type([('AAPL', 'Stock'), ('GOOGL', 'Stock'), ('TSLA', 'Stock')], 'GOOGL') == 'Stock'\", \"assert get_security_type([('AAPL', 'Stock'), (... | {
"split": "train",
"index": 79440,
"acecode_id": "bigcode_python_fns_42111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `verify_and_categorize(emails: List[str]) -> Dict[str, int]` that takes a list of email addresses as input and returns a dictionary where the keys are valid email domains and the values are the counts of how many valid email addresses belong to each domain.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_and_categorize(['user1@gmail.com', 'user2@gmail.com', 'user3@yahoo.com']) == {'gmail.com': 2, 'yahoo.com': 1}\", \"assert verify_and_categorize(['invalid_email', 'user1@hotmail.com', 'user2@hotmail.com']) == {'hotmail.com': 2}\", \"assert verify_and_c... | {
"split": "train",
"index": 79441,
"acecode_id": "evol_2786",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple inventory management system. Your function, `manage_inventory`, takes a list of items and a command string as input. The command can be one of the following: 'list', 'add', 'update', or 'delete'. The behavior of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_inventory(['apple', 'banana', 'orange'], 'list') == ['apple', 'banana', 'orange']\", \"assert manage_inventory([], 'list') == []\", \"assert manage_inventory(['apple'], 'add', 'banana') == ['apple', 'banana']\", \"assert manage_inventory(['apple', 'ba... | {
"split": "train",
"index": 79442,
"acecode_id": "oss_3773",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `nums` of length `n`, write a function `productExceptSelf` that returns a new array `ans` of the same length where `ans[i]` is the product of all elements in `nums` except `nums[i]`. Your solution should not use division and must have a time complexit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert productExceptSelf([1, 2, 3, 4]) == [24, 12, 8, 6]\", \"assert productExceptSelf([5, 6, 7]) == [42, 35, 30]\", \"assert productExceptSelf([1, 0, 3, 0]) == [0, 0, 0, 0]\", \"assert productExceptSelf([-1, 1, 0, -3, 3]) == [0, 0, 9, 0, 0]\", \"assert productExce... | {
"split": "train",
"index": 79443,
"acecode_id": "oss_20993",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of positions represented as a list of tuples, where each tuple contains three float values corresponding to the x, y, and z coordinates of a particle in a 3D space. Your task is to implement a function that takes this list of positions and returns a new lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimize_positions([(3.0, 4.0, 5.0), (1.0, 2.0, 3.0)], 1.0) == [(2.0, 3.0, 4.0), (0.0, 1.0, 2.0)]\", \"assert minimize_positions([(0.5, 0.5, 0.5), (1.5, 1.5, 1.5)], 1.0) == [(0.0, 0.0, 0.0), (0.5, 0.5, 0.5)]\", \"assert minimize_positions([(10.0, 10.0, 10.0)... | {
"split": "train",
"index": 79444,
"acecode_id": "bigcode_python_fns_13236",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a dictionary representing a sample category based on a given user and optional parameters. The function should take a string `user` and an optional dictionary of parameters `params`. The generated dictionary should have the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_sample_category('user1') == {'name': 'Sample category', 'persian_title': 'persian', 'parent_category': None}\", \"assert create_sample_category('user2', name='Custom Category') == {'name': 'Custom Category', 'persian_title': 'persian', 'parent_categor... | {
"split": "train",
"index": 79445,
"acecode_id": "bigcode_python_fns_18564",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_sorted_team_names(teams: List[str]) -> List[str]` that takes a list of team names as input and returns a new list containing the team names sorted in alphabetical order. Your function should not modify the original list of team n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sorted_team_names(['Lions', 'Tigers', 'Bears']) == ['Bears', 'Lions', 'Tigers']\", \"assert get_sorted_team_names(['Zebras', 'Apples', 'Oranges', 'Bananas']) == ['Apples', 'Bananas', 'Oranges', 'Zebras']\", \"assert get_sorted_team_names(['Team Alpha', '... | {
"split": "train",
"index": 79446,
"acecode_id": "bigcode_python_fns_31553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file paths and a configuration dictionary that provides a data path and an output file name. Write a function `save_file_paths(file_paths: List[str], config: Dict[str, str]) -> List[str]` that saves each file path into a CSV file at ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_file_paths(['file1.txt', 'file2.txt'], {'data_path': '/files', 'out_file': 'output.csv'}) == ['file1.txt', 'file2.txt']\", \"assert save_file_paths(['doc1.pdf', 'doc2.pdf', 'doc3.pdf'], {'data_path': '/docs', 'out_file': 'documents.csv'}) == ['doc1.pdf'... | {
"split": "train",
"index": 79447,
"acecode_id": "bigcode_python_fns_41752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a parser for a custom order processing language. The language allows users to define orders with various shipping options and destinations. The order object is created using the following syntax: `object = Order(unit, shipping_option)` where `un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str_parse_str_test(Order('ITEM1', 'SUP(ITEM1)')) == 'SUP(ITEM1)'\", \"assert str_parse_str_test(Order('ITEM1', 'SUP(ITEM1, MTO(PROVINCE1))')) == 'SUP(ITEM1, MTO(PROVINCE1))'\", \"assert str_parse_str_test(Order('ITEM1', 'CVY(ITEM1)')) == 'CVY(ITEM1)'\", \"as... | {
"split": "train",
"index": 79448,
"acecode_id": "oss_2310",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer, write a function that returns the next higher number that can be formed using the exact same digits. If no higher number can be formed, return the integer itself. For example, if the input is 123, the output should be 132. If the input is 321, since it's the h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_higher_number(123) == 132\", \"assert next_higher_number(1232) == 1322\", \"assert next_higher_number(70) == 70\", \"assert next_higher_number(321) == 321\", \"assert next_higher_number(54321) == 54321\", \"assert next_higher_number(12345) == 12354\", \... | {
"split": "train",
"index": 79449,
"acecode_id": "bigcode_python_fns_10816",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path in a file system. Your task is to implement a function `apply_monkey_patches(state_path: str) -> None` which simulates applying three different patches to the given file path. The function should not return anything, but it should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_monkey_patches('path/to/state') is None\", \"assert apply_monkey_patches('') is None\", \"assert apply_monkey_patches('C:/Users/Example/Documents') is None\", \"assert apply_monkey_patches('/usr/local/bin') is None\", \"assert apply_monkey_patches('rel... | {
"split": "train",
"index": 79450,
"acecode_id": "bigcode_python_fns_48050",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of images and their corresponding target instances in a computer vision project. The function should take three parameters: a list of images, a list of target instances for each image, and a list of lists represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dataset(['img1', 'img2'], ['target1', 'target2'], [['obj1'], ['obj2', 'obj3']]) == [('img1', 'target1', 1), ('img2', 'target2', 2)]\", \"assert process_dataset([], [], []) == []\", \"assert process_dataset(['img1'], ['target1'], [[]]) == [('img1', 't... | {
"split": "train",
"index": 79451,
"acecode_id": "oss_33593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the type of software based on its version string. The function should return a specific constant value based on the prefix of the version string. The constants and their corresponding prefixes are as follows: - 'FIREFO... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_software_type('firefox-3.6') == 'FIREFOX'\", \"assert determine_software_type('JRE-8.0') == 'JRE'\", \"assert determine_software_type('rhel-7.9') == 'RHEL'\", \"assert determine_software_type('Webmin-1.0') == 'WEBMIN'\", \"assert determine_software... | {
"split": "train",
"index": 79452,
"acecode_id": "oss_877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_volume(base_type: str, side: float, height: float) -> float` that calculates the volume of a regular pyramid with a specified base type. The base type can be 'square', 'triangle', or 'pentagon'. For a square base, the area is calculated as `side^2`. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_volume('square', 4, 6) == 32.0\", \"assert calculate_volume('square', 0, 5) == 0.0\", \"assert calculate_volume('triangle', 0, 5) == 0.0\", \"assert calculate_volume('pentagon', 0, 5) == 0.0\", \"assert calculate_volume('square', 8, 4) == 85.333333... | {
"split": "train",
"index": 79453,
"acecode_id": "evol_36106",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Create a function named vowels_count that takes a string as input and returns the number of vowels in that string. The vowels are defined as 'a', 'e', 'i', 'o', 'u', and 'y' only when it appears at the end of the string. The function should ignore case and include any special c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vowels_count('abcde') == 2\", \"assert vowels_count('ACEDY') == 3\", \"assert vowels_count('') == 0\", \"assert vowels_count('y') == 1\", \"assert vowels_count('Y') == 1\", \"assert vowels_count('exemplify') == 4\", \"assert vowels_count('123') == 0\", \"ass... | {
"split": "train",
"index": 79454,
"acecode_id": "evol_6775",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_primes_in_range(start: int, end: int) -> List[int]` that takes two integers `start` and `end` as input and returns a list of all prime numbers in the inclusive range from `start` to `end`. A prime number is a natural number greater than 1 that is not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes_in_range(15, 30) == [17, 19, 23, 29]\", \"assert find_primes_in_range(10, 20) == [11, 13, 17, 19]\", \"assert find_primes_in_range(1, 10) == [2, 3, 5, 7]\", \"assert find_primes_in_range(20, 40) == [23, 29, 31, 37]\", \"assert find_primes_in_rang... | {
"split": "train",
"index": 79455,
"acecode_id": "evol_5388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where each key is a string and each value is an integer, write a function that takes a function as an argument and applies this function to each value in the dictionary. The function should return a new dictionary that has the same keys but with the values tr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_dict_values(lambda x: x + 1, {'a': 1, 'b': 2, 'c': 3}) == {'a': 2, 'b': 3, 'c': 4}\", \"assert transform_dict_values(lambda x: x * 2, {'x': 5, 'y': 10}) == {'x': 10, 'y': 20}\", \"assert transform_dict_values(lambda x: x - 3, {'key1': 7, 'key2': 14... | {
"split": "train",
"index": 79456,
"acecode_id": "bigcode_python_fns_11051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `parse_inputs(image: str, checkpoint: str, top_k: int = 1, category_names: Optional[str] = None, gpu: bool = False) -> Dict[str, Union[str, int, bool]]` that simulates the parsing of command line inputs for predicting an image classificat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_inputs('path/to/image.jpg', 'path/to/checkpoint.pth', 1, None, False) == {'image': 'path/to/image.jpg', 'checkpoint': 'path/to/checkpoint.pth', 'top_k': 1, 'category_names': None, 'gpu': False}\", \"assert parse_inputs('path/to/image.png', 'path/to/che... | {
"split": "train",
"index": 79457,
"acecode_id": "bigcode_python_fns_48534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates sending a text message and retrieving a list of messages sent. The function should accept a list of messages to be sent and return a list containing the status of each message sent (success or failure). Each message in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_messages([{'to': '1234567890', 'from': '0987654321', 'text': 'Hello!'}, {'to': '2345678901', 'from': '9876543210', 'text': 'Hi there!'}]) == ['success', 'success']\", \"assert send_messages([{'to': '', 'from': '0987654321', 'text': 'Empty recipient!'}, ... | {
"split": "train",
"index": 79458,
"acecode_id": "oss_3553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of strings representing different categories and returns a dictionary containing the count of each category. Each string in the input list represents a category, and the output dictionary should have the category... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_categories(['entity', 'entity_poly_seq', 'chem_comp', 'entity', 'chem_comp_atom', 'struct_asym', 'entity', 'chem_comp']) == {'entity': 3, 'entity_poly_seq': 1, 'chem_comp': 2, 'chem_comp_atom': 1, 'struct_asym': 1}\", \"assert count_categories(['a', 'b... | {
"split": "train",
"index": 79459,
"acecode_id": "oss_3793",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `process_template` that takes two parameters: a template string and a dictionary of variables. The template string may contain placeholders in the form of `{{variable_name}}` which should be replaced with the corresponding valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_template('Hello, {{name}}!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert process_template('Welcome to {{place}}.', {'place': 'Wonderland'}) == 'Welcome to Wonderland.'\", \"assert process_template('Goodbye, {{user}}!', {'user': 'Bob'}) == 'Good... | {
"split": "train",
"index": 79460,
"acecode_id": "oss_6842",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `connect_google_account(action_url: str, error_url: str, code: Optional[str]) -> str` that simulates the process of connecting a user's Google account to an existing account on a platform. The function takes three parameters: `action_url`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect_google_account('http://example.com/success', 'http://example.com/error', 'auth_code_123') == 'http://example.com/success?success=true'\", \"assert connect_google_account('http://example.com/success', 'http://example.com/error', None) == 'http://examp... | {
"split": "train",
"index": 79461,
"acecode_id": "oss_5404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the counts of various role-based counters on a device. Your task is to implement a function that takes this list and returns a new list where each element is the count of the corresponding role-based counter increased by 1. The inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increment_counters([1, 2, 3]) == [2, 3, 4]\", \"assert increment_counters([0]) == [1]\", \"assert increment_counters([5, 10, 15]) == [6, 11, 16]\", \"assert increment_counters([-1, -2, -3]) == [0, -1, -2]\", \"assert increment_counters([99]) == [100]\", \"as... | {
"split": "train",
"index": 79462,
"acecode_id": "bigcode_python_fns_6036",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `no_test_server_credentials()` that checks if a set of credentials for a test integration is defined and non-empty. The function should return `True` if at least one of the following credentials is either undefined or empty: `TEST_INTEGRA... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert no_test_server_credentials({'TEST_INTEGRATION_CLIENT_ID': '', 'TEST_INTEGRATION_USERNAME': 'user', 'TEST_INTEGRATION_PASSWORD': 'pass', 'TEST_INTEGRATION_READ_CLIENT_ID': 'read_id', 'TEST_INTEGRATION_WRITE_CLIENT_ID': 'write_id'}) == True\", \"assert no_test... | {
"split": "train",
"index": 79463,
"acecode_id": "bigcode_python_fns_10522",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking operation. Implement a function `bank_operations` that takes the following inputs: an initial balance (float), a minimum balance (float), a list of deposit amounts (list of floats), and a list of withdrawal amounts (list of floats... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations(1000.00, 100.00, [200.00, 300.00], [100.00, 500.00]) == 900.00\", \"assert bank_operations(100.00, 100.00, [], []) == 100.00\", \"assert bank_operations(200.00, 50.00, [100.00], [200.00]) == 100.00\", \"assert bank_operations(1000.00, 100.00,... | {
"split": "train",
"index": 79464,
"acecode_id": "oss_19369",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a command for a package server. Implement a function `generate_server_command(root: str, cmd: str = 'run', *args: str) -> List[str]` that takes the following parameters: \n- `root`: a string representing the package root from which to serve packag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_server_command('my_packages') == ['pypiserver', 'run', 'my_packages']\", \"assert generate_server_command('my_packages', 'start') == ['pypiserver', 'start', 'my_packages']\", \"assert generate_server_command('my_packages', 'stop', 'force') == ['pypi... | {
"split": "train",
"index": 79465,
"acecode_id": "bigcode_python_fns_23692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of items, each associated with a category name. Write a function `get_item_count_by_category(items: List[Tuple[str, str]], category_name: str) -> int` that takes a list of tuples, where each tuple contains an item name and its associated category name, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_item_count_by_category([('item1', 'fruit'), ('item2', 'fruit'), ('item3', 'vegetable')], 'fruit') == 2\", \"assert get_item_count_by_category([('item1', 'fruit'), ('item2', 'fruit'), ('item3', 'vegetable')], 'vegetable') == 1\", \"assert get_item_count_b... | {
"split": "train",
"index": 79466,
"acecode_id": "bigcode_python_fns_18955",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing a database of activities, where each dictionary contains an activity's 'code', a list of 'exchanges', and other relevant data. Each exchange is a dictionary that includes an 'input', 'type', and other properties. Write a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_activity_tags([{'code': 'A1', 'exchanges': [{'input': ['B1'], 'type': 'biosphere'}]}, {'code': 'A2', 'exchanges': [{'input': ['B2'], 'type': 'technosphere'}]}], [{'code': 'A1', 'exchanges': [{'input': ['B1'], 'type': 'biosphere'}]}, {'code': 'A3', 'ex... | {
"split": "train",
"index": 79467,
"acecode_id": "bigcode_python_fns_31199",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 3D points representing the vertices of a mesh. Your task is to find the points that lie within a specified distance from the upper plane of a bounding box defined by the minimum and maximum x, y, and z coordinates. The function should return a list of po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_points_near_upper_plane([(0, 0, 1), (1, 1, 2), (2, 2, 3)], 3, 1) == [(1, 1, 2), (2, 2, 3)]\", \"assert get_points_near_upper_plane([(0, 0, 1), (1, 1, 2), (2, 2, 3)], 3, 0.5) == [(2, 2, 3)]\", \"assert get_points_near_upper_plane([(1, 1, 0), (2, 2, 1), (3... | {
"split": "train",
"index": 79468,
"acecode_id": "bigcode_python_fns_46564",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of numbers. Your task is to implement a function that determines the maximum sum of any non-empty contiguous subarray within the given list. The function should return this maximum sum. For example, given the input list `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert max_subarray_sum([1]) == 1\", \"assert max_subarray_sum([5,4,-1,7,8]) == 23\", \"assert max_subarray_sum([-1,-2,-3,-4]) == -1\", \"assert max_subarray_sum([-1,3,2,-5,4]) == 5\", \"assert max_subarray... | {
"split": "train",
"index": 79469,
"acecode_id": "bigcode_python_fns_33455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that checks a string of characters to find the index of the digit '7' if it is surrounded by prime digits on both sides. The function should ignore any non-digit characters and should not consider '7' if it is at the start or end of the digit sequence. If '7' i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert locate_seven_between_primes('x7y') == -1\", \"assert locate_seven_between_primes('57') == -1\", \"assert locate_seven_between_primes('a7b2') == -1\", \"assert locate_seven_between_primes('9.7.11') == -1\", \"assert locate_seven_between_primes('1#7#0') == -1\... | {
"split": "train",
"index": 79470,
"acecode_id": "evol_20592",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of patterns provided as input. Your function should take a list of strings, where each string represents a pattern. The patterns can contain alphanumeric characters and special characters. Your goal is to generate a new list of patterns, wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_patterns(['pattern1', 'pattern2']) == ['pattern1.processed', 'pattern2.processed']\", \"assert process_patterns(['test', 'example', 'sample']) == ['test.processed', 'example.processed', 'sample.processed']\", \"assert process_patterns(['abc', 'def'])... | {
"split": "train",
"index": 79471,
"acecode_id": "oss_28852",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a Python dictionary that contains configuration details for a package. Your task is to implement a function `extract_package_info` that takes this dictionary as input and returns a new dictionary with the same structure, preserving its content. The input dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_package_info({'name': 'django-nested-admin', 'version': '1.0.0', 'install_requires': ['python-monkey-business>=1.0.0', 'six'], 'description': 'Django admin classes that allow for nested inlines', 'author': 'John Doe', 'author_email': 'john@example.co... | {
"split": "train",
"index": 79472,
"acecode_id": "oss_8931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that translates a Unix timestamp, represented as epoch time, into a common date/time format while handling time zone specific translations. The function should take in a Unix timestamp and the target time zone as parameters, and return the date/time in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_timestamp(-28800, 'GMT') == '1969-12-31 16:00:00'\", \"assert convert_timestamp(0, 'GMT') == '1970-01-01 00:00:00'\", \"assert convert_timestamp(1609459200, 'GMT') == '2021-01-01 00:00:00'\", \"assert convert_timestamp(1672531199, 'GMT') == '2022-12-... | {
"split": "train",
"index": 79473,
"acecode_id": "evol_16397",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two matrices of the same dimensions, implement a function `add_matrices(mat1, mat2)` that takes two 2D lists (matrices) as input and returns a new matrix that is the element-wise sum of the two input matrices. The input matrices are guaranteed to have the same number of r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_matrices([[1,2],[3,4]], [[5,6],[7,8]]) == [[6,8],[10,12]]\", \"assert add_matrices([[0,0],[0,0]], [[1,1],[1,1]]) == [[1,1],[1,1]]\", \"assert add_matrices([[1,1,1],[1,1,1]], [[2,2,2],[2,2,2]]) == [[3,3,3],[3,3,3]]\", \"assert add_matrices([[1]], [[1]]) =... | {
"split": "train",
"index": 79474,
"acecode_id": "evol_20645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to convert a UTC datetime string to a datetime object with the UTC timezone information. The function should be named `dt_from_utc_str` and should take an optional string input representing a UTC datetime in the format 'YYYY-MM-DDTHH:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dt_from_utc_str('2021-01-01T12:00:00Z') == datetime(2021, 1, 1, 12, 0, 0, tzinfo=timezone.utc)\", \"assert dt_from_utc_str('2020-06-15T08:30:00Z') == datetime(2020, 6, 15, 8, 30, 0, tzinfo=timezone.utc)\", \"assert dt_from_utc_str('2019-12-31T23:59:59Z') == ... | {
"split": "train",
"index": 79475,
"acecode_id": "oss_1565",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `listings` and `daily_revenue`, where `listings` contains tuples with the format (listing_code, commission) and `daily_revenue` contains tuples with the format (listing_code, date, revenue), implement a function that calculates the total company revenue per dat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_company_revenue([('X', 0.05)], [('X', '2023-10-01', 500.0), ('Y', '2023-10-01', 100.0)]) == [('2023-10-01', 25.0)]\", \"assert calculate_company_revenue([('F', 0.2)], [('F', '2023-10-04', 1000.0)]) == [('2023-10-04', 200.0)]\", \"assert calculate_c... | {
"split": "train",
"index": 79476,
"acecode_id": "bigcode_python_fns_29835",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `median(my_list)` that calculates the median of the list. The median is the value separating the higher half from the lower half of the list. If the list has an odd number of elements, return the middle element. If the list has an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([1, 3, 2]) == 2\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([5, 3, 1, 4, 2]) == 3\", \"assert median([7, 8, 9, 10]) == 8.5\", \"assert median([1, 2]) == 1.5\", \"assert median([10, 20, 30]) == 20\", \"assert median([1]) == 1\", \"assert... | {
"split": "train",
"index": 79477,
"acecode_id": "evol_36193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a nested object which can be either a dictionary or a list. Your task is to write a function that retrieves the value from this nested structure based on a specified path. The path can be provided as a string, where keys are separated by dots (.) for dictionaries,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_nested_value({}, 'a.b.c') is None\", \"assert get_nested_value({'a': {'b': {'c': [1, 2, 3, 4]}}}, 'a.b.c.1') == 2\", \"assert get_nested_value({'x': {'y': 'z'}}, 'x.y') == 'z'\", \"assert get_nested_value({'x': {'y': 'z'}}, 'x.a', 'default') == 'default'... | {
"split": "train",
"index": 79478,
"acecode_id": "bigcode_python_fns_42192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function that determines the pair of elements within a given array that have the minimal difference. The function should return the pair as a tuple. The array may consist of both integers and floating point numbers. If the array is empty or contains only one ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_pair_diff([1]) == 'At least 2 numeric elements are needed'\", \"assert min_pair_diff([1, 'a', 2.5]) == (1, 2.5)\", \"assert min_pair_diff([3, 2, 1]) == (1, 2)\", \"assert min_pair_diff([1.1, 1.2, 1.3]) == (1.1, 1.2)\", \"assert min_pair_diff([5, 5.1, 5.2... | {
"split": "train",
"index": 79479,
"acecode_id": "evol_23958",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary representing project details from a translation service and extracts the source language code from it. The input is a dictionary with various keys, and you need to return the value associated with the key 'source_l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_source_language_code({'source_language_code': 'en', 'target_language_code': 'fr'}) == 'en'\", \"assert get_source_language_code({'source_language_code': 'es', 'target_language_code': 'de'}) == 'es'\", \"assert get_source_language_code({'target_language_c... | {
"split": "train",
"index": 79480,
"acecode_id": "oss_14708",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `transform_schema(data: dict) -> dict` that takes a dictionary representing a data record and transforms it according to the following rules: 1) If the dictionary contains a key 'age', multiply its value by 2. 2) If the dictionary contains a key 'name', con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_schema({'name': 'john', 'age': 30, 'isActive': True}) == {'name': 'JOHN', 'age': 60, 'isActive': False}\", \"assert transform_schema({'name': 'jane', 'age': 25}) == {'name': 'JANE', 'age': 50}\", \"assert transform_schema({'age': 40, 'isActive': Fa... | {
"split": "train",
"index": 79481,
"acecode_id": "evol_9589",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `nick` representing a player's nickname in a game. Write a function `force_game_start(nick: str) -> str` that returns a message indicating that the game has been forced to start by the player with the given nickname. The message should be formatted as: '\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert force_game_start('Player1') == '\\\\u0002Player1\\\\u0002 has forced the game to start.'\", \"assert force_game_start('GamerX') == '\\\\u0002GamerX\\\\u0002 has forced the game to start.'\", \"assert force_game_start('Alice') == '\\\\u0002Alice\\\\u0002 has ... | {
"split": "train",
"index": 79482,
"acecode_id": "bigcode_python_fns_43964",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two points in a 2D space represented by their coordinates (x1, y1) and (x2, y2). Write a function `get_intermediate_coordinates(x1: int, y1: int, x2: int, y2: int) -> List[Tuple[int, int]]` that returns a list of coordinates of all points lying on the straight lin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_intermediate_coordinates(0, 0, 0, 3) == [(0, 0), (0, 1), (0, 2), (0, 3)]\", \"assert get_intermediate_coordinates(0, 0, 3, 0) == [(0, 0), (1, 0), (2, 0), (3, 0)]\", \"assert get_intermediate_coordinates(1, 2, 1, 5) == [(1, 2), (1, 3), (1, 4), (1, 5)]\", ... | {
"split": "train",
"index": 79483,
"acecode_id": "bigcode_python_fns_15301",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the Month-Over-Month (MOM) percentage change for a given list of monthly values. The MOM percentage change is calculated using the formula: MOM% = ((current_month_value - previous_month_value) / previous_month_value) * 10... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mom_percentage_changes([100, 120, 150, 130, 140, 160, 170]) == [20.0, 25.0, -13.33, 7.69, 14.29, 6.25]\", \"assert calculate_mom_percentage_changes([50, 100, 200]) == [100.0, 100.0]\", \"assert calculate_mom_percentage_changes([10, 10, 10]) == [0.0... | {
"split": "train",
"index": 79484,
"acecode_id": "oss_29885",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `generate_test_system` that takes a string parameter `project_name` and returns a string indicating the test system created for that project. The function should follow these rules: If the `project_name` is exactly 'test_grid_sinfactory',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_test_system('test_grid_sinfactory') == 'Test system created for grid sinfactory project'\", \"assert generate_test_system('test_project_1') == 'Test system created for project: test_project_1'\", \"assert generate_test_system('example_project') == '... | {
"split": "train",
"index": 79485,
"acecode_id": "bigcode_python_fns_28402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers `nums` and an integer `target`. Write a function `twoSum` to find the indices of the two numbers such that they add up to the `target`. You may assume that each input will have exactly one solution, and you may not use the same element twice. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert twoSum([2, 7, 11, 15], 9) == [0, 1]\", \"assert twoSum([3, 2, 4], 6) == [1, 2]\", \"assert twoSum([1, 5, 3], 8) == [1, 2]\", \"assert twoSum([0, 4, 3, 0], 0) == [0, 3]\", \"assert twoSum([-1, -2, -3, -4, -5], -8) == [2, 4]\", \"assert twoSum([-10, -3, 2, 0, ... | {
"split": "train",
"index": 79486,
"acecode_id": "oss_15157",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple user authentication system. Your goal is to implement a function `authenticate_users(user_data)` which takes a list of user data and verifies the login credentials of each user. The input will be a list of dictionaries, where each dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_users([{'username': 'user1', 'password': 'password1'}, {'username': 'user2', 'password': 'wrongpassword'}]) == ['Login successful', 'Invalid credentials']\", \"assert authenticate_users([{'username': 'user3', 'password': 'password3'}, {'username... | {
"split": "train",
"index": 79487,
"acecode_id": "oss_2611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates basic operations of a simple file system. The file system consists of directories and files. Your function should support the following operations: create a directory, create a file, delete a directory (and all its contents... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_file_system([('create_directory', 'folder1')]) == ['folder1']\", \"assert simulate_file_system([('create_directory', 'folder1'), ('create_file', 'folder1/file1.txt'), ('delete_file', 'folder1/file1.txt')]) == ['folder1']\", \"assert simulate_file_sy... | {
"split": "train",
"index": 79488,
"acecode_id": "oss_12144",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a random ephemeral port number that can be used for network connections. An ephemeral port is a temporary port that is assigned dynamically by the operating system. Your function should return a port number between 4915... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ephemeral_port() >= 49152 and generate_ephemeral_port() <= 65535\", \"assert generate_ephemeral_port() >= 49152 and generate_ephemeral_port() <= 65535\", \"assert generate_ephemeral_port() >= 49152 and generate_ephemeral_port() <= 65535\", \"assert ... | {
"split": "train",
"index": 79489,
"acecode_id": "bigcode_python_fns_30433",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a color format as a string. Your task is to implement a function that returns the corresponding pixel format based on the following mappings: 'RGB' maps to 'R8G8B8', 'RGBa' maps to 'R8G8B8X8', 'RGBA' maps to 'R8G8B8X8', 'RGBX' maps to 'R8G8B8X8', and 'BGR' maps to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_pixel_format('RGB') == 'R8G8B8'\", \"assert get_pixel_format('RGBa') == 'R8G8B8X8'\", \"assert get_pixel_format('RGBA') == 'R8G8B8X8'\", \"assert get_pixel_format('RGBX') == 'R8G8B8X8'\", \"assert get_pixel_format('BGR') == 'B8G8R8'\", \"assert get_pixel... | {
"split": "train",
"index": 79490,
"acecode_id": "oss_25946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that computes the path to the image data for a specific source name from a predefined dataset metadata structure. The metadata is represented as a dictionary containing details about various sources and their corresponding image data paths... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_clim_im('source1') == 'images/source1.img'\", \"assert compute_clim_im('source2') == 'images/source2.img'\", \"assert compute_clim_im('source3') == 'Source name not found'\", \"assert compute_clim_im('source4') == 'Source name not found'\", \"assert ... | {
"split": "train",
"index": 79491,
"acecode_id": "oss_11870",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, write a function that returns the Nth term of a sequence where each term is the sum of the two preceding even numbers, starting from 0 and 2. For example, the sequence begins as 0, 2, 2, 4, 6, 10, ... and so on. Implement the function `accumulative_e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert accumulative_even_fibonacci(1) == 0\", \"assert accumulative_even_fibonacci(2) == 2\", \"assert accumulative_even_fibonacci(3) == 2\", \"assert accumulative_even_fibonacci(4) == 4\", \"assert accumulative_even_fibonacci(5) == 6\", \"assert accumulative_even_... | {
"split": "train",
"index": 79492,
"acecode_id": "evol_386",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a user profile already exists based on their email. The function should take a list of user profiles and an email string as input. Each user profile is represented as a dictionary with at least an 'email' key. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert does_profile_exist([{'email': 'test1@example.com'}, {'email': 'test2@example.com'}], 'test1@example.com') == True\", \"assert does_profile_exist([{'email': 'test1@example.com'}, {'email': 'test2@example.com'}], 'test3@example.com') == False\", \"assert does_... | {
"split": "train",
"index": 79493,
"acecode_id": "bigcode_python_fns_32090",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a term and a linguistic expression, write a function that determines the position of the specified term within the provided expression, considering only alphanumeric characters and ignoring punctuation and spaces. The position should be 1-indexed, meaning the first word i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert position('love', 'I love programming in Python!') == 2\", \"assert position('Python', 'Learning Python is fun.') == 2\", \"assert position('fun', 'This is a fun challenge!') == 4\", \"assert position('challenge', 'This is a fun challenge!') == 5\", \"assert ... | {
"split": "train",
"index": 79494,
"acecode_id": "evol_24054",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified priority queue for background tasks based on their 'niceness' values. The niceness value ranges from -20 (highest priority) to 19 (lowest priority), with 0 being the default niceness. Your function needs to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert priority_task_queue([('Task 1', 10), ('Task 2', 5), ('Task 3', 15)], 'DESC') == ['Task 3', 'Task 1', 'Task 2']\", \"assert priority_task_queue([('Task 1', 10), ('Task 2', 5), ('Task 3', 15)], 'ASC') == ['Task 2', 'Task 1', 'Task 3']\", \"assert priority_task... | {
"split": "train",
"index": 79495,
"acecode_id": "oss_27368",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `sell_stock(sell_order: int, user_holding: int, company_balance: int) -> bool` that determines whether a user can successfully sell a specified amount of stock back to the company in exchange for money. The function should ensure that the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sell_stock(10, 20, 1500) == True\", \"assert sell_stock(5, 5, 500) == True\", \"assert sell_stock(1, 0, 100) == False\", \"assert sell_stock(100, 200, 15000) == True\", \"assert sell_stock(50, 25, 3000) == False\", \"assert sell_stock(10, 10, 1000) == True\"... | {
"split": "train",
"index": 79496,
"acecode_id": "oss_37151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented as an adjacency list where each key is a node and its value is a list of nodes it points to. Your task is to implement a function `circular_abstractions(graph: Dict[int, List[int]], settings: Dict[str, int]) -> List[Tuple[int, int]]` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert circular_abstractions({0: [1], 1: [2], 2: []}, {'max_depth': 2}) == [(0, 3), (1, 2), (2, 1)]\", \"assert circular_abstractions({0: [1], 1: [], 2: [3], 3: []}, {'max_depth': 1}) == [(0, 2), (1, 1), (2, 2), (3, 1)]\", \"assert circular_abstractions({0: [], 1: ... | {
"split": "train",
"index": 79497,
"acecode_id": "bigcode_python_fns_1940",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the distance from each pixel in a binary image to the nearest non-zero pixel. Your function should take a 2D list (matrix) of integers, where 0 represents a background pixel and any positive integer represents a foregr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distance_transform([[0, 0], [0, 0], [0, 0]]) == [[-1, -1], [-1, -1], [-1, -1]]\", \"assert distance_transform([[1, 1], [1, 1], [1, 1]]) == [[0, 0], [0, 0], [0, 0]]\", \"assert distance_transform([[0, 1], [1, 0]]) == [[1, 0], [0, 1]]\", \"assert distance_tran... | {
"split": "train",
"index": 79498,
"acecode_id": "bigcode_python_fns_38871",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings and a delimiter, implement a function that joins all non-empty strings (excluding strings that are only whitespace) into a single string, ensuring there are no leading or trailing delimiters. If the list is empty or contains only empty strings or strings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert join_strings(['hello', 'world', 'foo', 'bar', '', ' '], ', ') == 'hello, world, foo, bar'\", \"assert join_strings(['hello', ' ', 'world'], ', ') == 'hello, world'\", \"assert join_strings(['', '', ' '], ', ') == ''\", \"assert join_strings(['foo', 'bar'], '... | {
"split": "train",
"index": 79499,
"acecode_id": "evol_6508",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.