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 have a game that continuously checks for user inputs to decide whether the game should keep running or not. Implement a function `should_game_run(events: List[Tuple[str, Optional[str]]]) -> bool` that takes a list of events and returns a boolean indicating whether the game ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert should_game_run([('KEYDOWN', 'ESCAPE')]) == False\", \"assert should_game_run([('QUIT', None)]) == False\", \"assert should_game_run([('KEYDOWN', 'A'), ('KEYDOWN', 'B')]) == True\", \"assert should_game_run([('KEYDOWN', 'ESCAPE'), ('QUIT', None)]) == False\"...
{ "split": "train", "index": 69900, "acecode_id": "bigcode_python_fns_44938", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing gene expression levels and a threshold value, implement a function that filters out the genes (integers) that have expression levels below the given threshold. The function should return a list of genes that meet or exceed the threshold. Yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_genes([1, 2, 3, 4, 5], 3) == [3, 4, 5]\", \"assert filter_genes([10, 20, 30, 40, 50], 25) == [30, 40, 50]\", \"assert filter_genes([0, 0, 0, 0], 1) == []\", \"assert filter_genes([5, 15, 25, 35], 15) == [15, 25, 35]\", \"assert filter_genes([-5, -10, ...
{ "split": "train", "index": 69901, "acecode_id": "bigcode_python_fns_33768", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer array `nums` and an integer `k`, return the maximum sum of a non-empty subsequence of that array such that for every two consecutive integers in the subsequence, `nums[i]` and `nums[j]`, where `i < j`, the condition `j - i <= k` is satisfied. Additionally, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert constrainedSubsetSum([10,2,-10,5,20], 2) == 37\", \"assert constrainedSubsetSum([-1,-2,-3], 1) == -1\", \"assert constrainedSubsetSum([10,-2,-10,-5,20], 2) == 23\", \"assert constrainedSubsetSum([1, 2, 3, 4, 5], 1) == 15\", \"assert constrainedSubsetSum([0, ...
{ "split": "train", "index": 69902, "acecode_id": "evol_20238", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a string as input and returns a list of all unique anagrams of the given string. The anagrams should be returned in any order. For example, if the input string is 'abc', the function should return all unique permutations of the string 'abc'.\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_anagrams('a') == ['a']\", \"assert get_anagrams('') == ['']\", \"assert get_anagrams('ab') == ['ab', 'ba']\", \"assert get_anagrams('aaa') == ['aaa']\", \"assert get_anagrams('zz') == ['zz']\", \"assert get_anagrams('z') == ['z']\"]}" }
{ "split": "train", "index": 69903, "acecode_id": "evol_17300", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given the head of a doubly linked list, implement a function that reverses the list in-place while maintaining its inherent properties. The function should return the new head of the reversed list. Each node in the doubly linked list contains a 'data' attribute, a 'next' pointe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_doubly_linked_list(None) is None\", \"assert reverse_doubly_linked_list(Node(1)).data == 1\", \"assert reverse_doubly_linked_list(Node(1)).next is None\"]}" }
{ "split": "train", "index": 69904, "acecode_id": "evol_9981", "num_tests": 3 }
acecode
[ { "role": "user", "content": "Implement a function `encrypt_message` that simulates a simplified encryption process based on provided security parameters. The function takes the following parameters: \n\n- `security_control` (a dictionary representing the security context, containing two keys: `encrypted` (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encrypt_message({'encrypted': True, 'authenticated': True}, b'test_data', 1, b'1234567890abcdef', b'my_plain_text', b'auth_key_12345678') == b'my_plain_text' + b'1234'\", \"assert encrypt_message({'encrypted': True, 'authenticated': True}, b'abcdefgh', 2, b'...
{ "split": "train", "index": 69905, "acecode_id": "bigcode_python_fns_35316", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the atomic numbers of atoms in a molecule, implement a function `calculate_complexity(atomic_numbers: List[int], cutoff: int) -> int` that returns the complexity of the molecule. The complexity is defined as the sum of unique pairs of atoms...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_complexity([1, 1, 1], 2) == 0\", \"assert calculate_complexity([1, 3, 5, 7], 4) == 6\", \"assert calculate_complexity([1, 2, 3], 1) == 0\", \"assert calculate_complexity([1, 2, 3, 4, 5], 5) == 10\", \"assert calculate_complexity([1, 1, 2, 2], 2) ==...
{ "split": "train", "index": 69906, "acecode_id": "bigcode_python_fns_31940", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the retrieval of video content from a video hosting website. The function should take a URL as input and return a mock video content string. If the URL is valid (i.e., it starts with 'http://' or 'https://'), return a strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_video_content('http://example.com/video') == 'Video content retrieved from http://example.com/video'\", \"assert get_video_content('https://example.com/video') == 'Video content retrieved from https://example.com/video'\", \"assert get_video_content('ftp...
{ "split": "train", "index": 69907, "acecode_id": "oss_2718", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of edges representing a graph and a starting vertex, write a function `get_neighbor_distances(edges, v0)` that returns a dictionary containing the nearest neighbors and their corresponding distances from the starting vertex. Each edge is represented as a tuple of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_neighbor_distances([(0, 1, 10), (0, 2, 5), (1, 3, 15)], 0) == {1: 10, 2: 5}\", \"assert get_neighbor_distances([(0, 1, 10)], 0) == {1: 10}\", \"assert get_neighbor_distances([(1, 0, 10), (0, 2, 15)], 1) == {0: 10}\", \"assert get_neighbor_distances([(0, ...
{ "split": "train", "index": 69908, "acecode_id": "bigcode_python_fns_34296", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function to find the maximum sum of any contiguous subarray. The function should be able to handle cases where all elements are negative and return the maximum single element in that case. Write a function `max_sum_subarray(arr)` that tak...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_sum_subarray([2, 3, -5, 4]) == 5\", \"assert max_sum_subarray([-2, -3, -1, -7]) == -1\", \"assert max_sum_subarray([1, 2, 3, -2, 5]) == 9\", \"assert max_sum_subarray([-1, -2, -3, -4]) == -1\", \"assert max_sum_subarray([0, -1, -2, 0]) == 0\", \"assert m...
{ "split": "train", "index": 69909, "acecode_id": "evol_33069", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings that may contain both letters and numbers, determine if the reverse of the concatenated strings forms a palindrome. A palindrome is a sequence that reads the same backward as forward. Return 'Yes' if the reversed concatenated string is a palindrome, and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome_sequence(['abc', '789', 'cba']) == 'No'\", \"assert is_palindrome_sequence(['123', '321']) == 'Yes'\", \"assert is_palindrome_sequence(['a', 'b', 'c', 'c', 'b', 'a']) == 'Yes'\", \"assert is_palindrome_sequence(['1', '2', '3', '4', '5']) == 'No...
{ "split": "train", "index": 69910, "acecode_id": "evol_20914", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `filter_primes(values)` that takes a list of values and returns a list containing only the prime integers from the input list. The function should ignore any non-integer values, including strings, floats, and other data types. The output should be a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_primes(['a', 3.14, 5, 11, 16]) == [5, 11]\", \"assert filter_primes([1, 2, 3, 'abc', {}, [], 7, 13]) == [2, 3, 7, 13]\", \"assert filter_primes([4, 6, 8, 10, 12]) == []\", \"assert filter_primes([17, 'text', 19, 1.5, 23]) == [17, 19, 23]\", \"assert f...
{ "split": "train", "index": 69911, "acecode_id": "evol_25621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of mountains along a hiking trail. Your task is to write a function that identifies the peaks in the trail, where a peak is defined as a mountain with a height greater than the height of its immediate neighbors and a spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_peaks([1, 3, 2, 5, 4], 2) == [[3, 1], [5, 3]]\", \"assert find_peaks([10, 20, 15, 25, 5], 15) == [[20, 1], [25, 3]]\", \"assert find_peaks([1, 2, 3, 4, 5], 0) == []\", \"assert find_peaks([10, 20, 30, 20, 10], 15) == [[30, 2]]\", \"assert find_peaks([50...
{ "split": "train", "index": 69912, "acecode_id": "oss_31583", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that computes the Jaccard similarity coefficient between two provided sentences. The Jaccard similarity is defined as the size of the intersection divided by the size of the union of the sets of words from both sentences. Write a function named `jaccard_sim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert jaccard_similarity('I love programming', 'I love coding') == 0.5\", \"assert jaccard_similarity('Hello World', 'Hello') == 0.5\", \"assert jaccard_similarity('This is a test', 'This is another test') == 0.6\", \"assert jaccard_similarity('One two three four'...
{ "split": "train", "index": 69913, "acecode_id": "evol_21655", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given message, represented as a dictionary, contains exactly one record. The dictionary will have a single key, which maps to a list of records. Your function should return the number of records in the list if there i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_records({'records': [1]}) == 1\", \"assert check_records({'records': [5]}) == 1\", \"assert check_records({'records': [0]}) == 1\", \"assert check_records({'records': [100]}) == 1\", \"assert check_records({'records': ['a']}) == 1\", \"assert check_rec...
{ "split": "train", "index": 69914, "acecode_id": "bigcode_python_fns_35912", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a synchronous workflow step. The function should take in two parameters: `result`, which can either be `None` or a tuple of three elements, and `ctx`, which represents the execution context (a placeholder that you can i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_sync_step('context', None) == 'Step has ended'\", \"assert process_sync_step('context', (1, 2, 3)) == 'Message batch has been enqueued'\", \"assert process_sync_step('context', (True, 'msg', 42)) == 'Message batch has been enqueued'\", \"assert proce...
{ "split": "train", "index": 69915, "acecode_id": "bigcode_python_fns_14990", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that takes in a number represented as a string, `value`, and two integers, `low` and `high`, which define a range. The function should return the nearest integer to the input number without using standard rounding functions. Additionally, ensure that the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_rounding('10', 0, 20) == 10\", \"assert complex_rounding('5.5', 5, 10) == 5\", \"assert complex_rounding('20', 0, 20) == 20\", \"assert complex_rounding('19.5', 0, 20) == 19\", \"assert complex_rounding('14.5', 10, 20) == 14\", \"assert complex_round...
{ "split": "train", "index": 69916, "acecode_id": "evol_25769", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two strings, write a function to find the number of common lowercase letters between the two strings, ignoring any non-letter characters. Additionally, calculate the ratio of common letters to the total number of unique lowercase letters in both strings by dividing the nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_chars_ratio('hello', 'world') == (2, 0.2857142857142857)\", \"assert common_chars_ratio('abcdef', 'ghijkl') == (0, 0.0)\", \"assert common_chars_ratio('xyz', 'abc') == (0, 0.0)\", \"assert common_chars_ratio('hello', 'helicopter') == (4, 0.44444444444...
{ "split": "train", "index": 69917, "acecode_id": "evol_19633", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of file paths and returns a dictionary containing the count of files with each unique extension. The function should take a list of file paths as input and return a dictionary where the keys are unique file ex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_file_extensions(['/tmp/dir/file1.txt', '/tmp/dir/file2.md', '/tmp/dir/file3.txt', '/tmp/dir/file4.py', '/tmp/dir/file5.md']) == {'.txt': 2, '.md': 2, '.py': 1}\", \"assert count_file_extensions(['/home/user/document.pdf', '/home/user/photo.jpg', '/home...
{ "split": "train", "index": 69918, "acecode_id": "oss_33749", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You need to generate a dataset containing 100 elements, initially filled with the value 20. An inflection point is introduced at index 50, where the values are modified. The values from index 50 to 59 should be replaced with a decreasing sequence from 20 to 2, and the values fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_data() != [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0, 0, ...
{ "split": "train", "index": 69919, "acecode_id": "oss_29260", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that returns a new array containing the elements of the input array in reverse order. The input array may contain any integers, including negative numbers and zero. Do not modify the original array.\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_array([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_array([0, -1, -2, -3]) == [-3, -2, -1, 0]\", \"assert reverse_array([]) == []\", \"assert reverse_array([10]) == [10]\", \"assert reverse_array([1, 2, 3]) == [3, 2, 1]\", \"assert reverse_...
{ "split": "train", "index": 69920, "acecode_id": "evol_28631", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of an item from a list based on its ID. Given a list of integers representing item IDs, and an integer ID to delete, your function should remove the ID from the list if it exists and return the modified lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_item([1, 2, 3, 4], 3) == [1, 2, 4]\", \"assert delete_item([10, 20, 30], 10) == [20, 30]\", \"assert delete_item([], 1) == []\", \"assert delete_item([1, 2, 3], 4) == [1, 2, 3]\", \"assert delete_item([5, 5, 5], 5) == [5, 5]\", \"assert delete_item([1...
{ "split": "train", "index": 69921, "acecode_id": "bigcode_python_fns_40740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two 1D arrays as input and returns a new array containing the element-wise multiplication of the two arrays. If the arrays are not of the same length, return a message indicating that the operation cannot be performed due to the mismatch in lengt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_arrays([1, 2], [3, 4]) == [3, 8]\", \"assert multiply_arrays([2, 3], [4, 5]) == [8, 15]\", \"assert multiply_arrays([1], [5]) == [5]\", \"assert multiply_arrays([0, 1], [2, 3]) == [0, 3]\", \"assert multiply_arrays([], []) == []\", \"assert multiply...
{ "split": "train", "index": 69922, "acecode_id": "evol_33519", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a positive integer n, return a list of all its divisors in ascending order. A divisor of n is an integer d such that n % d == 0. Your solution should implement a function that takes an integer n as input and returns a list of its divisors. The list should not include dupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_of_divisors(1) == [1]\", \"assert list_of_divisors(2) == [1, 2]\", \"assert list_of_divisors(3) == [1, 3]\", \"assert list_of_divisors(4) == [1, 2, 4]\", \"assert list_of_divisors(5) == [1, 5]\", \"assert list_of_divisors(6) == [1, 2, 3, 6]\", \"assert ...
{ "split": "train", "index": 69923, "acecode_id": "bigcode_python_fns_41798", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists, list1 and list2, implement a function `to_dict(list1, list2)` that converts these lists into a dictionary where elements from list1 are the keys and elements from list2 are the values. If the lists are of different lengths, only pairs up to the length of the sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_dict(['a', 'b', 'c'], [1, 2, 3]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert to_dict(['x', 'y'], [10, 20, 30]) == {'x': 10, 'y': 20}\", \"assert to_dict(['key1'], [100, 200]) == {'key1': 100}\", \"assert to_dict([], []) == {}\", \"assert to_dict(['one', 'two'...
{ "split": "train", "index": 69924, "acecode_id": "evol_8426", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an input string, write a function that will remove all non-alphanumeric characters and provide an error handler system for non-string inputs. Additionally, ensure that the function preserves the order of alphanumeric characters as they appear in the string. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_non_alphanum('Hello, World!') == 'HelloWorld'\", \"assert remove_non_alphanum('1234-5678') == '12345678'\", \"assert remove_non_alphanum('') == ''\", \"assert remove_non_alphanum('Python3.9') == 'Python39'\", \"assert remove_non_alphanum('!@#$%^&*()')...
{ "split": "train", "index": 69925, "acecode_id": "evol_30005", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the validation and logging of air traffic control status updates. The function should take an integer value as input and check if it is within the range of 0 to 100 (inclusive). If the value is within this range, return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_air_control(0) == 'Air control status changed to 0'\", \"assert update_air_control(50) == 'Air control status changed to 50'\", \"assert update_air_control(100) == 'Air control status changed to 100'\", \"assert update_air_control(25) == 'Air control ...
{ "split": "train", "index": 69926, "acecode_id": "oss_30101", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given an iterable (like a list or a string) and an integer n. Write a function `chunk_iterable(iterable, n)` that returns a list of lists, where each inner list contains at most n elements from the iterable. If there are remaining elements in the iterable that are fewer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert chunk_iterable([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert chunk_iterable([1, 2, 3], 1) == [[1], [2], [3]]\", \"assert chunk_iterable(['a', 'b', 'c', 'd'], 3) == [['a', 'b', 'c'], ['d']]\", \"assert chunk_iterable([], 5) == []\", \"assert chunk_...
{ "split": "train", "index": 69927, "acecode_id": "bigcode_python_fns_47567", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a sorted array of distinct integers that has been rotated an unknown number of times. Write a function to search for a target value in the array. If the target is found in the array, return its index; otherwise, return -1. You should assume that the array does not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_in_rotated_array([55, 60, 65, 70, 75, 80, 85, 90, 95, 15, 20, 25, 30, 35, 40, 45], 40) == 14\", \"assert search_in_rotated_array([55, 60, 65, 70, 75, 80, 85, 90, 95, 15, 20, 25, 30, 35, 40, 45], 15) == 9\", \"assert search_in_rotated_array([55, 60, 65...
{ "split": "train", "index": 69928, "acecode_id": "oss_35200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given string is a valid identifier in programming. A valid identifier must follow these rules: 1. It must start with a letter (a-z or A-Z) or an underscore (_). 2. The rest of the identifier can contain letters, digit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_identifier('valid_identifier') == True\", \"assert is_valid_identifier('_validIdentifier123') == True\", \"assert is_valid_identifier('3invalidIdentifier') == False\", \"assert is_valid_identifier('invalid-identifier') == False\", \"assert is_valid_...
{ "split": "train", "index": 69929, "acecode_id": "bigcode_python_fns_46233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `filter_customers(customers)` that takes a list of customer dictionaries and returns a list of customers who have ordered at least 3 different types of products. Each customer dictionary contains the keys 'customerId' and 'orders', where 'orders' is a list of d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_customers([{'customerId': 1, 'orders': [{'productId': 101}, {'productId': 102}, {'productId': 103}, {'productId': 101}]}]) == [{'customerId': 1, 'orders': [{'productId': 101}, {'productId': 102}, {'productId': 103}, {'productId': 101}]}]\", \"assert f...
{ "split": "train", "index": 69930, "acecode_id": "evol_13789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of strings and a separator string, then returns the concatenation of all the elements in the list, separated by the specified separator. The function should be defined as `def concatenate_with_separator(string_list: List[str], separator...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate_with_separator(['Hello', 'World'], ' ') == 'Hello World'\", \"assert concatenate_with_separator(['Sample', 'Text', 'Hello'], '-') == 'Sample-Text-Hello'\", \"assert concatenate_with_separator(['Python', 'is', 'fun'], '') == 'Pythonisfun'\", \"ass...
{ "split": "train", "index": 69931, "acecode_id": "evol_14955", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `Average` that calculates the average of a list of numbers. The function should take a list of integers or floats as input and return the average of those numbers as a float. If the provided list is empty, the function should return 0.0. For example,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Average([1, 2, 3]) == 2.0\", \"assert Average([10, 20, 30]) == 20.0\", \"assert Average([-1, 0, 1]) == 0.0\", \"assert Average([5]) == 5.0\", \"assert Average([]) == 0.0\", \"assert Average([1.5, 2.5, 3.5]) == 2.5\", \"assert Average([1, 2, 3, 4, 5]) == 3.0\...
{ "split": "train", "index": 69932, "acecode_id": "oss_36122", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns a new string with the characters in reverse order. The function should handle an empty string and return it as is. For example, given the input 'hello', the function should return 'olleh'.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('abcde') == 'edcba'\", \"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$%') == '%$#@!'\", \"a...
{ "split": "train", "index": 69933, "acecode_id": "evol_32278", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a Bluetooth address, where each integer is a byte (0 to 255). Your task is to implement a function that converts this list of integers into a formatted string representation of the Bluetooth address. The output should be in the form...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ba2str([1, 2, 3, 4, 5, 6]) == '06:05:04:03:02:01'\", \"assert ba2str([255, 255, 255, 255, 255, 255]) == 'FF:FF:FF:FF:FF:FF'\", \"assert ba2str([0, 0, 0, 0, 0, 0]) == '00:00:00:00:00:00'\", \"assert ba2str([16, 32, 48, 64, 80, 96]) == '60:50:40:30:20:10'\", \...
{ "split": "train", "index": 69934, "acecode_id": "bigcode_python_fns_47536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> List[int]` that returns the Fibonacci sequence up to the nth position. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 69935, "acecode_id": "evol_33508", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple scoring system for a gaming application. The function should take a list of player scores for different game sessions and return a unique list of player scores, ensuring that no player has multiple scores in the sa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_scores([('player1', 'session1', 10), ('player2', 'session2', 15), ('player1', 'session1', 10)]) == [('player1', 'session1', 10), ('player2', 'session2', 15)]\", \"assert get_unique_scores([('player1', 'session1', 5), ('player2', 'session1', 10), (...
{ "split": "train", "index": 69936, "acecode_id": "oss_15802", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `custom_operations(list1, list2, operations)` that takes two lists of integers (or nested lists) and a list of operation strings. The operations can include: 'merge', 'common_elements', 'unique_elements', 'sort_in_descending', 'length_of_list', 'sum_of_elem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_operations([1, 2, 3], [3, 4, 5], ['merge']) == [5, 4, 3, 3, 2, 1]\", \"assert custom_operations([1, 2, 3], [3, 4, 5], ['common_elements']) == [3]\", \"assert custom_operations([1, 2, 3], [3, 4, 5], ['unique_elements']) == [5, 4, 2, 1]\", \"assert cust...
{ "split": "train", "index": 69937, "acecode_id": "evol_20975", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given two lists of integers representing the maximum x-coordinates and maximum y-coordinates of several bounding boxes, along with a list of indices that indicate which bounding boxes should be considered. Your task is to implement a function that takes these inputs and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_bounding_boxes([100, 150, 200, 120, 180], [80, 120, 150, 100, 140], [0, 2, 4], ['red', 'green', 'blue']) == [(100, 80, 'red'), (200, 150, 'green'), (180, 140, 'blue')]\", \"assert get_bounding_boxes([50, 75, 90], [30, 45, 60], [0, 1, 2], ['black', 'white...
{ "split": "train", "index": 69938, "acecode_id": "oss_25629", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are asked to create a function `create_session()` that simulates the creation of a session object for performing HTTP operations. The function should return a dictionary representing the session object, which contains a key `headers` initialized with a default set of header...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_session() == {'headers': {'Content-Type': 'application/json', 'User-Agent': 'MyApp/1.0'}}\", \"assert create_session()['headers']['Content-Type'] == 'application/json'\", \"assert create_session()['headers']['User-Agent'] == 'MyApp/1.0'\", \"assert 'h...
{ "split": "train", "index": 69939, "acecode_id": "bigcode_python_fns_20663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of building documentation for a project. The function should take a list of strings, where each string represents a name of a document. The function should return a list of strings representing the status of eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_docs(['doc1', 'doc2', 'InvalidDoc']) == ['Built: doc1', 'Built: doc2', 'Failed to build: InvalidDoc']\", \"assert build_docs(['docA', 'docB']) == ['Built: docA', 'Built: docB']\", \"assert build_docs(['doc1', 'doc2', 'doc3', 'InvalidDoc']) == ['Built: ...
{ "split": "train", "index": 69940, "acecode_id": "bigcode_python_fns_30959", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that determines if it's possible to navigate through a maze represented by a 2D grid from the top-left corner to the bottom-right corner while avoiding obstacles. The maze is defined as a 2D list of integers where 0 represents ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert navigate_maze([[0, 1, 0, 0], [0, 0, 0, 1], [1, 0, 1, 0], [0, 0, 0, 0]]) == True\", \"assert navigate_maze([[0, 0, 0], [1, 1, 0], [0, 0, 0]]) == True\", \"assert navigate_maze([[0, 0, 1], [1, 0, 0], [0, 0, 0]]) == True\", \"assert navigate_maze([[0, 1], [1, 0...
{ "split": "train", "index": 69941, "acecode_id": "oss_33640", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a provided string is a valid American telephone number format. The function should return True if the phone number matches the pattern (either (123) 456-7890, 123-456-7890, or 123.456.7890), and the area code (the first three digits) must be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert checkPhoneNumber('(123) 456-7890', ['123', '456', '789']) == True\", \"assert checkPhoneNumber('123-456-7890', ['123', '456', '789']) == True\", \"assert checkPhoneNumber('123.456.7890', ['123', '456', '789']) == True\", \"assert checkPhoneNumber('123 456 78...
{ "split": "train", "index": 69942, "acecode_id": "evol_24412", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a gene entry in the format 'transcript_id|gene_id|chromosome|orientation|p_value'. Your task is to implement a function that processes this list and returns a dictionary where the keys are unique gene_ids and the valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_p_values(['ENSMUST00000203335.1|ENSMUSG00000045962.16|chr6|-|0.05', 'ENSMUST00000203336.1|ENSMUSG00000045962.16|chr6|-|0.01', 'ENSMUST00000203337.1|ENSMUSG00000045963.16|chr7|-|0.03']) == {'ENSMUSG00000045962.16': 0.01, 'ENSMUSG00000045963.16': 0.03...
{ "split": "train", "index": 69943, "acecode_id": "bigcode_python_fns_30065", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of show occurrences and returns a dictionary containing information about the shows and their corresponding occurrences. The occurrences list consists of dictionaries with the following attributes: 'eventitem....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_occurrences([]) == {}\", \"assert process_occurrences([{'eventitem.pk': 1, 'occurrence': 'Show A - Occurrence 1'}]) == {1: ['Show A - Occurrence 1']}\", \"assert process_occurrences([{'eventitem.pk': 1, 'occurrence': 'Show A - Occurrence 1'}, {'event...
{ "split": "train", "index": 69944, "acecode_id": "oss_20510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a video URL and extracts a video ID from it. Your function should take a string input representing the video URL and perform the following tasks: 1. Extract the video ID from the URL if it follows the pattern 'v=<videoID>',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_video_id('https://www.example.com/watch?v=abc123') == 'abc123'\", \"assert extract_video_id('https://www.example.com/watch?v=xyz_456') == 'xyz_456'\", \"assert extract_video_id('https://www.example.com/view?v=video-789') == 'video-789'\", \"assert ex...
{ "split": "train", "index": 69945, "acecode_id": "oss_29414", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement the function `sum_of_sqrt_of_primes(arr)` that returns the sum of square roots of unique positive prime numbers in the array. If the array is empty, return None. If there are no non-negative prime numbers, return zero.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_sqrt_of_primes([-1, 0, 1, 9]) == 0\", \"assert sum_of_sqrt_of_primes([]) == None\", \"assert sum_of_sqrt_of_primes([4, 6, 8, 10]) == 0\", \"assert sum_of_sqrt_of_primes([-2, -3, -5]) == 0\", \"assert sum_of_sqrt_of_primes([1, 4, 6]) == 0\", \"assert s...
{ "split": "train", "index": 69946, "acecode_id": "evol_7119", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function `max_difference` that returns the maximum difference between any two elements in the list, defined as the absolute difference between the largest and smallest integers in the list. If the list contains fewer tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_difference([4, 7, 2, 9, 5, 1]) == 8\", \"assert max_difference([3, 3, 3, 3, 3]) == 0\", \"assert max_difference([10, 3, 8, 1, 6]) == 9\", \"assert max_difference([5]) == 0\", \"assert max_difference([]) == 0\", \"assert max_difference([1, 2]) == 1\", \"a...
{ "split": "train", "index": 69947, "acecode_id": "oss_27321", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string in Markdown format and converts it into a simple HTML format. Your function should preserve the basic structure of the Markdown, such as headings, lists, and paragraphs. Implement a function named `convert_markdown_to_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_markdown_to_html('# Header') == '<h1>Header</h1>'\", \"assert convert_markdown_to_html('## Subheader') == '<h2>Subheader</h2>'\", \"assert convert_markdown_to_html('### Subsubheader') == '<h3>Subsubheader</h3>'\", \"assert convert_markdown_to_html('T...
{ "split": "train", "index": 69948, "acecode_id": "oss_16057", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the names of all languages in a specific language, given a list of language data and a language ID. The language data will be in the form of a list of dictionaries, where each dictionary represents a language with keys 'id'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_language_names([{'id': 'fi', 'name': 'Suomi', 'name_fi': 'Suomi', 'name_sv': 'Finska', 'name_en': 'Finnish'}, {'id': 'en', 'name': 'English', 'name_fi': 'Englanti', 'name_sv': 'Engelska', 'name_en': 'English'}], 'fi') == {'name': 'Suomi', 'name_fi': 'Suo...
{ "split": "train", "index": 69949, "acecode_id": "oss_37721", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of 20 float values representing cosmological parameters, implement a function that calculates the average of these values and returns it. The input will be a list of floats that contain the following values: [0.969, 0.654, 1.06, 0.703, 1.1615, 0.759, 0.885, 0.6295,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(average_cosmological_parameters([0.703, 1.1615, 0.759]) - 0.8745) < 1e-4\", \"assert abs(average_cosmological_parameters([0.857, 1.123, 0.843]) - 0.941) < 1e-4\", \"assert abs(average_cosmological_parameters([0.5245, 0.99, 0.7485]) - 0.75433333333) < 1e-...
{ "split": "train", "index": 69950, "acecode_id": "bigcode_python_fns_15096", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a configuration for a plugin manager based on the provided parameters. The function should accept the following parameters: an integer 'id' representing the Plugin instance ID, and optional lists for 'log_files', 'configura...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_manager_config(1) == {'id': 1, 'log_files': None, 'configuration_files': None, 'ports': None, 'process_manager': None, 'executables': None}\", \"assert create_manager_config(2, log_files=['log1.txt', 'log2.txt']) == {'id': 2, 'log_files': ['log1.txt',...
{ "split": "train", "index": 69951, "acecode_id": "bigcode_python_fns_29224", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with counting the number of job folders in a given list of folder names. Each folder name that starts with the prefix 'job' is considered a job folder. Write a function `count_job_folders(folders: List[str]) -> int` that takes a list of folder names and returns t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_job_folders(['job1', 'job2', 'test', 'job3']) == 3\", \"assert count_job_folders(['jobA', 'jobB', 'jobC']) == 3\", \"assert count_job_folders(['test1', 'test2', 'test3']) == 0\", \"assert count_job_folders(['job1', 'folder1', 'job2']) == 2\", \"assert ...
{ "split": "train", "index": 69952, "acecode_id": "bigcode_python_fns_13567", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string containing a series of characters, where each character is associated with a category. The categories are represented by uppercase letters, and each character within a category is represented by a printable ASCII character that immediately follows its cat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_characters('A3 B@ C5 D! E2 F&') == {'A': ['3'], 'B': ['@'], 'C': ['5'], 'D': ['!'], 'E': ['2'], 'F': ['&']}\", \"assert categorize_characters('X1 Y2') == {'X': ['1'], 'Y': ['2']}\", \"assert categorize_characters('A1 B2 C3 D4 E5') == {'A': ['1'], ...
{ "split": "train", "index": 69953, "acecode_id": "oss_5096", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `insert_at_position(data: int, position: int, linked_list: List[int]) -> List[int]` that inserts a new integer `data` at a specified `position` in a given list representing a linked list. The position is 0-based, where 0 represents th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_at_position(5, 0, [1, 2, 3]) == [5, 1, 2, 3]\", \"assert insert_at_position(5, 1, [1, 2, 3]) == [1, 5, 2, 3]\", \"assert insert_at_position(5, 3, [1, 2, 3]) == [1, 2, 3, 5]\", \"assert insert_at_position(5, 4, [1, 2, 3]) == [1, 2, 3, 5]\", \"assert in...
{ "split": "train", "index": 69954, "acecode_id": "oss_3147", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a generator function in Python that produces the first 'n' quadratic numbers, where 'n' is a positive integer input to the function. A quadratic number is defined as a number that can be expressed in the form of i^2, where i is a positive integer starting from 1. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(quadratic_numbers(1)) == [1]\", \"assert list(quadratic_numbers(2)) == [1, 4]\", \"assert list(quadratic_numbers(3)) == [1, 4, 9]\", \"assert list(quadratic_numbers(4)) == [1, 4, 9, 16]\", \"assert list(quadratic_numbers(5)) == [1, 4, 9, 16, 25]\", \"as...
{ "split": "train", "index": 69955, "acecode_id": "evol_18983", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts unique copyright statements from a given block of text. The copyright information is represented by a block of text enclosed within a pair of comment symbols (e.g., # for Python comments). Your function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_copyright_statements('# Copyright (c) 2021 Company XYZ #') == ['Copyright (c) 2021 Company XYZ']\", \"assert extract_copyright_statements('No copyright statements here.') == []\", \"assert extract_copyright_statements('Some text here # Copyright (c) ...
{ "split": "train", "index": 69956, "acecode_id": "oss_29279", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `cookies_to_header(cookies)` that takes a dictionary of cookies as input and returns a string representing the corresponding HTTP header for the cookies. The input dictionary `cookies` contains cookie names as keys and their values as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cookies_to_header({'session_id': 'abc123', 'user_id': '12345'}) == 'Cookie: session_id=abc123; user_id=12345'\", \"assert cookies_to_header({'theme': 'dark', 'lang': 'en'}) == 'Cookie: theme=dark; lang=en'\", \"assert cookies_to_header({'id': 'xyz', 'token':...
{ "split": "train", "index": 69957, "acecode_id": "oss_37374", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to generate an augmented trajectory for a robotic arm to pick up an object from a pick position, move it to a drop position, and then drop it. The function `create_augmented_traj` takes the following parameters: `robot` (the robotic arm o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_augmented_traj('robot', [0, 0, 0], [1, 1, 1], [[1, 0, 0], [0, 1, 0], [0, 0, 1]], [[0, -1, 0], [1, 0, 0], [0, 0, 1]], 0.2) == [['pick', [0, 0, 0]], ['lift', [0, 0, 0.2]], ['move', [1, 1, 0.2]], ['drop', [1, 1, 1]]]\", \"assert create_augmented_traj('ro...
{ "split": "train", "index": 69958, "acecode_id": "oss_11621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to build a list of reachable planets for each planet in a given list of planets. Each planet is represented as a dictionary with keys 'planet' and 'reachable'. The 'planet' key holds the name of the planet, and the 'reachable' key con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_reachables([{'planet': 'Earth', 'reachable': ['Mars']}, {'planet': 'Mars', 'reachable': []}]) == [{'planet': 'Earth', 'reachable': ['Mars']}, {'planet': 'Mars', 'reachable': []}]\", \"assert build_reachables([{'planet': 'A', 'reachable': ['B', 'C']}, {...
{ "split": "train", "index": 69959, "acecode_id": "oss_6094", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `is_multiply_prime(a)` that returns `True` if the input number `a` can be expressed as the product of exactly three unique prime numbers, and returns `False` otherwise. The input number `a` will not exceed 1000. For example, `is_multiply_prime(30)` should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_multiply_prime(30) == True\", \"assert is_multiply_prime(6) == False\", \"assert is_multiply_prime(42) == True\", \"assert is_multiply_prime(1) == False\", \"assert is_multiply_prime(105) == True\", \"assert is_multiply_prime(24) == False\", \"assert is_m...
{ "split": "train", "index": 69960, "acecode_id": "evol_22722", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a record with various key-value pairs. Your task is to rename specific keys in these dictionaries according to a provided mapping of old key names to new key names. Write a function that takes in two paramet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rename_columns([{'a': 1, 'b': 2}], {'a': 'alpha'}) == [{'alpha': 1, 'b': 2}]\", \"assert rename_columns([{'name': 'Alice', 'age': 30}], {'name': 'full_name'}) == [{'full_name': 'Alice', 'age': 30}]\", \"assert rename_columns([{'id': 1, 'value': 100}], {'valu...
{ "split": "train", "index": 69961, "acecode_id": "bigcode_python_fns_21858", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a DNA sequence represented as a string consisting of the characters 'A', 'T', 'G', and 'C'. Your task is to write a function `calculate_gc_content(sequence: str) -> float` that calculates the GC content of the DNA sequence. The GC content is defined as the proport...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_gc_content('ATGC') == 0.5\", \"assert calculate_gc_content('GGCC') == 1.0\", \"assert calculate_gc_content('ATATAT') == 0.0\", \"assert calculate_gc_content('ACGTACGT') == 0.5\", \"assert calculate_gc_content('GCGC') == 1.0\", \"assert calculate_gc...
{ "split": "train", "index": 69962, "acecode_id": "bigcode_python_fns_44079", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to simulate the scrolling of credits in a game. The function should take in parameters for the credit text, the starting x-coordinate, the screen width, and the scrolling direction. The function should return the new x-coordinate of the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scroll_credits('Hello World', 10, 50, 'LEFT') == 9\", \"assert scroll_credits('Hello World', 49, 50, 'LEFT') == 48\", \"assert scroll_credits('Hello World', 50, 50, 'LEFT') == 49\", \"assert scroll_credits('Hello World', 45, 50, 'RIGHT') == 46\", \"assert sc...
{ "split": "train", "index": 69963, "acecode_id": "oss_21191", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple database connection and query execution. Your function should take two parameters: a boolean indicating whether to initialize the database connection and a string representing an SQL query. If the database connecti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_database_operation(True, 'SELECT * FROM users') == 'Query executed: SELECT * FROM users'\", \"assert simulate_database_operation(True, 'DELETE FROM orders') == 'Query executed: DELETE FROM orders'\", \"assert simulate_database_operation(True, 'UPDAT...
{ "split": "train", "index": 69964, "acecode_id": "oss_33971", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `get_shortest_string` that takes three distinct strings as input and returns the string that has the fewest characters after removing all vowel characters (a, e, i, o, u) from each string. If there are multiple strings with the same length after vowel remov...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_shortest_string('No', 'Vowels', 'Allowed') == 'N'\", \"assert get_shortest_string('HelloWorld', 'Goodbye', 'Farewell') == 'Gdby'\", \"assert get_shortest_string('Special', 'Characters', 'Included') == 'Spcl'\", \"assert get_shortest_string('Simple', 'Exa...
{ "split": "train", "index": 69965, "acecode_id": "evol_18648", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a decorator function named `upon_teardown` that marks a given function as a handler to be called upon a teardown event. The decorator should take a callable function `f` as its argument and return a new function that, when called, indicates that the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upon_teardown(lambda: 'Hello')() == 'Hello'\", \"assert upon_teardown(lambda: 42)() == 42\", \"assert upon_teardown(lambda: True)() == True\", \"assert upon_teardown(lambda: None)() == None\", \"assert upon_teardown(lambda: [1, 2, 3])() == [1, 2, 3]\", \"ass...
{ "split": "train", "index": 69966, "acecode_id": "bigcode_python_fns_35224", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple graphical user interface (GUI) button representation. Implement a function `create_button(image: str, scale: float) -> dict` that takes an image filename and a scaling factor as inputs, and returns a dictionary containing the button propert...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_button('about_image.png', 0.5) == {'image': 'about_image.png', 'scale': 0.5, 'width': 50.0, 'height': 50.0}\", \"assert create_button('feedback_image.png', 1.0) == {'image': 'feedback_image.png', 'scale': 1.0, 'width': 100.0, 'height': 100.0}\", \"ass...
{ "split": "train", "index": 69967, "acecode_id": "oss_8295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string consisting of a sentence and returns the sentence with the words reversed in order. For example, given the input 'Hello World', your function should return 'World Hello'.\nPlease reason step by step, then write a self-contained Python soluti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_sentence('Hello World') == 'World Hello'\", \"assert reverse_sentence('I am learning to code') == 'code to learning am I'\", \"assert reverse_sentence('Python is great') == 'great is Python'\", \"assert reverse_sentence('The quick brown fox') == 'fox...
{ "split": "train", "index": 69968, "acecode_id": "evol_28319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a function `get_os_platform()` that retrieves the operating system information of a machine. The function should return an object (dictionary) containing the following keys: `system`, `release`, and `machine`. The values for these keys should be hardcoded wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_os_platform() == {'system': 'Windows', 'release': '10', 'machine': 'AMD64'}\", \"assert get_os_platform()['system'] == 'Windows'\", \"assert get_os_platform()['release'] == '10'\", \"assert get_os_platform()['machine'] == 'AMD64'\", \"assert 'system' in ...
{ "split": "train", "index": 69969, "acecode_id": "bigcode_python_fns_7392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `switch_case(a)` that mimics the behavior of a switch statement using if-else statements. The function should take an integer input `a` and execute the following logic: If `a` is 1, call the function `func1()`. If `a` is 2, call the function `func2()`. If `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert switch_case(1) == 'func1 called'\", \"assert switch_case(2) == 'func2 called'\", \"assert switch_case(4) == 'Unexpected input or case not defined'\", \"assert switch_case(0) == 'Unexpected input or case not defined'\", \"assert switch_case(-1) == 'Unexpected...
{ "split": "train", "index": 69970, "acecode_id": "evol_12411", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing file sizes in megabytes. Your task is to implement a function that calculates the total size of files in a specified folder. The function should take in the list of file sizes and return the total size in megabytes. If the list is e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_size([]) == 0\", \"assert calculate_total_size([10]) == 10\", \"assert calculate_total_size([10, 20]) == 30\", \"assert calculate_total_size([1, 2, 3, 4, 5]) == 15\", \"assert calculate_total_size([5, 5, 5, 5, 5]) == 25\", \"assert calculate_...
{ "split": "train", "index": 69971, "acecode_id": "bigcode_python_fns_7663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `left` and `right`, return a new list containing the elements present in `left` but not in `right`. The order of the elements in the output list should be the same as in `left`. The input lists may contain duplicates. You can assume that both lists ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert table_difference([1, 2, 3, 4], [3, 4, 5]) == [1, 2]\", \"assert table_difference([], [1, 2, 3]) == []\", \"assert table_difference([1, 2, 3], []) == [1, 2, 3]\", \"assert table_difference([1, 2, 2, 3], [2, 2]) == [1, 3]\", \"assert table_difference([5, 5, 5]...
{ "split": "train", "index": 69972, "acecode_id": "bigcode_python_fns_4682", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a tree structure where each key is a node and its corresponding value is its parent node. Your task is to implement a function `find_parent(tree, target)` that returns the parent node of the specified target node. If the target node does ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_parent({'A': None, 'B': 'A', 'C': 'A', 'D': 'B', 'E': 'B', 'F': 'C', 'G': 'C'}, 'B') == 'A'\", \"assert find_parent({'A': None, 'B': 'A', 'C': 'A', 'D': 'B', 'E': 'B', 'F': 'C', 'G': 'C'}, 'A') == None\", \"assert find_parent({'A': None, 'B': 'A', 'C': ...
{ "split": "train", "index": 69973, "acecode_id": "oss_23729", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given integer is a perfect square. A perfect square is an integer that is the square of an integer. For example, 0, 1, 4, 9, 16 are perfect squares, while 2, 3, 5, and 7 are not. The function should take a single inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_square(0) == True\", \"assert is_perfect_square(1) == True\", \"assert is_perfect_square(4) == True\", \"assert is_perfect_square(9) == True\", \"assert is_perfect_square(16) == True\", \"assert is_perfect_square(2) == False\", \"assert is_perfect...
{ "split": "train", "index": 69974, "acecode_id": "bigcode_python_fns_42154", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a random username. Your function should generate a username that is 12 characters long, exclusively using lowercase letters (a-z). Implement a function named `generate_random_username` that takes no parameters and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_random_username()) == 12\", \"assert all(c in 'abcdefghijklmnopqrstuvwxyz' for c in generate_random_username())\", \"assert generate_random_username() != generate_random_username()\", \"assert generate_random_username() != generate_random_userna...
{ "split": "train", "index": 69975, "acecode_id": "oss_20618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of suspended jobs. Each job is represented by a unique identifier (integer). You need to implement a function that resumes a job based on the provided input arguments. The function should accept a list of arguments and return a message indica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resume_job([], [1, 2, 3]) == 'Job 3 resumed successfully.'\", \"assert resume_job(['+'], [1, 2, 3]) == 'Job 3 resumed successfully.'\", \"assert resume_job(['-'], [1, 2, 3]) == 'Job 2 resumed successfully.'\", \"assert resume_job(['+'], [5, 6]) == 'Job 6 res...
{ "split": "train", "index": 69976, "acecode_id": "bigcode_python_fns_48726", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `validate_ip_address(ip_addr: str) -> str` that checks if a given string conforms to the standard format of an IPv4 internet protocol address. The function should return 'true' if the supplied string is a valid IPv4 address and 'false' otherwise. A valid IP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_ip_address('127.0.0.1') == 'true'\", \"assert validate_ip_address('0.0.0.0') == 'true'\", \"assert validate_ip_address('255.255.255.255') == 'true'\", \"assert validate_ip_address('192.168.1.1') == 'true'\", \"assert validate_ip_address('256.100.50....
{ "split": "train", "index": 69977, "acecode_id": "evol_10514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of temperature observations for a year, where each observation is represented as a tuple containing a date (in the format 'YYYY-MM-DD') and a temperature value (as a float). Write a function `average_temperature(temps: List[Tuple[str, float]]) -> float` tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_temperature([('2022-01-01', 30.0), ('2022-01-02', 32.5), ('2022-01-03', 31.0)]) == 31.17\", \"assert average_temperature([('2022-01-01', 25.0), ('2022-01-02', 27.5)]) == 26.25\", \"assert average_temperature([('2022-01-01', 20.0)]) == 20.00\", \"asse...
{ "split": "train", "index": 69978, "acecode_id": "bigcode_python_fns_31013", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `range_validation` that receives three lists: `numbers`, `lower_bounds`, and `upper_bounds`. The function should return a list of boolean values where each boolean indicates whether the corresponding number in the `numbers` list is within its respective low...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert range_validation([4,7,10], [2,5,8], [5,10,14]) == [True, True, True]\", \"assert range_validation([1, 2, 3], [0, 2, 3], [2, 3, 4]) == [True, True, True]\", \"assert range_validation([1, 5, 10], [1, 2, 9], [4, 5, 10]) == [True, True, True]\", \"assert range_v...
{ "split": "train", "index": 69979, "acecode_id": "evol_13059", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given text based on a specified pattern. The function should tokenize the pattern and the text, remove the tokens present in the pattern from the text, and then join the remaining tokens into a single string. Tokens a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_text_based_on_pattern('hello world', 'world') == 'hello'\", \"assert process_text_based_on_pattern('abc123 def456 ghi789', 'def456') == 'abc123 ghi789'\", \"assert process_text_based_on_pattern('the quick brown fox', 'the fox') == 'quick brown'\", \"...
{ "split": "train", "index": 69980, "acecode_id": "oss_20023", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple virtual machine for a custom programming language that allows for variable declaration, assignment, and retrieval operations. The virtual machine maintains a dictionary to store variable values. Your task is to implement a single functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert virtual_machine([('declare', ('x',)), ('assign', ('x', 10)), ('retrieve', ('x',))]) == [10]\", \"assert virtual_machine([('declare', ('y',)), ('assign', ('y', 20)), ('retrieve', ('y',))]) == [20]\", \"assert virtual_machine([('declare', ('a',)), ('assign', (...
{ "split": "train", "index": 69981, "acecode_id": "oss_11285", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with scheduling a cron job for test plans based on their IDs. A test plan ID is valid for scheduling a cron job if it is a positive integer. Write a function `schedule_cron_job(test_plan_id: int) -> bool` that takes a test plan ID as input and returns True if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert schedule_cron_job(1) == True\", \"assert schedule_cron_job(10) == True\", \"assert schedule_cron_job(100) == True\", \"assert schedule_cron_job(999) == True\", \"assert schedule_cron_job(123456) == True\", \"assert schedule_cron_job(0) == False\", \"assert s...
{ "split": "train", "index": 69982, "acecode_id": "bigcode_python_fns_32341", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a matrix represented as a list of lists, write a function `draw_matrix` that takes a 2D list of integers and returns a new matrix where each element is replaced by its corresponding index in the original matrix. For example, if the input matrix is [[1, 2], [3, 4]], the ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_matrix([[1, 2], [3, 4]]) == [[(0, 0), (0, 1)], [(1, 0), (1, 1)]]\", \"assert draw_matrix([]) == []\", \"assert draw_matrix([[1]]) == [[(0, 0)]]\", \"assert draw_matrix([[1, 2, 3], [4, 5, 6]]) == [[(0, 0), (0, 1), (0, 2)], [(1, 0), (1, 1), (1, 2)]]\", \"...
{ "split": "train", "index": 69983, "acecode_id": "bigcode_python_fns_23880", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two arrays of integers `A` and `B` of equal length, calculate the sum of the Hamming distances between each corresponding pair of integers in `A` and `B`. The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert totalHammingDistance([0, 0], [0, 0]) == 0\", \"assert totalHammingDistance([1, 1, 1], [1, 1, 1]) == 0\", \"assert totalHammingDistance([15], [0]) == 4\", \"assert totalHammingDistance([255, 255], [0, 0]) == 16\", \"assert totalHammingDistance([5], [5]) == 0\...
{ "split": "train", "index": 69984, "acecode_id": "evol_14507", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a buffer management system for a graphics application. The system should allow for efficient modification of a range of data within a buffer object and return the modified buffer after the updates. Your task is to implement a function `modify_bu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_buffer([1, 2, 3, 4, 5], 1, 3, [10, 20, 30]) == [1, 10, 20, 30, 5]\", \"assert modify_buffer([0, 0, 0, 0], 0, 1, [5, 6]) == [5, 6, 0, 0]\", \"assert modify_buffer([1, 2, 3], 0, 2, [4, 5, 6]) == [4, 5, 6]\", \"assert modify_buffer([10, 20, 30, 40], 2, 2...
{ "split": "train", "index": 69985, "acecode_id": "oss_6", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a retry mechanism for a given function. The retry behavior should adhere to the following rules: If the provided function raises an exception and the custom retry condition returns True for that exception, the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_retry(lambda: 'success', 100, 1000, lambda e: isinstance(e, ValueError)) == 'success'\", \"assert simulate_retry(lambda: 'hello', 100, 1000, lambda e: False) == 'hello'\", \"assert simulate_retry(lambda: 1/0, 100, 1000, lambda e: isinstance(e, TypeE...
{ "split": "train", "index": 69986, "acecode_id": "oss_29124", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of messages and returns the IDs of all unread messages that have attachments. Each message is represented by a dictionary with two keys: 'id' (a string representing the message ID) and 'is_unread' (a boolean indicating i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unread_message_ids([{'id': '1', 'is_unread': True, 'has_attachment': True}, {'id': '2', 'is_unread': False, 'has_attachment': True}, {'id': '3', 'is_unread': True, 'has_attachment': False}, {'id': '4', 'is_unread': True, 'has_attachment': True}]) == ['1'...
{ "split": "train", "index": 69987, "acecode_id": "bigcode_python_fns_8050", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing words, punctuation marks, and special characters, implement a function that transforms the string into snake_case format. The transformation involves removing all punctuation and special characters, replacing spaces with underscores, and converting all...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_snake_case('This is a phrase.') == 'this_is_a_phrase'\", \"assert to_snake_case('Hello World!') == 'hello_world'\", \"assert to_snake_case('Python is fun.') == 'python_is_fun'\", \"assert to_snake_case('A B C!') == 'a_b_c'\", \"assert to_snake_case('Singl...
{ "split": "train", "index": 69988, "acecode_id": "evol_12570", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that resets various game statistics to their initial values. The function should take a dictionary representing the current game statistics as input and return a dictionary with the statistics reset to their initial values. The input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_game_stats({'game_active': True, 'high_score': 100, 'ships_left': 3, 'score': 50, 'level': 2, 'ship_limit': 3}) == {'game_active': False, 'high_score': 0, 'ships_left': 3, 'score': 0, 'level': 1}\", \"assert reset_game_stats({'game_active': False, 'hig...
{ "split": "train", "index": 69989, "acecode_id": "oss_232", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a URL routing system for a web application. The given code snippet is a part of the URL configuration for the application. The `urlpatterns` variable is a list of URL patterns that map to specific views within the application. Each tuple in the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_profile_route([], '/profile/<username>') == [('/profile/<username>', 'actor_profile')]\", \"assert add_profile_route([('/invite', 'actor_invite')], '/profile/<username>') == [('/invite', 'actor_invite'), ('/profile/<username>', 'actor_profile')]\", \"ass...
{ "split": "train", "index": 69990, "acecode_id": "oss_16849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_plus_or_minus(token_type: str) -> bool` that checks if the given token type is either a plus ('+') or minus ('-'). The function should return True if the token type is either '+' or '-', and False otherwise. The input will be a single string representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_plus_or_minus('+') == True\", \"assert is_plus_or_minus('-') == True\", \"assert is_plus_or_minus('0') == False\", \"assert is_plus_or_minus('1') == False\", \"assert is_plus_or_minus('*') == False\", \"assert is_plus_or_minus('/') == False\", \"assert is...
{ "split": "train", "index": 69991, "acecode_id": "bigcode_python_fns_40559", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a model configuration for a specific neural network architecture. The function should take two parameters: a boolean `pretrained`, and a boolean `use_ssld`. If `pretrained` is set to True, the function should prepare th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_model_config(False, False) == {'model_type': 'SE_HRNet_W48_C', 'pretrained': False, 'use_ssld': False}\", \"assert generate_model_config(True, False) == {'model_type': 'SE_HRNet_W48_C', 'pretrained': True, 'use_ssld': False}\", \"assert generate_mod...
{ "split": "train", "index": 69992, "acecode_id": "bigcode_python_fns_8265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the average net asset value (NAV) of a fund based on its value over a specific date range. Given a list of fund values corresponding to each date in the date range, your goal is to implement a function `calculate_average_nav(values: List[float]) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_nav([100.0, 200.0, 300.0]) == 200.0\", \"assert calculate_average_nav([0.0, 0.0, 0.0]) == 0.0\", \"assert calculate_average_nav([-100.0, -200.0, -300.0]) == -200.0\", \"assert calculate_average_nav([50.0]) == 50.0\", \"assert calculate_aver...
{ "split": "train", "index": 69993, "acecode_id": "oss_36582", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating user input for a registration form. Write a function `validate_registration` that takes four parameters: `first_name`, `last_name`, `email`, and `password`. The function should return a dictionary with validation results for each input field based...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_registration('John', 'Doe', 'john.doe@example.com', 'Password1!') == {'first_name': True, 'last_name': True, 'email': True, 'password': True}\", \"assert validate_registration('John', 'Doe', 'john.doeexample.com', 'Password1!') == {'first_name': Tru...
{ "split": "train", "index": 69994, "acecode_id": "oss_14084", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that generates a string representation of a neural network architecture based on provided configuration parameters. The function should accept the following parameters: \n\n1. `GRU_layers` (int): The number of GRU layers in the architect...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_model_architecture(1, [64], 0, [], False, 0.0, (None, 10, 8)) == 'Model Architecture: 1 GRU layers with neurons [64], 0 Dense layers'\", \"assert generate_model_architecture(2, [64, 32], 0, [], True, 0.2, (None, 10, 8)) == 'Model Architecture: 2 GRU...
{ "split": "train", "index": 69995, "acecode_id": "bigcode_python_fns_5227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists: `optimizers` and `problems`. Each element in the `optimizers` list represents a unique optimizer, and each element in the `problems` list represents a unique problem instance. Your task is to create a function `compare_optimizers(optimizers: List[str], ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(compare_optimizers(['Adam'], ['Problem1'], 20)) == 1\", \"assert 'SGD Problem1' in compare_optimizers(['SGD'], ['Problem1', 'Problem2'], 20)\", \"assert 'Adam Problem2' in compare_optimizers(['Adam', 'RMSProp'], ['Problem1', 'Problem2'], 20)\", \"assert ...
{ "split": "train", "index": 69996, "acecode_id": "bigcode_python_fns_27403", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Design and implement a function named 'create_car_info' that takes the following parameters: make (str), model (str), year (int), color (str), and mileage (float). The function should validate the inputs as follows: the make, model, and color must be strings; the year must be a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_car_info('Honda', 'Civic', 2010, 'Blue', 85000) == 'Make: Honda, Model: Civic, Year: 2010, Color: Blue, Mileage: 85000 miles'\", \"assert create_car_info('Toyota', 'Corolla', 2020, 'Red', 30000) == 'Make: Toyota, Model: Corolla, Year: 2020, Color: Red...
{ "split": "train", "index": 69997, "acecode_id": "evol_8918", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string is a palindrome. A string is considered a palindrome if it reads the same backward as forward. Ignore cases and non-alphanumeric characters. You need to implement the function `is_string_palindrome(s: str) -> bool` where `s` is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_string_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_string_palindrome('No lemon, no melon') == True\", \"assert is_string_palindrome('Hello, World!') == False\", \"assert is_string_palindrome('Racecar') == True\", \"assert is_string...
{ "split": "train", "index": 69998, "acecode_id": "evol_18491", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two 2D arrays (representing images) that consist of pixel values. Your task is to stack these two images vertically to create a new image. The two images must have the same width (number of columns). Write a function `stack_images_vertically(image_0: List[List[int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stack_images_vertically([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[1, 2], [3, 4], [5, 6], [7, 8]]\", \"assert stack_images_vertically([[1]], [[2]]) == [[1], [2]]\", \"assert stack_images_vertically([[1, 2]], [[3, 4]]) == [[1, 2], [3, 4]]\", \"assert stack_imag...
{ "split": "train", "index": 69999, "acecode_id": "bigcode_python_fns_32729", "num_tests": 16 }