data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a list of strings. Your task is to implement a function `process_cases(list_: List[str]) -> Tuple[bool, bool, bool]` that processes the input list and determines the following: 1) Whether the list is empty, 2) Whether the first string in the list is an uppercase g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_cases([]) == (True, False, False)\", \"assert process_cases(['HELLO']) == (False, True, False)\", \"assert process_cases(['hello']) == (False, False, False)\", \"assert process_cases(['# This is a comment']) == (False, False, True)\", \"assert proces... | {
"split": "train",
"index": 64800,
"acecode_id": "bigcode_python_fns_11255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `substitute_str(str1: str, str2: str, sentence: str) -> str` that takes two distinct character sequences `str1` and `str2`, and a sentence. The function should identify and substitute the inaugural occurrence of `str1` with `str2` in the sentence, and return th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substitute_str('Seville', 'blood', \\\"My mother's Seville orange marmalade is the best\\\") == \\\"My mother's blood orange marmalade is the best\\\"\", \"assert substitute_str('apple', 'orange', 'I like to eat an apple a day') == 'I like to eat an orange a... | {
"split": "train",
"index": 64801,
"acecode_id": "evol_8740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes an array of strings as input and concatenates the strings together in the order they are given, including any whitespace and special characters, and then reverses the entire resultant string. The function should handle empty strings and arrays with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_concatenate(['Hello', ' ', 'World']) == 'dlroW olleH'\", \"assert reverse_concatenate(['', 'a', 'b', 'c']) == 'cba'\", \"assert reverse_concatenate(['SingleString']) == 'gnirtSelgniS'\", \"assert reverse_concatenate(['', '', '']) == ''\", \"assert re... | {
"split": "train",
"index": 64802,
"acecode_id": "evol_7165",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of language codes and a domain. Write a function `get_available_languages(domain: str, language_codes: List[str]) -> List[str]` that returns a list of available languages for the given translation domain. The function should include 'en_US' in the result li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_available_languages('messages', ['en_US', 'fr_FR', 'de_DE']) == ['en_US', 'fr_FR']\", \"assert get_available_languages('messages', ['zh_CN', 'ja_JP']) == ['en_US']\", \"assert get_available_languages('notifications', ['it_IT', 'pt_PT']) == ['en_US']\", \... | {
"split": "train",
"index": 64803,
"acecode_id": "bigcode_python_fns_14722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a command. Your task is to check if the command contains the substring '--help'. If it does, return the command string; otherwise, return a message indicating that the command is not valid. Implement a function `check_command(cmd: str) -> str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_command('gcon_py --help') == 'gcon_py --help'\", \"assert check_command('gcon_py') == 'gcon_py is not valid.'\", \"assert check_command('python --help') == 'python --help'\", \"assert check_command('npm install') == 'npm install is not valid.'\", \"ass... | {
"split": "train",
"index": 64804,
"acecode_id": "bigcode_python_fns_49307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the left movement of a game character within a specified game window. The function should accept three parameters: the current position of the character (an integer), the speed of movement (an integer), and a boolean `l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_left(10, 5, False) == 5\", \"assert move_left(10, 5, True) == 5\", \"assert move_left(3, 5, True) == -2\", \"assert move_left(0, 5, False) == 0\", \"assert move_left(0, 5, True) == -5\", \"assert move_left(20, 10, False) == 10\", \"assert move_left(20, ... | {
"split": "train",
"index": 64805,
"acecode_id": "oss_29306",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, calculate the accumulative sum of the cubed values of all integers inclusively ranging from 1 to n. Implement a function `accumulative_sum(n: int) -> int` that returns this sum.\nPlease reason step by step, then write a self-contained Python solution. Give y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert accumulative_sum(1) == 1\", \"assert accumulative_sum(2) == 9\", \"assert accumulative_sum(3) == 36\", \"assert accumulative_sum(4) == 100\", \"assert accumulative_sum(5) == 225\", \"assert accumulative_sum(6) == 441\", \"assert accumulative_sum(7) == 784\",... | {
"split": "train",
"index": 64806,
"acecode_id": "evol_36123",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> int` that returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: fib(0) = 0, fib(1) = 1, and for n >= 2, fib(n) = fib(n-1) + fib(n-2). If the input `n` is negative, the function should return -1. You can assume... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 64807,
"acecode_id": "evol_16914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a message packet based on a given dictionary of fields and values. The function should take a dictionary as input and return a string representation of the message packet in the following format: each key-value pair should be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_packet({'field1': 'value1', 'field2': 'value2'}) == '{field1: value1, field2: value2}'\", \"assert generate_packet({'tlast': 1, 'fieldA': 'valueA'}) == '{tlast: 1, fieldA: valueA, callTB: 1}'\", \"assert generate_packet({'key1': 123, 'key2': 456}) =... | {
"split": "train",
"index": 64808,
"acecode_id": "oss_8205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes in a list of integers and returns a new list containing only the even numbers from the original list, maintaining their original order. Implement the function `filter_even_numbers` which accepts the following parameter:\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_... | {
"split": "train",
"index": 64809,
"acecode_id": "oss_34752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a report based on input parameters. Write a function `generate_report` that takes in a dictionary `params` where the keys represent different attributes of the report, and the values are the corresponding data for those attributes. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_report({'name': 'Alice', 'age': 30, 'city': 'New York'}) == 'name: Alice, age: 30, city: New York'\", \"assert generate_report({'product': 'Laptop', 'price': 999.99, 'brand': 'BrandX'}) == 'product: Laptop, price: 999.99, brand: BrandX'\", \"assert ... | {
"split": "train",
"index": 64810,
"acecode_id": "bigcode_python_fns_33898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two numerical arrays, write a function that calculates the largest disparity between the maximum value of the first array and the minimum value of the second array, as well as the maximum value of the second array and the minimum value of the first array. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_largest_disparity([-1, -2, -3], [4, 5, 6]) == 9\", \"assert calculate_largest_disparity([10, 20], [5, 15]) == 15\", \"assert calculate_largest_disparity([], [1, 2, 3]) == None\", \"assert calculate_largest_disparity([1, 2, 3], []) == None\", \"asse... | {
"split": "train",
"index": 64811,
"acecode_id": "evol_18292",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given number is an Armstrong number. An Armstrong number is defined as a number where the sum of its digits each raised to the power of the number of digits equals the number itself. For example, 371 is an Armstrong number because 3^3 + 7^3... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_armstrong(0) == True\", \"assert is_armstrong(1) == True\", \"assert is_armstrong(2) == True\", \"assert is_armstrong(3) == True\", \"assert is_armstrong(4) == True\", \"assert is_armstrong(5) == True\", \"assert is_armstrong(6) == True\", \"assert is_arm... | {
"split": "train",
"index": 64812,
"acecode_id": "evol_22616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of cities represented by unique integer identifiers and a list of undesirable cities (bad cities) represented by unique integer identifiers. Your task is to write a function `find_good_cities(cities, bad_cities)` that takes in two parameters: a set of integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_good_cities({1, 2, 3, 4, 5}, {2, 4}) == {1, 3, 5}\", \"assert find_good_cities({10, 20, 30}, {10}) == {20, 30}\", \"assert find_good_cities({1, 2, 3}, {1, 2, 3}) == set()\", \"assert find_good_cities({1, 2, 3}, set()) == {1, 2, 3}\", \"assert find_good_... | {
"split": "train",
"index": 64813,
"acecode_id": "oss_30893",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the behavior of a communication interface for a tracking system. The system communicates with various nodes and tags using a custom protocol. Your task is to implement a function that checks the status of the listening node and retrieves the statu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_status('TAG123', True) == True\", \"assert check_status('TAG123', False) == True\", \"assert check_status('TAG456', True) == True\", \"assert check_status('TAG456', False) == True\", \"assert check_status('TAG789', True) == True\", \"assert check_statu... | {
"split": "train",
"index": 64814,
"acecode_id": "oss_28280",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a specified character appears in a given string exactly a certain number of times. The function should take three parameters: a string `text`, a character `char`, and an integer `num`. It should return `True` if `char` appears in `text` exact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_count_in_string('hello world', 'o', 2) == True\", \"assert char_count_in_string('hello world', 'l', 3) == True\", \"assert char_count_in_string('hello', 'h', 1) == True\", \"assert char_count_in_string('hello', 'e', 1) == True\", \"assert char_count_in_... | {
"split": "train",
"index": 64815,
"acecode_id": "evol_5899",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_texas_zip_code(zip_code: str) -> bool` that takes a string representing a US zip code and returns True if the zip code is valid for Texas, and False otherwise. The valid Texas zip codes range from 75000 to 79999 and 88500 to 88599. The function should ignor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_texas_zip_code('75001') == True\", \"assert is_texas_zip_code(' 75001 ') == True\", \"assert is_texas_zip_code('79999') == True\", \"assert is_texas_zip_code(' 79999 ') == True\", \"assert is_texas_zip_code('88500') == True\", \"assert is_texas_zip_code('... | {
"split": "train",
"index": 64816,
"acecode_id": "evol_2004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `hex_to_reversed_bin(hex_val: str) -> str` that takes a hexadecimal string `hex_val` as input and returns its binary representation reversed. The input `hex_val` will always be a valid hexadecimal string. You may assume that it will not be empty. For example, i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_reversed_bin('FF') == '11111111'\", \"assert hex_to_reversed_bin('0') == '0'\", \"assert hex_to_reversed_bin('0x1') == '1'\", \"assert hex_to_reversed_bin('7') == '111'\", \"assert hex_to_reversed_bin('8') == '0001'\", \"assert hex_to_reversed_bin('FF... | {
"split": "train",
"index": 64817,
"acecode_id": "evol_6827",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given an integer n representing the number of sides of a convex polygon, implement a function that calculates the total number of distinct diagonals that can be formed within that polygon. A diagonal is defined as a line segment connecting two non-adjacent vertices. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_diagonals(3) == 0\", \"assert find_diagonals(5) == 5\", \"assert find_diagonals(6) == 9\", \"assert find_diagonals(7) == 14\", \"assert find_diagonals(8) == 20\", \"assert find_diagonals(9) == 27\", \"assert find_diagonals(10) == 35\", \"assert find_dia... | {
"split": "train",
"index": 64818,
"acecode_id": "evol_24290",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of means, variances, and weights (pi) representing a mixture of Gaussian distributions, write a function `loglikelihood(x: float, mean: List[float], var: List[float], pi: List[float]) -> float` that calculates the log likelihood of observing a given data point `x`.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert loglikelihood(0.0, [1.0], [1.0], [1.0]) == -1.4189385332046727\", \"assert loglikelihood(1.0, [0.0, 2.0], [1.0, 1.0], [0.5, 0.5]) == -1.4189385332046727\", \"assert loglikelihood(1.0, [1.0, 1.0], [1.0, 1.0], [0.5, 0.5]) == -0.9189385332046727\", \"assert log... | {
"split": "train",
"index": 64819,
"acecode_id": "bigcode_python_fns_18774",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function `standardize_mission_name(mission_name: str) -> str` that takes in a string representing a mission name and standardizes it by substituting each whitespace character with an underscore ('_') and transforming all alphabetic characters to their lowercase equivale... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert standardize_mission_name('Apollo 11') == 'apollo_11'\", \"assert standardize_mission_name(' Crew Dragon ') == '__crew_dragon___'\", \"assert standardize_mission_name(' Artemis I') == '___artemis_i'\", \"assert standardize_mission_name('Lunar Gateway') =... | {
"split": "train",
"index": 64820,
"acecode_id": "evol_22019",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names representing hex files. Your task is to implement a function that checks if any of these files exist in the system. For this problem, you will simulate the behavior of a file system where all files are considered to be present. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_file_existence(['file1.hex', 'file2.hex', 'file3.hex']) == [True, True, True]\", \"assert check_file_existence(['test.hex', 'example.hex']) == [True, True]\", \"assert check_file_existence(['empty.hex']) == [True]\", \"assert check_file_existence(['fil... | {
"split": "train",
"index": 64821,
"acecode_id": "bigcode_python_fns_42993",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a game. Your task is to implement a function `highest_score(scores)` that returns the highest score achieved in the game. If the list is empty, the function should return 0. You can assume that the scores are non-negat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_score([78, 92, 64, 85, 99]) == 99\", \"assert highest_score([55, 42, 67, 71, 58]) == 71\", \"assert highest_score([]) == 0\", \"assert highest_score([0, 0, 0, 0]) == 0\", \"assert highest_score([10]) == 10\", \"assert highest_score([10, 20, 30, 40]) ... | {
"split": "train",
"index": 64822,
"acecode_id": "oss_7044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a set of processes in an operating system. Each process is identified by its name, and the value associated with each name is a tuple containing two integers: the arrival time and the burst time of the process. Your task is to implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_process_to_execute({'P1': (0, 5), 'P2': (1, 3), 'P3': (2, 7), 'P4': (3, 2)}) == 'P4'\", \"assert next_process_to_execute({'P1': (0, 2), 'P2': (1, 2)}) == 'P1'\", \"assert next_process_to_execute({'P1': (0, 3), 'P2': (1, 5), 'P3': (2, 3)}) == 'P1'\", \"a... | {
"split": "train",
"index": 64823,
"acecode_id": "oss_1046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, each representing a computational experiment result. Each dictionary contains the following keys: 'pde', 'kernel_type', 'opt_algo', 'exec_time', 'mem_consumption', 'normL2', and 'sol_kernel'. Your task is to implement a function that takes ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_exec_mem_metrics([{'pde': 'pde1', 'kernel_type': 'type1', 'opt_algo': 'algo1', 'exec_time': 1.2, 'mem_consumption': 256, 'normL2': 0.01, 'sol_kernel': []}]) == [(1.2, 256)]\", \"assert extract_exec_mem_metrics([{'pde': 'pde2', 'kernel_type': 'type2',... | {
"split": "train",
"index": 64824,
"acecode_id": "bigcode_python_fns_34683",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function, enhanced_vowels_count, that accepts a string representing a word and returns the total number of vowels (including 'a', 'e', 'i', 'o', 'u', and 'y' if and only if it's the last letter). The function should also handle non-English characters and special charac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enhanced_vowels_count('abcde') == 2\", \"assert enhanced_vowels_count('ACEDY') == 3\", \"assert enhanced_vowels_count('\\u00e9xampl\\u00eb') == 3\", \"assert enhanced_vowels_count('caf\\u00e9') == 2\", \"assert enhanced_vowels_count('na\\u00efve') == 3\", \"... | {
"split": "train",
"index": 64825,
"acecode_id": "evol_1228",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the distance between two geographical points represented by their longitude and latitude coordinates using the Haversine formula. Implement a function `haversine_distance(lon1, lat1, lon2, lat2)` that takes four parameters: the longitude and lati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(haversine_distance(0, 0, 0, 0) - 0) < 1e-1\", \"assert abs(haversine_distance(10, 20, 10, 20) - 0) < 1e-1\", \"assert abs(haversine_distance(-90.0, 0.0, 90.0, 0.0) - 20015.09) < 1e-1\", \"assert abs(haversine_distance(0.0, 0.0, -180.0, 0.0) - 20015.09) <... | {
"split": "train",
"index": 64826,
"acecode_id": "oss_13621",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of events recorded at different timestamps. Your task is to implement a function `calculate_average_events(events: List[int]) -> float` that calculates the average number of events per timestamp. The average should be cal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_events([1, 2, 3, 4, 5]) == 3.00\", \"assert calculate_average_events([5, 10, 15]) == 10.00\", \"assert calculate_average_events([0, 0, 0]) == 0.00\", \"assert calculate_average_events([3]) == 3.00\", \"assert calculate_average_events([]) ==... | {
"split": "train",
"index": 64827,
"acecode_id": "bigcode_python_fns_11045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing multiple space-separated words. Your task is to implement a function that takes this string as input and returns a list of unique words sorted in alphabetical order. A word is defined as a sequence of characters that does not include spaces. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_sorted_words('apple banana apple orange') == ['apple', 'banana', 'orange']\", \"assert unique_sorted_words('hello world hello') == ['hello', 'world']\", \"assert unique_sorted_words('apple') == ['apple']\", \"assert unique_sorted_words('a b c d e') ==... | {
"split": "train",
"index": 64828,
"acecode_id": "bigcode_python_fns_44224",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing nodes, where each dictionary contains properties 'value' and 'price'. Your task is to implement a function `filter_nodes(nodes)` that takes a list of these nodes as input and returns a new list containing only the nodes where th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_nodes([{'value': 30.0, 'price': 150.0}, {'value': 20.0, 'price': 80.0}, {'value': 25.1, 'price': 120.0}]) == [{'value': 30.0, 'price': 150.0}, {'value': 25.1, 'price': 120.0}]\", \"assert filter_nodes([{'value': 15.0, 'price': 200.0}, {'value': 10.0, ... | {
"split": "train",
"index": 64829,
"acecode_id": "oss_1494",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, write a function `find_palindromes(n)` that returns a list of all numerical palindromes within the interval from 1 to n, inclusive. A numerical palindrome is a number that remains the same when its digits are reversed.\nPlease reason step by step, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_palindromes(1) == [1]\", \"assert find_palindromes(9) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert find_palindromes(10) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert find_palindromes(11) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 11]\", \"assert find_palindromes(22) == ... | {
"split": "train",
"index": 64830,
"acecode_id": "evol_8438",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that receives a positive integer input and calculates the product of the individual digits on the condition that only the digits greater than 2 are used in the product. If no digit is greater than 2, return -1. Additionally, if the input number is a pri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_digits(456) == 120\", \"assert product_of_digits(2) == -1\", \"assert product_of_digits(11) == -1\", \"assert product_of_digits(77) == 49\", \"assert product_of_digits(45) == 20\", \"assert product_of_digits(101) == -1\"]}"
} | {
"split": "train",
"index": 64831,
"acecode_id": "evol_2066",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a sequence of characters. Your task is to implement a function that takes this string as input and returns the number of unique characters in it. A character is considered unique if it appears only once in the string. The input string may ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_characters('abcABC123!@#') == 12\", \"assert count_unique_characters('aabbcc') == 0\", \"assert count_unique_characters('!!@@##$$%%^^&&') == 0\", \"assert count_unique_characters('Python 3.8') == 10\", \"assert count_unique_characters('abcdabcd'... | {
"split": "train",
"index": 64832,
"acecode_id": "bigcode_python_fns_47830",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `highest_product_of_three(nums)` that returns the highest product of three distinct numbers from the list. The input list `nums` will contain at least three integers and may include both positive and negative integers. Your function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_product_of_three([1, 10, 2, 6, 5, 3]) == 300\", \"assert highest_product_of_three([-10, -10, 1, 3, 2]) == 300\", \"assert highest_product_of_three([1, 2, 3]) == 6\", \"assert highest_product_of_three([1, 2, 3, 4]) == 24\", \"assert highest_product_of... | {
"split": "train",
"index": 64833,
"acecode_id": "oss_15931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a data structure for a time-locked cryptocurrency transaction. The function should take the following parameters: \n- `message_id` (str): The unique identifier for the transaction message.\n- `oracle_fees` (float): The fees... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_timelock_transaction('msg1', 0.01, 15000, '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa', 1672531199, ['pubkeyA', 'pubkeyB'], 2) == {'message_id': 'msg1', 'oracle_fees': 0.01, 'miners_fee_satoshi': 15000, 'return_address': '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa', ... | {
"split": "train",
"index": 64834,
"acecode_id": "oss_12691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `stable_sort` that takes a list of floating-point values and returns a new list containing the same values sorted in ascending order. The sorting must be stable, meaning that the relative order of equal elements must remain unchanged. You should also consid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stable_sort([-2.5, 4.5, 4.5, 1.5, 7.5]) == [-2.5, 1.5, 4.5, 4.5, 7.5]\", \"assert stable_sort([3.3, 2.2, 3.3, 1.1]) == [1.1, 2.2, 3.3, 3.3]\", \"assert stable_sort([0.1, 0.3, 0.2, 0.1]) == [0.1, 0.1, 0.2, 0.3]\", \"assert stable_sort([1.0, 1.0, 1.0, 1.0]) ==... | {
"split": "train",
"index": 64835,
"acecode_id": "evol_16043",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes certificate installation commands for devices based on provided arguments. The function should take the following parameters: a string `cert_name` representing the name of the certificate (default 'dummycert'), a boolean `o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_certificate('mycert', False, False, '1234ABCD', '/path/to/cert.pem') == 'Installing mycert on device 1234ABCD at /path/to/cert.pem'\", \"assert process_certificate('mycert', True, False, '1234ABCD', '/path/to/cert.pem') == 'Overwriting mycert on devi... | {
"split": "train",
"index": 64836,
"acecode_id": "bigcode_python_fns_26945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `list_operations(list_a, list_b)` that takes two lists of floating point numbers as input. The function should perform the following operations: First, sum the numbers at respective indexes of both lists. If an index exists in one list and doesn't in the ot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_operations([1.0, 2.0, 3.0], [4.0, 5.0, 6.0, 7.0]) == ([5.0, 7.0, 9.0, 7.0], [5.0, 12.0, 21.0, 28.0])\", \"assert list_operations([1.0, 2.0], []) == ([1.0, 2.0], [1.0, 3.0])\", \"assert list_operations([1.5], [2.5]) == ([4.0], [4.0])\", \"assert list_ope... | {
"split": "train",
"index": 64837,
"acecode_id": "evol_17720",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to organize images into separate folders based on their category. You will be given a list of image file paths, where each file path is in the format 'category/filename.jpg'. Your function should return a dictionary that maps each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_images(['apple/123.jpg', 'banana/456.jpg', 'apple/789.jpg']) == {'apple': ['123.jpg', '789.jpg'], 'banana': ['456.jpg']}\", \"assert organize_images(['dog/1.png', 'cat/2.png', 'dog/3.png', 'cat/4.png']) == {'dog': ['1.png', '3.png'], 'cat': ['2.png'... | {
"split": "train",
"index": 64838,
"acecode_id": "oss_24031",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, determine if it is possible to swap elements between the two lists such that the first list contains only even numbers while maintaining the total sums of both lists. Return 'YES' if the transformation is possible, otherwise return 'NO'.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exchange([1, 2, 3, 4], [1, 5, 3, 4]) == 'NO'\", \"assert exchange([1, 3, 5], [2, 4, 6]) == 'NO'\", \"assert exchange([1, 1, 1], [2, 4, 6]) == 'NO'\", \"assert exchange([3, 5, 7], [2, 4, 6]) == 'NO'\", \"assert exchange([2, 3, 4], [5, 6, 7]) == 'NO'\", \"asse... | {
"split": "train",
"index": 64839,
"acecode_id": "evol_4645",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that simulates an AI's meme generation process. The AI will generate a meme based on an input message related to various topics. If the input message contains a specific keyword, the AI will successfully create a meme. If the keyword is no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_meme('I want a meme about cats') == {'attempted_solution': 'AI-generated cat meme'}\", \"assert generate_meme('Tell me a meme about dogs') == {'failure': 'The memes are beyond my sense of humor'}\", \"assert generate_meme('I love programming') == {'... | {
"split": "train",
"index": 64840,
"acecode_id": "oss_28103",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are asked to implement a function `test_isolated_labels(adata_batch)` that takes a single parameter, `adata_batch`, representing a batch of annotated data. Your task is to simulate the testing of isolated labels in the dataset. For this function, you need to perform the fol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_isolated_labels([1, 2, 3, 3, 4]) == 4\", \"assert test_isolated_labels([1, 1, 1, 1]) == 1\", \"assert test_isolated_labels([1, 2, 2, 3, 4, 5, 5, 6]) == 6\", \"assert test_isolated_labels([]) == 0\", \"assert test_isolated_labels([1]) == 1\", \"assert te... | {
"split": "train",
"index": 64841,
"acecode_id": "oss_3590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function named `check_auth` that validates a user's credentials against a predefined set of valid username and password pairs. The function should take two parameters: `username` (a string) and `password` (a string). It should return `True` if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_auth('user1', 'password1') == True\", \"assert check_auth('user2', 'password2') == True\", \"assert check_auth('user1', 'wrongpassword') == False\", \"assert check_auth('user2', 'wrongpassword') == False\", \"assert check_auth('wronguser', 'password1')... | {
"split": "train",
"index": 64842,
"acecode_id": "oss_8950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `max_priority_queue_operations(operations: List[Tuple[str, Union[str, int]]]) -> List[Union[str, None]]` that simulates a max priority queue. The `operations` list contains tuples where the first element is a string representing the operation ('push', 'pop'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_priority_queue_operations([('push', 'item1', 3), ('push', 'item2', 1), ('push', 'item3', 2), ('peek',)]) == ['item1']\", \"assert max_priority_queue_operations([('pop',)]) == ['Priority queue is empty']\", \"assert max_priority_queue_operations([('push',... | {
"split": "train",
"index": 64843,
"acecode_id": "evol_34971",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the nth term of a specific sequence where the first two terms are defined as follows: the 1st term is 1, and the 2nd term is 2. For all subsequent terms (from the 3rd term onward), each term is the sum of the two preceding terms. Implement a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_nth_term(1) == 1\", \"assert calculate_nth_term(2) == 2\", \"assert calculate_nth_term(3) == 3\", \"assert calculate_nth_term(4) == 5\", \"assert calculate_nth_term(5) == 8\", \"assert calculate_nth_term(6) == 13\", \"assert calculate_nth_term(7) =... | {
"split": "train",
"index": 64844,
"acecode_id": "oss_33467",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_configuration` that retrieves configuration settings for a specific type and name from a given dictionary. The input will be a dictionary `settings` structured such that it contains keys representing different configuration types, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_configuration({'database': {'db1': {'host': 'localhost', 'port': 5432}}, 'cache': {'cache1': {'host': 'localhost', 'port': 6379}}}, 'database', 'db1') == {'host': 'localhost', 'port': 5432}\", \"assert get_configuration({'database': {'db1': {'host': 'loc... | {
"split": "train",
"index": 64845,
"acecode_id": "bigcode_python_fns_2342",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `filter_recipes(recipes: List[Dict[str, Union[str, int]]], criteria: Dict[str, Union[str, int]]) -> List[Dict[str, Union[str, int]]]` that filters a list of recipes based on specified criteria including dietary restrictions, maximum calories, maximum cookin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_recipes([{'name': 'Salad', 'ingredients': 'Lettuce, Tomato', 'dietary_restrictions': 'Vegan', 'calories': 150, 'cooking_time': '15 mins', 'cuisine': 'American'}], {'dietary_restrictions': 'Vegan'}) == [{'name': 'Salad', 'ingredients': 'Lettuce, Tomato... | {
"split": "train",
"index": 64846,
"acecode_id": "evol_5803",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `dec_to_ternary(n: int) -> str` that converts a decimal integer to its ternary (base 3) representation. If the input is negative, return the ternary representation of its absolute value. The function should return the ternary representation as a string. For... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dec_to_ternary(0) == '0'\", \"assert dec_to_ternary(1) == '1'\", \"assert dec_to_ternary(2) == '2'\", \"assert dec_to_ternary(3) == '10'\", \"assert dec_to_ternary(4) == '11'\", \"assert dec_to_ternary(5) == '12'\", \"assert dec_to_ternary(6) == '20'\", \"as... | {
"split": "train",
"index": 64847,
"acecode_id": "evol_27663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add_without_arithmetic(x: int, y: int) -> int` that adds two integers x and y without using the standard arithmetic operators (+, -, *, /).\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_without_arithmetic(0, 0) == 0\", \"assert add_without_arithmetic(1, 1) == 2\", \"assert add_without_arithmetic(-1, -1) == -2\", \"assert add_without_arithmetic(5, 3) == 8\", \"assert add_without_arithmetic(10, 20) == 30\", \"assert add_without_arithmetic... | {
"split": "train",
"index": 64848,
"acecode_id": "evol_26441",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an integer `margin`, write a function `margin_to_brightness` that calculates the brightness level based on the provided `margin`. The brightness is determined by the formula: \\( \text{brightness} = \\left( \\frac{|\\text{margin}|}{\\text{max_lead}} \\right) \\times 100 +... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert margin_to_brightness(0) == 0\", \"assert margin_to_brightness(30) == 100\", \"assert margin_to_brightness(-30) == 100\", \"assert margin_to_brightness(15) == 50\", \"assert margin_to_brightness(-15) == 50\", \"assert margin_to_brightness(60) == 200\", \"asse... | {
"split": "train",
"index": 64849,
"acecode_id": "bigcode_python_fns_4340",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to implement a function called `max_height` that takes a list of integers as input and returns the maximum height among the buildings. If the list is empty, return 0. \n\nFunction ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_height([1, 2, 3, 4, 5]) == 5\", \"assert max_height([5, 4, 3, 2, 1]) == 5\", \"assert max_height([3, 1, 4, 1, 5, 9]) == 9\", \"assert max_height([0]) == 0\", \"assert max_height([]) == 0\", \"assert max_height([1]) == 1\", \"assert max_height([-1, -2, -3... | {
"split": "train",
"index": 64850,
"acecode_id": "oss_7405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing an SQL query. Your task is to determine if the query contains a potential SQL injection. An SQL injection is identified by the presence of specific keywords: 'SELECT', 'UNION', 'DROP', 'INSERT', 'DELETE', 'UPDATE', 'WHERE', 'OR', 'AND', 'NOT'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_sql_injection('SELECT * FROM users') == True\", \"assert is_sql_injection('No injection here!') == False\", \"assert is_sql_injection('DROP TABLE users') == True\", \"assert is_sql_injection('INSERT INTO products VALUES (1, \\\"Book\\\")') == True\", \"as... | {
"split": "train",
"index": 64851,
"acecode_id": "bigcode_python_fns_14941",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Ken has already created 25 necklaces. Tami creates m additional necklaces compared to Ken. Write a function 'total_necklaces(m)' that returns the total number of necklaces produced by both Ken and Tami.\nPlease reason step by step, then write a self-contained Python solution. G... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_necklaces(0) == 50\", \"assert total_necklaces(1) == 51\", \"assert total_necklaces(5) == 55\", \"assert total_necklaces(10) == 60\", \"assert total_necklaces(15) == 65\", \"assert total_necklaces(20) == 70\", \"assert total_necklaces(25) == 75\", \"as... | {
"split": "train",
"index": 64852,
"acecode_id": "evol_23374",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of dictionaries representing news articles, where each dictionary contains the keys 'Title', 'Votes', and 'Comments'. The function should return a list of tuples, each containing the title of the article, the number of votes as an integer,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_news_data([{'Title': 'Article 1', 'Votes': '100', 'Comments': '5'}, {'Title': 'Article 2', 'Votes': '200', 'Comments': '0'}]) == [('Article 1', 100, 5), ('Article 2', 200, 0)]\", \"assert process_news_data([]) == []\", \"assert process_news_data([{'T... | {
"split": "train",
"index": 64853,
"acecode_id": "evol_11888",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `clip_values(arr: List[int], xmin: int, xmax: int) -> List[int]` that modifies the input list by clipping its values. Specifically, any value in the list that is less than `xmin` should be replaced with `xmin`, and any value that i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clip_values([1, 5, 10, 15], 5, 10) == [5, 5, 10, 10]\", \"assert clip_values([-10, 0, 5, 10], 0, 5) == [0, 0, 5, 5]\", \"assert clip_values([3, 6, 9], 4, 8) == [4, 6, 8]\", \"assert clip_values([20, 15, 10], 12, 18) == [18, 15, 12]\", \"assert clip_values([1... | {
"split": "train",
"index": 64854,
"acecode_id": "bigcode_python_fns_31857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of airport codes and a specific airport code, write a function that returns a list of all the destination airport codes that can be reached from the specified airport. The input is a list of tuples where each tuple contains an origin airport code and a destination ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_destinations([('JFK', 'LAX'), ('LAX', 'SFO'), ('JFK', 'SFO')], 'JFK') == ['LAX', 'SFO']\", \"assert get_destinations([('JFK', 'LAX'), ('LAX', 'SFO'), ('JFK', 'SFO')], 'LAX') == ['SFO']\", \"assert get_destinations([('JFK', 'LAX'), ('LAX', 'SFO'), ('JFK',... | {
"split": "train",
"index": 64855,
"acecode_id": "bigcode_python_fns_30378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 'Clone' object which contains the following attributes: 'deltas', 'frequencies', and 'clone_id'. The attribute 'deltas' is a list of integers representing the number of mutations, while 'frequencies' is a dictionary where the keys are strings (representing the n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clone_to_df(Clone([1, 2], {'A': 10, 'B': 20}, 'clone_1')) == [{'clone_id': 'clone_1', 'alt_cn': 1, 'A': 10, 'B': 20}, {'clone_id': 'clone_1', 'alt_cn': 2, 'A': 10, 'B': 20}]\", \"assert clone_to_df(Clone([0, 3], {'X': 5, 'Y': 15}, 'clone_2')) == [{'clone_id'... | {
"split": "train",
"index": 64856,
"acecode_id": "bigcode_python_fns_46563",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 9x9 Sudoku board represented by a 2D list, where empty cells are denoted by '.', implement a function `solveSudoku(board)` that fills the board with numbers from 1 to 9 according to Sudoku rules. The Sudoku rules state that each number must appear exactly once in each r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solveSudoku([['5', '3', '.', '.', '7', '.', '.', '.', '.'], ['6', '.', '.', '1', '9', '5', '.', '.', '.'], ['.', '9', '8', '.', '.', '.', '.', '6', '.'], ['8', '.', '.', '.', '6', '.', '.', '.', '3'], ['4', '.', '8', '.', '.', '3', '.', '.', '1'], ['7', '.',... | {
"split": "train",
"index": 64857,
"acecode_id": "evol_19873",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D rectangular space defined by its origin and extent. Your task is to calculate the coordinates of the corners of the rectangle. The rectangle is defined by its space origin (x, y) and space extent (width, height). Write a function `calculate_corners(space_orig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_corners((-0.05, -0.05), (0.1, 0.1)) == [(-0.05, -0.05), (0.05, -0.05), (0.05, 0.05), (-0.05, 0.05)]\", \"assert calculate_corners((0, 0), (2, 3)) == [(0, 0), (2, 0), (2, 3), (0, 3)]\", \"assert calculate_corners((1, 1), (1, 1)) == [(1, 1), (2, 1), ... | {
"split": "train",
"index": 64858,
"acecode_id": "bigcode_python_fns_40277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `hub_id`, which represents the ID of a hub in the form of a hexadecimal string. Your task is to determine if this `hub_id` exists in a predefined set of hub IDs represented as a list of strings. Implement a function `exists(hub_id: str) -> bool` that retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exists('Hubs.1a2b') == True\", \"assert exists('Hubs.3c4d') == True\", \"assert exists('Hubs.5e6f') == True\", \"assert exists('Hubs.7g8h') == True\", \"assert exists('Hubs.0000') == False\", \"assert exists('Hubs.1a2c') == False\", \"assert exists('Hubs.3c4... | {
"split": "train",
"index": 64859,
"acecode_id": "bigcode_python_fns_9373",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if there are any relationships between two types of entities, ExpressionBioEntity and GOTerm, in a given dataset. Implement a function called `check_relationship_exists` that takes a list of relationships, each represented as a dictionary contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_relationship_exists([{'entity1': 'entityA', 'relationship': 'CELLULAR_COMPONENT_RIBBON_TERM', 'entity2': {'primaryKey': 'GO:otherLocations'}}, {'entity1': 'entityB', 'relationship': 'SOME_OTHER_RELATIONSHIP', 'entity2': {'primaryKey': 'GO:otherLocation... | {
"split": "train",
"index": 64860,
"acecode_id": "bigcode_python_fns_14422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are developing a job processing system that manages various types of operations for different job types. Each job type is associated with a specific operation adapter that defines its behavior. You have an `OPERATION_ADAPTERS` dictionary that maps job types to their corresp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_job_operation_adapter('SPARK_STRUCTURED_STREAMING_CODE') is not None\", \"assert get_job_operation_adapter('SPARK_CODE') is not None\", \"assert get_job_operation_adapter('TENSORFLOW_CODE') is not None\", \"assert get_job_operation_adapter('FLINK_CODE') ... | {
"split": "train",
"index": 64861,
"acecode_id": "oss_33948",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a color picker application that allows users to select a color using sliders for hue and saturation. The hue slider ranges from 0 to 360, and the saturation slider ranges from 0 to 100. Your task is to write a function `convertToColor(h, s)` that ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convertToColor(0, 0) == 'hsl(0, 0%, 50%)'\", \"assert convertToColor(360, 100) == 'hsl(360, 100%, 50%)'\", \"assert convertToColor(180, 50) == 'hsl(180, 50%, 50%)'\", \"assert convertToColor(120, 75) == 'hsl(120, 75%, 50%)'\", \"assert convertToColor(240, 20... | {
"split": "train",
"index": 64862,
"acecode_id": "oss_8961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple file management system. Your goal is to implement a function that takes a list of file names (strings) and returns a dictionary containing the count of each unique file name in the list. The keys of the dictionary should be the unique file ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_file_names(['file1.txt', 'file2.txt', 'file1.txt']) == {'file1.txt': 2, 'file2.txt': 1}\", \"assert count_file_names(['image.jpg', 'image.png', 'image.jpg', 'document.pdf']) == {'image.jpg': 2, 'image.png': 1, 'document.pdf': 1}\", \"assert count_file_... | {
"split": "train",
"index": 64863,
"acecode_id": "oss_34349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple menu system for a game, which determines the output based on the values of three variables: `exit`, `params`, and `key`. Your task is to implement a function `menu_system(exit: bool, params: dict, key: int) -> str` that returns the appr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert menu_system(True, {'exit': False}, 1) == 'Exit'\", \"assert menu_system(False, {'exit': True}, 1) == 'Exit'\", \"assert menu_system(False, {'exit': False}, 2) == 'Easy'\", \"assert menu_system(False, {'exit': False}, 1) == 'Continue'\", \"assert menu_system(... | {
"split": "train",
"index": 64864,
"acecode_id": "oss_18569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a list of indices, return a new list containing the elements from the original list at the specified indices. If an index is out of bounds, ignore it. The input list may contain duplicate elements. You need to implement a function `getitem(arr: List... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getitem([1, 2, 3, 4, 5], [0, 2, 4]) == [1, 3, 5]\", \"assert getitem([10, 20, 30, 40], [1, 3]) == [20, 40]\", \"assert getitem([5, 6, 7, 8], [0, 2]) == [5, 7]\", \"assert getitem([1, 2, 3, 4, 5], [5, 6]) == []\", \"assert getitem([100, 200, 300], [0, 1, 2]) ... | {
"split": "train",
"index": 64865,
"acecode_id": "bigcode_python_fns_49486",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that performs lookups on a library of music content based on provided URIs. The library content can be categorized into three types: campuses, archive days, and tracks. Your function should take a URI as input and return the corresponding... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lookup('CAMPUS:123') == 'Campus Content'\", \"assert lookup('ARCHIVE_DAY:2023-10-01') == 'Archive Content'\", \"assert lookup('ARCHIVE_DAY:2023-10-02') == 'Archive Content'\", \"assert lookup('TRACK:456') == 'Track Content'\", \"assert lookup('CAMPUS:789') =... | {
"split": "train",
"index": 64866,
"acecode_id": "oss_26365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two matrices represented as lists of lists, write a function `matrix_multiply(m_a, m_b)` that takes two matrices `m_a` and `m_b` as input and returns their product. The input matrices are guaranteed to be valid for multiplication, which means the number of columns in `m_a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert matrix_multiply([[1]], [[2]]) == [[2]]\", \"assert matrix_multiply([[1, 0], [0, 1]], [[5, 6], [7, 8]]) == [[5, 6], [7, 8]]\", \"assert matrix_multiply([[1, 2, 3]], [[4], ... | {
"split": "train",
"index": 64867,
"acecode_id": "bigcode_python_fns_49639",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function `power_list(lst, n)` that calculates the n-th exponent of each element within a list, returning a new list. The function should handle incorrect inputs and edge cases appropriately. If the list contains non-numeric elements, the function should raise a `TypeE... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert power_list([2, 3, 4], 2) == [4, 9, 16]\", \"assert power_list([1, 2, 3], 0) == [1, 1, 1]\", \"assert power_list([0, 1, 2], 1) == [0, 1, 2]\", \"assert power_list([-1, -2], 2) == [1, 4]\", \"assert power_list([1j, 2j], 2) == [-1, -4]\", \"assert power_list([3... | {
"split": "train",
"index": 64868,
"acecode_id": "evol_12297",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates new passwords based on certain criteria. The function should take in a string representing the new password and return a boolean value indicating whether the password meets the specified requirements. The password va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_password('Abcdefg1') == True\", \"assert validate_password('password123') == False\", \"assert validate_password('StrongP@ssw0rd') == False\", \"assert validate_password('12345678') == False\", \"assert validate_password('A1bcd234') == True\", \"ass... | {
"split": "train",
"index": 64869,
"acecode_id": "oss_24136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing sentences with potentially incorrect punctuation. Your task is to implement a function that substitutes the incorrect punctuation symbols with the correct ones according to the following rules: replace '..' with '.', '!!' with '!', and '??' wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert amend_punctuation('Hello.. How are you!! I am doing good.. What about you??') == 'Hello. How are you! I am doing good. What about you?'\", \"assert amend_punctuation('This is a test.. Are you there!!') == 'This is a test. Are you there!'\", \"assert amend_pu... | {
"split": "train",
"index": 64870,
"acecode_id": "evol_23464",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a series of employee updates in the format 'employee_id:full_name,email,department'. Your task is to write a function that processes this string and returns a list of dictionaries where each dictionary contains the keys 'employee_id', 'full_nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_employee_updates('1:John Doe,john@example.com,HR;2:Jane Smith,jane@example.com,Finance') == [{'employee_id': '1', 'full_name': 'John Doe', 'email': 'john@example.com', 'department': 'HR'}, {'employee_id': '2', 'full_name': 'Jane Smith', 'email': 'jan... | {
"split": "train",
"index": 64871,
"acecode_id": "oss_13961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that writes data to a file. The function should take three parameters: a filename, and two values, `x` and `y`. If both `x` and `y` are strings, the function should write them to the file in UTF-8 encoding, each on a new line. If eith... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_to_file('test.txt', 'Hello', 'World') is None\", \"assert write_to_file('test.txt', 'Python', 'Programming') is None\", \"assert write_to_file('test.txt', 'LeetCode', 123) is None\", \"assert write_to_file('test.txt', 456, 'Test') is None\", \"assert w... | {
"split": "train",
"index": 64872,
"acecode_id": "oss_7126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates the shutdown process of multiple worker processes. The function should take a list of worker processes and execute a specified cleanup function for each process. If any errors occur during the execution of the cl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_worker_shutdown(['process1', 'process2'], lambda: print('Cleanup successful')) is None\", \"assert simulate_worker_shutdown(['process1', 'process2'], lambda: 1/0) is None\", \"assert simulate_worker_shutdown(['process1'], lambda: print('Single proce... | {
"split": "train",
"index": 64873,
"acecode_id": "oss_24427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive integers x, return a sorted list of all unique elements where the sum of their digits is odd, their largest prime factor is located at a prime numbered index, and the elements themselves must be even. The indices are 0-based. The returned list should be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_sum_prime_index_factors([21, 33, 44, 55]) == []\", \"assert odd_sum_prime_index_factors([222, 444, 666]) == []\", \"assert odd_sum_prime_index_factors([9, 19, 29, 39]) == []\", \"assert odd_sum_prime_index_factors([11, 13, 17, 19, 23]) == []\", \"assert ... | {
"split": "train",
"index": 64874,
"acecode_id": "evol_1354",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the management of authentication tokens for a web service. Your function, `manage_tokens`, should accept a list of token operations and return the current authentication token after processing all operations. The operations... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_tokens([('set', 'token_1')]) == 'token_1'\", \"assert manage_tokens([('set', 'token_2'), ('get', None)]) == 'token_2'\", \"assert manage_tokens([('get', None)]) == ''\", \"assert manage_tokens([('set', 'token_3'), ('set', 'token_4')]) == 'token_4'\", ... | {
"split": "train",
"index": 64875,
"acecode_id": "oss_7404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the final amount for a transaction based on the details provided in a dictionary. The transaction details include 'importe' (float), 'descuento' (float), 'recargo' (float), and 'total' (float). Your function should com... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_transaction_total({'importe': 100.0, 'descuento': 10.0, 'recargo': 5.0}) == 95.0\", \"assert calculate_transaction_total({'importe': 200.0, 'descuento': 50.0, 'recargo': 25.0}) == 175.0\", \"assert calculate_transaction_total({'importe': 0.0, 'desc... | {
"split": "train",
"index": 64876,
"acecode_id": "oss_157",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain a comment in the form of a Python print statement that is incorrectly formatted. Your task is to write a function that takes this string as input and returns a corrected version of the print statement that prints the intended message to t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert correct_print_statement('#print \\\"HERE too\\\"') == 'print(\\\"HERE too\\\")'\", \"assert correct_print_statement('#print \\\"Hello, World!\\\"') == 'print(\\\"Hello, World!\\\")'\", \"assert correct_print_statement('#print \\\"\\\"') == 'print(\\\"\\\")'\... | {
"split": "train",
"index": 64877,
"acecode_id": "oss_32695",
"num_tests": 14
} |
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, which is a list of integers, and return a single integer representing the sum of the even numbers. If there are no even numbers, return ... | 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]) == 2\", \"assert sum_of_evens([-2, -1, 0, 1, 2]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", ... | {
"split": "train",
"index": 64878,
"acecode_id": "bigcode_python_fns_8926",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing some data points. Your task is to write a function that takes this list as input and returns the maximum difference between any two elements in the list, where the larger element appears after the smaller element. If the list has fe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_difference([3, 5, 1, 8]) == 7\", \"assert max_difference([8, 1, 2, 5]) == 4\", \"assert max_difference([1, 2, 3, 4, 5]) == 4\", \"assert max_difference([5, 4, 3, 2, 1]) == 0\", \"assert max_difference([10, 20, 30, 40, 50]) == 40\", \"assert max_differenc... | {
"split": "train",
"index": 64879,
"acecode_id": "bigcode_python_fns_22788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, convert all the characters at odd indices to lower case and all the characters at even indices to upper case. The first character is considered at index 0. Implement a function `odd_even_conv(s: str) -> str` that takes a string as input and returns the modified ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_even_conv('Python3.7') == 'PyThOn3.7'\", \"assert odd_even_conv('LeetCode') == 'LeEtCoDe'\", \"assert odd_even_conv('aBcDeFg') == 'AbCdEfG'\", \"assert odd_even_conv('!@#$%^&*()') == '!@#$%^&*()'\", \"assert odd_even_conv('') == ''\", \"assert odd_even_c... | {
"split": "train",
"index": 64880,
"acecode_id": "evol_32698",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an integer N, return the number of '1's in the first N characters of a magical string S, which is constructed such that it consists of the characters '1', '2', '3', '4', and '5' and follows a specific pattern. The first few elements of the magical string S are '1234511234... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert magicalString(1) == 1\", \"assert magicalString(2) == 1\", \"assert magicalString(3) == 1\", \"assert magicalString(4) == 1\", \"assert magicalString(5) == 1\", \"assert magicalString(6) == 2\"]}"
} | {
"split": "train",
"index": 64881,
"acecode_id": "evol_13253",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers and two integers representing a minimum and maximum range. The function should shuffle the list using the Fisher-Yates algorithm, replacing each element in the original list with a randomly generated integer within the specified ra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(shuffle_list([1, 2, 3, 4, 5], 0, 10)) == 5\", \"assert all(0 <= num <= 10 for num in shuffle_list([1, 2, 3, 4, 5], 0, 10))\", \"assert len(shuffle_list([10, 20, 30], 5, 15)) == 3\", \"assert all(5 <= num <= 15 for num in shuffle_list([10, 20, 30], 5, 15)... | {
"split": "train",
"index": 64882,
"acecode_id": "evol_34772",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a term and its corresponding field type, implement a function that converts the term into a serialized Xapian value based on the field type. The function should accept two parameters: 'term', which can be of various types (boolean, integer, float, date, datetime, or text)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert term_to_xapian_value(True, 'boolean') == 't'\", \"assert term_to_xapian_value(False, 'boolean') == 'f'\", \"assert term_to_xapian_value('sample text', 'text') == 'sample text'\", \"assert term_to_xapian_value('another example', 'text') == 'another example'\"... | {
"split": "train",
"index": 64883,
"acecode_id": "bigcode_python_fns_32875",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `safe_string_equals(a: str, b: str) -> bool` that compares two strings `a` and `b` in a way that mitigates timing attacks. The function should return `True` if both strings are exactly equal in length and content, and `False` otherwise. Note that the compar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_string_equals('hello', 'hello') == True\", \"assert safe_string_equals('hello', 'world') == False\", \"assert safe_string_equals('abc', 'abc') == True\", \"assert safe_string_equals('abc', 'abcd') == False\", \"assert safe_string_equals('abcd', 'abc') =... | {
"split": "train",
"index": 64884,
"acecode_id": "bigcode_python_fns_28649",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `radix_sort(arr: List[int]) -> List[int]` that sorts an array of non-negative integers using the Radix Sort algorithm. The function should take a list of integers as input and return a new list containing the sorted integers in ascending order.\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert radix_sort([170, 45, 75, 90, 802, 24, 2, 66]) == [2, 24, 45, 66, 75, 90, 170, 802]\", \"assert radix_sort([3, 2, 1, 0]) == [0, 1, 2, 3]\", \"assert radix_sort([10, 1, 100, 11, 2]) == [1, 2, 10, 11, 100]\", \"assert radix_sort([5]) == [5]\", \"assert radix_so... | {
"split": "train",
"index": 64885,
"acecode_id": "evol_10025",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `champion_scores` and `challenger_scores`, representing the performance scores of a champion model and a challenger model respectively. Your task is to implement a function `compare_models(champion_scores: List[int], challenger_scores: List[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_models([10, 20, 30], [15, 25, 35], 'higher_average') == True\", \"assert compare_models([10, 20, 30], [5, 15, 25], 'higher_average') == False\", \"assert compare_models([10, 20, 30], [5, 15, 25], 'lower_average') == True\", \"assert compare_models([1... | {
"split": "train",
"index": 64886,
"acecode_id": "bigcode_python_fns_18703",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a decision tree algorithm from scratch that can categorize a fruit as either a mango or an apple based on its color and surface texture. The algorithm should take in a dataset of fruits with their respective characteristics and should include methods for building the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_fruit([{'color': 'Green', 'surface': 'Rough', 'type': 'Mango'},{'color': 'Red', 'surface': 'Smooth', 'type': 'Apple'}], {'color': 'Green', 'surface': 'Rough'}) == 'Mango'\", \"assert predict_fruit([{'color': 'Green', 'surface': 'Rough', 'type': 'Mang... | {
"split": "train",
"index": 64887,
"acecode_id": "evol_32035",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a JSON object that contains a title and text. Your task is to implement a function that processes this JSON object. If the title contains the phrase 'an error has occurred' (case insensitive), return a string 'Error encountered'. Otherwise, extract all stock ticke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_article('{\\\"title\\\": \\\"Test Title\\\", \\\"text\\\": \\\"This is a sample text with AAPL and MSFT.\\\"}') == ['AAPL', 'MSFT']\", \"assert process_article('{\\\"title\\\": \\\"An Error Has Occurred\\\", \\\"text\\\": \\\"This text is irrelevant.... | {
"split": "train",
"index": 64888,
"acecode_id": "bigcode_python_fns_1950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a writing style detection algorithm by setting up the necessary dependencies. The function, `initialize_algorithm`, should check if the required dependencies are already present. If they are not present, it should simulat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_algorithm(False) == 'Downloading dependencies...'\", \"assert initialize_algorithm(True) == 'Dependencies are already present.'\", \"assert initialize_algorithm(False) == 'Downloading dependencies...'\", \"assert initialize_algorithm(True) == 'Dep... | {
"split": "train",
"index": 64889,
"acecode_id": "bigcode_python_fns_37313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the minimum value in a 2D array and returns both the minimum value and a list of its position(s) in the array. The function should take a 2D list of integers as input and return a tuple containing the minimum value and a list of tuples re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_2d_array([[5, 2, 3], [4, 5, 1], [7, 1, 15]]) == (1, [(1, 2), (2, 1)])\", \"assert min_2d_array([[9, 8, 7], [6, 5, 4], [3, 2, 1]]) == (1, [(2, 2)])\", \"assert min_2d_array([[0, -1, -2], [-3, -4, -5], [-6, -7, -8]]) == (-8, [(2, 2)])\", \"assert min_2d_ar... | {
"split": "train",
"index": 64890,
"acecode_id": "evol_32725",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a machine learning training configuration setup. The function should take five optional parameters with default values, and return a dictionary containing these parameters. The parameters are as follows: \n- `epochs` (type:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_config() == {'epochs': 100, 'reg_coef': 0.001, 'batch_size': 32, 'batch_print': 30, 'save_freq': 1}\", \"assert setup_config(50) == {'epochs': 50, 'reg_coef': 0.001, 'batch_size': 32, 'batch_print': 30, 'save_freq': 1}\", \"assert setup_config(50, 0.01... | {
"split": "train",
"index": 64891,
"acecode_id": "oss_35272",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing the configuration of a multicast group range in a networking application. Your goal is to create a function that enables or disables the flapping feature for this multicast group range, and also retrieves the current status of the flapping feature. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_flap_enabled() == False\", \"assert manage_flap_enabled(True) == None\", \"assert manage_flap_enabled(False) == None\", \"assert manage_flap_enabled() == False\", \"assert manage_flap_enabled(True) == None\", \"assert manage_flap_enabled(False) == Non... | {
"split": "train",
"index": 64892,
"acecode_id": "oss_27845",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple file system object. The function should be able to store information about the object's name, type, size, and permissions. Additionally, the function should allow for setting and getting the object's permission... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_system_object('example.txt', 'file', 1024, 'rwxr-xr-x') == 'rwxr-xr-x'\", \"assert file_system_object('documents', 'directory', 2048, 'rwxr-xr-x') == 'rwxr-xr-x'\", \"assert file_system_object('image.png', 'file', 512, 'rw-r--r--') == 'rw-r--r--'\", \"a... | {
"split": "train",
"index": 64893,
"acecode_id": "oss_31628",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing JSON payloads containing various key-value pairs. Each dictionary has a key `dag_execution_date`, which is a string in the format 'YYYY-MM-DD HH:MM:SS.microseconds', and two other keys: `user`, which is a string representing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_earliest_execution([{'dag_execution_date': '2023-10-01 10:00:00.000000', 'user': 'alice', 'context_marker': 'marker1'}, {'dag_execution_date': '2023-10-01 09:00:00.000000', 'user': 'bob', 'context_marker': 'marker2'}]) == ('2023-10-01 09:00:00.000000', ... | {
"split": "train",
"index": 64894,
"acecode_id": "oss_37319",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of different players in a game. Your task is to implement a function that takes this list as input and returns the highest score and the number of players who achieved that score. The function should return a tuple with t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_score_and_count([10, 20, 20, 5, 5]) == (20, 2)\", \"assert highest_score_and_count([1, 2, 3, 4, 5]) == (5, 1)\", \"assert highest_score_and_count([5, 5, 5, 5]) == (5, 4)\", \"assert highest_score_and_count([]) == (0, 0)\", \"assert highest_score_and_... | {
"split": "train",
"index": 64895,
"acecode_id": "bigcode_python_fns_20909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that multiplies all the elements in the array and returns the total product. For example, if the input array is [1, 3, 5, 7], the output should be the product of all elements, which is 105.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_elements([1, 3, 5, 7]) == 105\", \"assert multiply_elements([2, 4, 6]) == 48\", \"assert multiply_elements([-1, -2, -3]) == -6\", \"assert multiply_elements([0, 1, 2]) == 0\", \"assert multiply_elements([10, 10, 10]) == 1000\", \"assert multiply_ele... | {
"split": "train",
"index": 64896,
"acecode_id": "evol_13370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, create a function that finds and returns the 3rd, 4th, and 5th lowest even numbers without using any built-in sorting or selection functions. If there are fewer than five even numbers, return an empty list.\nPlease reason step by step, then write a sel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_lowest_evens([1, 3, 5, 7]) == []\", \"assert find_lowest_evens([2, 4, 6, 8, 10]) == [6, 8, 10]\", \"assert find_lowest_evens([20, 22, 24]) == []\", \"assert find_lowest_evens([]) == []\", \"assert find_lowest_evens([100, 200, 300, 400, 500]) == [300, 40... | {
"split": "train",
"index": 64897,
"acecode_id": "evol_8548",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two sorted lists of integers, implement a function `union_and_intersection(list1, list2)` that returns a new sorted list which contains the intersection of the two lists followed by the union of the two lists. The intersection list should contain the common elements, whil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert union_and_intersection([1, 3, 5, 6, 7], [2, 3, 4, 5, 6]) == ([3, 5, 6], [1, 2, 3, 4, 5, 6, 7])\", \"assert union_and_intersection([1, 2, 3], [4, 5, 6]) == ([], [1, 2, 3, 4, 5, 6])\", \"assert union_and_intersection([1, 2, 3], [1, 2, 3]) == ([1, 2, 3], [1, 2,... | {
"split": "train",
"index": 64898,
"acecode_id": "evol_19272",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid of size m x n, where each cell can either be '0' (disabled) or '1' (enabled). Write a function `get_adjacent_cells(pos: Tuple[int, int], grid: List[List[int]]) -> List[Tuple[int, int]]` that takes a position as a tuple (i, j) and returns a list of valid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_adjacent_cells((1, 1), [[1, 1], [0, 0]]) == [(0, 1)]\", \"assert get_adjacent_cells((0, 0), [[0]]) == []\", \"assert get_adjacent_cells((0, 2), [[0, 0, 1], [1, 0, 1]]) == [(1, 2)]\", \"assert get_adjacent_cells((2, 0), [[1, 1, 1], [1, 0, 1], [0, 0, 1]]) ... | {
"split": "train",
"index": 64899,
"acecode_id": "bigcode_python_fns_25368",
"num_tests": 5
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.