data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Implement a function `fahrenheit_to_celsius(fahrenheit)` that converts a temperature from Fahrenheit to Celsius. The input will be a single parameter, `fahrenheit`, which can be a number or a string representation of a number. If the input cannot be converted to a float, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fahrenheit_to_celsius(32) == 0.0\", \"assert fahrenheit_to_celsius(212) == 100.0\", \"assert fahrenheit_to_celsius(100) == 37.78\", \"assert fahrenheit_to_celsius(0) == -17.78\", \"assert fahrenheit_to_celsius(-40) == -40.0\", \"assert fahrenheit_to_celsius(... | {
"split": "train",
"index": 75300,
"acecode_id": "evol_2858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given hexadecimal numeral (as a string) into its equivalent representation in the base-10 number system. The input string may or may not start with '0x'. Your function should also validate if the given string is a valid hexadecimal number. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_decimal('0xFF') == 255\", \"assert hex_to_decimal('0x1A') == 26\", \"assert hex_to_decimal('0x0') == 0\", \"assert hex_to_decimal('0x10') == 16\", \"assert hex_to_decimal('0xG') == -1\", \"assert hex_to_decimal('0x1F4') == 500\", \"assert hex_to_decim... | {
"split": "train",
"index": 75301,
"acecode_id": "evol_1480",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `key_list` and `word_list`, along with a list of integers `num_list`, write a function `create_dict` that constructs a dictionary. Each key in the dictionary should be derived from `key_list`, and the corresponding value should be a list containing the associat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dict(['fruit', 'tropical'], ['apple', 'banana'], [2, 3]) == {'fruit': ['apple', 'apple'], 'tropical': ['banana', 'banana', 'banana']}\", \"assert create_dict(['color', 'shape'], ['red', 'circle'], [1, 2]) == {'color': ['red'], 'shape': ['circle', 'cir... | {
"split": "train",
"index": 75302,
"acecode_id": "evol_31112",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input, representing the name of a configuration. The function should simulate deleting this configuration by returning the name of the deleted configuration. If the configuration name is empty or contains special ch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_configuration('config1') == 'config1'\", \"assert delete_configuration('') == 'Invalid configuration name'\", \"assert delete_configuration('config@3') == 'Invalid configuration name'\", \"assert delete_configuration('config#4') == 'Invalid configurat... | {
"split": "train",
"index": 75303,
"acecode_id": "bigcode_python_fns_33657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `create_event(id: str, type_: str, arguments: dict) -> dict` that creates an event with a unique identifier, a type, and associated entities. The function should return a dictionary representation of the event, with the following structure... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_event('E3', 'Family:T7', {'Amount': 'T8', 'Type': 'T9'}) == {'id': 'E3', 'type_': 'Family:T7', 'arguments': {'Amount': 'T8', 'Type': 'T9'}}\", \"assert create_event('E1', 'Tobacco:T2', {'State': 'T1'}) == {'id': 'E1', 'type_': 'Tobacco:T2', 'arguments... | {
"split": "train",
"index": 75304,
"acecode_id": "oss_11964",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function to find the most common element in a given list and return a tuple containing the element and its frequency. If there is a tie for the most common element, return the one that appears first in the list. If the list is empty, return (None, 0). Ensure that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_common([1, 2, 3, 2, 4, 1, 3, 2, 2, 5, 6, 7]) == (2, 4)\", \"assert most_common([1, 2, 3, 1, 2, 3, 4, 5, 6, 7]) == (1, 2)\", \"assert most_common([5, 5, 6, 6, 7, 7, 8, 8]) == (5, 2)\", \"assert most_common([1]) == (1, 1)\", \"assert most_common([]) == (N... | {
"split": "train",
"index": 75305,
"acecode_id": "evol_13291",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, write a function that generates an n x n identity matrix. An identity matrix is a square matrix in which all the elements of the principal diagonal are ones, and all other elements are zeros. Your function should return this matrix as a list of lists... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_identity_matrix(1) == [[1]]\", \"assert generate_identity_matrix(2) == [[1, 0], [0, 1]]\", \"assert generate_identity_matrix(3) == [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\", \"assert generate_identity_matrix(4) == [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0]... | {
"split": "train",
"index": 75306,
"acecode_id": "bigcode_python_fns_44426",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `extended_collatz(n: int) -> List[int]` that computes the extended Collatz sequence for a given integer n. The sequence starts with n and follows these rules: if the number is even, divide it by 2; if it's odd, multiply it by 3 and add 1. The sequence conti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extended_collatz(6) == [6, 3, 10, 5, 16, 8, 4, 2, 1]\", \"assert extended_collatz(19) == [19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1]\", \"assert extended_collatz(12) == [12, 6, 3, 10, 5, 16, 8, 4, 2, 1]\", \"assert extende... | {
"split": "train",
"index": 75307,
"acecode_id": "evol_11644",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that checks if a given string is an isogram (a word or phrase without a repeating letter). The function should be case-insensitive and disregard any spaces or punctuation. The function should return True if the string is an isogram, and False otherwis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_isogram('Subdermatoglyphic') == True\", \"assert check_isogram('The quick brown fox jumps over the lazy dog') == False\", \"assert check_isogram('abcdefg') == True\", \"assert check_isogram('Hello World') == False\", \"assert check_isogram('Isogram') =... | {
"split": "train",
"index": 75308,
"acecode_id": "evol_25254",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples representing exons in a transcript. Each tuple contains two integers: the start and end positions of an exon. Your task is to implement a function `count_junctions(exons)` that takes this list of exon tuples as input and returns the number of junc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_junctions([(100, 200), (150, 250), (300, 400)]) == 1\", \"assert count_junctions([(10, 20), (25, 35), (40, 50)]) == 2\", \"assert count_junctions([(1, 5), (6, 10), (11, 15)]) == 2\", \"assert count_junctions([(1, 2), (3, 4), (5, 6), (7, 8)]) == 3\", \"... | {
"split": "train",
"index": 75309,
"acecode_id": "oss_35863",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a list of packages. Your function should support three operations: adding a package, removing a package, and listing all installed packages. You need to implement a single function called `manage_packages` that takes a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_packages(['add package1', 'add package2', 'list']) == ['package1', 'package2']\", \"assert manage_packages(['add package1', 'remove package1', 'list']) == []\", \"assert manage_packages(['add package1', 'add package1', 'list']) == ['package1']\", \"as... | {
"split": "train",
"index": 75310,
"acecode_id": "oss_2177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a positive integer 'number', return a list of sub-lists, each containing 'number' consecutive elements from the input list. If the length of the list is not divisible by 'number', return an empty list. Implement a function `divide_list(array: List[i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_list([1, 2, 3, 4, 5, 6], 2) == [[1, 2], [3, 4], [5, 6]]\", \"assert divide_list([10, 20, 30, 40], 4) == [[10, 20, 30, 40]]\", \"assert divide_list([1, 2, 3, 4], 1) == [[1], [2], [3], [4]]\", \"assert divide_list([], 1) == []\", \"assert divide_list([1... | {
"split": "train",
"index": 75311,
"acecode_id": "bigcode_python_fns_34979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function entitled 'sum_within_bounds' that checks whether the sum of distinct numbers in a given integer sequence falls within a specified range defined by two integers, inclusive. Additionally, the function must verify that the number of integers in the sequ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_within_bounds([1, 2, 4, 10], 15, 25) == True\", \"assert sum_within_bounds([1, 5, 10], 5, 15) == False\", \"assert sum_within_bounds([3, 3, 3, 3], 3, 10) == True\", \"assert sum_within_bounds([1, 2, 3, 4, 5], 10, 20) == False\", \"assert sum_within_bound... | {
"split": "train",
"index": 75312,
"acecode_id": "evol_9132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary contains various keys and values. Your task is to create a Python function `process_data(data)` that takes a list of dictionaries as input and performs the following steps: 1. For each dictionary in the list, determine... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([{'a': 1, 'b': 2}, {'x': 5, 'y': 10}]) == [(2, 1.5), (2, 7.5)]\", \"assert process_data([{'key1': 'value1', 'key2': 'value2'}, {'keyA': 0, 'keyB': 0}]) == [(2, 0.0), (2, 0.0)]\", \"assert process_data([{'key': 'value'}, {'num1': 10, 'num2': 20, ... | {
"split": "train",
"index": 75313,
"acecode_id": "oss_10126",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked to implement a function `is_valid_suite_class(klass)` that checks if a given class is a valid suite class. A class is considered a valid suite class if it meets the following criteria: it must be a class, it must not have any dependencies, and it can optionally h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_suite_class(type('TestSuite', (), {'dependencies': []})) == True\", \"assert is_valid_suite_class(type('AnotherSuite', (), {'dependencies': ['dependency']})) == False\", \"assert is_valid_suite_class(type('SuiteWithRank', (), {'dependencies': [], 'r... | {
"split": "train",
"index": 75314,
"acecode_id": "bigcode_python_fns_41776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a list of available games that players can join. The function should accept a list of game objects, where each game object contains a 'name' (a string representing the name of the game) and a 'started' (a boolean indicating... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_available_games([]) == [('', '- None -')]\", \"assert get_available_games([{'name': 'Chess', 'started': False}]) == [('', '- Select -'), ('Chess', 'Chess')]\", \"assert get_available_games([{'name': 'Poker', 'started': False}, {'name': 'Checkers', 'start... | {
"split": "train",
"index": 75315,
"acecode_id": "bigcode_python_fns_22476",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a blockchain system where each block has a certain difficulty level that determines whether it can validate its work. Implement a function `verify_block_work(difficulty: str, work: str) -> bool` that takes in the current difficulty of the block as a hexadecimal st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_block_work('fffffffeb1249486', 'fffffffeb1249486') == True\", \"assert verify_block_work('fffffffeb1249487', 'fffffffeb1249487') == True\", \"assert verify_block_work('fffffffeb1249488', 'fffffffeb1249487') == True\", \"assert verify_block_work('fffff... | {
"split": "train",
"index": 75316,
"acecode_id": "bigcode_python_fns_34294",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `launch_browser` that simulates launching a web browser. The function should return a string indicating the status of the browser launch. If the browser is successfully launched, the function should return 'Browser launched successfully'.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert launch_browser() == 'Browser launched successfully'\", \"assert launch_browser() == 'Failed to launch browser'\", \"assert launch_browser() == 'Failed to launch browser'\", \"assert launch_browser() == 'Browser launched successfully'\", \"assert launch_brows... | {
"split": "train",
"index": 75317,
"acecode_id": "bigcode_python_fns_16571",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a C++ class name in the format 'ROOT::ClassName', write a function that transforms it into a Python class name by following these steps: 1. Replace 'ROOT::' with 'Model_' and also replace any colons with underscores. 2. If the resulting class name st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_classname('ROOT::RThing') == 'Model_RThing'\", \"assert transform_classname('ROOT::Another::Example') == 'Model_Another_Example'\", \"assert transform_classname('ROOT::') == 'Model_'\", \"assert transform_classname('NonROOT::Class') == None\", \"as... | {
"split": "train",
"index": 75318,
"acecode_id": "bigcode_python_fns_18550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a logging mechanism for a hypothetical application. The function `simulate_logging(logdir, print_nonsense, print_nothing, address_in_use, sleep_time)` should behave as follows: \n\n- If `logdir` is None, the function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_logging(None, False, False, False, 5) == -1\", \"assert simulate_logging('/var/log/app', False, False, True, 5) == 2\", \"assert simulate_logging('/tmp/log', False, False, True, 10) == 2\", \"assert simulate_logging(None, True, False, False, 10) == ... | {
"split": "train",
"index": 75319,
"acecode_id": "bigcode_python_fns_19741",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of elements. Implement a function `complex_sorted_list(lst, reverse=False, min_sum=0)` that takes a list `lst` and returns a sorted list of unique strings that meet the following criteria: the string must not contain any digits, its length must be even, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_sorted_list(['aa', 2, '@', 'aaa']) == ['aa']\", \"assert complex_sorted_list(['ab', 1, 'a', 'aaa', 'cd']) == ['ab', 'cd']\", \"assert complex_sorted_list(['ab', 3, 'a', 'aaa', 'cd'], True) == ['cd', 'ab']\", \"assert complex_sorted_list([], reverse=T... | {
"split": "train",
"index": 75320,
"acecode_id": "evol_26206",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function `roman_multiplication_table(n: int) -> List[List[str]]` that generates a multiplication table of Roman numerals for integers from 1 to n. The function should return a 2D list where the element at the i-th row and j-th column represents the product of (i+1) and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert roman_multiplication_table(1) == [['I']]\", \"assert roman_multiplication_table(2) == [['I', 'II'], ['II', 'IV']]\", \"assert roman_multiplication_table(3) == [['I', 'II', 'III'], ['II', 'IV', 'VI'], ['III', 'VI', 'IX']]\", \"assert roman_multiplication_tabl... | {
"split": "train",
"index": 75321,
"acecode_id": "evol_29333",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a value `x` and two ranges defined by `in_min`, `in_max` for the input range, and `out_min`, `out_max` for the output range. Your task is to write a function that maps the value `x` from the input range to the output range. The mapping should be done linearly, suc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_value(5, 0, 10, 0, 100) == 50\", \"assert map_value(0, 0, 10, 0, 100) == 0\", \"assert map_value(10, 0, 10, 0, 100) == 100\", \"assert map_value(7, 0, 10, 0, 100) == 70\", \"assert map_value(3, 0, 10, 0, 100) == 30\", \"assert map_value(1, 0, 10, 0, 100)... | {
"split": "train",
"index": 75322,
"acecode_id": "bigcode_python_fns_19736",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer array 'nums', write a function 'max_subarray_sum' that returns the maximum sum of any contiguous subarray within the array. A subarray is defined as a contiguous part of the array. If the array is empty, the function should return 0.\nPlease reason step by step... | 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([]) == 0\", \"assert max_subarray_sum([5]) == 5\", \"assert max_subarray_sum([-2, -1, -3, 0]) == 0\", \"assert max_subarr... | {
"split": "train",
"index": 75323,
"acecode_id": "evol_11638",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_prime_groups(n: int) -> List[List[int]]` that generates the first `n` prime numbers and groups them into sub-arrays of 20. Each sub-array should maintain the original order of the prime numbers. If there are fewer than 20 primes remaining, the last su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_prime_groups(20) == [[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]]\", \"assert generate_prime_groups(21) == [[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71], [73]]\", \"assert generate_pri... | {
"split": "train",
"index": 75324,
"acecode_id": "evol_35342",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and an associated directory path. Your task is to create a function that simulates extracting these files from a compressed folder located at the specified directory. The function should return a list of the extracted file names. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_files(['file1.txt', 'file2.txt', 'file3.txt'], '/dummy/path') == ['file1.txt', 'file2.txt', 'file3.txt']\", \"assert extract_files(['image.png', 'document.pdf'], '/another/directory') == ['image.png', 'document.pdf']\", \"assert extract_files([], '/e... | {
"split": "train",
"index": 75325,
"acecode_id": "bigcode_python_fns_23946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that returns a list of accumulated recovery amounts for different towns. The function `get_accumulated_recoveries_data` takes a boolean parameter `ascending_order` to specify the ordering of the final result. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_accumulated_recoveries_data(True) == [('Town3', 80), ('Town1', 100), ('Town5', 120), ('Town2', 150), ('Town4', 200)]\", \"assert get_accumulated_recoveries_data(False) == [('Town4', 200), ('Town2', 150), ('Town5', 120), ('Town1', 100), ('Town3', 80)]\", ... | {
"split": "train",
"index": 75326,
"acecode_id": "oss_775",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city. Your task is to write a function that counts how many buildings have a strictly greater height than all the buildings to their left. A building is considered 'visible' if there are no taller build... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_visible_buildings([1, 3, 2, 4]) == 3\", \"assert count_visible_buildings([5, 3, 2, 1]) == 1\", \"assert count_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert count_visible_buildings([5, 1, 2, 3, 4]) == 1\", \"assert count_visible_buildings([3, 2, 1... | {
"split": "train",
"index": 75327,
"acecode_id": "bigcode_python_fns_33821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given string input. Your function should perform the following steps: 1. Convert the input string `data` to uppercase. 2. Calculate the length of the uppercase string. 3. Reverse the uppercase string. 4. Return a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('hello') == {'uppercase': 'HELLO', 'length': 5, 'reversed': 'OLLEH'}\", \"assert process_string('world') == {'uppercase': 'WORLD', 'length': 5, 'reversed': 'DLROW'}\", \"assert process_string('LeetCode') == {'uppercase': 'LEETCODE', 'length': ... | {
"split": "train",
"index": 75328,
"acecode_id": "oss_18758",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that calculates the product of its elements. The function should handle edge cases such as non-integer values, an empty array, or negative numbers. If the array is empty, return None. If any element is not an integer, return a me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_elements([4, 5, 1, 3]) == 60\", \"assert product_of_elements([]) == None\", \"assert product_of_elements([1, 2, 3, 4, 5]) == 120\", \"assert product_of_elements([2, -3, 4]) == -24\", \"assert product_of_elements([10, 20, 30]) == 6000\", \"assert p... | {
"split": "train",
"index": 75329,
"acecode_id": "evol_1144",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial(n: int) -> int` that calculates the factorial of a non-negative integer `n` using a recursive approach. The factorial of `n` is defined as the product of all positive integers less than or equal to `n`. In mathematical terms, it is denoted as `n!... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 75330,
"acecode_id": "evol_827",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called 'anchor_boat' that takes a string parameter 'boat_name' and returns a string that displays the message '{boat_name} is anchored'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert anchor_boat('Titanic') == 'Titanic is anchored'\", \"assert anchor_boat('Sailor') == 'Sailor is anchored'\", \"assert anchor_boat('Viking Ship') == 'Viking Ship is anchored'\", \"assert anchor_boat('Yacht') == 'Yacht is anchored'\", \"assert anchor_boat('Fis... | {
"split": "train",
"index": 75331,
"acecode_id": "evol_5735",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a boolean value that indicates whether a certain condition is met. Your task is to implement a function `check_condition(condition: bool) -> str` that returns 'Condition is True' if the condition is True, and 'Condition is False' if the condition is False. Write t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_condition(True) == 'Condition is True'\", \"assert check_condition(False) == 'Condition is False'\", \"assert check_condition(True) == 'Condition is True'\", \"assert check_condition(False) == 'Condition is False'\", \"assert check_condition(True) == '... | {
"split": "train",
"index": 75332,
"acecode_id": "oss_31733",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that returns the product of all elements except for the largest one. If the array has one or zero elements, return None. For example, given the input [1, 2, 3, 4, 5], the function should return 6 (1*2*3), since 5 is the highest n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_except_max([5, 1, 2, 3]) == 6\", \"assert product_except_max([10, 20, 30]) == 200\", \"assert product_except_max([1]) == None\", \"assert product_except_max([]) == None\", \"assert product_except_max([0, 0, 0]) == 0\", \"assert product_except_max([1,... | {
"split": "train",
"index": 75333,
"acecode_id": "evol_12507",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to implement a function `max_visible_buildings(heights: List[int]) -> int` that returns the maximum number of visible buildings when viewed from the left side. A building is c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_visible_buildings([1, 3, 2, 1, 5]) == 3\", \"assert max_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert max_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_buildings([3, 3, 3, 3, 3]) == 1\", \"assert max_visible_buildings([10, 20, 10,... | {
"split": "train",
"index": 75334,
"acecode_id": "bigcode_python_fns_20199",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, num_images and duration. Your task is to implement a function that calculates the frames per second (fps) given the number of images processed and the total time taken in seconds. The fps is calculated as the total number of images divided by the tot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fps(100, 2.0) == 50.0\", \"assert calculate_fps(0, 1.0) == 0.0\", \"assert calculate_fps(120, 3.0) == 40.0\", \"assert calculate_fps(75, 0.5) == 150.0\", \"assert calculate_fps(200, 4.0) == 50.0\", \"assert calculate_fps(10, 2.5) == 4.0\", \"assert... | {
"split": "train",
"index": 75335,
"acecode_id": "bigcode_python_fns_1202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing different types of programming languages, where each integer corresponds to a specific language. Your task is to implement a function `count_languages(languages: List[int]) -> Dict[int, int]` that counts the occurrence of each langu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_languages([1, 2, 1, 3, 2, 2]) == {1: 2, 2: 3, 3: 1}\", \"assert count_languages([4, 5, 4, 4, 6, 5, 6]) == {4: 3, 5: 2, 6: 2}\", \"assert count_languages([7, 8, 9]) == {7: 1, 8: 1, 9: 1}\", \"assert count_languages([]) == {}\", \"assert count_languages(... | {
"split": "train",
"index": 75336,
"acecode_id": "bigcode_python_fns_5681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that removes all special characters from a given string while preserving alphanumeric characters, spaces, and international characters. The function should raise a ValueError if the input is not a valid string. The function should be named 'remove_specia... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_special_chars('\\u00c4\\u00f1other \\u00a3xample \\u00f3f $tr\\u00edng with sp\\u00e8cial char\\u00e5cters') == '\\u00c4\\u00f1other xample \\u00f3f tr\\u00edng with sp\\u00e8cial char\\u00e5cters'\", \"assert remove_special_chars('Hello, World!') == ... | {
"split": "train",
"index": 75337,
"acecode_id": "evol_24983",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `count_sentences(documents: List[Dict[str, List[str]]], commit_interval: int) -> Tuple[int, List[int]]`. The function takes a list of documents, where each document is represented as a dictionary with a key 'all_sentences' that maps to a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_sentences([], 5) == (0, [])\", \"assert count_sentences([{'all_sentences': []}], 1) == (1, [0])\", \"assert count_sentences([{'all_sentences': ['Hello', 'World']}], 1) == (1, [2])\", \"assert count_sentences([{'all_sentences': ['Sentence 1', 'Sentence ... | {
"split": "train",
"index": 75338,
"acecode_id": "bigcode_python_fns_30737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a logging utility for a software system. The utility should allow for logging messages at different levels: 'WARNING', 'ERROR', and 'CRITICAL'. Your task is to implement a function named `log_message` that takes two parameters: `level` (a string rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message('WARNING', 'This is a warning') == 'Warning: This is a warning'\", \"assert log_message('ERROR', 'This is an error') == 'Error: This is an error'\", \"assert log_message('CRITICAL', 'This is critical') == 'Critical: This is critical'\", \"assert ... | {
"split": "train",
"index": 75339,
"acecode_id": "oss_33619",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a user's login credentials. Create a function `validate_login(username: str, password: str) -> str` that takes a username and a password as input and returns a success message if the credentials are valid, or an error message if they are not. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_login('admin', 'password') == 'Login successful'\", \"assert validate_login('admin', 'wrongpassword') == 'Invalid username or password'\", \"assert validate_login('user', 'password') == 'Invalid username or password'\", \"assert validate_login('admi... | {
"split": "train",
"index": 75340,
"acecode_id": "oss_14851",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 'text', implement a function `reverse(text)` that returns the string in reverse order without modifying the original string. You cannot use any pre-existing functions, iteration, or recursion. Handle any potential exceptions that may arise during execution and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse('Hello World') == 'dlroW olleH'\", \"assert reverse('Python') == 'nohtyP'\", \"assert reverse('OpenAI') == 'IAnepO'\", \"assert reverse('12345') == '54321'\", \"assert reverse('') == ''\", \"assert reverse('A') == 'A'\", \"assert reverse('abcdefg') =... | {
"split": "train",
"index": 75341,
"acecode_id": "evol_29650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that determines the type of tile based on given edge coordinates and a specified edge handling behavior. The function should take in two parameters: a tuple representing the x and y coordinates of a point on the edge of a tile,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_tile((2.5, 3.5), 'floor') == 'C'\", \"assert generate_tile((4.0, 6.0), 'floor') == 'A'\", \"assert generate_tile((2.1, 2.2), 'round') == 'A'\", \"assert generate_tile((1.0, 1.0), 'floor') == 'B'\", \"assert generate_tile((6.5, 3.2), 'round') == 'C'\... | {
"split": "train",
"index": 75342,
"acecode_id": "oss_37203",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes three parameters: a classification value (string), a classification name (string), and a feature schema ID (integer). The function should return a dictionary that contains the classification value, name, and feature schema ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_classification_annotation('common_classification', 'Common Classification', 12345) == {'value': 'common_classification', 'name': 'Common Classification', 'feature_schema_id': 12345}\", \"assert create_classification_annotation('rare_classification', '... | {
"split": "train",
"index": 75343,
"acecode_id": "oss_17552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that verifies if a specific user is correctly assigned to all issue templates in a Django project. The function should take a list of strings, each representing the content of an issue template file, and a string representing the expected... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_issue_templates(['assignees: \\\"imAsparky\\\"'], 'imAsparky', ['bug-report.md']) == True\", \"assert verify_issue_templates(['assignees: \\\"imAsparky\\\"'], 'imAsparky', ['chore.md']) == True\", \"assert verify_issue_templates(['assignees: \\\"imAsp... | {
"split": "train",
"index": 75344,
"acecode_id": "bigcode_python_fns_29570",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a command string and determines if it should be executed in verbose mode or suppressed mode. The command string consists of words separated by spaces. If the last word in the command string is '--verbose', it indicates that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_command('echo Hello World --verbose') == 'Execute with output'\", \"assert process_command('echo Hello World') == 'Execute silently'\", \"assert process_command('ls -l --verbose') == 'Execute with output'\", \"assert process_command('ls -l') == 'Exec... | {
"split": "train",
"index": 75345,
"acecode_id": "bigcode_python_fns_28576",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries where each dictionary contains a 'name' key, implement a function that groups these dictionaries by their 'name' values. The function should return a dictionary where the keys are the unique names and the values are lists of dictionaries that share ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize([{'name': 'john', 'age': 20}, {'name': 'jane', 'age': 19}, {'name': 'bob', 'age': 22}]) == {'john': [{'name': 'john', 'age': 20}], 'jane': [{'name': 'jane', 'age': 19}], 'bob': [{'name': 'bob', 'age': 22}]}\", \"assert categorize([{'name': 'john',... | {
"split": "train",
"index": 75346,
"acecode_id": "evol_15222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a non-negative integer n as input and returns a list of all prime numbers that are smaller than n. For example: count_up_to(5) should return [2,3], and count_up_to(11) should return [2,3,5,7]. If n is less than or equal to 1, the function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_up_to(5) == [2, 3]\", \"assert count_up_to(11) == [2, 3, 5, 7]\", \"assert count_up_to(0) == []\", \"assert count_up_to(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert count_up_to(1) == []\", \"assert count_up_to(18) == [2, 3, 5, 7, 11, 13, 17]\", \"as... | {
"split": "train",
"index": 75347,
"acecode_id": "evol_28144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with modifying a schema dictionary to include localized field keys based on provided fields and locales. Your function should take in a schema dictionary, a list of fields, and an optional list of locales. If locales are not provided, a default set of locales sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_localized_fields({}, ['name', 'description']) == {'name_en': ['ignore_missing', 'str', 'convert_to_extras'], 'name_fr': ['ignore_missing', 'str', 'convert_to_extras'], 'name_es': ['ignore_missing', 'str', 'convert_to_extras'], 'description_en': ['ignore_... | {
"split": "train",
"index": 75348,
"acecode_id": "bigcode_python_fns_34674",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a command response from a device. The response is in the format of a JSON-like dictionary represented as a string, which contains a 'command' key that maps to an integer and a 'status' key that maps to a string. Your task is to implement a fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_command_response(\\\"{'command': 42, 'status': 'success'}\\\") == 'Command executed successfully'\", \"assert parse_command_response(\\\"{'command': 5, 'status': 'success'}\\\") == 'Command executed successfully'\", \"assert parse_command_response(\\\"... | {
"split": "train",
"index": 75349,
"acecode_id": "bigcode_python_fns_885",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts two strings and determines if they are anagrams of each other, considering only the alphabetical characters in a case-insensitive manner. Ignore any uppercase letters and special symbols. The function should return True if they are anagrams, otherw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_anagram('Abcde+', 'EDCBA++') == True\", \"assert check_anagram('Listen!', 'Silent.') == True\", \"assert check_anagram('Triangle', 'Integral') == True\", \"assert check_anagram('Hello, World!', 'dlroW ,olleH') == True\", \"assert check_anagram('Anagram... | {
"split": "train",
"index": 75350,
"acecode_id": "evol_9501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the sum of all even Fibonacci numbers up to a given limit. The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, starting with 0 and 1. Your task is to create a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even_fibonacci_sum(10) == 10\", \"assert even_fibonacci_sum(0) == 0\", \"assert even_fibonacci_sum(2) == 2\", \"assert even_fibonacci_sum(8) == 10\", \"assert even_fibonacci_sum(1) == 0\", \"assert even_fibonacci_sum(34) == 44\", \"assert even_fibonacci_sum(... | {
"split": "train",
"index": 75351,
"acecode_id": "oss_15089",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a factory function that returns an instance of a specific class based on a given configuration. The function, `commiter_factory`, takes a dictionary `config` as input, which contains a key 'name' indicating the desired class. You have a predefin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert commiter_factory({'name': 'class_name_1'}) is not None\", \"assert type(commiter_factory({'name': 'class_name_1'})) is Class1\", \"assert commiter_factory({'name': 'class_name_2'}) is not None\", \"assert type(commiter_factory({'name': 'class_name_2'})) is C... | {
"split": "train",
"index": 75352,
"acecode_id": "oss_14231",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and a format string as input, and returns the binary data string obtained by packing the integers according to the given format string using the `struct` module in Python. The format string specifies how ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pack_integers([1, 2], '<2I') == b'\\\\x01\\\\x00\\\\x00\\\\x00\\\\x02\\\\x00\\\\x00\\\\x00'\", \"assert pack_integers([255, 256], '<2I') == b'\\\\xff\\\\x00\\\\x00\\\\x00\\\\x00\\\\x01\\\\x00\\\\x00'\", \"assert pack_integers([0], '<I') == b'\\\\x00\\\\x00\\... | {
"split": "train",
"index": 75353,
"acecode_id": "oss_22746",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a sequence of integers and a non-negative integer 'bsj', write a function that transforms the sequence by rotating it to the left by 'bsj' positions. The function should return the transformed sequence as a list. For example, if the input sequence is [1, 2, 3, 4, 5] and b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate_sequence([1, 2, 3, 4, 5], 2) == [3, 4, 5, 1, 2]\", \"assert rotate_sequence([10, 20, 30, 40, 50], 1) == [20, 30, 40, 50, 10]\", \"assert rotate_sequence([1, 2, 3], 0) == [1, 2, 3]\", \"assert rotate_sequence([5, 6, 7, 8, 9], 5) == [5, 6, 7, 8, 9]\", \... | {
"split": "train",
"index": 75354,
"acecode_id": "bigcode_python_fns_4589",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines if a bank account's balance goes below zero based on a list of deposit and withdrawal operations. The function should take into account whether the operations are case-insensitive. If case_insensitive is set to True, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([('Deposit', 100), ('Withdrawal', 100)], case_insensitive=True) == True\", \"assert below_zero([('Deposit', 100), ('Withdrawal', 50)], case_insensitive=True) == False\", \"assert below_zero([('Deposit', 50), ('Withdrawal', 100)], case_insensitive=... | {
"split": "train",
"index": 75355,
"acecode_id": "evol_26421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `has_prime_numbers(num_list)` that takes a list of integers as input and returns True if there are any prime numbers in the list, and False otherwise. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_prime_numbers([17, 24, 46, 37]) == True\", \"assert has_prime_numbers([1, 4, 6, 8]) == False\", \"assert has_prime_numbers([2, 3, 5, 7]) == True\", \"assert has_prime_numbers([10, 12, 14, 15]) == False\", \"assert has_prime_numbers([11, 13, 17, 19]) == T... | {
"split": "train",
"index": 75356,
"acecode_id": "evol_2421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a command to run a Docker container. The function should take two parameters: a project root directory (a string) and an image name (also a string). It should return a string formatted as 'docker run --volume {project_root}... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_docker_command('/home/user/myproject', 'myimage') == 'docker run --volume /home/user/myproject:/app myimage'\", \"assert generate_docker_command('/var/www/html', 'webserver') == 'docker run --volume /var/www/html:/app webserver'\", \"assert generate... | {
"split": "train",
"index": 75357,
"acecode_id": "bigcode_python_fns_38406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even numbers from the original list, preserving their order. The function should be named `filter_even_numbers`. The input list can contain both positive and neg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([0, 2, 4, 6]) == [0, 2, 4, 6]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([10... | {
"split": "train",
"index": 75358,
"acecode_id": "bigcode_python_fns_46970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that counts the number of unprocessed certificate requests. Each request can either be processed (denoted by a non-null generation date) or unprocessed (denoted by a null generation date). Implement a function `count_unprocessed_requests(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unprocessed_requests([None, '2023-01-01', None, '2023-01-02']) == 2\", \"assert count_unprocessed_requests(['2023-01-01', '2023-01-02']) == 0\", \"assert count_unprocessed_requests([None, None, None]) == 3\", \"assert count_unprocessed_requests(['2023-... | {
"split": "train",
"index": 75359,
"acecode_id": "bigcode_python_fns_43219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and a positive integer 'n', implement a function that returns the smallest product of any contiguous subarray of size 'n'. If the length of the array is less than 'n', return None.\nPlease reason step by step, then write a self-contained Python soluti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_contiguous_product([1, 2, 3, 4, 5], 2) == 2\", \"assert smallest_contiguous_product([5, 4, 3, 2, 1], 4) == 24\", \"assert smallest_contiguous_product([-1, 1, -1, 1], 3) == -1\", \"assert smallest_contiguous_product([10, 20, 30, 40], 2) == 200\", \"a... | {
"split": "train",
"index": 75360,
"acecode_id": "evol_8155",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `insert_features` that takes an application name and a dictionary of features, and returns a SQL insert statement string for the application's features. The application name should be formatted as 'name-version-release'. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_features('myapp-1.0-2023', {'Internet': 1, 'Account Manager': 1, 'Use SSL': 1, 'Sharing-Sending': 1, 'Internationalization': 1}) == \\\"INSERT INTO version_features (app_version_id, internet, account_manager, uses_ssl, sharing_sending, translation) VA... | {
"split": "train",
"index": 75361,
"acecode_id": "bigcode_python_fns_5814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the coordinates of a rectangle defined by the left, bottom, right, and top edges. Implement a function `create_rectangle_area(left: float, bottom: float, right: float, top: float) -> float` that calculates the area of the rectangle. The area is defined as the widt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_rectangle_area(1.0, 1.0, 3.0, 4.0) == 6.0\", \"assert create_rectangle_area(0.0, 0.0, 5.0, 5.0) == 25.0\", \"assert create_rectangle_area(-2.0, -2.0, 1.0, 1.0) == 9.0\", \"assert create_rectangle_area(1.5, 2.5, 4.5, 5.5) == 9.0\", \"assert create_rect... | {
"split": "train",
"index": 75362,
"acecode_id": "bigcode_python_fns_46569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing file sizes. Your task is to implement a function that calculates the total size of all files in the list. The function should return the total size as an integer. If the list is empty, return 0.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_file_size([10, 20, 30]) == 60\", \"assert total_file_size([1, 2, 3, 4, 5]) == 15\", \"assert total_file_size([100, 200]) == 300\", \"assert total_file_size([]) == 0\", \"assert total_file_size([5]) == 5\", \"assert total_file_size([0, 0, 0]) == 0\", \"... | {
"split": "train",
"index": 75363,
"acecode_id": "bigcode_python_fns_44977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple part-of-speech tagging function for natural language processing. Your goal is to create a function called `tag` that accepts either a sentence as a string or a list of words as input and returns a list of tuples, each containing a word ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tag(['The', 'horse', 'raced', 'past', 'the', 'barn', 'fell', '.']) == [('The', 'DT'), ('horse', 'NN'), ('raced', 'VBD'), ('past', 'IN'), ('the', 'DT'), ('barn', 'NN'), ('fell', 'VBD'), ('.', '.')]\", \"assert tag(['The', '.']) == [('The', 'DT'), ('.', '.')]\... | {
"split": "train",
"index": 75364,
"acecode_id": "oss_17340",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_inline_styles(html: str) -> List[Tuple[str, str]]` that takes a string representing an HTML document and returns a list of tuples where each tuple contains the name of an HTML tag and its corresponding inline CSS style. An inline CSS style is defined a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_inline_styles('<div style=\\\"color:blue;\\\"></div>') == [('div', 'color:blue;')]\", \"assert extract_inline_styles('<span></span>') == []\", \"assert extract_inline_styles('<h1 style=\\\"font-size:300%;\\\">Header</h1><p style=\\\"color:red;\\\">Pa... | {
"split": "train",
"index": 75365,
"acecode_id": "evol_2298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s and an integer n, write a function `is_happy(s: str, n: int) -> bool` that checks if every unique combination of n consecutive letters in the string appears at least twice. Return True if all unique combinations meet this condition, otherwise return False.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_happy('abc', 2) == False\", \"assert is_happy('ababab', 2) == True\", \"assert is_happy('aaaa', 1) == True\", \"assert is_happy('abcde', 2) == False\", \"assert is_happy('abcd', 4) == False\", \"assert is_happy('abcdefg', 2) == False\", \"assert is_happy(... | {
"split": "train",
"index": 75366,
"acecode_id": "evol_21758",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary containing information about different services and their corresponding permissions. The function should filter out the items that have at least one service with the permission 'spfirewall_allow_all' and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_services_with_permission({'item1': {'service1': 'spfirewall_allow_all'}, 'item2': {'service2': 'spfirewall_deny_all'}}) == ['item1']\", \"assert filter_services_with_permission({'item1': {'service1': 'spfirewall_deny_all'}, 'item2': {'service2': 'spfi... | {
"split": "train",
"index": 75367,
"acecode_id": "oss_24191",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tweets that require text processing. Your task is to implement a function that takes the list of tweets as input and returns the final processed tweets after applying the following text processing steps: 1. Remove single characters from the start of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tweets(['bThis is a sample tweet']) == ['this is a sample tweet']\", \"assert process_tweets(['Catching up with the latest AI trends']) == ['catching up with the latest ai trends']\", \"assert process_tweets(['bNatural Language Processing is fascinat... | {
"split": "train",
"index": 75368,
"acecode_id": "oss_21479",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a binary tree represented by a TreeNode class. Each node has an integer value and two children (left and right). A leaf node is defined as a node that does not have any children (both left and right child are None). Write a function `getLeafCount(root: TreeNode) -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getLeafCount(TreeNode(1, TreeNode(2), TreeNode(3))) == 2\", \"assert getLeafCount(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)), TreeNode(3))) == 3\", \"assert getLeafCount(TreeNode(1)) == 1\", \"assert getLeafCount(TreeNode(1, None, TreeNode(2))) == 1\"... | {
"split": "train",
"index": 75369,
"acecode_id": "oss_13272",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers as input and returns a tuple containing the smallest and largest elements along with their respective positions in the list. The output should be in the format: (min_value, min_index, max_value, max_index).\nPlease reason step by s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_min_max_positions([23, 12, 56, 72, 9, 10]) == (9, 4, 72, 3)\", \"assert find_min_max_positions([1, 2, 3, 4, 5]) == (1, 0, 5, 4)\", \"assert find_min_max_positions([-5, -1, -10, 0, 5, 10]) == (-10, 2, 10, 5)\", \"assert find_min_max_positions([100, 200, ... | {
"split": "train",
"index": 75370,
"acecode_id": "evol_17599",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of module names as strings. Your task is to implement a function `find_disjunct_modules(modules: List[str]) -> List[str]` that returns a list of module names that are not currently in the system's modules. The system's modules can be simulated using a prede... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_disjunct_modules(['os', 'sys', 'math']) == []\", \"assert find_disjunct_modules(['custom_module1', 'custom_module2', '', 'custom_module1']) == ['custom_module1', 'custom_module2']\", \"assert find_disjunct_modules(['numpy', 'pandas', 'matplotlib']) == [... | {
"split": "train",
"index": 75371,
"acecode_id": "bigcode_python_fns_15885",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of client roles and returns a list of clients that are authenticated to the 'user' role. Your function should only include clients that have the 'user' role in their list of roles. Implement the function `get_user_client... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_clients([{'name': 'Alice', 'roles': ['admin', 'user']}, {'name': 'Bob', 'roles': ['guest']}, {'name': 'Charlie', 'roles': ['user']}]) == [{'name': 'Alice', 'roles': ['admin', 'user']}, {'name': 'Charlie', 'roles': ['user']}]\", \"assert get_user_cli... | {
"split": "train",
"index": 75372,
"acecode_id": "bigcode_python_fns_1858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of dictionaries, each representing products from two different e-commerce platforms. Each dictionary contains the following keys: 'id', 'name', 'description', 'manufacturer', and 'price'. Your task is to implement a function that computes a list of produ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_product_pairs([{'id': '1', 'name': 'Product A', 'description': 'Description A', 'manufacturer': 'Company X', 'price': 100.0}], [{'id': '2', 'name': 'Product B', 'description': 'Description B', 'manufacturer': 'Company X', 'price': 110.0}], 15.0) == [('1... | {
"split": "train",
"index": 75373,
"acecode_id": "bigcode_python_fns_6523",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `manage_library_member` that accepts a member's name, member ID, and a list of books they wish to borrow. The function should return a dictionary containing the member's name, member ID, and a list of successfully borrowed books. The function should enforce th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_library_member('Alice', 'a01', ['Book1', 'Book2']) == {'name': 'Alice', 'member_id': 'a01', 'books_borrowed': ['Book1', 'Book2']}\", \"assert manage_library_member('Bob', 'b01', ['Book1', 'Book2', 'Book1']) == {'name': 'Bob', 'member_id': 'b01', 'book... | {
"split": "train",
"index": 75374,
"acecode_id": "evol_2595",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given input is of a valid data type for a hypothetical DataFrame profile. The valid data types include integers, floats, strings, and lists of integers or floats. Your function should take a single parameter, `data`, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_data_type(10) == True\", \"assert is_valid_data_type(3.14) == True\", \"assert is_valid_data_type('hello') == True\", \"assert is_valid_data_type([1, 2, 3]) == True\", \"assert is_valid_data_type([1.0, 2.0, 3.0]) == True\", \"assert is_valid_data_ty... | {
"split": "train",
"index": 75375,
"acecode_id": "bigcode_python_fns_14067",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_positive(x)` that raises a `ValueError` if the input `x` is less than 0. The function should not return any value. Write doctests to demonstrate the expected behavior when valid and invalid inputs are provided.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_positive(5) is None\", \"assert check_positive(0) is None\", \"assert check_positive(100) is None\", \"assert check_positive(99.99) is None\", \"assert check_positive(1.5) is None\", \"assert check_positive(10) is None\", \"assert check_positive(2) is ... | {
"split": "train",
"index": 75376,
"acecode_id": "evol_8219",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sum_of_primes_in_range(start: int, end: int) -> int` that calculates the sum of all prime numbers between the given start and end values (inclusive). You must create a bespoke prime number check function using the Sieve of Eratosthenes algorithm. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_primes_in_range(1, 10) == 17\", \"assert sum_of_primes_in_range(10, 20) == 60\", \"assert sum_of_primes_in_range(2, 2) == 2\", \"assert sum_of_primes_in_range(15, 15) == 0\", \"assert sum_of_primes_in_range(1, 1) == 0\", \"assert sum_of_primes_in_rang... | {
"split": "train",
"index": 75377,
"acecode_id": "evol_10615",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a user API serializer. The function `serialize_user` should take a dictionary representing a user and return a new dictionary containing only the specified fields: 'id', 'username', 'email', and 'date_joined'. If any of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_user({'id': 1, 'username': 'testuser', 'email': 'test@example.com', 'date_joined': '2020-01-01'}) == {'id': 1, 'username': 'testuser', 'email': 'test@example.com', 'date_joined': '2020-01-01'}\", \"assert serialize_user({'id': 2, 'username': 'user2... | {
"split": "train",
"index": 75378,
"acecode_id": "oss_9115",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `create_static_map` that represents a static map of a city as a grid of cells. Each cell can either be empty or occupied by a building. The function takes in the number of rows and columns for the map, along with a list of buil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_static_map(3, 3, [(0, 0), (1, 1), (2, 2)]) == ([[True, False, False], [False, True, False], [False, False, True]], 3)\", \"assert create_static_map(3, 3, [(1, 1), (1, 1), (1, 1)]) == ([[False, False, False], [False, True, False], [False, False, False]... | {
"split": "train",
"index": 75379,
"acecode_id": "oss_10507",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries that represent shelters, where each dictionary contains the keys 'name' and 'address'. Your task is to extract the names of the shelters and return them as a list. Implement the function `extract_shelter_names(shelters)` that takes a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_shelter_names([{'name': 'Shelter A', 'address': '123 Main St, Sacramento, CA'}, {'name': 'Shelter B', 'address': '456 Elm St, Sacramento, CA'}]) == ['Shelter A', 'Shelter B']\", \"assert extract_shelter_names([{'name': 'Shelter C', 'address': '789 Oa... | {
"split": "train",
"index": 75380,
"acecode_id": "oss_3777",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of location objects, each having a method `getCode()`, `getName()`, and `getRefId()`. Your task is to implement a function, `collect_location_data(locations)`, that takes a list of these location objects as input and returns a list of lists, where each inne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collect_location_data([MockLocation('001', 'Location A', 'Ref001'), MockLocation('002', 'Location B', 'Ref002')]) == [['001', 'Location A', 'Ref001'], ['002', 'Location B', 'Ref002']]\", \"assert collect_location_data([MockLocation('003', 'Location C', 'Ref0... | {
"split": "train",
"index": 75381,
"acecode_id": "bigcode_python_fns_6702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented as an adjacency list where each key is a node and its value is a list of nodes it points to. Your task is to implement a function `get_descendants(graph: Dict[int, List[int]], node: int) -> List[int]` that returns a list of all descend... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_descendants({1: [2, 3], 2: [4], 3: [4, 5], 4: [], 5: []}, 1) == [2, 3, 4, 5]\", \"assert get_descendants({1: [], 2: [], 3: []}, 1) == []\", \"assert get_descendants({1: [2], 2: [3], 3: [4], 4: []}, 2) == [3, 4]\", \"assert get_descendants({1: [2], 2: [3]... | {
"split": "train",
"index": 75382,
"acecode_id": "bigcode_python_fns_25907",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `cache_function` that simulates the behavior of caching the results of a given function call. The function should take another function `func`, its arguments `args`, and keyword arguments `kwargs`. If the function has been called with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_function(lambda x: x + 1, (1,)) == 2\", \"assert cache_function(lambda x: x + 1, (2,)) == 3\", \"assert cache_function(lambda x, y: x * y, (2, 3)) == 6\", \"assert cache_function(lambda x, y: x * y, (2, 3)) == 6\", \"assert cache_function(lambda x: x *... | {
"split": "train",
"index": 75383,
"acecode_id": "bigcode_python_fns_33010",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that calculates the sum of two numbers, starting from 0 and incrementing by 1 until it reaches a target sum of 42. The function should not require any input arguments and should return the sum when it reaches 42.\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_sum() == 42\", \"assert recursive_sum() == 42\", \"assert recursive_sum() == 42\", \"assert recursive_sum() == 42\", \"assert recursive_sum() == 42\", \"assert recursive_sum() == 42\", \"assert recursive_sum() == 42\", \"assert recursive_sum() == 4... | {
"split": "train",
"index": 75384,
"acecode_id": "evol_4826",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that determines the frequency of a specific word within a provided text passage, considering synonyms as identified by a provided dictionary. The function should differentiate based on word capitalization. Implement the function `get_word_frequency(text: str,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_word_frequency(\\\"To be or not to be, that is the question.\\\", 'be', {\\\"be\\\": [\\\"exist\\\", \\\"occur\\\", \\\"happen\\\"]}) == 2\", \"assert get_word_frequency(\\\"The quick brown fox jumps over the lazy dog.\\\", 'fox', {\\\"fox\\\": [\\\"vulp... | {
"split": "train",
"index": 75385,
"acecode_id": "evol_29403",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that counts the occurrences of each word in a given text string. The text may contain punctuation and words are separated by spaces. The word count should be case-insensitive, meaning 'Word' and 'word' should be treated as the same. A... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_count('Hello world! Hello everyone.') == {'hello': 2, 'world': 1, 'everyone': 1}\", \"assert word_count('') == {}\", \"assert word_count('word word word') == {'word': 3}\", \"assert word_count('word, word, word.') == {'word': 3}\", \"assert word_count('... | {
"split": "train",
"index": 75386,
"acecode_id": "oss_24406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values representing a bicluster, implement a function `standardize_bicluster(bicluster: List[float]) -> List[float]` that standardizes the bicluster by subtracting the mean of the values from each element and then dividing by the standard deviation of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert standardize_bicluster([1, 2, 3, 4, 5]) == [-1.414213562373095, -0.7071067811865475, 0.0, 0.7071067811865475, 1.414213562373095]\", \"assert standardize_bicluster([10, 12, 14, 16, 18]) == [-1.414213562373095, -0.7071067811865475, 0.0, 0.7071067811865475, 1.41... | {
"split": "train",
"index": 75387,
"acecode_id": "bigcode_python_fns_12532",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a Discord bot reaction management system. Your function should take a list of events where each event consists of a user ID and an emoji representing a reaction. The function should also take a list of e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_reactions([(1, '\\ud83d\\ude04'), (2, '\\ud83d\\ude22')], ['\\ud83d\\ude04', '\\ud83d\\ude22', '\\ud83d\\ude21']) == ['\\ud83d\\ude21']\", \"assert manage_reactions([(3, '\\ud83d\\udc4d'), (4, '\\ud83d\\udc4e')], ['\\ud83d\\udc4d', '\\ud83d\\ude04', '... | {
"split": "train",
"index": 75388,
"acecode_id": "oss_36899",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates all possible complete bids in a negotiation space defined by a domain. The domain specifies the issues and their possible values. A bid is a combination of values for all the issues in the domain. Your function should t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_all_bids(['issue1', 'issue2'], {'issue1': ['value1', 'value2'], 'issue2': ['value3']}) == [['value1', 'value3'], ['value2', 'value3']]\", \"assert generate_all_bids(['issue1'], {'issue1': ['value1', 'value2', 'value3']}) == [['value1'], ['value2'], ... | {
"split": "train",
"index": 75389,
"acecode_id": "oss_17949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `get_frequent_numbers(nums)` that returns a list of unique integers sorted in descending order by their frequency of occurrence in the input list. If two numbers have the same frequency, return the larger number first. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_frequent_numbers([1, 2, 2, 3, 3, 3]) == [3, 2, 1]\", \"assert get_frequent_numbers([4, 4, 4, 1, 1, 2]) == [4, 1, 2]\", \"assert get_frequent_numbers([5, 5, 5, 2, 2, 0]) == [5, 2, 0]\", \"assert get_frequent_numbers([10]) == [10]\", \"assert get_frequent_... | {
"split": "train",
"index": 75390,
"acecode_id": "bigcode_python_fns_17094",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function that determines if a given non-negative integer is a perfect square. A perfect square is an integer that is the square of an integer. You need to implement the function `is_perfect_square(n: int) -> bool`, where `n` is a non-negative integer. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_perfect_square(0) == True\", \"assert is_perfect_square(1) == True\", \"assert is_perfect_square(4) == True\", \"assert is_perfect_square(9) == True\", \"assert is_perfect_square(16) == True\", \"assert is_perfect_square(25) == True\", \"assert is_perfect... | {
"split": "train",
"index": 75391,
"acecode_id": "evol_30914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that applies a specific mathematical operation to a given input array of integers. The function should take two parameters: `input_array`, which is an array of integers, and `operation`, a string that specifies the mathematical operat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_operation([1, 2, 3], 'add') == [2, 3, 4]\", \"assert apply_operation([10, 20, 30], 'subtract') == [9, 19, 29]\", \"assert apply_operation([2, 4, 6], 'multiply') == [4, 8, 12]\", \"assert apply_operation([10, 15, 20], 'divide') == [5, 7, 10]\", \"assert... | {
"split": "train",
"index": 75392,
"acecode_id": "oss_16797",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a positive integer n, implement a function `modify_abs_values_in_list(lst, n)` that returns the product of the absolute values of all numbers in the list that are not divisible by any prime number less than or equal to n. If n is less than 2 or grea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_abs_values_in_list([1, 2, 3], 10) == 1\", \"assert modify_abs_values_in_list([-1, -2, -3], 10) == 1\", \"assert modify_abs_values_in_list([10, 15, 20], 15) == 1\", \"assert modify_abs_values_in_list([4, 6, 8, 10], 5) == 1\", \"assert modify_abs_values... | {
"split": "train",
"index": 75393,
"acecode_id": "evol_20063",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total monthly spendings for a user based on their expenses in various categories. You will be given a dictionary containing the amounts spent in different categories such as housing, pension insurance, food, health, transport, debt, utilities... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_expenses({'housing': 0.0, 'pensionIns': 0.0, 'food': 0.0, 'health': 0.0, 'transport': 0.0, 'debt': 0.0, 'utilities': 0.0, 'clothing': 0.0, 'vacation': 0.0, 'unexpected': 0.0}) == 0.0\", \"assert calculate_total_expenses({'housing': 100.0, 'pe... | {
"split": "train",
"index": 75394,
"acecode_id": "bigcode_python_fns_33086",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that calculates the absolute difference between two times given in 24-hour format and translates this difference into hours, minutes, and seconds. Additionally, take a timezone difference as an input and incorporate it into the final result. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert time_diff('12:00:00', '14:30:00', 0) == '2 hour(s) 30 minute(s) 0 second(s)'\", \"assert time_diff('09:15:30', '11:45:00', 0) == '2 hour(s) 29 minute(s) 30 second(s)'\", \"assert time_diff('00:00:00', '23:59:59', 0) == '23 hour(s) 59 minute(s) 59 second(s)'\... | {
"split": "train",
"index": 75395,
"acecode_id": "evol_192",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that calculates the surface area of a sphere given its radius. The surface area of a sphere can be calculated using the formula: A = 4 * π * r^2, where r is the radius of the sphere. The function should take a single argument, radius, which is a non-n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert surface_area_of_sphere(0) == 0.0\", \"assert surface_area_of_sphere(1) == 12.566370614359172\", \"assert surface_area_of_sphere(2) == 50.26548245743669\", \"assert surface_area_of_sphere(3) == 113.09733552923255\", \"assert surface_area_of_sphere(4) == 201.0... | {
"split": "train",
"index": 75396,
"acecode_id": "evol_22687",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a couple represented as a tuple of two integers (a, b), where a and b can be equal or different, write a function that returns a string representation of the couple. If the two integers are equal, return the integer as a string. If they are different, return a string form... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert couple_to_string((12, 15)) == '12-15'\", \"assert couple_to_string((12, 12)) == '12'\", \"assert couple_to_string((20, 25)) == '20-25'\", \"assert couple_to_string((5, 5)) == '5'\", \"assert couple_to_string((1, 2)) == '1-2'\", \"assert couple_to_string((0, ... | {
"split": "train",
"index": 75397,
"acecode_id": "bigcode_python_fns_3215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two lists of integers as input and determines whether it's possible to exchange elements between the lists to transform the first list into a list of only even numbers. This must be done while maintaining the overall sum of both lists. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exchange([2, 4, 6], [1, 3, 5]) == 'YES'\", \"assert exchange([1, 3, 5], [2, 4, 6]) == 'YES'\", \"assert exchange([10, 12], [5, 7]) == 'YES'\", \"assert exchange([0], [0]) == 'YES'\", \"assert exchange([8, 10, 12], [1, 3, 5]) == 'YES'\", \"assert exchange([2,... | {
"split": "train",
"index": 75398,
"acecode_id": "evol_4399",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a VCF (Variant Call Format) header for genomic variant data. Write a function `generate_vcf_header` that takes the following inputs: \n1. `contigs`: a list of strings representing the names of contigs (chromosomes) on which variants were called. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_vcf_header(['chr1', 'chr2'], ['Sample1', 'Sample2'], False, True) == {'fileformat': 'VCFv4.2', 'filters': [{'id': 'PASS'}, {'id': 'REF', 'description': 'Genotyping model thinks this site is reference.'}, {'id': 'QUAL', 'description': 'Confidence in ... | {
"split": "train",
"index": 75399,
"acecode_id": "bigcode_python_fns_48061",
"num_tests": 11
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.