data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with extracting unique tags from a hierarchical structure represented as a list of dictionaries. Each dictionary may contain an 'import_playbook' key, which refers to another dictionary that should also be processed for tags, and a 'tags' key that contains either...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_tags([{'tags': ['web', 'db']}, {'tags': 'always'}, {'tags': ['app', 'web']}]) == ['web', 'db', 'app']\", \"assert get_unique_tags([{'tags': ['test', 'always']}, {'tags': 'db'}, {'import_playbook': 'other', 'tags': ['api', 'test']}]) == ['test', 'd...
{ "split": "train", "index": 61900, "acecode_id": "bigcode_python_fns_35772", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `s` that represents a mathematical expression. Implement a function `evaluate_expression(s: str) -> int` that evaluates the expression. This calculator should be able to handle addition, subtraction, multiplication, division, and parentheses. The expressi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('2 * 2') == 4\", \"assert evaluate_expression('10 / 2 + 3 * 2') == 11\", \"assert evaluate_expression('(2+(3*2-1))/3+(6*2)') == 14\", \"assert evaluate_expression('1 + 1') == 2\", \"assert evaluate_expression('3 * (2 + 1)') == 9\", \"asse...
{ "split": "train", "index": 61901, "acecode_id": "evol_26778", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a Python function `find_duplicates(matrix)` that takes a two-dimensional list (matrix) as input and returns a list of tuples representing the positions (row index, column index) of duplicate tuples within the matrix. The function should handle non-numeric elements and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_duplicates([[('a', 'b'), ('c', 'd')], [('a', 'b'), ('e', 'f')]]) == [(1, 0, ('a', 'b'))]\", \"assert find_duplicates([[('a', 'b'), ('c', 'd')], [('e', 'f'), ('g', 'h')]]) == []\", \"assert find_duplicates([[('a',), ('b',)], [('a',), ('b',)],[('c',), ('d...
{ "split": "train", "index": 61902, "acecode_id": "evol_3379", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `sum_of_even_numbers(nums)` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function should handle both positive and negative integers. The input list can be empty, and your function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([-2, -4, -6]) == -12\", \"assert sum_of_even_numbers([1, 3, 5]) == 0\", \"assert sum_of_even_numbers([]) == 0\", \"assert sum_of_even_numbers([0]) == 0\", \"assert sum_of_even_numbers(...
{ "split": "train", "index": 61903, "acecode_id": "bigcode_python_fns_15560", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_factorial(n: int) -> int` that computes the factorial of a non-negative integer n. The factorial of a number n is defined as the product of all positive integers less than or equal to n. For example, the factorial of 5 (denoted as 5!) is 5 * 4 * ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_factorial(0) == 1\", \"assert calculate_factorial(1) == 1\", \"assert calculate_factorial(2) == 2\", \"assert calculate_factorial(3) == 6\", \"assert calculate_factorial(4) == 24\", \"assert calculate_factorial(5) == 120\", \"assert calculate_facto...
{ "split": "train", "index": 61904, "acecode_id": "oss_24156", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `first_occurrence(lst: List[int], target: int) -> Tuple[bool, Optional[int]]` that takes a sorted list of integers and a target integer as input. The function should return a tuple where the first element is a Boolean indicating whether the target was found...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_occurrence([], 5) == (False, None)\", \"assert first_occurrence([1, 2, 3, 4, 5], 3) == (True, 2)\", \"assert first_occurrence([1, 2, 3, 4, 5], 6) == (False, None)\", \"assert first_occurrence([1, 1, 1, 1], 1) == (True, 0)\", \"assert first_occurrence([...
{ "split": "train", "index": 61905, "acecode_id": "evol_21150", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of service objects, each represented as a dictionary with a 'UUID' key and a 'characteristics' key, where 'characteristics' is a list of dictionaries containing 'UUID' and 'properties'. Write a function that checks if there is exactly one service with the U...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_service([{ 'UUID': 'GENERIC_ATTRIBUTE_SERVICE_UUID', 'characteristics': [{'UUID': 'SERVICE_CHANGED_CHARACTERISTIC_UUID', 'properties': ['indicate']}] }]) == True\", \"assert check_service([{ 'UUID': 'GENERIC_ATTRIBUTE_SERVICE_UUID', 'characteristics': ...
{ "split": "train", "index": 61906, "acecode_id": "bigcode_python_fns_39263", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes parameters for vectorized operations. The function takes in a dictionary `params` containing the following keys: 'rs2' (an integer), 'vl' (an integer), an optional key 'start' (an integer), and an optional key 'mask' (a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_vector_data({'rs2': 10, 'vl': 5}, 2) == (5, 0, [1, 1, 1, 1, 1])\", \"assert process_vector_data({'rs2': 15, 'vl': 3, 'start': 2}, 5) == (3, 2, [1, 1, 1])\", \"assert process_vector_data({'rs2': 9, 'vl': 2, 'start': 3}, 3) == (3, 3, [1, 1])\", \"asser...
{ "split": "train", "index": 61907, "acecode_id": "oss_22173", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Count Primes and Calculate Their Sum\n\nGiven a non-negative integer n, implement a function that counts the number of prime numbers less than n and calculates the sum of these prime numbers. The function should return a tuple containing two integers: the first integer is the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countPrimes(10) == (4, 17)\", \"assert countPrimes(0) == (0, 0)\", \"assert countPrimes(1) == (0, 0)\", \"assert countPrimes(2) == (0, 0)\", \"assert countPrimes(3) == (1, 2)\", \"assert countPrimes(4) == (2, 5)\", \"assert countPrimes(6) == (3, 10)\", \"ass...
{ "split": "train", "index": 61908, "acecode_id": "evol_11562", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a magic number 'shift' which represents how many positions each letter in the English alphabet should be shifted to the left. Implement a function `new_alphabet(shift: int) -> str` that returns a string representing the new order of the English alphabet after the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert new_alphabet(0) == 'abcdefghijklmnopqrstuvwxyz'\", \"assert new_alphabet(1) == 'bcdefghijklmnopqrstuvwxyza'\", \"assert new_alphabet(2) == 'cdefghijklmnopqrstuvwxyzab'\", \"assert new_alphabet(3) == 'defghijklmnopqrstuvwxyzabc'\", \"assert new_alphabet(4) ==...
{ "split": "train", "index": 61909, "acecode_id": "bigcode_python_fns_48328", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, replace specific substrings in each string according to the provided mapping. The mapping is represented as a list of tuples, where each tuple contains a key and its corresponding value. Write a function `substitute_vars(oldList: List[str], keyValueList...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert substitute_vars(['Hello, benchmark_name!', 'Your path is benchmark_path.'], [('benchmark_name', 'TestBenchmark'), ('benchmark_path', '/usr/local/test')]) == ['Hello, TestBenchmark!', 'Your path is /usr/local/test.']\", \"assert substitute_vars(['No replaceme...
{ "split": "train", "index": 61910, "acecode_id": "bigcode_python_fns_36726", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to calculate the area of the largest rectangle that can be formed within the histogram. A rectangle is formed between two heights and the width is determined by the distance between t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_rectangle_area([]) == 0\", \"assert largest_rectangle_area([1]) == 1\", \"assert largest_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert largest_rectangle_area([1, 2, 3, 4, 5]) == 9\", \"assert largest_rectangle_area([5, 4, 3, 2, 1]) == 9\", \"a...
{ "split": "train", "index": 61911, "acecode_id": "bigcode_python_fns_32828", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `project_to_epsilon_ball` that projects each integer in the list onto the L_2 epsilon-ball. The L_2 epsilon-ball is defined as all points x such that the norm of x is less than or equal to epsilon. Your function should return a new lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert project_to_epsilon_ball([3, 4], 5) == [3.0, 4.0]\", \"assert project_to_epsilon_ball([3, 4], 10) == [3.0, 4.0]\", \"assert project_to_epsilon_ball([-3, -4], 5) == [-3.0, -4.0]\", \"assert project_to_epsilon_ball([-3, -4], 10) == [-3.0, -4.0]\", \"assert proj...
{ "split": "train", "index": 61912, "acecode_id": "bigcode_python_fns_45601", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers `arr` and a list of indices `indices`, write a function `lookup_batch(arr: List[int], indices: List[int]) -> List[int]` that returns a new list containing the elements from `arr` at the positions specified by `indices`. If any index in `indices` is out ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lookup_batch([10, 20, 30, 40, 50], [0, 1, 2]) == [10, 20, 30]\", \"assert lookup_batch([1, 2, 3, 4, 5], [5]) == [-1]\", \"assert lookup_batch([5, 10, 15], [0, 2, 1]) == [5, 15, 10]\", \"assert lookup_batch([100], [0]) == [100]\", \"assert lookup_batch([7, 8,...
{ "split": "train", "index": 61913, "acecode_id": "bigcode_python_fns_27862", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple game environment. The game consists of episodes, each of which involves a certain number of timesteps. Your task is to implement the `simulate_game` function, which takes two parameters: an integer `num_epis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_game(3, [10, 15, 8]) == ['Episode 1 finished after 10 timesteps', 'Episode 2 finished after 15 timesteps', 'Episode 3 finished after 8 timesteps']\", \"assert simulate_game(2, [5, 12]) == ['Episode 1 finished after 5 timesteps', 'Episode 2 finished ...
{ "split": "train", "index": 61914, "acecode_id": "oss_23572", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 4x4 game board represented by a 2D array `block_status` containing characters 'x', 'o', and 'd'. The characters represent the status of each block on the game board. Your task is to implement a function `check_draw` that takes the game board `block_status` and a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_draw([['x', 'o', 'x', 'o'], ['o', 'x', 'o', 'x'], ['x', 'o', 'x', 'o'], ['o', 'x', 'o', 'x']], 'DRAW') == True\", \"assert check_draw([['x', 'o', 'x', 'o'], ['o', 'x', 'o', 'x'], ['x', 'o', 'x', 'o'], ['d', 'x', 'o', 'x']], 'DRAW') == False\", \"assert...
{ "split": "train", "index": 61915, "acecode_id": "oss_21782", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a two-dimensional list of integers, implement a function that calculates the maximum difference between the smallest and largest integers found in any sub-array of the two-dimensional list. The function should return this maximum difference. For example, in the array [[3,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_max_disparity([[0]]) == 0\", \"assert calc_max_disparity([[5, 5, 5], [5, 5]]) == 0\", \"assert calc_max_disparity([[1, -1], [-2, 2]]) == 4\", \"assert calc_max_disparity([[10, 5, 0], [0, 5, 10]]) == 10\", \"assert calc_max_disparity([[1, 1], [1, 1]]) ==...
{ "split": "train", "index": 61916, "acecode_id": "evol_19819", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given two integer arrays, Array A and Array B, write a function that finds the difference between corresponding elements in the two arrays and returns a new array storing these difference values. If the arrays have differing lengths, the function should return an appropriate er...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert array_difference([1, 2, 3], [4, 5, 6]) == [-3, -3, -3]\", \"assert array_difference([10, 20, 30], [1, 2, 3]) == [9, 18, 27]\", \"assert array_difference([0, 0, 0], [0, 0, 0]) == [0, 0, 0]\", \"assert array_difference([1], [1]) == [0]\", \"assert array_differ...
{ "split": "train", "index": 61917, "acecode_id": "evol_6836", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function called `identify_palindrome_segments` that accepts a string as input, isolates and returns all distinctive palindromic segments (with length more than 1) and also calculates their collective quantity. Additionally, the function should return the longest pal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_palindrome_segments('a') == ([], 0, '')\", \"assert identify_palindrome_segments('abc') == ([], 0, '')\", \"assert identify_palindrome_segments('level') == (['eve', 'level'], 2, 'level')\", \"assert identify_palindrome_segments('rotor') == (['oto', ...
{ "split": "train", "index": 61918, "acecode_id": "evol_2030", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing the `insertion_sort` function in Python. The function takes an unsorted list of integers as input and should return a new list containing the elements sorted in non-decreasing order using the insertion sort algorithm. The insertion sort algorith...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insertion_sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert insertion_sort([3, 1, 4, 1, 5, 9, 2, 6, 5]) == [1, 1, 2, 3, 4, 5, 5, 6, 9]\", \"assert insertion_sort([-1, -3, 2, 0, 5, -2]) == [-3, -2, -1, 0, 2, 5]\", \"assert insertion_sort([]) == []\",...
{ "split": "train", "index": 61919, "acecode_id": "oss_28825", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a new list containing only the elements that occur an odd number of times in the input list. The function should handle large lists efficiently. The output list should not contain duplicate elements and should maintain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert odd_times_elements([1, 1, 2, 2, 3]) == [3]\", \"assert odd_times_elements([1, 1, 1, 2, 2, 3, 3, 3]) == [1, 3]\", \"assert odd_times_elements([5, 5, 5, 5]) == []\", \"assert odd_times_elements([10, 20, 10, 30, 30]) == [20]\", \"assert odd_times_elements([1, 1...
{ "split": "train", "index": 61920, "acecode_id": "evol_31468", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total value of an inventory of tools in a hardware store. Each tool is represented by its name, quantity, and unit price. You need to implement a function `calculate_inventory_value(tools: List[Tuple[str, int, floa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_inventory_value([]) == 0.00\", \"assert calculate_inventory_value([('Hammer', 10, 15.99)]) == 159.90\", \"assert calculate_inventory_value([('Screwdriver', 20, 9.99)]) == 199.80\", \"assert calculate_inventory_value([('Drill', 3, 29.99)]) == 89.97\...
{ "split": "train", "index": 61921, "acecode_id": "oss_1130", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function `cumulative_total(array)` that returns a new array containing the cumulative sum of the elements in the input array. The cumulative sum at each index is the sum of all previous elements in the array up to that index, including th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_total([1, 2, 3, 4, 5]) == [1, 3, 6, 10, 15]\", \"assert cumulative_total([1, -1, 1, -1]) == [1, 0, 1, 0]\", \"assert cumulative_total([0, 0, 0]) == [0, 0, 0]\", \"assert cumulative_total([-1, -2, -3]) == [-1, -3, -6]\", \"assert cumulative_total([...
{ "split": "train", "index": 61922, "acecode_id": "evol_10570", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of downloading components from a repository based on specific input parameters. Your function should accept a dictionary containing the following keys: 'repo_uoa', 'module_uoa', 'data_uoa', 'new_repo_uoa', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert download_component({'repo_uoa': 'test_repo', 'module_uoa': 'module1', 'data_uoa': 'data1', 'new_repo_uoa': 'local', 'skip_module_check': 'no'}) == {'return': 0}\", \"assert download_component({'repo_uoa': 'test_repo', 'module_uoa': '', 'data_uoa': 'data1', '...
{ "split": "train", "index": 61923, "acecode_id": "bigcode_python_fns_21109", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a date and time in ISO 8601 format (e.g., '2023-10-01T12:00:00-00:00'). Your task is to implement a function that removes timezone information and replaces the 'T' delimiter with a space. If the input string represents midnight in UTC ('T00:0...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert iso_to_plotly_time_string('2023-10-01T12:00:00') == '2023-10-01 12:00:00'\", \"assert iso_to_plotly_time_string('2023-10-01T00:00:00') == '2023-10-01'\", \"assert iso_to_plotly_time_string('2023-10-01T15:30:00') == '2023-10-01 15:30:00'\", \"assert iso_to_pl...
{ "split": "train", "index": 61924, "acecode_id": "bigcode_python_fns_49442", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with managing database sessions in a web application. Write a function called `close_session` that simulates closing a database session. The function should take any number of arguments and keyword arguments but does not need to process them. Your function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert close_session() == 'Session closed'\", \"assert close_session(1) == 'Session closed'\", \"assert close_session('test') == 'Session closed'\", \"assert close_session(1, 2, 3) == 'Session closed'\", \"assert close_session(a=1, b=2) == 'Session closed'\", \"ass...
{ "split": "train", "index": 61925, "acecode_id": "bigcode_python_fns_14740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of configuration strings for a network application. Each configuration string is a comma-separated list of commands that should be executed in sequence. Your function should take a list of these configuration strings...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_commands(['command1,command2', 'command3']) == 'Executed: command1\\\\nExecuted: command2\\\\nExecuted: command3'\", \"assert process_commands(['command1']) == 'Executed: command1'\", \"assert process_commands(['command1,command2,command3']) == 'Exec...
{ "split": "train", "index": 61926, "acecode_id": "bigcode_python_fns_31321", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a caching mechanism for meta tags in a web application. Write a Python function that manages the cache by checking if caching is enabled and if a cache reset operation is requested. The function should return specific messages based on the states ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_meta_tags_cache(True, True) == 'Meta tags cache has been successfully reset.'\", \"assert manage_meta_tags_cache(True, False) == 'Meta tags caching is enabled.'\", \"assert manage_meta_tags_cache(False, True) == 'Meta tags caching is not enabled.'\", ...
{ "split": "train", "index": 61927, "acecode_id": "oss_18822", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with decoding a base64 encoded string. Write a function `decode_base64_string(value: Dict[str, str]) -> str` that takes a dictionary `value` as input, with a key 'result_base64_encoded' containing a base64 encoded string. The function should decode this string an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_base64_string({'result_base64_encoded': 'SGVsbG8gV29ybGQ='}) == 'Hello World'\", \"assert decode_base64_string({'result_base64_encoded': 'U29tZSB0ZXh0'}) == 'Some text'\", \"assert decode_base64_string({'result_base64_encoded': 'QmFzZTY0IGVuY29kaW5n'}...
{ "split": "train", "index": 61928, "acecode_id": "bigcode_python_fns_3058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with building a command-line argument string for a specific plugin based on the provided name, output directory, and options. Write a function `build_plugin_argument(name: str, outdir: str, options: List[str]) -> str` that takes three parameters: a string `name` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_plugin_argument('cpp', 'output', []) == '--cpp_out=output'\", \"assert build_plugin_argument('java', 'bin', ['opt1', 'opt2']) == '--java_out=opt1,opt2:bin'\", \"assert build_plugin_argument('python', '/usr/local/bin', ['debug']) == '--python_out=debug:...
{ "split": "train", "index": 61929, "acecode_id": "bigcode_python_fns_22432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a similarity score between two molecules represented in a simplified string format. Each molecule is represented by a series of atomic symbols separated by commas, where 'C' represents carbon, 'O' represents oxygen, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_similarity_score('C,O,N\\\\nC,O') == 2\", \"assert calculate_similarity_score('C,C,N\\\\nC,O,N') == 2\", \"assert calculate_similarity_score('H,O,N\\\\nH,O') == 2\", \"assert calculate_similarity_score('C,C,C\\\\nC,O,N') == 1\", \"assert calculate_...
{ "split": "train", "index": 61930, "acecode_id": "oss_9434", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a project that involves file name manipulations for various data files. Your task is to write a Python function `manipulate_file_names(shapefilepath, xsshapefileName, demFileName)` that performs the following operations: 1. Constructs a file name by joining `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manipulate_file_names('/path/to/shapefiles', 'example_shapefile', 'example_demFile.tif') == ('/path/to/shapefiles/example_shapefile.shp', 'example_demFile_bankLines')\", \"assert manipulate_file_names('/data/shapes', 'land_use', 'elevation_data.bin') == ('/d...
{ "split": "train", "index": 61931, "acecode_id": "oss_22043", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of light curve flux values and their corresponding time points. Your task is to implement a function that filters out the flux values based on a specified frequency range. The function should take in three parameters: a list of time points, a list of flux v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_flux([0, 1, 2], [1.0, 1.2, 1.1], (0.0, 0.1)) == []\", \"assert filter_flux([0, 1, 2, 3], [1.0, 1.2, 1.1, 1.3], (0.2, 0.3)) == []\", \"assert filter_flux([0, 1], [1.0, 1.5], (0.2, 0.3)) == []\", \"assert filter_flux([], [], (0.1, 0.2)) == []\", \"asser...
{ "split": "train", "index": 61932, "acecode_id": "bigcode_python_fns_9893", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string s, determine if the string is cheerful or not. A string is considered cheerful if: it contains at least three characters, all groups of three consecutive characters are distinct, each character recurs at least three times, no character appears four times successi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_happy('abcabcabc') == True\", \"assert is_happy('aabbcc') == False\", \"assert is_happy('a') == False\", \"assert is_happy('aa') == False\", \"assert is_happy('abcd') == False\", \"assert is_happy('aabb') == False\", \"assert is_happy('adbbd') == False\",...
{ "split": "train", "index": 61933, "acecode_id": "evol_30374", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that sets up a lookup table for coloring visualizations based on species data. The lookup table will define colors for different species using RGB values. Your function should accept the number of species and a list of RGB color tuples co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_lookup_table(2, [(1.0, 0.0, 0.0), (0.0, 1.0, 0.0)]) == {0: (1.0, 0.0, 0.0, 1.0), 1: (0.0, 1.0, 0.0, 1.0)}\", \"assert setup_lookup_table(3, [(0.0, 0.0, 1.0), (1.0, 1.0, 0.0), (0.5, 0.5, 0.5)]) == {0: (0.0, 0.0, 1.0, 1.0), 1: (1.0, 1.0, 0.0, 1.0), 2: (0...
{ "split": "train", "index": 61934, "acecode_id": "oss_19331", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that calculates the median value from a given list of numbers, which can include both integers and floating point numbers. The list may be unsorted and could contain duplicate or missing numbers. If the total number of elements in the list is even, the median s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_median([1, 2, 3, 4, 5]) == 3\", \"assert calculate_median([1, 2, 3, 4]) == 2.5\", \"assert calculate_median([5, 1, 3, 2, 4]) == 3\", \"assert calculate_median([10.5, 20.2, 30.1, 40.0]) == 25.15\", \"assert calculate_median([3.1, 3.1, 3.1]) == 3.1\"...
{ "split": "train", "index": 61935, "acecode_id": "evol_29228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a reference layer name and two tuples of values: means and scales, create a function that generates a dictionary representation of a pre-process block. The dictionary should contain the reference layer name and a list of channels, where each channel is represented as a di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_pre_process_block('layer1', (0.5, 0.5, 0.5)) == {'reference-layer-name': 'layer1', 'channels': [{'id': 0, 'mean': 0.5}, {'id': 1, 'mean': 0.5}, {'id': 2, 'mean': 0.5}]}\", \"assert create_pre_process_block('layer2', (0.1, 0.2), (1.0, 1.5)) == {'refere...
{ "split": "train", "index": 61936, "acecode_id": "bigcode_python_fns_20503", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_sudoku_solution` that takes a 9x9 matrix representing a Sudoku solution and returns `True` if the solution is valid, and `False` otherwise. A valid Sudoku solution must have each row, each column, and each of the nine 3x3 subgrids contain all of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_sudoku_solution([[3, 4, 6, 8, 2, 9, 7, 5, 1], [7, 8, 9, 6, 5, 1, 4, 3, 2], [5, 2, 1, 4, 7, 3, 6, 9, 8], [6, 3, 7, 9, 4, 8, 5, 2, 1], [2, 9, 4, 5, 1, 6, 3, 8, 7], [8, 1, 5, 3, 6, 7, 9, 4, 2], [9, 6, 8, 1, 3, 5, 2, 7, 4], [1, 7, 3, 2, 8, 4, 9, 6, 5], [4,...
{ "split": "train", "index": 61937, "acecode_id": "evol_13727", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates adding assets into a system. The function should accept a single argument, `asset_json`, which is a dictionary containing asset details. The function should check if the asset addition was successful based on the presen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_assets({'uuid': '1234'}) == {'status': 'success', 'uuid': '1234'}\", \"assert add_assets({'name': 'Asset1'}) == {'status': 'incomplete', 'reason': 'Missing UUID'}\", \"assert add_assets({'uuid': '5678'}) == {'status': 'success', 'uuid': '5678'}\", \"asse...
{ "split": "train", "index": 61938, "acecode_id": "bigcode_python_fns_8065", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list of floats representing a grid of values. Your task is to implement a function that generates contour levels for the grid based on specified intervals. Each contour level represents a threshold value, and you must return a list of contour levels that fall...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_contour_levels([[1, 2], [3, 4]], 1, 4, 1) == [1.0, 2.0, 3.0, 4.0]\", \"assert generate_contour_levels([[1, 2], [3, 4]], 2, 3, 0.5) == [2.0, 2.5, 3.0]\", \"assert generate_contour_levels([[1, 2], [3, 4]], 3, 2, 1) == []\", \"assert generate_contour_l...
{ "split": "train", "index": 61939, "acecode_id": "oss_37716", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of network packets represented as byte strings. Each packet contains an Ethernet header, and you need to extract specific information from these packets. Your task is to implement a function `extract_packet_info(packets: List[bytes]) -> List[Tuple[str, str,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_packet_info([b'\\\\x00\\\\x1A\\\\x2B\\\\x3C\\\\x4D\\\\x5E\\\\x00\\\\x1A\\\\x2B\\\\x3C\\\\x4D\\\\x5F\\\\x08\\\\x00']) == [('00:1a:2b:3c:4d:5e', '00:1a:2b:3c:4d:5f', '08:00')]\", \"assert extract_packet_info([b'\\\\x01\\\\x02\\\\x03\\\\x04\\\\x05\\\\x0...
{ "split": "train", "index": 61940, "acecode_id": "oss_28234", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a formatting string that specifies how to format various types of data. The formatting string consists of tokens separated by commas, where each token can define a numeric or string format followed by a character that indicates the type. Your task is to implement ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert str2format('10d,20f,30s') == ['{:<10g}', '{:>20f}', '{:.30s}']\", \"assert str2format('5S,3d,2f') == ['{:.5s}', '{:<3g}', '{:>2f}']\", \"assert str2format('100S,50d') == ['{:.100s}', '{:<50g}']\", \"assert str2format('2e,3f') == ['{:>2e}', '{:>3f}']\", \"ass...
{ "split": "train", "index": 61941, "acecode_id": "bigcode_python_fns_16930", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of lists, where each inner list may contain different data types, including integers, strings, and floats. Your task is to implement a function that flattens this list of lists into a single list, preserving the order of the elements. If the input list is e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_list_of_lists([[1, 2], [3, 4], [5]]) == [1, 2, 3, 4, 5]\", \"assert flatten_list_of_lists([[1, 'a', 3.5], [2, 'b'], []]) == [1, 'a', 3.5, 2, 'b']\", \"assert flatten_list_of_lists([['hello'], ['world']]) == ['hello', 'world']\", \"assert flatten_list...
{ "split": "train", "index": 61942, "acecode_id": "bigcode_python_fns_21316", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to process genetic information from a list of strings, where each string contains details about a gene in the format: 'Gene_Name\\tStart_Position\\tStop_Position\\tStrand'. Your function should extract and summarize this informatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_genes(['GeneA\\\\t1\\\\t100\\\\t+']) == ['1\\\\t100\\\\t+\\\\t1\\\\tGeneA']\", \"assert summarize_genes(['GeneA\\\\t1\\\\t100\\\\t+', 'GeneB\\\\t1\\\\t100\\\\t+']) == ['1\\\\t100\\\\t+\\\\t2\\\\tGeneA, GeneB']\", \"assert summarize_genes(['GeneA\\\...
{ "split": "train", "index": 61943, "acecode_id": "oss_1031", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple simulation of a snake's behavior in a game. Define a function `snake_game_simulation(initial_position: Tuple[int, int], food_position: Tuple[int, int], screen_dimensions: Tuple[int, int]) -> Tuple[bool, bool]` where: \n\n- `initial_posi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert snake_game_simulation((400, 300), (400, 300), (800, 600)) == (True, False)\", \"assert snake_game_simulation((400, 300), (500, 300), (800, 600)) == (False, False)\", \"assert snake_game_simulation((0, 0), (1, 1), (800, 600)) == (False, False)\", \"assert sna...
{ "split": "train", "index": 61944, "acecode_id": "oss_3467", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries, each representing a person with their details (name, age, email, id), implement a function `format_person_data(persons: List[Dict[str, Union[str, int]]]) -> str` that reformats this data into a new JSON string structure. The new structure should ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_person_data([]) == '{}'\", \"assert format_person_data([{'id': '1', 'name': 'Alice', 'age': 30, 'email': 'alice@example.com'}]) == '{\\\"1\\\": {\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30, \\\"email\\\": \\\"alice@example.com\\\"}}'\", \"assert form...
{ "split": "train", "index": 61945, "acecode_id": "evol_21581", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string `text`, implement a function `normalize_text(text: str, strip_accents: bool = False, lowercase: bool = False) -> str` that normalizes the input string based on the following rules: 1. If `strip_accents` is `True`, remove accents from all characters in the string....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_text('No accents here', strip_accents=False, lowercase=False) == 'No accents here'\", \"assert normalize_text('H\\u00c9LLO @USUARIO', strip_accents=True, lowercase=False) == 'HELLO @USUARIO'\", \"assert normalize_text(' Spaces before and after '...
{ "split": "train", "index": 61946, "acecode_id": "bigcode_python_fns_40108", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of IDs and returns a new list containing only the IDs that meet specific criteria. The IDs are represented as strings and must adhere to the following conditions: 1. The length of each ID must be at least 5 ch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_ids(['12345', 'A1234', 'B5678', 'C9012']) == ['12345', 'B5678', 'C9012']\", \"assert filter_ids(['A12345', 'B6789']) == ['B6789']\", \"assert filter_ids(['A', 'A1', 'A12', 'A123', 'A1234']) == []\", \"assert filter_ids(['B', 'C', 'D', 'E', 'F']) == []...
{ "split": "train", "index": 61947, "acecode_id": "oss_22779", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the movement of a character on a grid-based world. The grid is represented as a 2D array where each cell can contain one of the following values: 'C' (the character's current position), 'T' (a treasure), 'O' (an obstacl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_character([['C', 'T', 'O'], ['.', '.', 'T'], ['.', '.', '.']], 'RRD') == 'Game over!'\", \"assert move_character([['C', '.', 'T'], ['.', 'O', '.'], ['.', '.', 'T']], 'DDLLUU') == 'You lose!'\", \"assert move_character([['C', 'T'], ['T', '.']], 'DD') == ...
{ "split": "train", "index": 61948, "acecode_id": "oss_19057", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a Python function to filter a given list of strings based on two conditions: First, return the list with the strings having a length greater than the given number; Second, the strings must contain at least one vowel. Your function should not be case sensitive (should cons...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_strings(['Example', 'ct', 'dog', 'hello', 'word'], 2) == ['Example', 'dog', 'hello', 'word']\", \"assert filter_strings(['apple', 'banana', 'cherry', 'date'], 4) == ['apple', 'banana', 'cherry']\", \"assert filter_strings(['sky', 'fly', 'myth', 'try']...
{ "split": "train", "index": 61949, "acecode_id": "evol_33014", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given the dimensions of a grid defined by 'rows' and 'cols', implement a function that checks if a specific cell located at 'row' and 'col' is considered to be inside a square area that excludes the boundary of the grid. A cell is considered inside the square if it is not locat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_square_inside(1, 1, 3, 3) == True\", \"assert is_square_inside(0, 1, 3, 3) == False\", \"assert is_square_inside(1, 0, 3, 3) == False\", \"assert is_square_inside(0, 0, 5, 5) == False\", \"assert is_square_inside(4, 4, 5, 5) == False\", \"assert is_square...
{ "split": "train", "index": 61950, "acecode_id": "bigcode_python_fns_2299", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of command line arguments for a file synchronization command based on given subjects. The function should take a list of subjects as input and return a list of strings representing these command line arguments. Each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sync_arguments(['subject1', 'subject2']) == ['--include', 'subject1', '--include', 'subject1/sss_fif', '--include', 'subject1/sss_fif/*', '--include', 'subject1/sss_log', '--include', 'subject1/sss_log/*', '--include', 'subject2', '--include', 'subj...
{ "split": "train", "index": 61951, "acecode_id": "bigcode_python_fns_44578", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two non-empty matrices A and B with equal dimensions (up to 5x5), implement a function that subtracts matrix B from matrix A and returns the transposed result of the resulting matrix C, where C is defined as C[i][j] = A[i][j] - B[i][j].\nPlease reason step by step, then w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtract_and_transpose([[5, 5], [5, 5]], [[1, 1], [1, 1]]) == [[4, 4], [4, 4]]\", \"assert subtract_and_transpose([[3]], [[1]]) == [[2]]\", \"assert subtract_and_transpose([[0, 0], [0, 0]], [[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert subtract_and_trans...
{ "split": "train", "index": 61952, "acecode_id": "evol_26123", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom URL generator that allows for the registration of prefixes and basenames and then generates a list of corresponding URLs. Your task is to implement a function `generate_urls` that takes a list of tuples, where each tuple contains a prefix (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_urls([('user', 'user'), ('profile', 'profile')]) == ['user/user/', 'profile/profile/']\", \"assert generate_urls([('product', 'item'), ('category', 'group')]) == ['product/item/', 'category/group/']\", \"assert generate_urls([('admin', 'dashboard')]...
{ "split": "train", "index": 61953, "acecode_id": "oss_28032", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `compliance_check` that takes in a string `policy` as a parameter and returns a response indicating the status of the compliance check. If the compliance check for the given policy is found (specifically, if the policy is 'policy123'), th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compliance_check('policy123').message == 'Compliance check for policy123 is successful'\", \"assert compliance_check('policy123').status_code == 200\", \"assert compliance_check('policy456').status_code == 500\", \"assert compliance_check('policy789').status...
{ "split": "train", "index": 61954, "acecode_id": "oss_22347", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that replaces all occurrences of a list of substrings in a given string with another list of corresponding substrings. The function should take three parameters: a string `s`, a list of strings `t` (the substrings to be replaced), and a list of strings `r` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multi_replace('The quick brown fox jumps over the lazy fox.', ['fox', 'dog'], ['cat', 'puppy']) == 'The quick brown cat jumps over the lazy cat.'\", \"assert multi_replace('Hello world!', ['Hello', 'world'], ['Hi', 'Earth']) == 'Hi Earth!'\", \"assert multi_...
{ "split": "train", "index": 61955, "acecode_id": "evol_5570", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that lightens a list of RGB colors by a specified fraction. The function should take in a list of colors, where each color is represented as a tuple of three integers (R, G, B) in the range of 0 to 255, and a float representing the amount...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lighten_colors([(0, 0, 0)], 0.5) == [(127, 127, 127)]\", \"assert lighten_colors([(255, 255, 255)], 0.1) == [(255, 255, 255)]\", \"assert lighten_colors([(255, 0, 0)], 0.2) == [(255, 51, 51)]\", \"assert lighten_colors([(0, 0, 0), (255, 255, 255)], 0.2) == [...
{ "split": "train", "index": 61956, "acecode_id": "bigcode_python_fns_19861", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks the validity of an application attribute. The function should take an attribute name and a value as input. Specifically, the function should return True if the attribute name is 'health' and the value is non-negative (grea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert attribute_fixer('health', 0) == True\", \"assert attribute_fixer('health', 10) == True\", \"assert attribute_fixer('health', -1) == False\", \"assert attribute_fixer('stamina', 0) == False\", \"assert attribute_fixer('health', -5) == False\", \"assert attrib...
{ "split": "train", "index": 61957, "acecode_id": "oss_20327", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves and decodes a specified integer value from a given data structure. The function should take the following parameters: 'device_resources', which is a dictionary containing parameter definitions; 'cell_data', which is an obje...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_cell_integer_param({'param1': {'is_integer_like': lambda: True, 'string_format': 'int', 'decode_integer': lambda x: int(x)}}, {'cell_type': 'param1', 'attributes': {'param1': '42'}}, 'param1') == 42\", \"assert get_cell_integer_param({'param1': {'is_inte...
{ "split": "train", "index": 61958, "acecode_id": "bigcode_python_fns_12967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to encode a given string of data using a simple encoding mechanism. The encoding mechanism is to reverse the string and then convert each character to its corresponding ASCII value, separated by commas. Implement a function called `en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_data('abc') == '99,98,97'\", \"assert encode_data('OpenAI') == '73,65,110,101,112,79'\", \"assert encode_data('') == ''\", \"assert encode_data('!@#') == '35,64,33'\", \"assert encode_data('123') == '51,50,49'\", \"assert encode_data('racecar') == '11...
{ "split": "train", "index": 61959, "acecode_id": "oss_12575", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function `ensure_decorator` that takes two arguments: `max_attempts` (an integer) which specifies the maximum number of attempts to execute the function, and `exceptions` (a tuple of Exception classes) which specifies the exceptions to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ensure_decorator(3, (ZeroDivisionError, TypeError))(divide)(10, 2) == 5.0\", \"assert ensure_decorator(3, (ZeroDivisionError, TypeError))(divide)(0, 1) == 0.0\", \"assert ensure_decorator(2, (ZeroDivisionError, TypeError))(divide)(4, 2) == 2.0\", \"assert en...
{ "split": "train", "index": 61960, "acecode_id": "oss_16186", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given an integer `n` which indicates that we have `n` courses, labeled from `1` to `n`. You are also given an array `relations` where `relations[i] = [a, b]`, representing a prerequisite relationship between course `a` and course `b`: course `a` has to be studied before...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minNumberOfSemesters(4, [[1,2],[2,3],[3,4]], 1) == 4\", \"assert minNumberOfSemesters(3, [[1,2],[2,3],[3,1]], 2) == -1\", \"assert minNumberOfSemesters(5, [[2,1],[3,1],[4,2],[5,3]], 2) == 4\", \"assert minNumberOfSemesters(1, [], 1) == 1\", \"assert minNumbe...
{ "split": "train", "index": 61961, "acecode_id": "evol_1244", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of tuples, where each tuple contains a string and an integer, implement a function that constructs a dictionary. The keys of the dictionary should be the factorial of the integer from the tuple, and the values should be another dictionary that maps each unique char...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tuple_to_dict([]) == {}\", \"assert tuple_to_dict([('A', 1)]) == {1: {'A': 0}}\", \"assert tuple_to_dict([('abcdef', 3)]) == {6: {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5}}\", \"assert tuple_to_dict([('Python', 6)]) == {720: {'P': 0, 'y': 1, 't': 2, 'h...
{ "split": "train", "index": 61962, "acecode_id": "evol_32960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_max` that takes either three numeric parameters or a list of tuples where each tuple consists of three numeric parameters. If three numeric parameters are provided, return the largest of the three. If a list of tuples is provided, return a list contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max(1, 2, 3) == 3\", \"assert find_max(-1, -2, -3) == -1\", \"assert find_max(0, 0, 0) == 0\", \"assert find_max(5, 5, 5) == 5\", \"assert find_max(1.5, 2.5, 0.5) == 2.5\", \"assert find_max(-1.2, -2.3, -0.5) == -0.5\", \"assert find_max(100, 200, 300) ...
{ "split": "train", "index": 61963, "acecode_id": "evol_34034", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns a tuple containing the reversed version of the string and the count of vowels in the string. Vowels are defined as 'a', 'e', 'i', 'o', 'u' (case-insensitive).\nPlease reason step by step, then write a self-contained ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string_and_count_vowels('hello world') == ('dlrow olleh', 3)\", \"assert reverse_string_and_count_vowels('Python') == ('nohtyP', 1)\", \"assert reverse_string_and_count_vowels('aeiou') == ('uoiea', 5)\", \"assert reverse_string_and_count_vowels('xyz'...
{ "split": "train", "index": 61964, "acecode_id": "evol_28293", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes two time strings in the format 'HH:MM:SS' and determines which time point is earlier. The function should return a string indicating whether the first time is 'earlier', 'later', or 'equal' to the second time. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_time_points('08:00:00', '09:30:00') == 'earlier'\", \"assert compare_time_points('09:30:00', '08:00:00') == 'later'\", \"assert compare_time_points('12:15:30', '12:15:30') == 'equal'\", \"assert compare_time_points('00:00:01', '00:00:00') == 'later'\...
{ "split": "train", "index": 61965, "acecode_id": "oss_6290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of employee salaries and returns the average salary of the employees. The function should ensure that only positive salaries are considered in the calculation. If there are no positive salaries in the list, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_salary([50000, 60000, 75000]) == 61666.67\", \"assert average_salary([0, -5000, -10000]) == 0\", \"assert average_salary([-100, -50, -25]) == 0\", \"assert average_salary([30000, 40000, 50000, 60000]) == 45000.0\", \"assert average_salary([100, 200, ...
{ "split": "train", "index": 61966, "acecode_id": "evol_24565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function called `add_fractions` which takes two fractions as input and returns their sum as a new fraction. Each fraction is represented by a tuple of two integers (numerator, denominator). The denominator will always be non-zero. The r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_fractions((1, 2), (1, 3)) == (5, 6)\", \"assert add_fractions((1, 4), (1, 4)) == (1, 2)\", \"assert add_fractions((-1, 2), (1, 2)) == (0, 1)\", \"assert add_fractions((2, 3), (2, 3)) == (4, 3)\", \"assert add_fractions((5, 6), (1, 6)) == (1, 1)\", \"asse...
{ "split": "train", "index": 61967, "acecode_id": "oss_35390", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing lines of Python code. Your task is to count how many unique lines contain the specific import statement 'from .hexen import *'. You should only count each unique line once. Implement a function `count_unique_import_lines(code_lines: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_import_lines(['from .hexen import *', 'print(\\\"Hello World\\\")', 'from .hexen import *']) == 1\", \"assert count_unique_import_lines(['from .hexen import *', 'from .hexen import *', 'print(\\\"Hello World\\\")']) == 1\", \"assert count_unique...
{ "split": "train", "index": 61968, "acecode_id": "oss_24880", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string representing a filename and modifies it according to specific rules. The function should rename the file by replacing all occurrences of the substring 'BrainVision' with 'BV', and also ensure that the file extension re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rename_file('data_BrainVision.txt') == 'data_BV.txt'\", \"assert rename_file('BrainVision_data.csv') == 'BV_data.csv'\", \"assert rename_file('experiment_BrainVision.pdf') == 'experiment_BV.pdf'\", \"assert rename_file('BrainVision_report.docx') == 'BV_repor...
{ "split": "train", "index": 61969, "acecode_id": "bigcode_python_fns_41333", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sentence, implement a function `extract_words_with_three_consonants` that extracts all words containing at least 3 consecutive consonants. The function should be case insensitive. A word is defined as a sequence of characters that only includes letters and is surrounded...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_words_with_three_consonants('The sheep are sleeping.') == []\", \"assert extract_words_with_three_consonants('Ssshhh, it is a secret!') == ['Ssshhh']\", \"assert extract_words_with_three_consonants('Look at the beautiful scenery.') == []\", \"assert ...
{ "split": "train", "index": 61970, "acecode_id": "evol_30352", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that compares two lists of repositories and verifies if they are equal. Each repository is represented as a string. Implement a function `are_repositories_equal(repositories_a: List[str], repositories_b: List[str]) -> bool` which takes in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_repositories_equal(['repo1', 'repo2', 'repo3'], ['repo3', 'repo2', 'repo1']) == True\", \"assert are_repositories_equal(['repo1', 'repo2', 'repo2'], ['repo2', 'repo1', 'repo2']) == True\", \"assert are_repositories_equal(['repoA', 'repoB'], ['repoB', 're...
{ "split": "train", "index": 61971, "acecode_id": "bigcode_python_fns_20175", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that selects a random image from a predefined list of image filenames. Your goal is to implement a function that takes no parameters and returns a randomly selected image filename from the list. The list of images includes the following f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_random_image() in ['las-01.jpg', 'mountain-02.jpg', 'beach-03.jpg', 'forest-04.jpg']\", \"assert select_random_image() in ['las-01.jpg', 'mountain-02.jpg', 'beach-03.jpg', 'forest-04.jpg']\", \"assert select_random_image() in ['las-01.jpg', 'mountain-...
{ "split": "train", "index": 61972, "acecode_id": "oss_37590", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that decodes a categorical probability distribution. The function, `decode_category`, should take in two parameters: a list of category labels and a list of probabilities corresponding to those categories. The function should return the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_category(['a', 'b', 'c'], [0.3, 0.4, 0.45]) == 'c'\", \"assert decode_category(['x', 'y', 'z'], [0.2, 0.8, 0.0]) == 'y'\", \"assert decode_category(['cat', 'dog', 'mouse'], [0.1, 0.4, 0.4]) == 'dog'\", \"assert decode_category(['red', 'green', 'blue']...
{ "split": "train", "index": 61973, "acecode_id": "oss_11347", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of bounding boxes represented as tuples (xmin, ymin, xmax, ymax) and a threshold value representing the maximum allowed overlap (Intersection over Union - IoU) for two boxes to be considered overlapping. Your task is to implement a function that returns the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert non_max_suppression([(0, 0, 2, 2)], [0.9], 0.5) == [0]\", \"assert non_max_suppression([], [], 0.5) == []\", \"assert non_max_suppression([(0, 0, 1, 1)], [0.5], 0.5) == [0]\", \"assert non_max_suppression([(0, 0, 1, 1), (2, 2, 3, 3)], [0.1, 0.1], 0.5) == [0,...
{ "split": "train", "index": 61974, "acecode_id": "bigcode_python_fns_24027", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves notifications for a user in a blogging platform. The notifications are stored in a list of dictionaries, where each dictionary contains the notification details such as the message and a boolean indicating whether it ha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_notifications(1, [{'user_id': 1, 'message': 'New comment on your post', 'read': False}, {'user_id': 2, 'message': 'User followed you', 'read': True}]) == [{'message': 'New comment on your post', 'read': False}]\", \"assert get_notifications(2, [{'user_id...
{ "split": "train", "index": 61975, "acecode_id": "oss_13036", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of headers and a corresponding row of data. Your task is to create a dictionary representation of a chemical system based on the provided headers and row. The headers contain various keywords related to properties, names, units, and systems. You need to pro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_chemical_system(['Name', 'Property', 'Preparation'], ['Water', 'H2O', 'Boil']) == {'main': {'name': 'Water', 'properties': ['H2O'], 'preparation': ['Boil'], 'sub_systems': []}}\", \"assert create_chemical_system(['Compound', 'Quantity', 'Method'], ['N...
{ "split": "train", "index": 61976, "acecode_id": "bigcode_python_fns_42492", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of variables that can contain different data types, write a function `identify_datatypes(data)` that returns a new list containing the names of the data types of each variable in the input list. The input list may contain strings, integers, floats, lists, tuples, d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_datatypes(['Alice', 30, [4, 5], (3, 4), {'key': 'value'}, {1, 2}, 30.5, False]) == ['str', 'int', 'list', 'tuple', 'dict', 'set', 'float', 'bool']\", \"assert identify_datatypes([True, 0, 1.0, 'test', [], (), {}, set()]) == ['bool', 'int', 'float', ...
{ "split": "train", "index": 61977, "acecode_id": "evol_21756", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with retrieving data from two different services: Earth observation and Mundi services. Implement a function `get_combined_data()` that returns a list of dictionaries containing predefined data from both services. The Earth observation data should be represented ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_combined_data() == [{'location': 'Earth', 'data': 'Earth observation data'}, {'location': 'Mundi', 'data': 'Mundi data'}]\", \"assert get_combined_data()[0]['location'] == 'Earth'\", \"assert get_combined_data()[0]['data'] == 'Earth observation data'\", ...
{ "split": "train", "index": 61978, "acecode_id": "oss_27917", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_max_sum_subarray` that takes the list as input and returns the maximum sum of any contiguous subarray within the list. A subarray is a contiguous part of the array. If the list is empty, return 0.\nPlease reason step by step, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_sum_subarray([1, 2, 3, -2, 5]) == 9\", \"assert find_max_sum_subarray([-2, -3, -1]) == -1\", \"assert find_max_sum_subarray([5, 4, -1, 7, 8]) == 23\", \"assert find_max_sum_subarray([1]) == 1\", \"assert find_max_sum_subarray([]) == 0\", \"assert fi...
{ "split": "train", "index": 61979, "acecode_id": "bigcode_python_fns_28030", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of package names and a target package name. Write a function `check_package_installed(packages: List[str], target: str) -> bool` that checks whether the target package is present in the list of packages. The function should return True if the target package...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_package_installed(['numpy', 'scipy', 'matplotlib'], 'scipy') == True\", \"assert check_package_installed(['numpy', 'scipy', 'matplotlib'], 'pandas') == False\", \"assert check_package_installed(['react', 'vue', 'angular', 'react'], 'react') == True\", ...
{ "split": "train", "index": 61980, "acecode_id": "bigcode_python_fns_42137", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that sorts a given list of alphanumeric strings in ascending lexicographical order using the Quick sort algorithm. The function should take a list of strings as input and return a new list containing the sorted strings.\nPlease reason step by step, then wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quicksort(['B2', 'A1', 'C33', 'D4', 'E5', 'F6', 'A21']) == ['A1', 'A21', 'B2', 'C33', 'D4', 'E5', 'F6']\", \"assert quicksort(['apple', 'orange', 'banana', 'grape']) == ['apple', 'banana', 'grape', 'orange']\", \"assert quicksort(['123', '456', '789', '0']) ...
{ "split": "train", "index": 61981, "acecode_id": "evol_14501", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a dictionary of platform options settings and generates a list of directory paths based on the settings. The function should take the dictionary of settings as input and return a list of directory paths. The platform...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_settings({'download.default_directory': 'sices'}) == ['/path/to/raw_data/sices']\", \"assert process_settings({'download.default_directory': 'downloads'}) == ['/path/to/raw_data/downloads']\", \"assert process_settings({'download.default_directory': ...
{ "split": "train", "index": 61982, "acecode_id": "oss_2071", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `regex_match(pattern: str, string: str) -> bool` that checks if the given string matches the given pattern using regular expression matching. The pattern can include special characters such as '.' (which matches any single character) and '*' (which matches ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert regex_match('a*b', 'aaab') == True\", \"assert regex_match('a.b', 'acb') == True\", \"assert regex_match('ab*', 'ab') == True\", \"assert regex_match('ab*', 'a') == True\", \"assert regex_match('.*', 'anything') == True\", \"assert regex_match('....', 'test'...
{ "split": "train", "index": 61983, "acecode_id": "evol_26546", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given the root of a binary tree. Implement a function `findTilt(root)` that computes the sum of the tilt of each node in the binary tree. The tilt of a node is defined as the absolute difference between the sum of all values of nodes in the left subtree and the sum of a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findTilt(TreeNode(1, TreeNode(2), TreeNode(3))) == 1\", \"assert findTilt(TreeNode(4, TreeNode(2, TreeNode(3), TreeNode(5)), TreeNode(9, None, TreeNode(7)))) == 15\", \"assert findTilt(TreeNode(1)) == 0\", \"assert findTilt(TreeNode(1, TreeNode(2), None)) ==...
{ "split": "train", "index": 61984, "acecode_id": "evol_12424", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a string `s` that may contain multiple consecutive spaces, write a function `deduplicate_spaces(s: str) -> str` that removes any consecutive spaces in the string and replaces them with a single space. The function should also trim any leading or trailing spaces from the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deduplicate_spaces('this is an irritating string with random spacing .') == 'this is an irritating string with random spacing .'\", \"assert deduplicate_spaces(' hello world ') == 'hello world'\", \"assert deduplicate_spaces(' ') == ''\", \"asser...
{ "split": "train", "index": 61985, "acecode_id": "bigcode_python_fns_27995", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates changing the state of a column in a DataGridView. The function should take two parameters: a string representing the name of the column and a string representing the state change. The state change will be one of the fol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_column_state('Column1', 'Visible') == {'column_name': 'Column1', 'state': 'Visible'}\", \"assert change_column_state('Column2', 'Hidden') == {'column_name': 'Column2', 'state': 'Hidden'}\", \"assert change_column_state('Column3', 'ReadOnly') == {'colu...
{ "split": "train", "index": 61986, "acecode_id": "oss_28692", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of points and returns an array of tuples representing the coordinates of these points. The function should take a list of dictionaries as input, where each dictionary contains two keys: 'x' and 'y', representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_points([{'x': 1, 'y': 2}, {'x': 3, 'y': 4}, {'x': 5, 'y': 6}]) == [(1, 2), (3, 4), (5, 6)]\", \"assert process_points([{'x': 0, 'y': 0}, {'x': -1, 'y': -1}, {'x': 1, 'y': 1}]) == [(0, 0), (-1, -1), (1, 1)]\", \"assert process_points([{'x': 10, 'y': 2...
{ "split": "train", "index": 61987, "acecode_id": "oss_32272", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers `nums` and an integer `target`. Your task is to implement a function `find_pair_with_sum(nums: List[int], target: int) -> Optional[Tuple[int, int]]` that finds a pair of distinct indices (i, j) such that `nums[i] + nums[j] = target`. If such a p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pair_with_sum([10, 15, 3, 7], 17) == (0, 3)\", \"assert find_pair_with_sum([-1, 1, 2, -2, 3], 0) == (0, 1)\", \"assert find_pair_with_sum([1, 2, 3, 4, 5], 10) == None\", \"assert find_pair_with_sum([1, 2, 3, 4, 5], 1) == None\", \"assert find_pair_with_...
{ "split": "train", "index": 61988, "acecode_id": "bigcode_python_fns_38320", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that transforms a given message string. The function should take in a message as input and perform a series of transformations on that message. Your task is to implement the function according to the following specifications: \n\nF...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert message_transformer('Hello world') == 'HELLO_WORLD - Message Transformed'\", \"assert message_transformer('Python is fun') == 'PYTHON_IS_FUN - Message Transformed'\", \"assert message_transformer('LeetCode challenges') == 'LEETCODE_CHALLENGES - Message Trans...
{ "split": "train", "index": 61989, "acecode_id": "oss_26399", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom warning system for a machine learning library. Your goal is to create a custom warning class called `ConvergenceWarning` that captures convergence problems during the training of models. Your task is to implement a function `check_conve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"a...
{ "split": "train", "index": 61990, "acecode_id": "oss_1166", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function `cube(n)` that calculates and returns the cube of the inputted value n. The function should take one parameter, n, which can be any integer, and return the result of n raised to the power of 3.\nPlease reason step by step, then write a self-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cube(0) == 0\", \"assert cube(1) == 1\", \"assert cube(2) == 8\", \"assert cube(3) == 27\", \"assert cube(4) == 64\", \"assert cube(5) == 125\", \"assert cube(-1) == -1\", \"assert cube(-2) == -8\", \"assert cube(-3) == -27\", \"assert cube(-4) == -64\", \"a...
{ "split": "train", "index": 61991, "acecode_id": "evol_21857", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s, write a Python function that returns the longest substring of the given string that is a palindrome. A palindrome is defined as a word that remains the same when its characters are reversed. If the input is not a string or contains non-alphabet characters, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_palindrome_substring('abcbabcd') == 'abcba'\", \"assert longest_palindrome_substring('racecar') == 'racecar'\", \"assert longest_palindrome_substring('a') == 'a'\", \"assert longest_palindrome_substring('abccba') == 'abccba'\", \"assert longest_palin...
{ "split": "train", "index": 61992, "acecode_id": "evol_5062", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves a sub-configuration from an entry configuration dictionary. If the sub-configuration does not exist, an AttributeError should be raised with a specific error message. Implement the function `get_sub_config(entry_config,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sub_config({'a': 'value1', 'b': 'value2'}, 'a', 'key1') == 'value1'\", \"assert get_sub_config({'name': 'John', 'age': '30'}, 'age', 'user_data') == '30'\", \"assert get_sub_config({'color': 'red', 'size': 'large'}, 'color', 'item1') == 'red'\", \"assert...
{ "split": "train", "index": 61993, "acecode_id": "oss_33220", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates user permissions when a user logs in. The function should take a user ID and a list of permissions to be updated for that user. The function will return a dictionary containing the user ID and the updated permissions. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_user_permissions(1, ['read', 'write']) == {'user_id': 1, 'permissions': ['read', 'write']}\", \"assert update_user_permissions(2, []) == {'user_id': 2, 'permissions': []}\", \"assert update_user_permissions(3, ['admin', 'read']) == {'user_id': 3, 'per...
{ "split": "train", "index": 61994, "acecode_id": "bigcode_python_fns_37969", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the lengths of the three sides of a triangle, implement a function that calculates the area of the triangle using Heron's formula. The function should take three positive integers a, b, and c as parameters, representing the lengths of the sides of the triangle, and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_area(3, 4, 5) == 6.0\", \"assert calculate_area(5, 12, 13) == 30.0\", \"assert calculate_area(6, 8, 10) == 24.0\", \"assert calculate_area(7, 24, 25) == 84.0\", \"assert calculate_area(10, 10, 10) == 43.30127018922193\", \"assert calculate_area(8, ...
{ "split": "train", "index": 61995, "acecode_id": "evol_16468", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process an image represented as a 2D list of pixel values, where each pixel value is an integer representing its intensity in a grayscale image. Your function should identify the seam with the lowest energy cost based on a simple e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_low_energy_seam([[0]]) == [(0, 0)]\", \"assert find_low_energy_seam([[1, 3, 1], [1, 2, 1], [1, 5, 1]]) == [(0, 0), (1, 0), (2, 0)]\", \"assert find_low_energy_seam([[1, 1], [1, 1], [1, 1]]) == [(0, 0), (1, 0), (2, 0)]\", \"assert find_low_energy_seam([[...
{ "split": "train", "index": 61996, "acecode_id": "oss_9211", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a list of favorite books for users. Implement a function `add_favourite(user_id: int, book_id: int, favourites: List[Tuple[int, int]]) -> List[Tuple[int, int]]` that adds a new favorite book to a user's favorites list. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_favourite(1, 101, []) == [(1, 101)]\", \"assert add_favourite(1, 101, [(1, 101)]) == [(1, 101)]\", \"assert add_favourite(1, 102, [(1, 101)]) == [(1, 101), (1, 102)]\", \"assert add_favourite(2, 201, []) == [(2, 201)]\", \"assert add_favourite(2, 201, [(...
{ "split": "train", "index": 61997, "acecode_id": "oss_3352", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given geographical location name is valid. A valid location name must start with an uppercase letter and can only contain letters and spaces. Your function should take a string as input and return a boolean value ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_location('Poland') == True\", \"assert is_valid_location('New York') == True\", \"assert is_valid_location('los angeles') == False\", \"assert is_valid_location('Paris') == True\", \"assert is_valid_location('') == False\", \"assert is_valid_locatio...
{ "split": "train", "index": 61998, "acecode_id": "oss_36370", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `load_tests` that takes a list of module names as input and returns a list of strings. Each string should be formatted as 'DocTestSuite for {module_name}', where {module_name} is the name of the module from the input list. Implement the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_tests([]) == []\", \"assert load_tests(['module1']) == ['DocTestSuite for module1']\", \"assert load_tests(['module1', 'module2']) == ['DocTestSuite for module1', 'DocTestSuite for module2']\", \"assert load_tests(['moduleA', 'moduleB', 'moduleC']) == [...
{ "split": "train", "index": 61999, "acecode_id": "bigcode_python_fns_2376", "num_tests": 16 }