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 creating a function `is_valid_suffix(name: str, suffix: str) -> bool` that checks if a given suffix is a valid suffix for a given name. A suffix is considered valid if it matches the end of the name exactly (case-sensitive). The function should return True i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_suffix('JohnDoe', 'Doe') == True\", \"assert is_valid_suffix('Alice', 'ce') == True\", \"assert is_valid_suffix('Python', 'on') == True\", \"assert is_valid_suffix('LeetCode', 'Code') == True\", \"assert is_valid_suffix('Test', 'test') == False\", \... | {
"split": "train",
"index": 2400,
"acecode_id": "bigcode_python_fns_8144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that identifies the top n highest priced products from a list of products, where each product is represented as a dictionary containing 'name', 'price', and 'category'. The function should handle cases where the price or category might be missing by ig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_priced_products([{'name': 'Product A', 'price': 10, 'category': 'Electronics'}, {'name': 'Product B', 'price': 20, 'category': 'Electronics'}, {'name': 'Product C', 'price': 30, 'category': 'Home'}], 2) == [{'name': 'Product C', 'price': 30, 'category': ... | {
"split": "train",
"index": 2401,
"acecode_id": "evol_32307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that receives a tuple of strings and returns a dictionary where each string that is a palindrome is a key, and its value is the count of vowels ('a', 'e', 'i', 'o', 'u') found in that string. If a string is not a palindrome, it should not be included in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels_in_palindromes(('madam', 'radar', 'apple')) == {'madam': 2, 'radar': 2}\", \"assert count_vowels_in_palindromes(('noon', 'level', 'world')) == {'noon': 2, 'level': 2}\", \"assert count_vowels_in_palindromes(('racecar', 'hello', 'civic')) == {'ra... | {
"split": "train",
"index": 2402,
"acecode_id": "evol_28741",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `reverse_list(input_list)` that takes a list as input and returns a new list that is the reverse of the input list, while the original list remains unchanged. The input list will contain integers.\nPlease reason step by step, then write a self-contained Python ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_list([1, 2, 3]) == [3, 2, 1]\", \"assert reverse_list([4, 5, 6]) == [6, 5, 4]\", \"assert reverse_list([]) == []\", \"assert reverse_list([10]) == [10]\", \"assert reverse_list([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_list([-1, -2, -3]... | {
"split": "train",
"index": 2403,
"acecode_id": "evol_13687",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes the provided user data and returns the name of the product associated with the user's API access. The input will be a dictionary representing a user object, which contains a nested dictionary under the key 'profile'. This n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_product_name({'profile': {'api_access_data': {'product_name': 'Product A'}}}) == 'Product A'\", \"assert get_product_name({'profile': {'api_access_data': {'product_name': 'Product B'}}}) == 'Product B'\", \"assert get_product_name({'profile': {'api_acces... | {
"split": "train",
"index": 2404,
"acecode_id": "bigcode_python_fns_39133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating the output of a decoder function. The output from the decoder is expected to be a tuple with specific constraints. Implement a function that checks if the provided output meets the following criteria: 1) The output must be a tuple. 2) The tuple mu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_decoder_output(([], 'extra')) == (True, None)\", \"assert check_decoder_output([[], 'extra']) == (False, 'Decoder output must be a tuple')\", \"assert check_decoder_output((['a', 'b', 'c'], None)) == (True, None)\", \"assert check_decoder_output(([], {... | {
"split": "train",
"index": 2405,
"acecode_id": "bigcode_python_fns_48945",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, write a function `calculate_fibonacci(n)` that returns the nth Fibonacci number using a recursive approach. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 0, F(2) = 1, and for n > 2, F(n) = F(n-1) + F(n-2). If the input n is less ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fibonacci(0) == 0\", \"assert calculate_fibonacci(1) == 0\", \"assert calculate_fibonacci(2) == 1\", \"assert calculate_fibonacci(3) == 1\", \"assert calculate_fibonacci(4) == 2\", \"assert calculate_fibonacci(5) == 3\", \"assert calculate_fibonacc... | {
"split": "train",
"index": 2406,
"acecode_id": "oss_14438",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a given string by checking if it follows a specific format. The string must consist of alphanumeric characters, and it should start with a letter (either uppercase or lowercase). Your function should take a single strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_string('Hello123') == True\", \"assert is_valid_string('hello') == True\", \"assert is_valid_string('123abc') == False\", \"assert is_valid_string('!@#') == False\", \"assert is_valid_string('Test@123') == False\", \"assert is_valid_string('ValidStr... | {
"split": "train",
"index": 2407,
"acecode_id": "oss_32812",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates the shutdown of a remote server. The function `shutdown_server()` should take no parameters and return a string indicating the status of the shutdown process. When the function is called, it should return 'Server is shutting... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shutdown_server() == 'Server is shutting down...'\", \"assert shutdown_server() == 'Server is shutting down...'\", \"assert shutdown_server() == 'Server is shutting down...'\", \"assert shutdown_server() == 'Server is shutting down...'\", \"assert shutdown_s... | {
"split": "train",
"index": 2408,
"acecode_id": "bigcode_python_fns_43231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple substitution cipher function. A substitution cipher is a method of encrypting by which each letter in the plaintext is replaced by a letter at a fixed distance down the alphabet. Given a word in uppercase, your function should return the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substitution_cipher('A') == 'D'\", \"assert substitution_cipher('B') == 'E'\", \"assert substitution_cipher('C') == 'F'\", \"assert substitution_cipher('D') == 'G'\", \"assert substitution_cipher('E') == 'H'\", \"assert substitution_cipher('F') == 'I'\", \"a... | {
"split": "train",
"index": 2409,
"acecode_id": "oss_33667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that creates a representation of a Klein bottle with a specified color. The function should take a single string argument, 'color', and return a dictionary containing the color of the Klein bottle. The dictionary should have a key 'color' and the value shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_klein_bottle('red') == {'color': 'red'}\", \"assert create_klein_bottle('blue') == {'color': 'blue'}\", \"assert create_klein_bottle('green') == {'color': 'green'}\", \"assert create_klein_bottle('yellow') == {'color': 'yellow'}\", \"assert create_kle... | {
"split": "train",
"index": 2410,
"acecode_id": "evol_9056",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates the process of retrieving an index of available packages from a list of channels. The function should take a tuple of channel URLs, a boolean to indicate whether to prepend default channels, and an optional platform string. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_package_index(('url1', 'url2'), True) == {'package1': {'version': '1.0', 'channel': 'url1'}, 'package2': {'version': '2.0', 'channel': 'url2'}, 'package3': {'version': '3.0', 'channel': 'default'}}\", \"assert get_package_index(('url1',), False) == {'pac... | {
"split": "train",
"index": 2411,
"acecode_id": "bigcode_python_fns_7456",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of MQTT messages in a specific format. Each message contains information about a device and a tag scan event. Your task is to implement a function that processes these messages and returns a dictionary summarizing the number of times each device has been sc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_mqtt_messages([{'type': 'device', 'device_id': 'device1', 'config': {}}, {'type': 'scan', 'tag_id': 'tag1', 'device_id': 'device1'}]) == {'device1': 1}\", \"assert process_mqtt_messages([{'type': 'device', 'device_id': 'device1', 'config': {}}, {'typ... | {
"split": "train",
"index": 2412,
"acecode_id": "bigcode_python_fns_31769",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of column names and a list of rows, where each row is a list of values. The function should return a new list where the first element is the list of column names followed by the rows of values. Essentially, you need to cr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_table(['Name', 'Age'], [['Alice', 30], ['Bob', 25]]) == [['Name', 'Age'], ['Alice', 30], ['Bob', 25]]\", \"assert create_table(['Product', 'Price'], [['Apple', 1.2], ['Banana', 0.5]]) == [['Product', 'Price'], ['Apple', 1.2], ['Banana', 0.5]]\", \"ass... | {
"split": "train",
"index": 2413,
"acecode_id": "bigcode_python_fns_35904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that takes a nested numeric list and returns a new nested list where each numeric element has been replaced with its corresponding Fibonacci number. The function should handle any potential errors gracefully and return an empty list if an error oc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_fibonacci_recursively([1, 2, [3, 4, [5, 6], 7], 8, [9, [10]]]) == [1, 1, [2, 3, [5, 8], 13], 21, [34, [55]]]\", \"assert apply_fibonacci_recursively([]) == []\", \"assert apply_fibonacci_recursively([4, 5, [1, 2]]) == [3, 5, [1, 1]]\", \"assert apply_f... | {
"split": "train",
"index": 2414,
"acecode_id": "evol_235",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, create a new string where the first and last occurrence of each character is removed, and reverse the remaining characters in each word. If a word has less than 3 characters, it should be omitted from the result. Implement a function `modify_string(s: str) -> st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_string('a') == ''\", \"assert modify_string('a b c') == ''\", \"assert modify_string('Hello') == ''\", \"assert modify_string('abc') == ''\", \"assert modify_string('ab') == ''\"]}"
} | {
"split": "train",
"index": 2415,
"acecode_id": "evol_12134",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Your task is to implement a function that calculates the average age of the group. The function should take a list of integers as input and return a floating-point number that represents the average ag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_age([20, 30, 40]) == 30.0\", \"assert average_age([25, 35, 45, 55]) == 40.0\", \"assert average_age([10]) == 10.0\", \"assert average_age([]) == 0.0\", \"assert average_age([0, 0, 0]) == 0.0\", \"assert average_age([18, 25, 34, 45, 60]) == 36.4\", \"... | {
"split": "train",
"index": 2416,
"acecode_id": "oss_9935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function `shape(n)` that returns a string representation of a shape. The shape should be a right-angled triangle made of asterisks (*) with a base and height of n. Each row of the triangle should contain an increasing number of asterisks, starting fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shape(7) == '*\\\\n**\\\\n***\\\\n****\\\\n*****\\\\n******\\\\n*******'\", \"assert shape(4) == '*\\\\n**\\\\n***\\\\n****'\", \"assert shape(2) == '*\\\\n**'\", \"assert shape(1) == '*'\", \"assert shape(0) == ''\", \"assert shape(-1) == ''\", \"assert sha... | {
"split": "train",
"index": 2417,
"acecode_id": "bigcode_python_fns_13480",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary of key-value pairs, implement a function that returns a shuffled version of the dictionary. The shuffled version must not be the same as the previous shuffle result, and if only one key-value pair exists, return the original dictionary. Your function should h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(shuffle_dict({'apple': 'fruit'}), dict)\", \"assert shuffle_dict({'x': 10}) == {'x': 10}\", \"assert shuffle_dict({'only_key': 'only_value'}) == {'only_key': 'only_value'}\", \"assert shuffle_dict({'k1': 'v1'}) == {'k1': 'v1'}\", \"assert shuffle_... | {
"split": "train",
"index": 2418,
"acecode_id": "evol_32089",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a color interpolation function for a lighting system. The function needs to interpolate between two color values based on a specified time parameter `t`. Given a 2D array `rb` where each element represents the color values at different time interval... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpolateColor([[0, 0], [255, 255]], 0, 0, 256) == (0, 0)\", \"assert interpolateColor([[0, 0], [0, 0]], 0, 1, 256) == (0, 0)\", \"assert interpolateColor([[10, 20], [30, 40]], 0, 0, 256) == (10, 20)\", \"assert interpolateColor([[0, 0], [255, 255]], 0, 0,... | {
"split": "train",
"index": 2419,
"acecode_id": "oss_1655",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that can interpret and execute a simple domain-specific language for scientific computing. Your function should take a script as input, which can include variable assignments and basic arithmetic operations, and return the output o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpret_script('a = 5\\\\nb = 7\\\\nc = a + b\\\\nc') == 12\", \"assert interpret_script('x = 10\\\\ny = x - 2\\\\ny') == 8\", \"assert interpret_script('m = 4\\\\nn = 3\\\\no = m * n\\\\no') == 12\", \"assert interpret_script('a = 1\\\\nb = 2\\\\nc = a + ... | {
"split": "train",
"index": 2420,
"acecode_id": "oss_2088",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of n integers, where n varies from 1 to 10^5, and an integer k (1 <= k <= 100), implement a function that finds the k-th smallest even number in the list. If there are fewer than k even numbers, return None.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kth_smallest_even([1, 3, 5, 7], 1) == None\", \"assert kth_smallest_even([2, 4, 6, 8, 10], 2) == 4\", \"assert kth_smallest_even([10, 20, 30], 1) == 10\", \"assert kth_smallest_even([1, 2, 3, 4, 5, 6], 1) == 2\", \"assert kth_smallest_even([1, 1, 1, 2, 2], 1... | {
"split": "train",
"index": 2421,
"acecode_id": "evol_11344",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_even_sum(arr: List[int]) -> int` that returns the maximum sum of even numbers in the list. If there are no even numbers, return 0. The input list may contain both positive and negative integers.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_even_sum([1, 2, 3, 4, 5]) == 6\", \"assert max_even_sum([-1, -2, -3, -4]) == -6\", \"assert max_even_sum([1, 3, 5]) == 0\", \"assert max_even_sum([2, 4, 6, 8]) == 20\", \"assert max_even_sum([]) == 0\", \"assert max_even_sum([-1, 0, 2, 4, 6]) == 12\", \"... | {
"split": "train",
"index": 2422,
"acecode_id": "bigcode_python_fns_8781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list representing a chessboard of size 8x8, where each element can either be 0 or 1. Your task is to create a function `count_active_cells(board: List[List[int]]) -> int` that counts the number of active cells on the chessboard. An active cell is defined as a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_active_cells([[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]) == 0\", \"assert count_active... | {
"split": "train",
"index": 2423,
"acecode_id": "bigcode_python_fns_3012",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to manage events with start and end times. The function should generate a random start time for an event that is a fuzzy date time between January 1, 2000, and January 1, 2020, in the UTC timezone. The end time should be exactly 1 hour af... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_event() is not None\", \"assert 'start_at' in generate_event()\", \"assert 'end_at' in generate_event()\", \"assert generate_event()['start_at'].year >= 2000\", \"assert generate_event()['start_at'].year < 2020\", \"assert generate_event()['end_at']... | {
"split": "train",
"index": 2424,
"acecode_id": "oss_10758",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a template for parameter specification in a model. Write a function `create_parameter_template(n_types: int, n_type_covariates: int, initialize_coeffs: bool) -> List[Dict[str, Any]]` that generates a template based on the following criteria: \n\n1. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_parameter_template(1, 2, True) == [{'type': 1, 'covariate': 1, 'value': 0}, {'type': 1, 'covariate': 2, 'value': 0}]\", \"assert create_parameter_template(1, 3, False) == [{'type': 1, 'covariate': 1, 'value': None}, {'type': 1, 'covariate': 2, 'value'... | {
"split": "train",
"index": 2425,
"acecode_id": "bigcode_python_fns_13415",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a commit message and tags a release version for a version control system. The function should take a version string as input and return a string that represents the commit message and tag for that version. The commit messag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert commit_release('1.0.0') == 'Cut 1.0.0'\", \"assert commit_release('2.1.3') == 'Cut 2.1.3'\", \"assert commit_release('3.0.0') == 'Cut 3.0.0'\", \"assert commit_release('4.2.1') == 'Cut 4.2.1'\", \"assert commit_release('5.5.5') == 'Cut 5.5.5'\", \"assert com... | {
"split": "train",
"index": 2426,
"acecode_id": "bigcode_python_fns_37183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a formatted string representation of a cell card for a simulation model. The function `create_cell_card` should take in the following parameters: `cellNum` (a string representing the cell number), `matNum` (a string representing the material number)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_cell_card('C1', 'M1', 2.34567, ['S1', 'S2', 'S3'], 'O1', 1, 'This is a test.') == 'C1 M1 2.34567 S1 S2 S3 -O1 u=1 This is a test.'\", \"assert create_cell_card('C4', 'M4', 4.56789, ['S1'], 'O4', 4, 'Single inner surface.') == 'C4 M4 4.56789 S1 -O4 u=4... | {
"split": "train",
"index": 2427,
"acecode_id": "bigcode_python_fns_37549",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer number, return a list of its prime divisors in ascending order. Each prime divisor should appear in the result as many times as it divides the number. For example, if the input number is 20, the output should be [2, 2, 5] since 20 can be factored into 2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_divisors(20) == [2, 2, 5]\", \"assert prime_divisors(1) == []\", \"assert prime_divisors(2) == [2]\", \"assert prime_divisors(3) == [3]\", \"assert prime_divisors(4) == [2, 2]\", \"assert prime_divisors(6) == [2, 3]\", \"assert prime_divisors(12) == [2... | {
"split": "train",
"index": 2428,
"acecode_id": "bigcode_python_fns_19182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists, `pokemon` and `combats`, where `pokemon` is a list of dictionaries representing Pokemon with their attributes and `combats` is a list of dictionaries representing combat results between two Pokemon. Each combat entry has a 'Winner' key that indicates wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_data([{'First_Pokemon': 'Pikachu', 'Second_Pokemon': 'Charizard', 'Winner': 'Pikachu'}], [{'Name': 'Pikachu', 'Type': 'Electric'}, {'Name': 'Charizard', 'Type': 'Fire'}], 'Winner') == [{'Name': 'Pikachu', 'Type': 'Electric', 'Winner': 'Pikachu'}]\", ... | {
"split": "train",
"index": 2429,
"acecode_id": "bigcode_python_fns_18084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary string `bin_str` which represents a binary number (for example, '0b0011' or '0011'), write a function `binstr2int(bin_str: str) -> int` that converts this binary string into its decimal integer equivalent. The function should handle both types of binary string fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binstr2int('0b0000') == 0\", \"assert binstr2int('0b0001') == 1\", \"assert binstr2int('0b0010') == 2\", \"assert binstr2int('0b0011') == 3\", \"assert binstr2int('0b0100') == 4\", \"assert binstr2int('0b0111') == 7\", \"assert binstr2int('0b1000') == 8\", \... | {
"split": "train",
"index": 2430,
"acecode_id": "bigcode_python_fns_9816",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of mixed uppercase and lowercase letters, implement a function that rearranges the string so that all uppercase letters appear in the first half and all lowercase letters appear in the second half. The order of the letters should be preserved as they a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_letters('aA') == 'Aa'\", \"assert rearrange_letters('') == ''\", \"assert rearrange_letters('TEST') == 'TEST'\", \"assert rearrange_letters('A') == 'A'\", \"assert rearrange_letters('B') == 'B'\", \"assert rearrange_letters('C') == 'C'\"]}"
} | {
"split": "train",
"index": 2431,
"acecode_id": "evol_13510",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a collection of numerical values, create a two-dimensional array where each sub-array consists of a number and its corresponding n-th Fibonacci number. Implement this using a functional programming style. The Fibonacci number for each input value n should be determined us... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_fib_pairs([0, 1, 2]) == [[0, 0], [1, 1], [2, 1]]\", \"assert create_fib_pairs([5]) == [[5, 5]]\", \"assert create_fib_pairs([10, 11]) == [[10, 55], [11, 89]]\", \"assert create_fib_pairs([3, 4, 5]) == [[3, 2], [4, 3], [5, 5]]\", \"assert create_fib_pa... | {
"split": "train",
"index": 2432,
"acecode_id": "evol_25770",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the sum of all even numbers in the list. The function should take a single parameter, a list of integers, and return a single integer representing the sum of all even numbers. If there are no even numbers, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([-2, -1, 0, 1, 2]) == 0\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([2, 4, 6,... | {
"split": "train",
"index": 2433,
"acecode_id": "oss_14425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_divisors(n: int) -> List[int]` that takes an integer `n` as input and returns a list of all its divisors in ascending order. The input `n` will be a positive integer.\nPlease reason step by step, then write a self-contained Python solution. Give your final... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_divisors(1) == [1]\", \"assert get_divisors(2) == [1, 2]\", \"assert get_divisors(3) == [1, 3]\", \"assert get_divisors(4) == [1, 2, 4]\", \"assert get_divisors(5) == [1, 5]\", \"assert get_divisors(6) == [1, 2, 3, 6]\", \"assert get_divisors(7) == [1, 7... | {
"split": "train",
"index": 2434,
"acecode_id": "evol_33187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `enhanced_array_aggregation(lst, reverse=False)` that takes a list of strings and performs the following operations: discard strings that are of odd lengths or contain any digits, and return a sorted list based on the following criteria: The list should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enhanced_array_aggregation(['a', 'ab', 'abc', 'abcd', 'abcde']) == ['ab', 'abcd']\", \"assert enhanced_array_aggregation(['a', 'a1', 'abc', 'ABCD', 'abcde']) == ['ABCD']\", \"assert enhanced_array_aggregation(['aa', 'bb', 'cc', 'dd', 'ee', 'ff'], True) == ['... | {
"split": "train",
"index": 2435,
"acecode_id": "evol_7418",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Develop a function `enqueue(queue, data)` that adds an element to a queue with a maximum size limit. The queue follows the First-In-First-Out (FIFO) principle. If the queue is full, the function should raise an exception with the message 'Queue max size limit reached.' The queu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enqueue([], 1) == None\", \"assert enqueue([1], 2) == None\", \"assert enqueue([1, 2], 3) == None\", \"assert enqueue([1, 2], 2) == None\", \"assert enqueue([1], 2) == None\", \"assert enqueue([], 5) == None\", \"assert enqueue([1, 2, 3, 4], 5) == None\", \"... | {
"split": "train",
"index": 2436,
"acecode_id": "evol_9199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, which may contain both positive and negative numbers. Your task is to write a function that returns the maximum sum of any contiguous subarray within the list. A contiguous subarray is defined as a sequence of elements that are adjacent in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, -3, -1, -5]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_subarray_sum([0, -1, -2, -3]) == 0\", \"ass... | {
"split": "train",
"index": 2437,
"acecode_id": "oss_5517",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that rearranges the letters in a given list of strings in alphabetical order. The function should not only sort the strings themselves but also sort the characters within each string. The function should handle special characters and numbers, returning them in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings(['cba321', 'edcba,./']) == ['abc123', 'abcde,./']\", \"assert sort_strings(['123abc', '321cba']) == ['abc123', 'abc123']\", \"assert sort_strings(['1a2b3c', 'CBA']) == ['abc123', 'ABC']\", \"assert sort_strings(['single']) == ['egilns']\", \"ass... | {
"split": "train",
"index": 2438,
"acecode_id": "evol_9929",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given an object that may represent a model. Your task is to implement a function that retrieves the name of the table associated with that model. The table name can be accessed through the `__tablename__` attribute of the object. If the object does not have this attribu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_table_name(type('obj', (), {'__tablename__': 'users'})()) == 'users'\", \"assert get_table_name(type('obj', (), {'__tablename__': 'products'})()) == 'products'\", \"assert get_table_name(type('obj', (), {'__tablename__': 'orders'})()) == 'orders'\", \"as... | {
"split": "train",
"index": 2439,
"acecode_id": "bigcode_python_fns_19199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that sorts a list of integers in ascending order using a sorting algorithm that you implement manually. In addition to sorting, the function should also identify any repeating integers in the list and return a dictionary with the repeating integers as keys and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_count([3, 1, 2, 3, 4, 2]) == ([1, 2, 2, 3, 3, 4], {3: 2, 2: 2})\", \"assert sort_and_count([5, 5, 5, 5]) == ([5, 5, 5, 5], {5: 4})\", \"assert sort_and_count([1, 2, 3, 4]) == ([1, 2, 3, 4], {})\", \"assert sort_and_count([10, 9, 8, 7, 6, 5]) == ([5,... | {
"split": "train",
"index": 2440,
"acecode_id": "evol_21538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the longest contiguous subsequence in a given list of integers that contains at least one prime number and at least one composite number. The function should return the starting and ending indices of this subsequence. If there are no such subsequ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_sequence([4, 7, 10, 13, 6, 9, 15, 11, 19, 30]) == (0, 9)\", \"assert longest_sequence([1, 2, 3, 4, 5]) == (0, 4)\", \"assert longest_sequence([2, 3, 5, 7]) == (-1, -1)\", \"assert longest_sequence([4, 6, 8, 10]) == (-1, -1)\", \"assert longest_sequen... | {
"split": "train",
"index": 2441,
"acecode_id": "evol_4201",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a class called 'Animal' that represents a generic animal. The class should have properties 'age', 'gender', and 'weight'. Implement the class with a constructor that initializes these properties. Additionally, implement the following methods: 'eat',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Animal(5, 'male', 20).introduce() == 'This animal is 5 years old, weighs 20 kg and is a male.'\", \"assert Animal(3, 'female', 15).eat() == 'The animal is eating.'\", \"assert Animal(4, 'male', 25).sleep() == 'The animal is sleeping.'\", \"assert Animal(2, '... | {
"split": "train",
"index": 2442,
"acecode_id": "evol_1125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that converts the list into a set, ensuring that the conversion is case-sensitive and retains special characters. Additionally, the function should raise a ValueError if the input is not a list of strings. Write a function `convert_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_set(['Hello', 'world', 'hello']) == {'Hello', 'world', 'hello'}\", \"assert convert_to_set(['apple', 'Apple', 'APPLE']) == {'apple', 'Apple', 'APPLE'}\", \"assert convert_to_set(['abc', 'ABC', 'AbC']) == {'abc', 'ABC', 'AbC'}\", \"assert convert_t... | {
"split": "train",
"index": 2443,
"acecode_id": "evol_13196",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `sort_and_deduplicate(strings: List[str]) -> List[str]` that returns a new list containing the unique strings from the input list, sorted in alphabetical order. The input list may contain duplicates and can have strings of varying l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_deduplicate(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert sort_and_deduplicate(['cat', 'dog', 'cat', 'fish']) == ['cat', 'dog', 'fish']\", \"assert sort_and_deduplicate(['zebra', 'antelope', 'zebra', 'elephant'... | {
"split": "train",
"index": 2444,
"acecode_id": "bigcode_python_fns_1598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a URL string, implement a function `parse_url(url: str) -> Dict[str, Union[str, Dict[str, List[str]]]]` that parses the URL and returns a dictionary containing the following information: the hostname, port, path, and query parameters. The query parameters should be return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_url('http://example.com:80/path?param1=value1¶m2=value2') == {'hostname': 'example.com', 'port': '80', 'path': '/path', 'query_params': {'param1': ['value1'], 'param2': ['value2']}}\", \"assert parse_url('https://www.example.org/path/to/resource') ... | {
"split": "train",
"index": 2445,
"acecode_id": "oss_17800",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a text-based bulleted list of tool names. The function should accept a dictionary where the keys represent the names of the tools. Your function should return a string that starts with a header 'Tool List:' followed by each... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_bulleted_tool_list(OrderedDict({'Hammer': 1, 'Screwdriver': 2, 'Wrench': 3})) == 'Tool List:\\\\n- Hammer\\\\n- Screwdriver\\\\n- Wrench'\", \"assert create_bulleted_tool_list(OrderedDict({'Drill': 1})) == 'Tool List:\\\\n- Drill'\", \"assert create_b... | {
"split": "train",
"index": 2446,
"acecode_id": "bigcode_python_fns_19389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes an input layer for a neural network based on the number of channels and kernel size provided as input parameters. The function should take two parameters: `num_channels` (an integer representing the number of channels in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_input_layer(1, 3) == {'num_channels': 1, 'kernel_size': 3}\", \"assert initialize_input_layer(2, 5) == {'num_channels': 2, 'kernel_size': 5}\", \"assert initialize_input_layer(3, 7) == {'num_channels': 3, 'kernel_size': 7}\", \"assert initialize_i... | {
"split": "train",
"index": 2447,
"acecode_id": "oss_4263",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the coverage data for a genomic region, write a function that converts this coverage data into a list of tuples. Each tuple should contain the chromosome name (as a string), the coverage value (as a float), and the position (as an integer) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert coverage_to_tuples(['chrom=chr1', 1.0, 2.0, 'chrom=chr2', 3.0]) == [('chr1', 249255001, 0), ('chr1', 1.0, 5000), ('chr1', 2.0, 10000), ('chr2', 249255001, 0), ('chr2', 3.0, 5000)]\", \"assert coverage_to_tuples(['chrom=chrX', 4.5, 5.5]) == [('chrX', 24925500... | {
"split": "train",
"index": 2448,
"acecode_id": "bigcode_python_fns_48601",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a material provider's attributes in a software system. The function should take three parameters: `provider_store`, `material_name`, and `version_ttl`. The validation rules are as follows: 1. `provider_store` must be a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_material_provider('StoreA', 'Wood', 3600) == True\", \"assert validate_material_provider('StoreB', 'Steel', 7200) == True\", \"assert validate_material_provider('StoreC', 'Plastic', 1800) == True\", \"assert validate_material_provider('StoreD', 'Gla... | {
"split": "train",
"index": 2449,
"acecode_id": "oss_35080",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array `ranked` containing distinct integers in descending order, representing the ranks of players in a game. You are also given an array `player` containing distinct integers representing the scores of players. Your task is to determine the rank of each player... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findRanks([100, 90, 90, 80, 75, 60], [50, 65, 77, 90, 102]) == [6, 5, 4, 2, 1]\", \"assert findRanks([200, 150, 100], [250, 50]) == [1, 4]\", \"assert findRanks([10, 20, 30], [5, 15, 25, 35]) == [4, 3, 2, 1]\", \"assert findRanks([1000, 800, 600], [700, 900,... | {
"split": "train",
"index": 2450,
"acecode_id": "oss_23385",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the total number of stars for GitHub repositories that start with a specified prefix. You are given a list of tuples, where each tuple contains a repository name (string) and the number of stars it has (integer). Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_stars_with_prefix([('github_api', 100), ('github_actions', 200), ('gitlab_ci', 150), ('github_stats', 300)], 'github') == 600\", \"assert count_stars_with_prefix([('my_project', 20), ('your_project', 30), ('our_project', 40)], 'my') == 20\", \"assert c... | {
"split": "train",
"index": 2451,
"acecode_id": "oss_25568",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates setting a user's language preference in a web application. The function should take two parameters: `next_url` (a string representing the URL to redirect to) and `language` (a string representing the user's language prefere... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_language_preference('http://example.com', 'fr') == {'redirect_url': 'http://example.com', 'cookie': {'language': 'fr', 'max_age': 2592000}}\", \"assert set_language_preference('http://example.com', 'es') == {'redirect_url': 'http://example.com', 'cookie'... | {
"split": "train",
"index": 2452,
"acecode_id": "bigcode_python_fns_19108",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of driver records. Each driver record is represented as a dictionary containing 'name' (a string) and 'revenue' (a float). Your goal is to calculate the total revenue generated by all drivers in the list. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_revenue([]) == 0.0\", \"assert calculate_total_revenue([{'name': 'Alice', 'revenue': 1200.50}, {'name': 'Bob', 'revenue': 800.75}]) == 2001.25\", \"assert calculate_total_revenue([{'name': 'Charlie', 'revenue': 500.0}]) == 500.0\", \"assert c... | {
"split": "train",
"index": 2453,
"acecode_id": "bigcode_python_fns_6811",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are strings representing unique identifiers and the values are lists of dictionaries. Each dictionary in the list contains information about an owner, including their name and ID. Your task is to create a function that converts this inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_owners({'owner1': [{'name': 'Alice', 'id': 1}], 'owner2': [{'name': 'Bob', 'id': 2}]}) == {'owner1': [{'name': 'Alice', 'id': 1}], 'owner2': [{'name': 'Bob', 'id': 2}]}\", \"assert convert_owners({'ownerA': [{'name': 'Charlie', 'id': 3}], 'ownerB': [... | {
"split": "train",
"index": 2454,
"acecode_id": "bigcode_python_fns_7530",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `minimize_memory_footprint(words: List[str]) -> List[str]` that takes a list of strings and returns a list of strings representing the unique prefixes of each string that can be used to represent them in a Trie structure. The unique prefixes should be the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimize_memory_footprint(['apple', 'banana', 'grape', 'orange']) == ['apple', 'banana', 'grape', 'orange']\", \"assert minimize_memory_footprint(['abc', 'abcd', 'abcde']) == ['abc', 'abcd', 'abcde']\", \"assert minimize_memory_footprint(['a', 'b', 'c', 'd']... | {
"split": "train",
"index": 2455,
"acecode_id": "evol_14124",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `greet(name: str) -> str` that takes a string `name` as an input and returns a greeting message in the format 'Hello, {name}!' where {name} is replaced with the input name. The function should handle names of varying lengths and should not return any additional... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet('Alice') == 'Hello, Alice!'\", \"assert greet('Bob') == 'Hello, Bob!'\", \"assert greet('Charlie') == 'Hello, Charlie!'\", \"assert greet('Diana') == 'Hello, Diana!'\", \"assert greet('Eve') == 'Hello, Eve!'\", \"assert greet('Frank') == 'Hello, Frank!... | {
"split": "train",
"index": 2456,
"acecode_id": "evol_32581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of courses, where each course is represented as a dictionary containing the fields 'course_id', 'curriculum_id', and 'course_sessions'. Each 'course_sessions' is a list of dictionaries that have 'session' and 'description'. Your task is to write a function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_courses([{'course_id': 1, 'curriculum_id': 101, 'course_sessions': [{'session': 1, 'description': 'Math'}, {'session': 2, 'description': 'Science'}]}], [1]) == [{'course_id': 1, 'curriculum_id': 101, 'description': 'Math year 1', 'linked': 1}, {'cours... | {
"split": "train",
"index": 2457,
"acecode_id": "bigcode_python_fns_29780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and an integer `chunks_num`. Implement a function `split_into_chunks(data: List[int], chunks_num: int) -> List[List[int]]` that divides the list of integers into `chunks_num` lists using a round-robin approach. Each list should contain elements ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_into_chunks([1, 2, 3, 4, 5], 2) == [[1, 3, 5], [2, 4]]\", \"assert split_into_chunks([1, 2, 3], 1) == [[1, 2, 3]]\", \"assert split_into_chunks([1, 2, 3, 4], 3) == [[1, 4], [2], [3]]\", \"assert split_into_chunks([], 2) == [[], []]\", \"assert split_in... | {
"split": "train",
"index": 2458,
"acecode_id": "bigcode_python_fns_29497",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that organizes a list of file names based on their file extensions. The function should take a list of file names as input and return a dictionary where the keys are file extensions and the values are lists of file names that belon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_files(['image.png', 'doc.pdf', 'file.docx', 'script']) == {'png': ['image.png'], 'pdf': ['doc.pdf'], 'docx': ['file.docx'], 'no_extension': ['script']}\", \"assert organize_files(['a.txt', 'b.txt', 'c']) == {'txt': ['a.txt', 'b.txt'], 'no_extension'... | {
"split": "train",
"index": 2459,
"acecode_id": "oss_18556",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are asked to implement a function that simulates a basic service registration process. The function `register_and_return_service` should take a dictionary representing a configuration object, a service object, and an optional name for the service. The function should regist... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_and_return_service({}, 'serviceA') == 'serviceA'\", \"assert register_and_return_service({}, 'serviceB', 'myService') == 'serviceB'\", \"assert register_and_return_service({}, 'serviceC', None) == 'serviceC'\"]}"
} | {
"split": "train",
"index": 2460,
"acecode_id": "oss_22920",
"num_tests": 3
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a path to a file. Your task is to create a function that checks whether the given path is a valid file path. A valid file path must satisfy the following conditions: 1. It should start with a letter followed by a colon (e.g., 'C:'). 2. It can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_path('C:/Users/John/Documents/file.txt') == True\", \"assert is_valid_path('D:/Projects/Python/scripts/main.py') == True\", \"assert is_valid_path('E:/Data/2023/Report.docx') == True\", \"assert is_valid_path('C:/Invalid Path/Spaces/file.txt') == Fa... | {
"split": "train",
"index": 2461,
"acecode_id": "bigcode_python_fns_28269",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing package names and their required versions in the format 'package_name version'. Your task is to implement a function `check_dependencies(packages: List[str], installed: List[str]) -> Union[str, None]` that checks for dependency confl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_dependencies(['flask >=1.0'], ['flask 1.1']) == None\", \"assert check_dependencies(['requests ==2.25.1'], ['requests 2.25.1']) == None\", \"assert check_dependencies(['numpy >=1.19.0'], ['numpy 1.18.5']) == 'dependency conflict: numpy >=1.19.0 but you... | {
"split": "train",
"index": 2462,
"acecode_id": "bigcode_python_fns_43006",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of compiler flags represented as strings. Your task is to implement a function that filters out the unsupported flags. The function should take a list of compiler flags and return a new list containing only the flags that are supported. A flag is considered... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_supported_flags(['-O2', '-Wextra', '-Werror']) == ['-O2', '-Wextra']\", \"assert filter_supported_flags(['-g', '-Wshadow', '-Winvalid']) == ['-g', '-Wshadow']\", \"assert filter_supported_flags(['-O3', '-Wall']) == ['-Wall']\", \"assert filter_support... | {
"split": "train",
"index": 2463,
"acecode_id": "bigcode_python_fns_13788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function named `intersperse` that accepts a list of integers `numbers` and an integer `delimeter`. The function should return a new list where the `delimeter` is placed between every pair of consecutive elements in the `numbers` list. For example, if the input is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1], 4) == [1]\", \"assert intersperse([1, 2], 4) == [1, 4, 2]\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([5, 6, 7, 8], 0) == [5, 0, 6, 0, 7, 0, 8]\", \"assert intersperse... | {
"split": "train",
"index": 2464,
"acecode_id": "evol_32684",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of deposit and withdrawal operations on a bank account which starts with a zero balance, determine if the account balance dips below zero at any point. The operations may include integers or string representations of integers. Additionally, if a case_insensitive fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([1, 2, 3]) == False\", \"assert below_zero([1, 2, '-4', 5]) == True\", \"assert below_zero([1, '2', -3], True) == True\", \"assert below_zero([10, -5, -6]) == True\", \"assert below_zero([0, 0, 0]) == False\", \"assert below_zero(['1', '1', '-3'])... | {
"split": "train",
"index": 2465,
"acecode_id": "evol_17040",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `simulate_behavior()` that simulates the behavior of two functions: `se_enkrat()` and `pozeni_vmesnik()`. The function `se_enkrat()` should return a random boolean value, while `pozeni_vmesnik()` should return a string message 'Functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_behavior() in ['Function executed', None]\", \"assert simulate_behavior() in ['Function executed', None]\", \"assert simulate_behavior() in ['Function executed', None]\", \"assert simulate_behavior() in ['Function executed', None]\", \"assert simula... | {
"split": "train",
"index": 2466,
"acecode_id": "oss_18981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a rupee container system for a video game. The rupee container has a maximum capacity, and when rupees are added, the container should not exceed this maximum capacity. Your task is to implement the `updateRupeeContainer` function, which takes t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert updateRupeeContainer({'rupee': 10, 'maxRupee': 100}, 20) == {'rupee': 30, 'maxRupee': 100}\", \"assert updateRupeeContainer({'rupee': 90, 'maxRupee': 100}, 15) == {'rupee': 100, 'maxRupee': 100}\", \"assert updateRupeeContainer({'rupee': 50, 'maxRupee': 100}... | {
"split": "train",
"index": 2467,
"acecode_id": "oss_26647",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers as input and returns a new list containing only the odd numbers from the input list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_odd_numbers([1, 6, 3, 2, 8, 7, 0, 4, 9, 11, 22, 18, 33, 28, 26, 55, 49, 37, 63, 59]) == [1, 3, 7, 9, 11, 33, 55, 49, 37, 63, 59]\", \"assert filter_odd_numbers([2, 4, 6, 8, 10]) == []\", \"assert filter_odd_numbers([1, 3, 5, 7, 9]) == [1, 3, 5, 7, 9]\... | {
"split": "train",
"index": 2468,
"acecode_id": "evol_17598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing words spoken by listeners in a conversation. Your task is to implement a function that finds the top `num` most frequent words from this list. Words are case-sensitive and should be counted based on their occurrence in the list. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_frequent_words(['apple', 'banana', 'apple', 'orange', 'banana', 'kiwi'], 2) == [('apple', 2), ('banana', 2)]\", \"assert top_frequent_words(['hello', 'world', 'hello', 'python'], 2) == [('hello', 2), ('python', 1)]\", \"assert top_frequent_words(['a', 'b... | {
"split": "train",
"index": 2469,
"acecode_id": "bigcode_python_fns_31043",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple text-based maze game. The maze is represented as a 2D grid, where each cell can be either empty ('.') or blocked ('#'). Given a starting position and a treasure position in the maze, implement a function `find_trea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_treasure([['.', '.', '.'], ['#', '.', '#'], ['.', '.', '.']], (0, 0), (2, 2)) == 'You found the treasure!'\", \"assert find_treasure([['.', '#', '.'], ['#', '#', '.'], ['.', '.', '.']], (0, 0), (2, 2)) == 'You cannot reach the treasure.'\", \"assert fin... | {
"split": "train",
"index": 2470,
"acecode_id": "oss_33603",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a configuration object from command line arguments provided as a dictionary. Write a function `config_from_args(args: Dict[str, Any]) -> Dict[str, Any]` that takes a dictionary `args` as input and returns a new dictionary representing the configurat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert config_from_args({'p': 'my_program', 'd': '/tests', 'v': 'verifier', 'b': 'true', 'g': None, 't': 30, 'timer': None, 'sha': 'abc123'}) == {'program': 'my_program', 'test_dir': '/tests', 'verifier': 'verifier', 'break_on_error': True, 'groups': ['.*'], 'timeo... | {
"split": "train",
"index": 2471,
"acecode_id": "bigcode_python_fns_18389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that modifies a dictionary of HTTP headers by adding or updating the 'X-Auth-Token' header. The function should take in the original dictionary of headers and a new authentication token. If the 'X-Auth-Token' header is already ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_auth_token({'content-type': 'application/json'}, 'new_auth_token') == {'content-type': 'application/json', 'X-Auth-Token': 'new_auth_token'}\", \"assert update_auth_token({'content-type': 'text/html', 'X-Auth-Token': 'old_auth_token'}, 'new_auth_token... | {
"split": "train",
"index": 2472,
"acecode_id": "oss_199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings and a delimiter string, implement a function that returns a single string with the delimiter placed between each item in the list. The function should be defined as follows: def add_delimiter(strings: List[str], delimiter: str) -> str. For example, given... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_delimiter(['apple', 'orange', 'mango'], ', ') == 'apple, orange, mango'\", \"assert add_delimiter(['cat', 'dog'], ' & ') == 'cat & dog'\", \"assert add_delimiter(['a', 'b', 'c', 'd'], '-') == 'a-b-c-d'\", \"assert add_delimiter(['hello'], ' ') == 'hello'... | {
"split": "train",
"index": 2473,
"acecode_id": "evol_170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two 3D vectors `a` and `b`, write a function `rotation_matrix(a: List[float], b: List[float]) -> List[List[float]]` that calculates the rotation matrix `M` such that when the vector `a` is multiplied by `M`, it aligns with the vector `b`. The vectors `a` and `b` can be an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotation_matrix([1, 0, 0], [0, 1, 0]) == [[0.0, -1.0, 0.0], [1.0, 0.0, 0.0], [0.0, 0.0, 1.0]]\", \"assert rotation_matrix([1, 1, 1], [-1, -1, -1]) == [[-1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]]\", \"assert rotation_matrix([1, 0, 0], [1, 0, 0]) == ... | {
"split": "train",
"index": 2474,
"acecode_id": "bigcode_python_fns_27576",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string is a configuration setting in the format 'variable_name=variable_expression'. Your task is to implement a function `parse_configurations(configs: List[str]) -> Dict[str, str]` that processes the list and returns a dictionary ma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_configurations(['a=x+1', 'b=2', 'c=3']) == {'a': 'x+1', 'b': '2', 'c': '3'}\", \"assert parse_configurations(['# comment', 'd=4', 'e=5']) == {'d': '4', 'e': '5'}\", \"assert parse_configurations(['# comment', '', 'f=6']) == {'f': '6'}\", \"assert parse... | {
"split": "train",
"index": 2475,
"acecode_id": "bigcode_python_fns_35472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a numerical string, implement a function that substitutes every occurrence of the digit '7' with the character '#'. For example, if the input is '1234567890', the output should be '123456#890'. Write a function called `substitute_seven_with_hash(num_str)` that takes a str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substitute_seven_with_hash('1234567890') == '123456#890'\", \"assert substitute_seven_with_hash('77777') == '#####'\", \"assert substitute_seven_with_hash('123456') == '123456'\", \"assert substitute_seven_with_hash('9876543210') == '98#6543210'\", \"assert ... | {
"split": "train",
"index": 2476,
"acecode_id": "evol_8994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given four lists representing the open, high, low, and close prices of a financial asset over a period of time, implement a function `get_financial_data(open_array, high_array, low_array, close_array)` that returns a dictionary with the keys 'open', 'high', 'low', and 'close', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_financial_data([100, 110, 105, 115], [120, 125, 118, 130], [95, 100, 98, 102], [115, 120, 110, 125]) == {'open': [100, 110, 105, 115], 'high': [120, 125, 118, 130], 'low': [95, 100, 98, 102], 'close': [115, 120, 110, 125]}\", \"assert get_financial_data(... | {
"split": "train",
"index": 2477,
"acecode_id": "oss_8705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total loss from individual loss components in a machine learning training loop. Your function should take in five individual loss components and a batch size as input and return the total loss, which is the sum of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_and_update_loss(0.5, 0.8, 0.3, 0.6, 0.4, 16, MockLossRecord(), MockLossRecord(), MockLossRecord()) == 2.6\", \"assert calculate_and_update_loss(1.0, 1.0, 1.0, 1.0, 1.0, 32, MockLossRecord(), MockLossRecord(), MockLossRecord()) == 5.0\", \"assert ca... | {
"split": "train",
"index": 2478,
"acecode_id": "oss_21736",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines if a given string is a valid email address. An email address is considered valid if it follows the format: local_part@domain, where the local part can contain letters, digits, periods, underscores, and hyphens. The domain ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('example@example.com') == True\", \"assert is_valid_email('user_name@sub.domain.com') == True\", \"assert is_valid_email('user-name@domain.com') == True\", \"assert is_valid_email('user@domain') == False\", \"assert is_valid_email('user@.com')... | {
"split": "train",
"index": 2479,
"acecode_id": "bigcode_python_fns_41120",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates updating a static header in a web application. The function should take in three parameters: `user` (a string representing the user), `domain_name` (a string representing the domain name), and `static_header_id` (an int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_static_header_url('john_doe', 'example.com', 1) == '/api/v0/user/john_doe/webapps/example.com/static_headers/1/'\", \"assert update_static_header_url('alice', 'sample.org', 42) == '/api/v0/user/alice/webapps/sample.org/static_headers/42/'\", \"assert ... | {
"split": "train",
"index": 2480,
"acecode_id": "oss_15920",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `biometric_login(username: str, password: str, biometric_data: str) -> bool` that integrates a biometric recognition system with an existing password-based user login system. The function should verify the user's identity by checking both the password and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert biometric_login('user2', 'wrongpassword', 'biometric_info2') == False\", \"assert biometric_login('user3', 'password456', 'wrong_biometric_info') == False\", \"assert biometric_login('user6', 'wrongpassword', 'wrong_biometric_info') == False\", \"assert biom... | {
"split": "train",
"index": 2481,
"acecode_id": "evol_6466",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the average top-k accuracy of a model based on its predictions and the true labels. The function should take in two parameters: a list of predictions, where each prediction is a list of probabilities for each class, and a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_top_k_accuracy([[0.1, 0.2, 0.7], [0.5, 0.3, 0.2], [0.9, 0.05, 0.05]], [2, 0, 0], 2) == 1.0\", \"assert average_top_k_accuracy([[0.1, 0.2, 0.7], [0.5, 0.4, 0.1], [0.3, 0.4, 0.3]], [2, 1, 0], 1) == 0.3333333333333333\", \"assert average_top_k_accuracy(... | {
"split": "train",
"index": 2482,
"acecode_id": "oss_9148",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_palindrome(s: str) -> bool` that determines whether the given string `s` is a palindrome. A string is considered a palindrome if it reads the same forward and backward, ignoring case and spaces. For example, 'A man a plan a canal Panama' is a palindrome. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('kite') == False\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('A man a plan a canal Panama') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('12321') == True\", \"assert is_pal... | {
"split": "train",
"index": 2483,
"acecode_id": "evol_24158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of MIDI note values representing musical notes. Your task is to convert these MIDI values into their corresponding frequencies in Hertz (Hz) using the formula: frequency (Hz) = 440 * 2^((MIDI - 69) / 12), where MIDI is the MIDI note value. Additionally, you... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_midi_to_freq([60]) == ([261.6255653005986], [1.0])\", \"assert convert_midi_to_freq([69]) == ([440.0], [1.0])\", \"assert convert_midi_to_freq([0]) == ([0.0], [0.0])\", \"assert convert_midi_to_freq([-1]) == ([0.0], [0.0])\", \"assert convert_midi_to... | {
"split": "train",
"index": 2484,
"acecode_id": "bigcode_python_fns_16639",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with retrieving a specific value from a dictionary that contains various configuration settings. Write a function `get_setting(key)` that takes a string `key` as input and returns the value associated with that key from a given dictionary named `config`. If the k... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_setting('host') == 'localhost'\", \"assert get_setting('port') == 8080\", \"assert get_setting('debug') == True\", \"assert get_setting('timeout') == 30\", \"assert get_setting('username') == 'admin'\", \"assert get_setting('password') == 'secret'\", \"a... | {
"split": "train",
"index": 2485,
"acecode_id": "oss_7730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a generator function that produces Pascal's Triangle. The generator should yield each row of the triangle indefinitely, starting from row 0, which is [1]. Each subsequent row should be computed based on the previous row using the properties of binomial coefficients. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next(pascal()) == [1]\", \"assert next(pascal()) == [1]\", \"assert next(pascal()) == [1]\", \"assert next(pascal()) == [1]\", \"assert next(pascal()) == [1]\", \"assert next(pascal()) == [1]\", \"assert next(pascal()) == [1]\", \"assert next(pascal()) == [1... | {
"split": "train",
"index": 2486,
"acecode_id": "evol_2108",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `comp_info` where each key is a component name and the value is another dictionary containing a list of its dependencies under the key 'dependencies'. Write a function `get_all_dependencies(comp_info: Dict[str, Dict[str, List[str]]], comps: List[str])... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_all_dependencies({'A': {'dependencies': []}}, ['A']) == []\", \"assert get_all_dependencies({'A': {'dependencies': ['B']}, 'B': {'dependencies': ['C']}, 'C': {'dependencies': []}}, ['A']) == ['B', 'C']\", \"assert get_all_dependencies({'A': {'dependencie... | {
"split": "train",
"index": 2487,
"acecode_id": "bigcode_python_fns_15835",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_subarray_sum(arr: List[int]) -> int` that returns the maximum sum of any contiguous subarray within the given list. The input list may contain both positive and negative numbers. You may assume that the input list will always cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_subarray_sum([0, -1, -2, -3])... | {
"split": "train",
"index": 2488,
"acecode_id": "evol_15971",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Write a function `max_area(heights: List[int]) -> int` that calculates the area of the largest rectangle that can be formed under the histogram. The rectangle must be formed using contiguous bars,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area([1, 1, 1, 1]) == 4\", \"assert max_area([5, 4, 1, 2]) == 8\", \"assert max_area([1, 3, 2, 1, 2, 4]) == 6\", \"assert max_area([0, 0, 0, 0]) == 0\", \"assert max_area([1, 2, 3, 4, 5]) == 9\", \"assert ma... | {
"split": "train",
"index": 2489,
"acecode_id": "bigcode_python_fns_32439",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Design a function `generate_secure_key()` that creates a highly secure, quantum-computing resistant encryption key. The key must be 256 bits long and generated using a secure random number generator. The function should return the generated key as a hexadecimal string.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_secure_key() is not None\", \"assert len(generate_secure_key()) == 64\", \"assert all(c in '0123456789abcdef' for c in generate_secure_key())\", \"assert generate_secure_key() != generate_secure_key()\", \"assert generate_secure_key() != '0' * 64\",... | {
"split": "train",
"index": 2490,
"acecode_id": "evol_31805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a weather prediction model. The model receives a current temperature (in Celsius) and a boolean flag indicating whether the prediction should be deterministic or stochastic. If the prediction is deterministic, the outpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_weather(25.0, True) == 26.0\", \"assert predict_weather(10.0, False) >= 10.0 and predict_weather(10.0, False) <= 12.0\", \"assert predict_weather(0.0, True) == 1.0\", \"assert predict_weather(-5.0, False) >= -5.0 and predict_weather(-5.0, False) <= -... | {
"split": "train",
"index": 2491,
"acecode_id": "bigcode_python_fns_4378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of chapter titles and their respective contents, and returns a dictionary where the keys are the titles and the values are the contents of the chapters. The input is a list of tuples, where each tuple contains a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_chapters([]) == {}\", \"assert store_chapters([('Chapter 1', 'This is the content of Chapter 1')]) == {'Chapter 1': 'This is the content of Chapter 1'}\", \"assert store_chapters([('Chapter 1', 'Content 1'), ('Chapter 2', 'Content 2')]) == {'Chapter 1'... | {
"split": "train",
"index": 2492,
"acecode_id": "oss_36649",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an undirected graph represented as a list of edges, determine if a given set of vertices forms a vertex cover for that graph. A vertex cover is defined as a set of vertices such that every edge in the graph is incident to at least one vertex from the set. Write a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_vertex_cover([(0, 1), (1, 2), (2, 3)], [1, 2]) == True\", \"assert is_vertex_cover([(0, 1), (1, 2), (2, 3)], [0, 2]) == True\", \"assert is_vertex_cover([(0, 1), (1, 2), (2, 3)], [3]) == False\", \"assert is_vertex_cover([(0, 1), (1, 2), (2, 3)], []) == F... | {
"split": "train",
"index": 2493,
"acecode_id": "bigcode_python_fns_33587",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of edges in a graph, as well as a list of edges represented as pairs of indices. Your task is to implement a function that takes these inputs and determines if there exists a path from one node to another that has a tota... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_path([1, 2, 3, 4], [(0, 1), (1, 2), (2, 3)], 5) == False\", \"assert can_path([10, 20, 30], [(0, 1), (1, 2)], 25) == False\", \"assert can_path([3, 3, 3], [(0, 1), (1, 2)], 5) == False\", \"assert can_path([1, 1, 1], [(0, 1)], 2) == False\", \"assert can... | {
"split": "train",
"index": 2494,
"acecode_id": "bigcode_python_fns_14607",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_vowels_in_words(words: List[str]) -> List[int]` that takes a list of words and returns a list containing the count of vowels in each word. The vowel counting should be case-insensitive and should account for special characters or numbers within the w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels_in_words(['hello', 'world']) == [2, 1]\", \"assert count_vowels_in_words(['', 'a', 'b', 'c']) == [0, 1, 0, 0]\", \"assert count_vowels_in_words(['AEIOU', 'aeiou']) == [5, 5]\", \"assert count_vowels_in_words(['12345', '!@#$%']) == [0, 0]\", \"as... | {
"split": "train",
"index": 2495,
"acecode_id": "evol_23268",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given the root node of a binary tree. Implement a function that performs a level order traversal of the tree and returns the values of the nodes in a list, where each inner list represents a level of the tree. The level order traversal starts from the root level (level ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert level_order_traversal(None) == []\", \"assert level_order_traversal(TreeNode(1)) == [[1]]\", \"assert level_order_traversal(TreeNode(1, TreeNode(2), TreeNode(3))) == [[1], [2, 3]]\", \"assert level_order_traversal(TreeNode(1, TreeNode(2, TreeNode(4)), TreeNo... | {
"split": "train",
"index": 2496,
"acecode_id": "bigcode_python_fns_37947",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_all_digits(s: str) -> bool` that checks whether the input string `s` consists exclusively of numerical digits (0-9). The function should return `True` if the string is made up entirely of digits, and `False` otherwise.\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_all_digits('12345') == True\", \"assert is_all_digits('0123456789') == True\", \"assert is_all_digits('abc123') == False\", \"assert is_all_digits('123abc') == False\", \"assert is_all_digits(' ') == False\", \"assert is_all_digits('123 456') == False\"... | {
"split": "train",
"index": 2497,
"acecode_id": "evol_2311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `caselessSort` that returns a new list containing the strings sorted in a case-insensitive manner. The sorting should prioritize lowercase versions of the strings, but in case of a tie (when two strings are the same when converted t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert caselessSort(['banana', 'Apple', 'orange']) == ['Apple', 'banana', 'orange']\", \"assert caselessSort(['apple', 'Banana', 'apple']) == ['apple', 'apple', 'Banana']\", \"assert caselessSort(['a', 'A', 'b', 'B']) == ['A', 'a', 'B', 'b']\", \"assert caselessSor... | {
"split": "train",
"index": 2498,
"acecode_id": "bigcode_python_fns_7693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_maximum_difference(arr)` that returns the maximum difference between any two elements in the list such that the larger element comes after the smaller element. If no such difference exists, return 0. The function should handle ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum_difference([1, 2, 3, 4, 5]) == 4\", \"assert find_maximum_difference([5, 4, 3, 2, 1]) == 0\", \"assert find_maximum_difference([2, 3, 10, 6, 4, 8, 1]) == 8\", \"assert find_maximum_difference([7]) == 0\", \"assert find_maximum_difference([]) == ... | {
"split": "train",
"index": 2499,
"acecode_id": "bigcode_python_fns_5493",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.